mirror of https://github.com/halo-dev/halo-admin
[release-2.0] fix: plugin failed to get settings when plugin is stopped (#755)
This is an automated cherry-pick of #750 /assign ruibaby ```release-note 修复在 Console 端停止插件时,仍然获取设置选项导致显示失败提示的问题。 ```pull/754/head^2
parent
2ca70e7b72
commit
0756d72106
|
@ -25,6 +25,7 @@ import BasicLayout from "@/layouts/BasicLayout.vue";
|
||||||
import type { Ref } from "vue";
|
import type { Ref } from "vue";
|
||||||
import type { Plugin, SettingForm } from "@halo-dev/api-client";
|
import type { Plugin, SettingForm } from "@halo-dev/api-client";
|
||||||
import { usePermission } from "@/utils/permission";
|
import { usePermission } from "@/utils/permission";
|
||||||
|
import { usePluginLifeCycle } from "../composables/use-plugin";
|
||||||
|
|
||||||
const { currentUserHasPermission } = usePermission();
|
const { currentUserHasPermission } = usePermission();
|
||||||
|
|
||||||
|
@ -60,6 +61,8 @@ provide<Ref<string | undefined>>("activeTab", activeTab);
|
||||||
const settingName = computed(() => plugin.value?.spec.settingName);
|
const settingName = computed(() => plugin.value?.spec.settingName);
|
||||||
const configMapName = computed(() => plugin.value?.spec.configMapName);
|
const configMapName = computed(() => plugin.value?.spec.configMapName);
|
||||||
|
|
||||||
|
const { isStarted } = usePluginLifeCycle(plugin);
|
||||||
|
|
||||||
const { setting, handleFetchSettings } = useSettingForm(
|
const { setting, handleFetchSettings } = useSettingForm(
|
||||||
settingName,
|
settingName,
|
||||||
configMapName
|
configMapName
|
||||||
|
@ -112,7 +115,9 @@ onMounted(async () => {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (isStarted.value) {
|
||||||
await handleFetchSettings();
|
await handleFetchSettings();
|
||||||
|
}
|
||||||
|
|
||||||
tabs.value = cloneDeep(initialTabs);
|
tabs.value = cloneDeep(initialTabs);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue