mirror of
https://github.com/halo-dev/halo.git
synced 2025-12-20 16:44:38 +08:00
fix: show plugin error message (#5838)
#### What type of PR is this? /area ui /kind bug /milestone 2.15.0 #### What this PR does / why we need it: 修复插件异常启动时,指示器显示不正确的问题。 Fixes https://github.com/halo-dev/halo/pull/5520 #### Does this PR introduce a user-facing change? ```release-note None ```
This commit is contained in:
@@ -33,16 +33,8 @@ export function usePluginLifeCycle(
|
||||
const { enabled } = plugin.value.spec || {};
|
||||
const { phase } = plugin.value.status || {};
|
||||
|
||||
// Starting up
|
||||
if (
|
||||
enabled &&
|
||||
phase !== (PluginStatusPhaseEnum.Started || PluginStatusPhaseEnum.Failed)
|
||||
) {
|
||||
return t("core.common.status.starting_up");
|
||||
}
|
||||
|
||||
// Starting failed
|
||||
if (!isStarted.value) {
|
||||
if (enabled && phase === PluginStatusPhaseEnum.Failed) {
|
||||
const lastCondition = plugin.value.status?.conditions?.[0];
|
||||
|
||||
return (
|
||||
@@ -51,6 +43,14 @@ export function usePluginLifeCycle(
|
||||
.join(":") || "Unknown"
|
||||
);
|
||||
}
|
||||
|
||||
// Starting up
|
||||
if (
|
||||
enabled &&
|
||||
phase !== (PluginStatusPhaseEnum.Started || PluginStatusPhaseEnum.Failed)
|
||||
) {
|
||||
return t("core.common.status.starting_up");
|
||||
}
|
||||
};
|
||||
|
||||
const { isLoading: changingStatus, mutate: changeStatus } = useMutation({
|
||||
|
||||
Reference in New Issue
Block a user