diff --git a/packages/app/src/components/status-popover-body.tsx b/packages/app/src/components/status-popover-body.tsx index 97982fa21f7b..95481d5b893c 100644 --- a/packages/app/src/components/status-popover-body.tsx +++ b/packages/app/src/components/status-popover-body.tsx @@ -97,158 +97,6 @@ const useDefaultServerKey = ( } } -type ServerStatusState = { - servers: () => ServerStatusItem[] - defaultKey: () => ServerConnection.Key | undefined - ariaLabel: string - serversLabel: string - defaultLabel: string - manageLabel: string - onManage: () => void -} - -type ServerStatusItem = { - key: ServerConnection.Key - conn: ServerConnection.Any - health?: ServerHealth - blocked: boolean - active: boolean - onSelect: () => void -} - -export function StatusPopoverServerBody() { - const global = useGlobal() - const server = useServer() - const platform = usePlatform() - const dialog = useDialog() - const language = useLanguage() - const navigate = useNavigate() - let dialogRun = 0 - let dialogDead = false - onCleanup(() => { - dialogDead = true - dialogRun += 1 - }) - - const sortedServers = createMemo(() => listServersByHealth(global.servers.list(), server.key, global.servers.health)) - const defaultServer = useDefaultServerKey(platform.getDefaultServer) - const serverItems = createMemo(() => - sortedServers().map((conn) => { - const key = ServerConnection.key(conn) - return { - key, - conn, - health: global.servers.health[key], - blocked: global.servers.health[key]?.healthy === false, - active: !!server.current && key === ServerConnection.key(server.current), - onSelect: () => { - navigate("/") - queueMicrotask(() => server.setActive(key)) - }, - } - }), - ) - - return ( - { - const run = ++dialogRun - void import("./dialog-select-server").then((x) => { - if (dialogDead || dialogRun !== run) return - dialog.show(() => , defaultServer.refresh) - }) - }, - }} - /> - ) -} - -function ServerStatusPopoverView(props: { state: ServerStatusState }) { - return ( -
- - - - {props.state.servers().length > 0 ? `${props.state.servers().length} ` : ""} - {props.state.serversLabel} - - - - - - -
- ) -} - -function ServerStatusList(props: { state: ServerStatusState }) { - return ( -
-
- - {(item) => { - return ( - - ) - }} - - - -
-
- ) -} - export function StatusPopoverBody(props: { shown: Accessor }) { const sync = useSync() const global = useGlobal() diff --git a/packages/app/src/components/status-popover.tsx b/packages/app/src/components/status-popover.tsx index 2aed45702a1b..c4247faf5edb 100644 --- a/packages/app/src/components/status-popover.tsx +++ b/packages/app/src/components/status-popover.tsx @@ -12,7 +12,6 @@ import { useGlobal } from "@/context/global" import { hasNonBlockingServiceIssue, 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 }))) export function StatusPopover() { const language = useLanguage() @@ -72,8 +71,7 @@ export function StatusPopover() { ) } -export function StatusPopoverV2(props: { scope?: "server" }) { - if (props.scope === "server") return +export function StatusPopoverV2() { return } @@ -108,29 +106,6 @@ function DirectoryStatusPopover() { return } -function ServerStatusPopover() { - const language = useLanguage() - const server = useServer() - const global = useGlobal() - const [shown, setShown] = createSignal(false) - const serverHealth = () => global.servers.health[server.key]?.healthy - const state = createMemo(() => ({ - shown: shown(), - ready: serverHealth() !== undefined, - serverHealth: serverHealth(), - issue: false, - label: language.t("status.popover.trigger"), - onOpenChange: setShown, - body: () => ( - - - - ), - })) - - return -} - type StatusPopoverState = { shown: boolean ready: boolean