|
|
@@ -9,7 +9,11 @@ import { ServerConnection, useServer } from "@/context/server"
|
|
|
import { useServerSDK } from "@/context/server-sdk"
|
|
|
import { useSync } from "@/context/sync"
|
|
|
import { useGlobal } from "@/context/global"
|
|
|
-import { hasNonBlockingServiceIssue, serverStatusDotClass } from "./status-popover-indicator"
|
|
|
+import {
|
|
|
+ hasNonBlockingServiceIssue,
|
|
|
+ hasServiceNeedingAttention,
|
|
|
+ serverStatusDotClass,
|
|
|
+} from "./status-popover-indicator"
|
|
|
|
|
|
const Body = lazy(() => import("./status-popover-body").then((x) => ({ default: x.StatusPopoverBody })))
|
|
|
const ServerBody = lazy(() => import("./status-popover-body").then((x) => ({ default: x.StatusPopoverServerBody })))
|
|
|
@@ -22,6 +26,11 @@ export function StatusPopover() {
|
|
|
const [shown, setShown] = createSignal(false)
|
|
|
const serverHealth = () => global.servers.health[server.key]?.healthy
|
|
|
const ready = createMemo(() => serverHealth() === false || (sync().data.mcp_ready && sync().data.lsp_ready))
|
|
|
+ const attention = createMemo(() =>
|
|
|
+ hasServiceNeedingAttention({
|
|
|
+ mcp: Object.values(sync().data.mcp ?? {}).map((item) => item.status),
|
|
|
+ }),
|
|
|
+ )
|
|
|
const issue = createMemo(() =>
|
|
|
hasNonBlockingServiceIssue({
|
|
|
mcp: Object.values(sync().data.mcp ?? {}).map((item) => item.status),
|
|
|
@@ -49,6 +58,7 @@ export function StatusPopover() {
|
|
|
class={`absolute -top-px -right-px size-1.5 rounded-full ${serverStatusDotClass({
|
|
|
ready: ready(),
|
|
|
serverHealth: serverHealth(),
|
|
|
+ attention: attention(),
|
|
|
issue: issue(),
|
|
|
})}`}
|
|
|
/>
|
|
|
@@ -85,6 +95,11 @@ function DirectoryStatusPopover() {
|
|
|
const [shown, setShown] = createSignal(false)
|
|
|
const serverHealth = () => global.servers.health[ServerConnection.key(server().server)]?.healthy
|
|
|
const ready = createMemo(() => serverHealth() === false || (sync().data.mcp_ready && sync().data.lsp_ready))
|
|
|
+ const attention = createMemo(() =>
|
|
|
+ hasServiceNeedingAttention({
|
|
|
+ mcp: Object.values(sync().data.mcp ?? {}).map((item) => item.status),
|
|
|
+ }),
|
|
|
+ )
|
|
|
const issue = createMemo(() =>
|
|
|
hasNonBlockingServiceIssue({
|
|
|
mcp: Object.values(sync().data.mcp ?? {}).map((item) => item.status),
|
|
|
@@ -95,6 +110,7 @@ function DirectoryStatusPopover() {
|
|
|
shown: shown(),
|
|
|
ready: ready(),
|
|
|
serverHealth: serverHealth(),
|
|
|
+ attention: attention(),
|
|
|
issue: issue(),
|
|
|
label: language.t("status.popover.trigger"),
|
|
|
onOpenChange: setShown,
|
|
|
@@ -118,6 +134,7 @@ function ServerStatusPopover() {
|
|
|
shown: shown(),
|
|
|
ready: serverHealth() !== undefined,
|
|
|
serverHealth: serverHealth(),
|
|
|
+ attention: false,
|
|
|
issue: false,
|
|
|
label: language.t("status.popover.trigger"),
|
|
|
onOpenChange: setShown,
|
|
|
@@ -135,6 +152,7 @@ type StatusPopoverState = {
|
|
|
shown: boolean
|
|
|
ready: boolean
|
|
|
serverHealth: boolean | undefined
|
|
|
+ attention: boolean
|
|
|
issue: boolean
|
|
|
label: string
|
|
|
onOpenChange: (value: boolean) => void
|