[Fix#9923] The alarm instance management interface is always in the loading state (#9924)

* fix alert plugin loading bug

* update use-form.ts

* remove unused package

* Update use-form.ts

* Update use-form.ts

(cherry picked from commit c5c68a8893)
This commit is contained in:
Mr.An 2022-05-25 18:13:42 +08:00 committed by Jiajie Zhong
parent e663043c91
commit 69db18ebd7
1 changed files with 10 additions and 6 deletions

View File

@ -72,12 +72,16 @@ export function useForm() {
const getUiPluginsByType = async () => {
if (state.pluginsLoading) return
state.pluginsLoading = true
const plugins = await queryUiPluginsByType({ pluginType: 'ALERT' })
state.uiPlugins = plugins.map((plugin: IPlugin) => ({
label: plugin.pluginName,
value: plugin.id
}))
state.pluginsLoading = false
try {
const plugins = await queryUiPluginsByType({ pluginType: 'ALERT' })
state.uiPlugins = plugins.map((plugin: IPlugin) => ({
label: plugin.pluginName,
value: plugin.id
}))
state.pluginsLoading = false
} catch (e) {
state.pluginsLoading = false
}
}
const changePlugin = async (pluginId: IPluginId) => {