fix plugin state

This commit is contained in:
jxxghp
2023-08-03 18:21:32 +08:00
parent ed33968cb6
commit 440dd52dd1
3 changed files with 11 additions and 2 deletions

View File

@@ -523,6 +523,9 @@ export interface Plugin {
// 是否已安装
installed?: boolean
// 运行状态
state?: boolean
}
// 种子信息

View File

@@ -14,7 +14,7 @@ const props = defineProps({
})
// 定义触发的自定义事件
const emit = defineEmits(['remove'])
const emit = defineEmits(['remove', 'save'])
// 提示框
const $toast = useToast()
@@ -102,6 +102,8 @@ async function savePluginConf() {
if (result.success) {
$toast.success(`插件 ${props.plugin?.plugin_name} 配置已保存`)
pluginConfigDialog.value = false
// 通知父组件刷新
emit('save')
}
else {
$toast.error(`插件 ${props.plugin?.plugin_name} 配置保存失败:${result.message}}`)
@@ -192,7 +194,10 @@ const dropdownItems = ref([
</VAvatar>
</div>
<VCardItem class="py-2">
<VCardTitle>{{ props.plugin?.plugin_name }}</VCardTitle>
<VCardTitle class="flex items-center flex-row">
<VBadge v-if="props.plugin?.state" dot inline color="success" class="me-1 mb-1" />
{{ props.plugin?.plugin_name }}
</VCardTitle>
</VCardItem>
<VCardText>
{{ props.plugin?.plugin_desc }}

View File

@@ -71,6 +71,7 @@ onBeforeMount(fetchData)
:key="data.id"
:plugin="data"
@remove="fetchData"
@save="fetchData"
/>
</div>
<NoDataFound