mirror of https://github.com/halo-dev/halo
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 ```pull/5856/head v2.15.0
parent
1f71532327
commit
2178bd8b80
|
@ -154,14 +154,11 @@ const { startFields, endFields } = useEntityFieldItemExtensionPoint<Plugin>(
|
|||
!enabled || (enabled && phase === PluginStatusPhaseEnum.Started);
|
||||
|
||||
const getStatusDotState = () => {
|
||||
if (
|
||||
enabled &&
|
||||
phase !==
|
||||
(PluginStatusPhaseEnum.Started || PluginStatusPhaseEnum.Failed)
|
||||
) {
|
||||
return "default";
|
||||
if (enabled && phase === PluginStatusPhaseEnum.Failed) {
|
||||
return "error";
|
||||
}
|
||||
return "error";
|
||||
|
||||
return "default";
|
||||
};
|
||||
|
||||
return [
|
||||
|
|
|
@ -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({
|
||||
|
|
Loading…
Reference in New Issue