feat: Add storage hierarchy API and frontend integration

This commit is contained in:
garionion (aider) 2025-02-28 21:18:07 +01:00 committed by garionion
parent 005b04e380
commit 29ec555090
6 changed files with 264 additions and 10 deletions

View file

@ -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
);
});

View file

@ -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;