mirror of
https://github.com/jxxghp/MoviePilot-Frontend.git
synced 2026-08-04 12:57:10 +08:00
重构存储选项,更新为存储属性,优化存储字典和图标字典的生成逻辑,提升组件对存储配置的支持
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
<script setup lang="ts">
|
||||
import api from '@/api'
|
||||
import { StorageConf } from '@/api/types'
|
||||
import { Handle, Position } from '@vue-flow/core'
|
||||
import { storageOptions } from '@/api/constants'
|
||||
import { useI18n } from 'vue-i18n'
|
||||
|
||||
const { t } = useI18n()
|
||||
@@ -15,6 +16,27 @@ defineProps({
|
||||
required: true,
|
||||
},
|
||||
})
|
||||
|
||||
// 所有存储
|
||||
const storages = ref<StorageConf[]>([])
|
||||
|
||||
// 查询存储
|
||||
async function loadStorages() {
|
||||
const result: { [key: string]: any } = await api.get('system/setting/Storages')
|
||||
storages.value = result.data?.value ?? []
|
||||
}
|
||||
|
||||
// 存储字典
|
||||
const storageOptions = computed(() => {
|
||||
return storages.value.map(item => ({
|
||||
title: item.name,
|
||||
value: item.type,
|
||||
}))
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
loadStorages()
|
||||
})
|
||||
</script>
|
||||
<template>
|
||||
<div>
|
||||
|
||||
Reference in New Issue
Block a user