[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
This commit is contained in:
Mr.An 2022-05-25 18:13:42 +08:00 committed by GitHub
parent d8db2b57d2
commit c5c68a8893
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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) => {