-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add storage managment section + disks managment page
- Loading branch information
1 parent
3d907a0
commit ba8ac84
Showing
11 changed files
with
171 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
<template> | ||
<YAlert | ||
v-if="!hasDisks" | ||
alert | ||
icon="exclamation-triangle" | ||
variant="warning" | ||
> | ||
{{ $t("items_verbose_count", { items: $t('items.inserted_disk', 0) }, 0) }} | ||
</YAlert> | ||
<BRow v-else> | ||
<YListItem | ||
v-for="disk in disks" | ||
:key="disk.serial" | ||
:to="{ name: 'app-info', params: { id: disk.serial } }" | ||
:label="disk.name" | ||
:sublabel="disk.size" | ||
:description="disk.model" | ||
/> | ||
</BRow> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { humanSize } from '@/helpers/commons' | ||
import { ref, type Ref, computed } from 'vue' | ||
import api from '@/api' | ||
import type { APIDiskResult, Disk } from '@/types/core/api.ts' | ||
import YListItem from '@/components/globals/YListItem.vue' | ||
const disks: Ref<Disk[]> = ref([]) | ||
const hasDisks = computed(() => disks.value.length > 0) | ||
api.fetch<{ disks: APIDiskResult[] }>({ uri: 'storage/disk/list' }).then((result) => { | ||
disks.value = result.disks.map((disk) => { | ||
return { | ||
...disk, | ||
size: humanSize(disk.size), | ||
} | ||
}) | ||
}) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<template> | ||
<BListGroup class="menu-list"> | ||
<BListGroupItem | ||
v-for="item in menu" | ||
:key="item.routeName" | ||
:to="{ name: item.routeName }" | ||
> | ||
<YIcon :iname="item.icon" class="lg ml-1" /> | ||
<h4>{{ $t(item.translation) }}</h4> | ||
<YIcon iname="chevron-right" class="lg fs-sm ml-auto" /> | ||
</BListGroupItem> | ||
</BListGroup> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import { ref } from 'vue' | ||
const menu = ref([ | ||
{ | ||
routeName: 'storage-disks', | ||
icon: 'hdd-o', | ||
translation: 'storage_disks.category_name', | ||
}, | ||
]) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters