opencami 1.7.0 → 1.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +167 -7
- package/bin/opencami.js +15 -6
- package/dist/client/assets/{CSPContext-a-MQmQQt.js → CSPContext-DeJH85nm.js} +1 -1
- package/dist/client/assets/{DirectionContext-DRcND-Cm.js → DirectionContext-CxhRpXkm.js} +1 -1
- package/dist/client/assets/_sessionKey-CQE0brGK.js +23 -0
- package/dist/client/assets/agents-CMTFd_sG.js +2 -0
- package/dist/client/assets/agents-screen-BNQGEqcW.js +1 -0
- package/dist/client/assets/bots-B6oGzCxP.js +2 -0
- package/dist/client/assets/bots-screen-Be3cfGgq.js +1 -0
- package/dist/client/assets/button-D9Plv7hu.js +1 -0
- package/dist/client/assets/composite-B2KCZKKL.js +1 -0
- package/dist/client/assets/{connect-BX1MWO82.js → connect-DuJfnyNK.js} +1 -1
- package/dist/client/assets/dashboard-00GpXm5V.js +1 -0
- package/dist/client/assets/event-DD8Cz4O9.js +1 -0
- package/dist/client/assets/file-explorer-screen-CxwemBES.js +1 -0
- package/dist/client/assets/files-DyBJVXBu.js +2 -0
- package/dist/client/assets/{index-BlC2sH55.js → index-DtGzE-ea.js} +1 -1
- package/dist/client/assets/{index-Dg0mbvtv.js → index-Yo5UhdZV.js} +1 -1
- package/dist/client/assets/keyboard-shortcuts-dialog-BZwd-iyV.js +1 -0
- package/dist/client/assets/{main-CEuT8-Qi.js → main-CgwdHc9W.js} +16 -8
- package/dist/client/assets/{markdown-DKD6ZLRJ.js → markdown-DtWnt4NA.js} +1 -1
- package/dist/client/assets/memory-l756yiNq.js +2 -0
- package/dist/client/assets/memory-screen-BQtVRuzE.js +1 -0
- package/dist/client/assets/menu-BsS6CDf_.js +1 -0
- package/dist/client/assets/{opencami-logo-DA69yVKc.js → opencami-logo-Bmge6-FB.js} +1 -1
- package/dist/client/assets/popupStateMapping-D0ZbJR_o.js +1 -0
- package/dist/client/assets/{proxy-Cawf6X0W.js → proxy-CYZeDXoy.js} +1 -1
- package/dist/client/assets/{react-K9goXsVv.js → react-DODKNyyU.js} +1 -1
- package/dist/client/assets/search-dialog-DW91SK30.js +1 -0
- package/dist/client/assets/session-export-dialog-CliO9Ob-.js +1 -0
- package/dist/client/assets/settings-dialog-C1u52aju.js +1 -0
- package/dist/client/assets/skills-8T_avaVb.js +2 -0
- package/dist/client/assets/{skills-panel-DFL-3BRH.js → skills-panel-DSiH-DLs.js} +1 -1
- package/dist/client/assets/styles-DvaLh0o1.css +1 -0
- package/dist/client/assets/switch-DbgQPO6i.js +1 -0
- package/dist/client/assets/tabs-BsAvZnlD.js +1 -0
- package/dist/client/assets/tooltip-DLmutB5C.js +1 -0
- package/dist/client/assets/use-file-explorer-state-Cg_yDYJl.js +12 -0
- package/dist/client/assets/useBaseUiId-KQTzRPLp.js +1 -0
- package/dist/client/assets/useCompositeItem-BPY2_hF_.js +1 -0
- package/dist/client/assets/{useControlled-Cl9XA2_f.js → useControlled-B5pEEz2V.js} +1 -1
- package/dist/client/assets/{useMutation-C5bTdeC1.js → useMutation-BsQD6FKe.js} +1 -1
- package/dist/client/assets/useQuery-CmAJuY2W.js +1 -0
- package/dist/client/assets/visuallyHidden-COI6QeQH.js +1 -0
- package/dist/client/sw.js +5 -164
- package/dist/server/assets/{_sessionKey-BBG3ZUlo.js → _sessionKey-C9o7YfxA.js} +878 -755
- package/dist/server/assets/_tanstack-start-manifest_v-BMCAWon2.js +4 -0
- package/dist/server/assets/dashboard-GCKodTiJ.js +214 -0
- package/dist/server/assets/{index-BgMPaOsU.js → index-Bw-bA_2M.js} +4 -3
- package/dist/server/assets/{router-Bl2uabfY.js → router-DCjikH21.js} +704 -207
- package/dist/server/assets/{search-dialog-BtSQW9SR.js → search-dialog-BnwiXpdA.js} +5 -4
- package/dist/server/assets/settings-dialog-ClKFnZ1x.js +1511 -0
- package/dist/server/server.js +2 -2
- package/package.json +1 -1
- package/dist/client/assets/_sessionKey-BAmpzUOP.js +0 -23
- package/dist/client/assets/agents-BkeWu_3a.js +0 -2
- package/dist/client/assets/agents-screen-Cb76bcxn.js +0 -1
- package/dist/client/assets/bots-CyJwr-JU.js +0 -2
- package/dist/client/assets/bots-screen-CzNjLsQH.js +0 -1
- package/dist/client/assets/button-DNC5N25i.js +0 -1
- package/dist/client/assets/composite-Bliqcmg4.js +0 -1
- package/dist/client/assets/file-explorer-screen-CpY1O_ag.js +0 -1
- package/dist/client/assets/files-HiN5rXWq.js +0 -2
- package/dist/client/assets/keyboard-shortcuts-dialog-C2Hq19LN.js +0 -1
- package/dist/client/assets/memory-lhzf-8Q4.js +0 -2
- package/dist/client/assets/memory-screen-Zq9qfnJK.js +0 -1
- package/dist/client/assets/menu-47ooFeSm.js +0 -1
- package/dist/client/assets/owner-CFRNz_Tp.js +0 -1
- package/dist/client/assets/popupStateMapping-D5k-jOeY.js +0 -1
- package/dist/client/assets/search-dialog-C5Yae9rb.js +0 -1
- package/dist/client/assets/session-export-dialog-CBeTfbll.js +0 -1
- package/dist/client/assets/settings-dialog-CoeG9M1b.js +0 -1
- package/dist/client/assets/skills-BEkw619A.js +0 -2
- package/dist/client/assets/styles-D4EBtWYc.css +0 -1
- package/dist/client/assets/switch-DAFvLxNX.js +0 -1
- package/dist/client/assets/tabs-B2Y_7MvG.js +0 -1
- package/dist/client/assets/tooltip-D57Pal0B.js +0 -1
- package/dist/client/assets/use-file-explorer-state-DppKEjcl.js +0 -12
- package/dist/client/assets/useButton-DVAfkehQ.js +0 -1
- package/dist/client/assets/useCompositeItem-CzdGhGcj.js +0 -1
- package/dist/client/assets/visuallyHidden-CO3ZD5AQ.js +0 -1
- package/dist/server/assets/_tanstack-start-manifest_v-DmMFarHb.js +0 -4
- package/dist/server/assets/settings-dialog-D3fOAswX.js +0 -1173
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
const tsrStartManifest = () => ({ "routes": { "__root__": { "filePath": "/root/opencami/src/routes/__root.tsx", "children": ["/", "/agents", "/bots", "/connect", "/dashboard", "/files", "/memory", "/new", "/skills", "/api/agents", "/api/cron", "/api/follow-ups", "/api/history", "/api/llm-features", "/api/models", "/api/paths", "/api/personas", "/api/ping", "/api/send", "/api/sessions", "/api/skills", "/api/stream", "/api/stt", "/api/tts", "/chat/$sessionKey", "/api/dashboard/crons", "/api/dashboard/gateway", "/api/dashboard/system", "/api/files/delete", "/api/files/download", "/api/files/info", "/api/files/list", "/api/files/mkdir", "/api/files/read", "/api/files/rename", "/api/files/save", "/api/files/upload"], "preloads": ["/assets/main-CgwdHc9W.js"], "assets": [] }, "/": { "filePath": "/root/opencami/src/routes/index.tsx", "assets": [], "preloads": ["/assets/index-Yo5UhdZV.js"] }, "/agents": { "filePath": "/root/opencami/src/routes/agents.tsx", "assets": [], "preloads": ["/assets/agents-CMTFd_sG.js"] }, "/bots": { "filePath": "/root/opencami/src/routes/bots.tsx", "assets": [], "preloads": ["/assets/bots-B6oGzCxP.js"] }, "/connect": { "filePath": "/root/opencami/src/routes/connect.tsx", "assets": [], "preloads": ["/assets/connect-DuJfnyNK.js", "/assets/index-DtGzE-ea.js", "/assets/button-D9Plv7hu.js", "/assets/react-DODKNyyU.js"] }, "/dashboard": { "filePath": "/root/opencami/src/routes/dashboard.tsx", "assets": [], "preloads": ["/assets/dashboard-00GpXm5V.js", "/assets/useQuery-CmAJuY2W.js"] }, "/files": { "filePath": "/root/opencami/src/routes/files.tsx", "assets": [], "preloads": ["/assets/files-DyBJVXBu.js"] }, "/memory": { "filePath": "/root/opencami/src/routes/memory.tsx", "assets": [], "preloads": ["/assets/memory-l756yiNq.js"] }, "/new": { "filePath": "/root/opencami/src/routes/new.tsx", "assets": [], "preloads": ["/assets/new-DLlBm66g.js"] }, "/skills": { "filePath": "/root/opencami/src/routes/skills.tsx", "assets": [], "preloads": ["/assets/skills-8T_avaVb.js"] }, "/api/agents": { "filePath": "/root/opencami/src/routes/api/agents.ts" }, "/api/cron": { "filePath": "/root/opencami/src/routes/api/cron.ts" }, "/api/follow-ups": { "filePath": "/root/opencami/src/routes/api/follow-ups.ts" }, "/api/history": { "filePath": "/root/opencami/src/routes/api/history.ts" }, "/api/llm-features": { "filePath": "/root/opencami/src/routes/api/llm-features.ts" }, "/api/models": { "filePath": "/root/opencami/src/routes/api/models.ts" }, "/api/paths": { "filePath": "/root/opencami/src/routes/api/paths.ts" }, "/api/personas": { "filePath": "/root/opencami/src/routes/api/personas.ts" }, "/api/ping": { "filePath": "/root/opencami/src/routes/api/ping.ts" }, "/api/send": { "filePath": "/root/opencami/src/routes/api/send.ts" }, "/api/sessions": { "filePath": "/root/opencami/src/routes/api/sessions.ts" }, "/api/skills": { "filePath": "/root/opencami/src/routes/api/skills.ts" }, "/api/stream": { "filePath": "/root/opencami/src/routes/api/stream.ts" }, "/api/stt": { "filePath": "/root/opencami/src/routes/api/stt.ts" }, "/api/tts": { "filePath": "/root/opencami/src/routes/api/tts.ts" }, "/chat/$sessionKey": { "filePath": "/root/opencami/src/routes/chat/$sessionKey.tsx", "assets": [], "preloads": ["/assets/_sessionKey-CQE0brGK.js", "/assets/useQuery-CmAJuY2W.js", "/assets/tooltip-DLmutB5C.js", "/assets/button-D9Plv7hu.js", "/assets/useMutation-BsQD6FKe.js", "/assets/use-file-explorer-state-Cg_yDYJl.js", "/assets/useBaseUiId-KQTzRPLp.js", "/assets/useControlled-B5pEEz2V.js", "/assets/popupStateMapping-D0ZbJR_o.js", "/assets/event-DD8Cz4O9.js", "/assets/CSPContext-DeJH85nm.js", "/assets/DirectionContext-CxhRpXkm.js", "/assets/menu-BsS6CDf_.js", "/assets/opencami-logo-Bmge6-FB.js", "/assets/proxy-CYZeDXoy.js", "/assets/markdown-DtWnt4NA.js", "/assets/index-DtGzE-ea.js", "/assets/react-DODKNyyU.js"] }, "/api/dashboard/crons": { "filePath": "/root/opencami/src/routes/api/dashboard/crons.ts" }, "/api/dashboard/gateway": { "filePath": "/root/opencami/src/routes/api/dashboard/gateway.ts" }, "/api/dashboard/system": { "filePath": "/root/opencami/src/routes/api/dashboard/system.ts" }, "/api/files/delete": { "filePath": "/root/opencami/src/routes/api/files/delete.ts" }, "/api/files/download": { "filePath": "/root/opencami/src/routes/api/files/download.ts" }, "/api/files/info": { "filePath": "/root/opencami/src/routes/api/files/info.ts" }, "/api/files/list": { "filePath": "/root/opencami/src/routes/api/files/list.ts" }, "/api/files/mkdir": { "filePath": "/root/opencami/src/routes/api/files/mkdir.ts" }, "/api/files/read": { "filePath": "/root/opencami/src/routes/api/files/read.ts" }, "/api/files/rename": { "filePath": "/root/opencami/src/routes/api/files/rename.ts" }, "/api/files/save": { "filePath": "/root/opencami/src/routes/api/files/save.ts" }, "/api/files/upload": { "filePath": "/root/opencami/src/routes/api/files/upload.ts" } }, "clientEntry": "/assets/main-CgwdHc9W.js" });
|
|
2
|
+
export {
|
|
3
|
+
tsrStartManifest
|
|
4
|
+
};
|
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useQuery } from "@tanstack/react-query";
|
|
3
|
+
async function fetchJson(url) {
|
|
4
|
+
const res = await fetch(url);
|
|
5
|
+
if (!res.ok) {
|
|
6
|
+
const body = await res.json().catch(() => ({}));
|
|
7
|
+
throw new Error(body.error || `Request failed: ${res.status}`);
|
|
8
|
+
}
|
|
9
|
+
return await res.json();
|
|
10
|
+
}
|
|
11
|
+
function formatGb(bytes) {
|
|
12
|
+
return `${(bytes / 1024 ** 3).toFixed(1)} GB`;
|
|
13
|
+
}
|
|
14
|
+
function formatCompact(num) {
|
|
15
|
+
return new Intl.NumberFormat(void 0, {
|
|
16
|
+
notation: "compact",
|
|
17
|
+
maximumFractionDigits: 1
|
|
18
|
+
}).format(num);
|
|
19
|
+
}
|
|
20
|
+
function formatCost(num) {
|
|
21
|
+
return `$${num.toFixed(3)}`;
|
|
22
|
+
}
|
|
23
|
+
function formatWhen(value) {
|
|
24
|
+
if (!value) return "—";
|
|
25
|
+
const date = new Date(value);
|
|
26
|
+
if (Number.isNaN(date.getTime())) return "—";
|
|
27
|
+
return date.toLocaleString();
|
|
28
|
+
}
|
|
29
|
+
function usageColor(percent) {
|
|
30
|
+
if (percent < 60) return "#10b981";
|
|
31
|
+
if (percent <= 80) return "#f59e0b";
|
|
32
|
+
return "#ef4444";
|
|
33
|
+
}
|
|
34
|
+
function ProgressBar({
|
|
35
|
+
percent
|
|
36
|
+
}) {
|
|
37
|
+
const clamped = Math.max(0, Math.min(100, percent));
|
|
38
|
+
return /* @__PURE__ */ jsx("div", { className: "h-2 w-full rounded-full bg-primary-200 overflow-hidden", children: /* @__PURE__ */ jsx("div", { className: "h-full rounded-full transition-all duration-300", style: {
|
|
39
|
+
width: `${clamped}%`,
|
|
40
|
+
backgroundColor: usageColor(clamped)
|
|
41
|
+
} }) });
|
|
42
|
+
}
|
|
43
|
+
function CardSkeleton() {
|
|
44
|
+
return /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-primary-200 bg-primary-100 p-4 animate-pulse space-y-3", children: [
|
|
45
|
+
/* @__PURE__ */ jsx("div", { className: "h-4 w-32 bg-primary-200 rounded" }),
|
|
46
|
+
/* @__PURE__ */ jsx("div", { className: "h-10 bg-primary-200 rounded" }),
|
|
47
|
+
/* @__PURE__ */ jsx("div", { className: "h-10 bg-primary-200 rounded" }),
|
|
48
|
+
/* @__PURE__ */ jsx("div", { className: "h-10 bg-primary-200 rounded" })
|
|
49
|
+
] });
|
|
50
|
+
}
|
|
51
|
+
function DashboardRoute() {
|
|
52
|
+
const systemQuery = useQuery({
|
|
53
|
+
queryKey: ["dashboard", "system"],
|
|
54
|
+
queryFn: () => fetchJson("/api/dashboard/system"),
|
|
55
|
+
refetchInterval: 1e4
|
|
56
|
+
});
|
|
57
|
+
const gatewayQuery = useQuery({
|
|
58
|
+
queryKey: ["dashboard", "gateway"],
|
|
59
|
+
queryFn: () => fetchJson("/api/dashboard/gateway"),
|
|
60
|
+
refetchInterval: 1e4
|
|
61
|
+
});
|
|
62
|
+
const cronQuery = useQuery({
|
|
63
|
+
queryKey: ["dashboard", "crons"],
|
|
64
|
+
queryFn: async () => {
|
|
65
|
+
const data = await fetchJson("/api/dashboard/crons");
|
|
66
|
+
return data.jobs;
|
|
67
|
+
},
|
|
68
|
+
refetchInterval: 1e4
|
|
69
|
+
});
|
|
70
|
+
const hasError = systemQuery.isError || gatewayQuery.isError || cronQuery.isError;
|
|
71
|
+
const cpuUsage = systemQuery.data?.cpu ?? 0;
|
|
72
|
+
const ramPercent = (systemQuery.data?.ram.total ?? 0) > 0 ? (systemQuery.data?.ram.used ?? 0) / (systemQuery.data?.ram.total ?? 1) * 100 : 0;
|
|
73
|
+
const diskPercent = (systemQuery.data?.disk.total ?? 0) > 0 ? (systemQuery.data?.disk.used ?? 0) / (systemQuery.data?.disk.total ?? 1) * 100 : 0;
|
|
74
|
+
return /* @__PURE__ */ jsxs("div", { className: "flex h-screen flex-col bg-surface text-primary-900", children: [
|
|
75
|
+
/* @__PURE__ */ jsxs("div", { className: "px-4 pt-4 pb-3 border-b border-primary-100", children: [
|
|
76
|
+
/* @__PURE__ */ jsx("h2", { className: "text-base font-semibold text-primary-900", children: "Dashboard" }),
|
|
77
|
+
/* @__PURE__ */ jsx("p", { className: "text-xs text-primary-500", children: "Live system and gateway overview (refreshes every 10s)" })
|
|
78
|
+
] }),
|
|
79
|
+
/* @__PURE__ */ jsxs("div", { className: "min-h-0 flex-1 overflow-auto p-4", children: [
|
|
80
|
+
hasError && /* @__PURE__ */ jsx("div", { className: "mb-4 rounded-lg border border-red-300/40 bg-red-500/10 px-3 py-2 text-sm text-red-400", children: "Failed to load one or more widgets. Retrying automatically…" }),
|
|
81
|
+
/* @__PURE__ */ jsxs("div", { className: "grid grid-cols-1 gap-4 lg:grid-cols-3", children: [
|
|
82
|
+
systemQuery.isLoading ? /* @__PURE__ */ jsx(CardSkeleton, {}) : /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-primary-200 bg-primary-100 p-4 space-y-3", children: [
|
|
83
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
84
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: "💻 System Stats" }),
|
|
85
|
+
/* @__PURE__ */ jsx("span", { className: "text-xs text-primary-500", children: "↻ auto-refresh" })
|
|
86
|
+
] }),
|
|
87
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
88
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs text-primary-500", children: [
|
|
89
|
+
/* @__PURE__ */ jsx("span", { children: "CPU" }),
|
|
90
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
91
|
+
cpuUsage.toFixed(1),
|
|
92
|
+
"% · ",
|
|
93
|
+
systemQuery.data?.cores ?? 0,
|
|
94
|
+
" ",
|
|
95
|
+
"cores"
|
|
96
|
+
] })
|
|
97
|
+
] }),
|
|
98
|
+
/* @__PURE__ */ jsx(ProgressBar, { percent: cpuUsage })
|
|
99
|
+
] }),
|
|
100
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
101
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs text-primary-500", children: [
|
|
102
|
+
/* @__PURE__ */ jsx("span", { children: "RAM" }),
|
|
103
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
104
|
+
formatGb(systemQuery.data?.ram.used ?? 0),
|
|
105
|
+
" /",
|
|
106
|
+
" ",
|
|
107
|
+
formatGb(systemQuery.data?.ram.total ?? 0)
|
|
108
|
+
] })
|
|
109
|
+
] }),
|
|
110
|
+
/* @__PURE__ */ jsx(ProgressBar, { percent: ramPercent })
|
|
111
|
+
] }),
|
|
112
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1", children: [
|
|
113
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between text-xs text-primary-500", children: [
|
|
114
|
+
/* @__PURE__ */ jsx("span", { children: "Disk" }),
|
|
115
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
116
|
+
formatGb(systemQuery.data?.disk.used ?? 0),
|
|
117
|
+
" /",
|
|
118
|
+
" ",
|
|
119
|
+
formatGb(systemQuery.data?.disk.total ?? 0)
|
|
120
|
+
] })
|
|
121
|
+
] }),
|
|
122
|
+
/* @__PURE__ */ jsx(ProgressBar, { percent: diskPercent })
|
|
123
|
+
] }),
|
|
124
|
+
/* @__PURE__ */ jsxs("div", { className: "border-t border-primary-200 pt-3 space-y-1.5 text-xs text-primary-500", children: [
|
|
125
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
126
|
+
/* @__PURE__ */ jsx("span", { children: "Load (1m/5m/15m)" }),
|
|
127
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
128
|
+
(systemQuery.data?.load?.[0] ?? 0).toFixed(2),
|
|
129
|
+
" ·",
|
|
130
|
+
" ",
|
|
131
|
+
(systemQuery.data?.load?.[1] ?? 0).toFixed(2),
|
|
132
|
+
" ·",
|
|
133
|
+
" ",
|
|
134
|
+
(systemQuery.data?.load?.[2] ?? 0).toFixed(2)
|
|
135
|
+
] })
|
|
136
|
+
] }),
|
|
137
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
138
|
+
/* @__PURE__ */ jsx("span", { children: "Uptime" }),
|
|
139
|
+
/* @__PURE__ */ jsx("span", { children: systemQuery.data?.uptime ?? "0m" })
|
|
140
|
+
] }),
|
|
141
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
142
|
+
/* @__PURE__ */ jsx("span", { children: "Net ↓ / ↑" }),
|
|
143
|
+
/* @__PURE__ */ jsxs("span", { children: [
|
|
144
|
+
systemQuery.data?.network.rx ?? "0 MB",
|
|
145
|
+
" /",
|
|
146
|
+
" ",
|
|
147
|
+
systemQuery.data?.network.tx ?? "0 MB"
|
|
148
|
+
] })
|
|
149
|
+
] }),
|
|
150
|
+
/* @__PURE__ */ jsxs("div", { className: "truncate", title: systemQuery.data?.cpuModel ?? "", children: [
|
|
151
|
+
"CPU: ",
|
|
152
|
+
systemQuery.data?.cpuModel ?? "Unknown CPU"
|
|
153
|
+
] })
|
|
154
|
+
] }),
|
|
155
|
+
/* @__PURE__ */ jsxs("div", { className: "border-t border-primary-200 pt-3", children: [
|
|
156
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs font-semibold text-primary-700 mb-2", children: "Top Processes" }),
|
|
157
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-1 text-xs", children: [
|
|
158
|
+
(systemQuery.data?.topProcesses ?? []).map((proc, idx) => /* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-2", children: [
|
|
159
|
+
/* @__PURE__ */ jsx("span", { className: "truncate text-primary-700", children: proc.name }),
|
|
160
|
+
/* @__PURE__ */ jsxs("span", { className: "text-primary-500 shrink-0", children: [
|
|
161
|
+
proc.cpu.toFixed(1),
|
|
162
|
+
"% CPU · ",
|
|
163
|
+
proc.mem.toFixed(1),
|
|
164
|
+
"% MEM"
|
|
165
|
+
] })
|
|
166
|
+
] }, `${proc.name}-${idx}`)),
|
|
167
|
+
(systemQuery.data?.topProcesses.length ?? 0) === 0 && /* @__PURE__ */ jsx("div", { className: "text-primary-500", children: "No process data." })
|
|
168
|
+
] })
|
|
169
|
+
] })
|
|
170
|
+
] }),
|
|
171
|
+
gatewayQuery.isLoading ? /* @__PURE__ */ jsx(CardSkeleton, {}) : /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-primary-200 bg-primary-100 p-4 space-y-4", children: [
|
|
172
|
+
/* @__PURE__ */ jsx("h3", { className: "text-sm font-semibold", children: "Gateway Status" }),
|
|
173
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-3 text-sm", children: [
|
|
174
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
175
|
+
/* @__PURE__ */ jsx("span", { className: "text-primary-500", children: "Active sessions" }),
|
|
176
|
+
/* @__PURE__ */ jsx("span", { children: gatewayQuery.data?.activeSessions ?? 0 })
|
|
177
|
+
] }),
|
|
178
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
179
|
+
/* @__PURE__ */ jsx("span", { className: "text-primary-500", children: "Tokens today" }),
|
|
180
|
+
/* @__PURE__ */ jsx("span", { children: formatCompact(gatewayQuery.data?.tokensToday ?? 0) })
|
|
181
|
+
] }),
|
|
182
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between", children: [
|
|
183
|
+
/* @__PURE__ */ jsx("span", { className: "text-primary-500", children: "Estimated cost" }),
|
|
184
|
+
/* @__PURE__ */ jsx("span", { children: formatCost(gatewayQuery.data?.costToday ?? 0) })
|
|
185
|
+
] })
|
|
186
|
+
] })
|
|
187
|
+
] }),
|
|
188
|
+
cronQuery.isLoading ? /* @__PURE__ */ jsx(CardSkeleton, {}) : /* @__PURE__ */ jsxs("div", { className: "rounded-xl border border-primary-200 bg-primary-100 p-4 flex flex-col min-h-[340px] max-h-[70vh]", children: [
|
|
189
|
+
/* @__PURE__ */ jsxs("h3", { className: "text-sm font-semibold mb-3", children: [
|
|
190
|
+
"🕐 Cron Jobs (",
|
|
191
|
+
cronQuery.data?.length ?? 0,
|
|
192
|
+
")"
|
|
193
|
+
] }),
|
|
194
|
+
/* @__PURE__ */ jsxs("div", { className: "space-y-2 overflow-auto pr-1", children: [
|
|
195
|
+
(cronQuery.data ?? []).map((job) => /* @__PURE__ */ jsxs("div", { className: `rounded-md border border-primary-200 px-2.5 py-2 ${job.enabled ? "opacity-100" : "opacity-50 grayscale"}`, children: [
|
|
196
|
+
/* @__PURE__ */ jsxs("div", { className: "flex items-center justify-between gap-3", children: [
|
|
197
|
+
/* @__PURE__ */ jsx("div", { className: "text-sm truncate", children: job.name }),
|
|
198
|
+
/* @__PURE__ */ jsx("div", { className: "text-xs", children: !job.enabled ? "⏸️" : job.lastStatus === "ok" ? "✅" : job.lastStatus === "error" ? "❌" : "—" })
|
|
199
|
+
] }),
|
|
200
|
+
/* @__PURE__ */ jsxs("div", { className: "mt-1 text-xs text-primary-500", children: [
|
|
201
|
+
"Next: ",
|
|
202
|
+
formatWhen(job.nextRun)
|
|
203
|
+
] })
|
|
204
|
+
] }, job.id)),
|
|
205
|
+
(cronQuery.data?.length ?? 0) === 0 && /* @__PURE__ */ jsx("div", { className: "text-xs text-primary-500", children: "No cron jobs found." })
|
|
206
|
+
] })
|
|
207
|
+
] })
|
|
208
|
+
] })
|
|
209
|
+
] })
|
|
210
|
+
] });
|
|
211
|
+
}
|
|
212
|
+
export {
|
|
213
|
+
DashboardRoute as component
|
|
214
|
+
};
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { useEffect } from "react";
|
|
3
|
-
import { R as Route } from "./router-
|
|
3
|
+
import { R as Route } from "./router-DCjikH21.js";
|
|
4
4
|
import "@tanstack/react-router";
|
|
5
5
|
import "@tanstack/react-query";
|
|
6
6
|
import "node:crypto";
|
|
7
|
-
import "ws";
|
|
8
7
|
import "node:fs";
|
|
9
|
-
import "node:path";
|
|
10
8
|
import "node:os";
|
|
9
|
+
import "node:path";
|
|
10
|
+
import "ws";
|
|
11
11
|
import "@tanstack/router-core/ssr/client";
|
|
12
|
+
import "node:stream";
|
|
12
13
|
import "node:child_process";
|
|
13
14
|
import "node:fs/promises";
|
|
14
15
|
import "path";
|