feat: Add storage hierarchy API and frontend integration
This commit is contained in:
parent
005b04e380
commit
29ec555090
6 changed files with 264 additions and 10 deletions
|
@ -50,7 +50,7 @@
|
|||
</template>
|
||||
|
||||
<script lang="ts" setup>
|
||||
import { ref, computed, watch, onMounted } from 'vue';
|
||||
import { ref, computed, watch, onMounted, defineComponent } from 'vue';
|
||||
import { useStorageStore } from '@/stores/storage';
|
||||
|
||||
// Component for recursive display of storage boxes
|
||||
|
@ -68,7 +68,7 @@ const StorageBox = defineComponent({
|
|||
|
||||
const childStorages = computed(() => {
|
||||
return props.nestedStorages.filter(storage =>
|
||||
storage.parent && storage.parent === props.storage.id
|
||||
storage.parent && storage.parent.valid && storage.parent.int64 === props.storage.id
|
||||
);
|
||||
});
|
||||
|
||||
|
|
|
@ -41,7 +41,11 @@ export const useStorageStore = defineStore('storage', {
|
|||
}
|
||||
|
||||
const data = await response.json();
|
||||
this.storageSpaces = data;
|
||||
this.storageSpaces = data.map((space: any) => ({
|
||||
id: space.id,
|
||||
parent: space.parent,
|
||||
location: space.location
|
||||
}));
|
||||
} catch (error: any) {
|
||||
this.error = error.message;
|
||||
throw error;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue