@burdenoff/microfe-vibecontrols 2026.528.5 → 2026.528.7
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/dist/VibeControlsRoot.js +89 -81
- package/dist/VibeControlsRoot.js.map +1 -1
- package/dist/VibeControlsRoutes.js +154 -136
- package/dist/VibeControlsRoutes.js.map +1 -1
- package/dist/components/templates/TemplateWizard.js +2 -2
- package/dist/components/templates/TemplateWizard.js.map +1 -1
- package/dist/constants/pluginCatalog.js +1 -1
- package/dist/pages/AgentsPage.js +234 -225
- package/dist/pages/AgentsPage.js.map +1 -1
- package/dist/pages/PluginsCatalogPage.js +287 -0
- package/dist/pages/PluginsCatalogPage.js.map +1 -0
- package/dist/pages/VibeCalendarPage.js +132 -107
- package/dist/pages/VibeCalendarPage.js.map +1 -1
- package/dist/pages/VibesPage.js +244 -231
- package/dist/pages/VibesPage.js.map +1 -1
- package/package.json +2 -2
package/dist/pages/AgentsPage.js
CHANGED
|
@@ -26,92 +26,101 @@ import { deriveAgentStatus as Me } from "../utils/agentStatus.js";
|
|
|
26
26
|
import { useCallback as o, useEffect as s, useMemo as c, useRef as l, useState as u } from "react";
|
|
27
27
|
import { useI18n as Ne } from "@burdenoff/fe-libs/shared/providers/shell/I18nProvider";
|
|
28
28
|
import { Bot as Pe, CheckSquare as Fe, Grid as Ie, List as Le, Plus as d, RefreshCw as Re, Trash2 as ze, XSquare as Be } from "lucide-react";
|
|
29
|
-
import {
|
|
29
|
+
import { useSearchParams as Ve } from "react-router-dom";
|
|
30
|
+
import { usePermissions as He } from "@burdenoff/fe-libs/shared/providers/shell";
|
|
30
31
|
import { AnimatePresence as f, motion as p } from "framer-motion";
|
|
31
32
|
import { Fragment as m, jsx as h, jsxs as g } from "react/jsx-runtime";
|
|
32
|
-
import { MotionItem as
|
|
33
|
+
import { MotionItem as _, MotionList as Ue, MotionPage as v } from "@burdenoff/fe-libs/shared/motion";
|
|
33
34
|
import { AccessDenied as We, PermissionButton as Ge } from "@burdenoff/fe-libs/shared/components";
|
|
34
35
|
//#region src/pages/AgentsPage.tsx
|
|
35
36
|
function Ke() {
|
|
36
|
-
let { onAgentSelect: Ke, workspaceId:
|
|
37
|
+
let { onAgentSelect: Ke, workspaceId: y } = pe(), b = me(), { hasPermission: qe, isLoading: Je, permissions: Ye } = He(), { t: Xe } = Ne(), x = o((e, t, n) => {
|
|
37
38
|
let r = Xe(e, n), i = r === e ? t : r;
|
|
38
39
|
return n ? Object.entries(n).reduce((e, [t, n]) => e.replace(`{{${t}}}`, String(n)), i) : i;
|
|
39
40
|
}, [Xe]), Ze = [
|
|
40
41
|
{
|
|
41
42
|
value: "all",
|
|
42
|
-
label:
|
|
43
|
+
label: x("agentsPage.statusAll", "All Statuses")
|
|
43
44
|
},
|
|
44
45
|
{
|
|
45
46
|
value: "ACTIVE",
|
|
46
|
-
label:
|
|
47
|
+
label: x("agentsPage.statusActive", "Active")
|
|
47
48
|
},
|
|
48
49
|
{
|
|
49
50
|
value: "STOPPED",
|
|
50
|
-
label:
|
|
51
|
+
label: x("agentsPage.statusStopped", "Stopped")
|
|
51
52
|
},
|
|
52
53
|
{
|
|
53
54
|
value: "OFFLINE",
|
|
54
|
-
label:
|
|
55
|
+
label: x("agentsPage.statusOffline", "Offline")
|
|
55
56
|
}
|
|
56
57
|
], Qe = [
|
|
57
58
|
{
|
|
58
59
|
value: "all",
|
|
59
|
-
label:
|
|
60
|
+
label: x("agentsPage.platformAll", "All Platforms")
|
|
60
61
|
},
|
|
61
62
|
{
|
|
62
63
|
value: "darwin",
|
|
63
|
-
label:
|
|
64
|
+
label: x("agentsPage.platformMac", "macOS")
|
|
64
65
|
},
|
|
65
66
|
{
|
|
66
67
|
value: "linux",
|
|
67
|
-
label:
|
|
68
|
+
label: x("agentsPage.platformLinux", "Linux")
|
|
68
69
|
},
|
|
69
70
|
{
|
|
70
71
|
value: "windows",
|
|
71
|
-
label:
|
|
72
|
+
label: x("agentsPage.platformWindows", "Windows")
|
|
72
73
|
}
|
|
73
|
-
], $e = qe(De.AGENT_LIST), [
|
|
74
|
+
], $e = qe(De.AGENT_LIST), [S, et] = u(""), [C, tt] = u("all"), [w, nt] = u("all"), [T, rt] = u("all"), [E, it] = u("grid"), [at, D] = u(!1), [ot, st] = u(!1), [O, ct] = Ve();
|
|
75
|
+
s(() => {
|
|
76
|
+
if (O.get("create") === "true") {
|
|
77
|
+
D(!0);
|
|
78
|
+
let e = new URLSearchParams(O);
|
|
79
|
+
e.delete("create"), ct(e, { replace: !0 });
|
|
80
|
+
}
|
|
81
|
+
}, [O, ct]);
|
|
82
|
+
let [k, A] = u(null), [j, lt] = u(!1), M = a((e) => e.connectingAgents), ut = a((e) => e.markAgentConnecting), N = a((e) => e.clearAgentConnecting), dt = c(() => new Set(Object.keys(M)), [M]), ft = l(/* @__PURE__ */ new Map());
|
|
74
83
|
s(() => {
|
|
75
84
|
let e = ft.current;
|
|
76
|
-
for (let t of Object.keys(
|
|
85
|
+
for (let t of Object.keys(M)) {
|
|
77
86
|
if (e.has(t)) continue;
|
|
78
87
|
let n = setTimeout(() => {
|
|
79
|
-
|
|
88
|
+
N(t), e.delete(t);
|
|
80
89
|
}, 3e4);
|
|
81
90
|
e.set(t, n);
|
|
82
91
|
}
|
|
83
|
-
for (let [t, n] of e.entries()) t in
|
|
92
|
+
for (let [t, n] of e.entries()) t in M || (clearTimeout(n), e.delete(t));
|
|
84
93
|
return () => {
|
|
85
94
|
for (let t of e.values()) clearTimeout(t);
|
|
86
95
|
e.clear();
|
|
87
96
|
};
|
|
88
|
-
}, [
|
|
89
|
-
let [
|
|
97
|
+
}, [M, N]);
|
|
98
|
+
let [P, F] = u(null), [I, L] = u(!1), pt = l(null), mt = l(null), [R, z] = u(/* @__PURE__ */ new Set()), [ht, gt] = u(!1), [_t, B] = u(null), [vt, V] = u(null), [yt, H] = u(!1), U = l(null);
|
|
90
99
|
s(() => () => {
|
|
91
|
-
|
|
100
|
+
U.current && clearTimeout(U.current);
|
|
92
101
|
}, []);
|
|
93
|
-
let
|
|
94
|
-
|
|
95
|
-
}, []),
|
|
96
|
-
|
|
97
|
-
}, []), [
|
|
98
|
-
variables: { workspaceId:
|
|
99
|
-
skip: !
|
|
102
|
+
let W = o((e) => {
|
|
103
|
+
U.current && clearTimeout(U.current), V(null), B(e), U.current = setTimeout(() => B(null), 3e3);
|
|
104
|
+
}, []), G = o((e) => {
|
|
105
|
+
U.current && clearTimeout(U.current), B(null), V(e), U.current = setTimeout(() => V(null), 5e3);
|
|
106
|
+
}, []), [bt] = ee({ refetchQueries: ["ListAgents"] }), { setDraftTagIds: xt, flushTags: St } = be("VIBECONTROLS_AGENT"), [Ct] = r({ refetchQueries: ["ListAgents"] }), [wt] = i({ refetchQueries: ["ListAgents"] }), [Tt] = ne({ refetchQueries: ["ListAgents"] }), [Et] = se({ refetchQueries: ["ListAgents"] }), [Dt] = ce({ refetchQueries: ["ListAgents"] }), [Ot] = oe({ refetchQueries: ["ListAgents"] }), { refetch: kt } = he(), { data: At, loading: jt, refetch: Mt } = ae({
|
|
107
|
+
variables: { workspaceId: y ?? "" },
|
|
108
|
+
skip: !y,
|
|
100
109
|
fetchPolicy: "cache-and-network"
|
|
101
|
-
}),
|
|
110
|
+
}), Nt = At?.targets?.items ?? [], Pt = Nt.length > 0, [Ft] = le({ refetchQueries: ["ListAgents"] }), [It] = re({ refetchQueries: ["ListAgents"] }), [Lt] = te({
|
|
102
111
|
refetchQueries: ["VibeControlsInitialData", "ListTargets"],
|
|
103
112
|
awaitRefetchQueries: !0
|
|
104
|
-
}),
|
|
105
|
-
if (!
|
|
113
|
+
}), Rt = o(async (e) => {
|
|
114
|
+
if (!y || !e.trim()) return null;
|
|
106
115
|
try {
|
|
107
|
-
let { data: t } = await
|
|
108
|
-
workspaceId:
|
|
116
|
+
let { data: t } = await Lt({ variables: {
|
|
117
|
+
workspaceId: y,
|
|
109
118
|
input: {
|
|
110
119
|
type: "DIRECT",
|
|
111
120
|
name: e.trim()
|
|
112
121
|
}
|
|
113
122
|
} }), n = t?.createTarget;
|
|
114
|
-
return n ? (
|
|
123
|
+
return n ? (kt(), Mt(), {
|
|
115
124
|
id: n.id,
|
|
116
125
|
name: n.name,
|
|
117
126
|
type: n.type ?? "DIRECT",
|
|
@@ -121,27 +130,27 @@ function Ke() {
|
|
|
121
130
|
return null;
|
|
122
131
|
}
|
|
123
132
|
}, [
|
|
124
|
-
|
|
125
|
-
Et,
|
|
133
|
+
Lt,
|
|
126
134
|
kt,
|
|
127
|
-
|
|
128
|
-
|
|
135
|
+
Mt,
|
|
136
|
+
y
|
|
137
|
+
]), { data: zt, loading: K, error: Bt, refetch: q } = ie({
|
|
129
138
|
variables: {
|
|
130
139
|
filter: {
|
|
131
|
-
isActive:
|
|
132
|
-
platform:
|
|
140
|
+
isActive: C === "ACTIVE" ? !0 : C === "OFFLINE" ? !1 : void 0,
|
|
141
|
+
platform: w === "all" ? void 0 : w
|
|
133
142
|
},
|
|
134
143
|
pagination: { limit: 100 }
|
|
135
144
|
},
|
|
136
145
|
fetchPolicy: "cache-first",
|
|
137
|
-
skip: !
|
|
146
|
+
skip: !y
|
|
138
147
|
}), J = fe({
|
|
139
148
|
fetchPolicy: "cache-and-network",
|
|
140
149
|
nextFetchPolicy: "cache-first",
|
|
141
150
|
notifyOnNetworkStatusChange: !0,
|
|
142
|
-
skip: !
|
|
151
|
+
skip: !y,
|
|
143
152
|
pollInterval: 3e4
|
|
144
|
-
}), [
|
|
153
|
+
}), [Vt] = de({ fetchPolicy: "network-only" }), { data: Y } = ue({ skip: !y }), Ht = J.data === void 0 && Y === void 0, X = c(() => {
|
|
145
154
|
let e = /* @__PURE__ */ new Map(), t = Y?.vibecontrolsAgentHealthProbeStream ?? J.data?.vibecontrolsAgentHealthProbes ?? [];
|
|
146
155
|
for (let n of t) e.set(n.agentId, {
|
|
147
156
|
agentId: n.agentId,
|
|
@@ -149,7 +158,7 @@ function Ke() {
|
|
|
149
158
|
errorMessage: n.errorMessage
|
|
150
159
|
});
|
|
151
160
|
return e;
|
|
152
|
-
}, [J.data, Y]), Z = c(() => (
|
|
161
|
+
}, [J.data, Y]), Z = c(() => (zt?.vibecontrolsAgents ?? []).map((e) => ({
|
|
153
162
|
id: e.id,
|
|
154
163
|
workspaceId: e.workspaceId,
|
|
155
164
|
name: e.name,
|
|
@@ -162,7 +171,7 @@ function Ke() {
|
|
|
162
171
|
id: e.id,
|
|
163
172
|
isActive: e.isActive,
|
|
164
173
|
metadata: e.metadata
|
|
165
|
-
}, X, { probesLoading:
|
|
174
|
+
}, X, { probesLoading: Ht }),
|
|
166
175
|
healthError: X.get(e.id)?.errorMessage ?? (e.lastGatewayAuthPushStatus === "failed" ? e.lastGatewayAuthPushError ?? "Gateway-auth push failed" : null),
|
|
167
176
|
lastHeartbeat: e.lastHeartbeat || null,
|
|
168
177
|
tunnelUrl: e.tunnelUrl ?? null,
|
|
@@ -187,62 +196,62 @@ function Ke() {
|
|
|
187
196
|
} : null
|
|
188
197
|
}))
|
|
189
198
|
})), [
|
|
190
|
-
|
|
199
|
+
zt?.vibecontrolsAgents,
|
|
191
200
|
X,
|
|
192
|
-
|
|
201
|
+
Ht,
|
|
193
202
|
dt
|
|
194
203
|
]);
|
|
195
204
|
s(() => {
|
|
196
|
-
let e = Object.keys(
|
|
205
|
+
let e = Object.keys(M);
|
|
197
206
|
if (e.length === 0) return;
|
|
198
207
|
let t = Date.now(), n = Infinity;
|
|
199
208
|
for (let r of e) {
|
|
200
|
-
let e =
|
|
201
|
-
e !== void 0 && (X.get(r)?.healthy === !0 && t >= e ?
|
|
209
|
+
let e = M[r];
|
|
210
|
+
e !== void 0 && (X.get(r)?.healthy === !0 && t >= e ? N(r) : e < n && (n = e));
|
|
202
211
|
}
|
|
203
212
|
if (n === Infinity) return;
|
|
204
213
|
let r = Math.max(0, n - t) + 50, i = setTimeout(() => {
|
|
205
214
|
let e = a.getState().connectingAgents;
|
|
206
215
|
for (let t of Object.keys(e)) {
|
|
207
216
|
let n = e[t];
|
|
208
|
-
n !== void 0 && X.get(t)?.healthy === !0 && Date.now() >= n &&
|
|
217
|
+
n !== void 0 && X.get(t)?.healthy === !0 && Date.now() >= n && N(t);
|
|
209
218
|
}
|
|
210
219
|
}, r);
|
|
211
220
|
return () => clearTimeout(i);
|
|
212
221
|
}, [
|
|
213
222
|
X,
|
|
214
|
-
|
|
215
|
-
|
|
223
|
+
M,
|
|
224
|
+
N
|
|
216
225
|
]);
|
|
217
226
|
let Q = c(() => Z.filter((e) => {
|
|
218
|
-
if (
|
|
219
|
-
let t =
|
|
227
|
+
if (S) {
|
|
228
|
+
let t = S.toLowerCase();
|
|
220
229
|
if (!(e.name.toLowerCase().includes(t) || e.hostname?.toLowerCase().includes(t) || e.id.toLowerCase().includes(t))) return !1;
|
|
221
230
|
}
|
|
222
|
-
return !(
|
|
231
|
+
return !(T !== "all" && !(e.tagAssignments ?? []).some((e) => e.tagId === T));
|
|
223
232
|
}), [
|
|
224
233
|
Z,
|
|
225
|
-
|
|
226
|
-
|
|
234
|
+
S,
|
|
235
|
+
T
|
|
227
236
|
]);
|
|
228
237
|
s(() => () => {
|
|
229
|
-
|
|
238
|
+
U.current && clearTimeout(U.current);
|
|
230
239
|
}, []);
|
|
231
|
-
let
|
|
232
|
-
|
|
240
|
+
let Ut = (e) => {
|
|
241
|
+
b(`/agents/${e.id}`), Ke?.({
|
|
233
242
|
id: e.id,
|
|
234
243
|
name: e.name,
|
|
235
244
|
type: e.platform || "unknown",
|
|
236
245
|
status: e.status || (e.isActive ? "ACTIVE" : "OFFLINE")
|
|
237
246
|
});
|
|
238
247
|
}, $ = () => {
|
|
239
|
-
|
|
240
|
-
},
|
|
248
|
+
D(!0);
|
|
249
|
+
}, Wt = async (e) => {
|
|
241
250
|
try {
|
|
242
251
|
st(!0);
|
|
243
252
|
let t = e.tunnelUrl?.trim(), n = e.agentApiKey?.trim();
|
|
244
253
|
if (t && n) {
|
|
245
|
-
let r = await
|
|
254
|
+
let r = await Ct({ variables: { input: {
|
|
246
255
|
tunnelUrl: t,
|
|
247
256
|
apiKey: n,
|
|
248
257
|
...e.name ? { name: e.name } : {},
|
|
@@ -251,10 +260,10 @@ function Ke() {
|
|
|
251
260
|
if (r.error) throw r.error;
|
|
252
261
|
let i = r.data?.addVibecontrolsAgentFromTunnel;
|
|
253
262
|
if (!i?.success) throw Error(i?.error || "Failed to onboard agent — probe or OAuth setup failed.");
|
|
254
|
-
if (i.agent?.id) return await
|
|
263
|
+
if (i.agent?.id) return await St(i.agent.id), { id: i.agent.id };
|
|
255
264
|
throw Error("Agent onboarding returned no agent record.");
|
|
256
265
|
}
|
|
257
|
-
let r = await
|
|
266
|
+
let r = await bt({ variables: { input: {
|
|
258
267
|
name: e.name,
|
|
259
268
|
hostname: e.hostname,
|
|
260
269
|
platform: e.platform,
|
|
@@ -264,63 +273,63 @@ function Ke() {
|
|
|
264
273
|
...e.tunnelUrl ? { tunnelUrl: e.tunnelUrl } : {},
|
|
265
274
|
...e.tunnelStatus ? { tunnelStatus: e.tunnelStatus } : {}
|
|
266
275
|
} } }), i = r.data?.createVibecontrolsAgent;
|
|
267
|
-
if (i?.id) return await
|
|
276
|
+
if (i?.id) return await St(i.id), { id: i.id };
|
|
268
277
|
throw r.error ? r.error : Error("Agent creation failed — no data returned from the server.");
|
|
269
278
|
} catch (e) {
|
|
270
279
|
if (t(e)) {
|
|
271
|
-
n(),
|
|
280
|
+
n(), H(!0), D(!1);
|
|
272
281
|
return;
|
|
273
282
|
}
|
|
274
283
|
throw console.error("Failed to create agent:", e), e;
|
|
275
284
|
} finally {
|
|
276
285
|
st(!1);
|
|
277
286
|
}
|
|
278
|
-
},
|
|
287
|
+
}, Gt = async (e) => {
|
|
279
288
|
try {
|
|
280
|
-
let t = (await
|
|
289
|
+
let t = (await Et({ variables: { agentId: e.id } })).data?.startVibecontrolsAgent;
|
|
281
290
|
if (!t?.success) {
|
|
282
291
|
if (/not yet configured|awaiting[-\s_]config/i.test(t?.error ?? "")) {
|
|
283
|
-
let t = (await
|
|
292
|
+
let t = (await Ot({ variables: { input: { agentId: e.id } } })).data?.setupAgentGatewayAuth;
|
|
284
293
|
if (t?.error) throw Error(`Agent needs credentials. Auto re-push failed: ${t.error}. Try "Re-push credentials" in Security tab.`);
|
|
285
294
|
if (!t) throw Error("Agent needs credentials. Auto re-push returned no result. Try \"Re-push credentials\" in Security tab.");
|
|
286
295
|
let n = t.agent?.lastGatewayAuthPushStatus, r = t.agent?.lastGatewayAuthPushError;
|
|
287
296
|
if (n === "failed") throw Error(`Credentials created but push to agent tunnel failed: ${r || "unknown error"}. Check that the agent can reach the workspace's gateway URLs from its host network.`);
|
|
288
|
-
let i = (await
|
|
297
|
+
let i = (await Et({ variables: { agentId: e.id } })).data?.startVibecontrolsAgent;
|
|
289
298
|
if (!i?.success) throw Error(`Credentials pushed but lifecycle/start failed: ${i?.error || "unknown error"}. The agent has fresh credentials; try clicking Reconnect again or check vibe status on the host.`);
|
|
290
|
-
await
|
|
299
|
+
await wt({ variables: { id: e.id } }), W(`Agent "${e.name}" re-credentialed and started.`);
|
|
291
300
|
return;
|
|
292
301
|
}
|
|
293
302
|
throw Error(t?.error || "Failed to start agent");
|
|
294
303
|
}
|
|
295
|
-
await
|
|
304
|
+
await wt({ variables: { id: e.id } }), W(`Agent "${e.name}" started`);
|
|
296
305
|
} catch (e) {
|
|
297
|
-
console.error("Failed to start agent:", e),
|
|
306
|
+
console.error("Failed to start agent:", e), G(e instanceof Error ? e.message : "Failed to start agent");
|
|
298
307
|
}
|
|
299
|
-
},
|
|
308
|
+
}, Kt = async (e) => {
|
|
300
309
|
try {
|
|
301
|
-
let t = (await
|
|
310
|
+
let t = (await Dt({ variables: { agentId: e.id } })).data?.stopVibecontrolsAgent;
|
|
302
311
|
if (!t?.success) throw Error(t?.error || "Failed to stop agent");
|
|
303
|
-
await
|
|
312
|
+
await Tt({ variables: { id: e.id } }), W(`Agent "${e.name}" stopped`);
|
|
304
313
|
} catch (e) {
|
|
305
|
-
console.error("Failed to stop agent:", e),
|
|
314
|
+
console.error("Failed to stop agent:", e), G(e instanceof Error ? e.message : "Failed to stop agent");
|
|
306
315
|
}
|
|
307
|
-
},
|
|
308
|
-
|
|
309
|
-
},
|
|
310
|
-
if (!
|
|
311
|
-
let e =
|
|
312
|
-
|
|
316
|
+
}, qt = (e) => {
|
|
317
|
+
F(e);
|
|
318
|
+
}, Jt = async () => {
|
|
319
|
+
if (!P) return;
|
|
320
|
+
let e = P;
|
|
321
|
+
L(!0);
|
|
313
322
|
try {
|
|
314
|
-
await
|
|
323
|
+
await Tt({
|
|
315
324
|
variables: { id: e.id },
|
|
316
325
|
refetchQueries: []
|
|
317
326
|
});
|
|
318
327
|
} catch (e) {
|
|
319
|
-
console.error("Failed to deactivate agent:", e),
|
|
328
|
+
console.error("Failed to deactivate agent:", e), G(e instanceof Error ? e.message : "Failed to disconnect agent"), L(!1), F(null), await q();
|
|
320
329
|
return;
|
|
321
330
|
}
|
|
322
331
|
try {
|
|
323
|
-
await
|
|
332
|
+
await Ft({
|
|
324
333
|
variables: {
|
|
325
334
|
id: e.id,
|
|
326
335
|
input: {
|
|
@@ -330,20 +339,20 @@ function Ke() {
|
|
|
330
339
|
}
|
|
331
340
|
},
|
|
332
341
|
refetchQueries: []
|
|
333
|
-
}),
|
|
342
|
+
}), W(`Agent "${e.name}" disconnected`);
|
|
334
343
|
} catch (e) {
|
|
335
|
-
console.error("Failed to clear tunnel fields:", e),
|
|
344
|
+
console.error("Failed to clear tunnel fields:", e), G("Agent marked offline, but failed to clear connection fields — clear them manually in Settings.");
|
|
336
345
|
}
|
|
337
|
-
|
|
338
|
-
},
|
|
339
|
-
|
|
340
|
-
},
|
|
341
|
-
|
|
342
|
-
},
|
|
343
|
-
if (!
|
|
344
|
-
let e =
|
|
346
|
+
L(!1), F(null), await q();
|
|
347
|
+
}, Yt = (e) => {
|
|
348
|
+
b(`/agents/${e.id}`);
|
|
349
|
+
}, Xt = (e) => {
|
|
350
|
+
A(e);
|
|
351
|
+
}, Zt = async () => {
|
|
352
|
+
if (!k) return;
|
|
353
|
+
let e = k.id, t = pt.current?.value?.trim() || "", n = mt.current?.value?.trim() || "";
|
|
345
354
|
try {
|
|
346
|
-
lt(!0), await
|
|
355
|
+
lt(!0), await Ft({
|
|
347
356
|
variables: {
|
|
348
357
|
id: e,
|
|
349
358
|
input: {
|
|
@@ -353,102 +362,102 @@ function Ke() {
|
|
|
353
362
|
}
|
|
354
363
|
},
|
|
355
364
|
refetchQueries: ["ListAgents", "VibecontrolsAgentHealthProbes"]
|
|
356
|
-
}), t && ut(e),
|
|
365
|
+
}), t && ut(e), A(null);
|
|
357
366
|
} catch (e) {
|
|
358
367
|
console.error("Failed to update tunnel settings:", e);
|
|
359
368
|
} finally {
|
|
360
369
|
lt(!1);
|
|
361
370
|
}
|
|
362
|
-
},
|
|
363
|
-
|
|
371
|
+
}, Qt = o((e) => {
|
|
372
|
+
z((t) => {
|
|
364
373
|
let n = new Set(t);
|
|
365
374
|
return n.has(e) ? n.delete(e) : n.add(e), n;
|
|
366
375
|
});
|
|
367
|
-
}, []),
|
|
368
|
-
|
|
369
|
-
}, [Q]),
|
|
370
|
-
|
|
371
|
-
}, []),
|
|
372
|
-
if (
|
|
373
|
-
|
|
376
|
+
}, []), $t = o(() => {
|
|
377
|
+
z(new Set(Q.map((e) => e.id)));
|
|
378
|
+
}, [Q]), en = o(() => {
|
|
379
|
+
z(/* @__PURE__ */ new Set());
|
|
380
|
+
}, []), tn = Q.length > 0 && R.size === Q.length, nn = R.size > 0, rn = o(async () => {
|
|
381
|
+
if (R.size !== 0 && window.confirm(x("agentsPage.bulkDeleteConfirm", "Are you sure you want to remove {{count}} agent(s)? This cannot be undone.", { count: R.size }))) {
|
|
382
|
+
gt(!0);
|
|
374
383
|
try {
|
|
375
|
-
let e = await Promise.allSettled(Array.from(
|
|
376
|
-
n > 0 ?
|
|
384
|
+
let e = await Promise.allSettled(Array.from(R).map((e) => It({ variables: { id: e } }))), t = e.filter((e) => e.status === "fulfilled").length, n = e.filter((e) => e.status === "rejected").length;
|
|
385
|
+
n > 0 ? G(`Removed ${t}, failed to remove ${n} agent${n === 1 ? "" : "s"}`) : W(`Removed ${t} agent${t === 1 ? "" : "s"}`), z(/* @__PURE__ */ new Set());
|
|
377
386
|
} catch (e) {
|
|
378
|
-
|
|
387
|
+
G(e instanceof Error ? e.message : "Failed to remove agents");
|
|
379
388
|
} finally {
|
|
380
|
-
|
|
389
|
+
gt(!1);
|
|
381
390
|
}
|
|
382
391
|
}
|
|
383
392
|
}, [
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
]),
|
|
393
|
+
R,
|
|
394
|
+
It,
|
|
395
|
+
G,
|
|
396
|
+
W
|
|
397
|
+
]), an = {
|
|
389
398
|
total: Z.length,
|
|
390
399
|
active: Z.filter((e) => e.status === "ACTIVE").length,
|
|
391
400
|
offline: Z.filter((e) => e.status !== "ACTIVE").length
|
|
392
401
|
};
|
|
393
|
-
return Je ? /* @__PURE__ */ h(
|
|
402
|
+
return Je ? /* @__PURE__ */ h(v, {
|
|
394
403
|
className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
|
|
395
|
-
children: /* @__PURE__ */ h(_e, { message:
|
|
396
|
-
}) : Ye && Ye.permissionStrings?.length > 0 && !$e ? /* @__PURE__ */ h(
|
|
404
|
+
children: /* @__PURE__ */ h(_e, { message: x("agentsPage.loadingPermissions", "Loading permissions...") })
|
|
405
|
+
}) : Ye && Ye.permissionStrings?.length > 0 && !$e ? /* @__PURE__ */ h(v, {
|
|
397
406
|
className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
|
|
398
407
|
children: /* @__PURE__ */ h(We, {
|
|
399
|
-
title:
|
|
400
|
-
description:
|
|
408
|
+
title: x("agentsPage.accessDeniedTitle", "Access Denied"),
|
|
409
|
+
description: x("agentsPage.accessDeniedDescription", "You don't have permission to view agents. Contact your workspace administrator for access.")
|
|
401
410
|
})
|
|
402
|
-
}) :
|
|
411
|
+
}) : Bt && Z.length === 0 ? /* @__PURE__ */ h(v, {
|
|
403
412
|
className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
|
|
404
413
|
children: /* @__PURE__ */ h(ve, {
|
|
405
|
-
title:
|
|
406
|
-
message:
|
|
414
|
+
title: x("agentsPage.failedLoad", "Failed to load agents"),
|
|
415
|
+
message: Bt.message,
|
|
407
416
|
onRetry: () => q()
|
|
408
417
|
})
|
|
409
|
-
}) : /* @__PURE__ */ g(
|
|
418
|
+
}) : /* @__PURE__ */ g(v, {
|
|
410
419
|
className: "space-y-6 p-4 sm:p-6 bg-bg-surface min-h-screen",
|
|
411
420
|
children: [
|
|
412
|
-
|
|
421
|
+
_t && /* @__PURE__ */ h("div", {
|
|
413
422
|
className: "fixed top-4 left-4 right-4 sm:left-auto z-[101] bg-status-success-bg text-status-success-text px-4 py-3 rounded-md shadow-lg text-sm",
|
|
414
|
-
children:
|
|
423
|
+
children: _t
|
|
415
424
|
}),
|
|
416
|
-
|
|
425
|
+
vt && /* @__PURE__ */ h("div", {
|
|
417
426
|
className: "fixed top-4 right-4 z-[101] bg-status-error-bg text-status-error-text px-4 py-3 rounded-md shadow-lg text-sm",
|
|
418
|
-
children:
|
|
427
|
+
children: vt
|
|
419
428
|
}),
|
|
420
429
|
/* @__PURE__ */ h(ge, {
|
|
421
|
-
title:
|
|
422
|
-
description:
|
|
423
|
-
active:
|
|
424
|
-
total:
|
|
430
|
+
title: x("agentsPage.title", "Agents"),
|
|
431
|
+
description: x("agentsPage.descriptionOnline", "{{active}} of {{total}} agents online", {
|
|
432
|
+
active: an.active,
|
|
433
|
+
total: an.total
|
|
425
434
|
}),
|
|
426
435
|
actions: /* @__PURE__ */ g("div", {
|
|
427
436
|
className: "flex w-full flex-col items-end gap-2 sm:w-auto sm:flex-row sm:items-center",
|
|
428
437
|
children: [/* @__PURE__ */ h("button", {
|
|
429
438
|
type: "button",
|
|
430
439
|
onClick: () => {
|
|
431
|
-
q(),
|
|
440
|
+
q(), Vt();
|
|
432
441
|
},
|
|
433
442
|
disabled: K || J.loading,
|
|
434
443
|
className: "flex items-center justify-center gap-2 px-3 py-2 text-text-secondary hover:bg-bg-sunken rounded-md transition-colors disabled:opacity-50",
|
|
435
|
-
title:
|
|
444
|
+
title: x("agentsPage.refreshTitle", "Refresh agents"),
|
|
436
445
|
children: /* @__PURE__ */ h(Re, { className: `size-4 ${K || J.loading ? "animate-spin" : ""}` })
|
|
437
|
-
}),
|
|
446
|
+
}), Pt ? /* @__PURE__ */ h(Ge, {
|
|
438
447
|
permission: De.AGENT_CREATE,
|
|
439
448
|
deniedBehavior: "disable",
|
|
440
|
-
deniedTooltip:
|
|
449
|
+
deniedTooltip: x("agentsPage.deniedCreateTooltip", "You don't have permission to create agents"),
|
|
441
450
|
children: /* @__PURE__ */ g("button", {
|
|
442
451
|
type: "button",
|
|
443
452
|
onClick: $,
|
|
444
453
|
className: "flex items-center gap-2 px-4 py-2 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg-hover transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
|
|
445
|
-
children: [/* @__PURE__ */ h(d, { className: "size-4" }),
|
|
454
|
+
children: [/* @__PURE__ */ h(d, { className: "size-4" }), x("agentsPage.addAgent", "Add Agent")]
|
|
446
455
|
})
|
|
447
456
|
}) : /* @__PURE__ */ g("button", {
|
|
448
457
|
type: "button",
|
|
449
458
|
onClick: $,
|
|
450
459
|
className: "flex items-center gap-2 px-4 py-2 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg-hover transition-colors",
|
|
451
|
-
children: [/* @__PURE__ */ h(d, { className: "size-4" }),
|
|
460
|
+
children: [/* @__PURE__ */ h(d, { className: "size-4" }), x("agentsPage.addAgent", "Add Agent")]
|
|
452
461
|
})]
|
|
453
462
|
})
|
|
454
463
|
}),
|
|
@@ -465,27 +474,27 @@ function Ke() {
|
|
|
465
474
|
children: [/* @__PURE__ */ g("div", {
|
|
466
475
|
className: "flex items-center gap-2",
|
|
467
476
|
children: [/* @__PURE__ */ h(Se, {
|
|
468
|
-
value:
|
|
477
|
+
value: S,
|
|
469
478
|
onChange: et,
|
|
470
|
-
placeholder:
|
|
479
|
+
placeholder: x("agentsPage.searchPlaceholder", "Search agents..."),
|
|
471
480
|
className: "flex-1 sm:w-64 sm:flex-none"
|
|
472
481
|
}), /* @__PURE__ */ g("div", {
|
|
473
482
|
className: "flex items-center gap-1 bg-bg-sunken rounded-md p-1 flex-shrink-0",
|
|
474
483
|
children: [/* @__PURE__ */ h("button", {
|
|
475
484
|
type: "button",
|
|
476
485
|
onClick: () => {
|
|
477
|
-
it("grid"),
|
|
486
|
+
it("grid"), z(/* @__PURE__ */ new Set());
|
|
478
487
|
},
|
|
479
|
-
className: `p-1.5 sm:p-2 rounded ${
|
|
480
|
-
title:
|
|
488
|
+
className: `p-1.5 sm:p-2 rounded ${E === "grid" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
|
|
489
|
+
title: x("agentsPage.gridViewTitle", "Grid view"),
|
|
481
490
|
children: /* @__PURE__ */ h(Ie, { className: "size-4 text-text-secondary" })
|
|
482
491
|
}), /* @__PURE__ */ h("button", {
|
|
483
492
|
type: "button",
|
|
484
493
|
onClick: () => {
|
|
485
|
-
it("list"),
|
|
494
|
+
it("list"), z(/* @__PURE__ */ new Set());
|
|
486
495
|
},
|
|
487
|
-
className: `p-1.5 sm:p-2 rounded ${
|
|
488
|
-
title:
|
|
496
|
+
className: `p-1.5 sm:p-2 rounded ${E === "list" ? "bg-bg-surface shadow-sm" : "hover:bg-bg-surface/50"}`,
|
|
497
|
+
title: x("agentsPage.listViewTitle", "List view"),
|
|
489
498
|
children: /* @__PURE__ */ h(Le, { className: "size-4 text-text-secondary" })
|
|
490
499
|
})]
|
|
491
500
|
})]
|
|
@@ -493,20 +502,20 @@ function Ke() {
|
|
|
493
502
|
className: "flex items-center gap-2 sm:gap-3 flex-wrap",
|
|
494
503
|
children: [
|
|
495
504
|
/* @__PURE__ */ h(Ce, {
|
|
496
|
-
label:
|
|
497
|
-
value:
|
|
505
|
+
label: x("agentsPage.filterStatus", "Status"),
|
|
506
|
+
value: C,
|
|
498
507
|
options: Ze,
|
|
499
508
|
onChange: tt
|
|
500
509
|
}),
|
|
501
510
|
/* @__PURE__ */ h(Ce, {
|
|
502
|
-
label:
|
|
503
|
-
value:
|
|
511
|
+
label: x("agentsPage.filterPlatform", "Platform"),
|
|
512
|
+
value: w,
|
|
504
513
|
options: Qe,
|
|
505
514
|
onChange: nt
|
|
506
515
|
}),
|
|
507
516
|
/* @__PURE__ */ h(Ee, {
|
|
508
|
-
label:
|
|
509
|
-
value:
|
|
517
|
+
label: x("agentsPage.filterTag", "Tag"),
|
|
518
|
+
value: T,
|
|
510
519
|
onChange: rt
|
|
511
520
|
})
|
|
512
521
|
]
|
|
@@ -518,49 +527,49 @@ function Ke() {
|
|
|
518
527
|
className: "ml-auto flex items-center gap-2",
|
|
519
528
|
children: /* @__PURE__ */ g("button", {
|
|
520
529
|
type: "button",
|
|
521
|
-
onClick:
|
|
530
|
+
onClick: tn ? en : $t,
|
|
522
531
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs text-text-secondary hover:text-text-primary transition-colors",
|
|
523
|
-
children: [/* @__PURE__ */ h(Fe, { className: "size-3.5" }),
|
|
532
|
+
children: [/* @__PURE__ */ h(Fe, { className: "size-3.5" }), tn ? x("agentsPage.deselectAll", "Deselect All") : x("agentsPage.selectAll", "Select All")]
|
|
524
533
|
})
|
|
525
534
|
})
|
|
526
535
|
}),
|
|
527
|
-
|
|
536
|
+
nn && /* @__PURE__ */ g("div", {
|
|
528
537
|
className: "flex flex-col sm:flex-row items-start sm:items-center gap-3 px-4 py-2 bg-action-primary-bg/10 border border-action-primary-bg/20 rounded-lg",
|
|
529
538
|
children: [/* @__PURE__ */ h("span", {
|
|
530
539
|
className: "text-sm font-medium text-text-primary",
|
|
531
|
-
children:
|
|
540
|
+
children: x("agentsPage.selectedCount", "{{count}} agents selected", { count: R.size })
|
|
532
541
|
}), /* @__PURE__ */ g("div", {
|
|
533
542
|
className: "flex items-center gap-1.5 sm:ml-auto",
|
|
534
543
|
children: [/* @__PURE__ */ g("button", {
|
|
535
544
|
type: "button",
|
|
536
|
-
onClick:
|
|
545
|
+
onClick: rn,
|
|
537
546
|
disabled: ht,
|
|
538
547
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs font-medium text-status-error-text bg-status-error-bg border border-status-error-text/20 rounded-md hover:bg-status-error-bg/80 transition-colors disabled:opacity-50",
|
|
539
548
|
children: [
|
|
540
549
|
/* @__PURE__ */ h(ze, { className: "size-3" }),
|
|
541
550
|
" ",
|
|
542
|
-
|
|
551
|
+
x("agentsPage.remove", "Remove")
|
|
543
552
|
]
|
|
544
553
|
}), /* @__PURE__ */ g("button", {
|
|
545
554
|
type: "button",
|
|
546
|
-
onClick:
|
|
555
|
+
onClick: en,
|
|
547
556
|
className: "flex items-center gap-1.5 px-3 py-1.5 text-xs text-text-secondary hover:text-text-primary transition-colors",
|
|
548
557
|
children: [
|
|
549
558
|
/* @__PURE__ */ h(Be, { className: "size-3" }),
|
|
550
559
|
" ",
|
|
551
|
-
|
|
560
|
+
x("agentsPage.deselect", "Deselect")
|
|
552
561
|
]
|
|
553
562
|
})]
|
|
554
563
|
})]
|
|
555
564
|
}),
|
|
556
|
-
|
|
565
|
+
S || C !== "all" || w !== "all" ? /* @__PURE__ */ g("p", {
|
|
557
566
|
className: "text-sm text-text-secondary",
|
|
558
|
-
children: [
|
|
567
|
+
children: [x("agentsPage.showingResults", "Showing {{filtered}} of {{total}} agents", {
|
|
559
568
|
filtered: Q.length,
|
|
560
569
|
total: Z.length
|
|
561
570
|
}), K && /* @__PURE__ */ h("span", {
|
|
562
571
|
className: "ml-2 text-text-muted",
|
|
563
|
-
children:
|
|
572
|
+
children: x("agentsPage.refreshing", "(refreshing...)")
|
|
564
573
|
})]
|
|
565
574
|
}) : null,
|
|
566
575
|
K && Z.length === 0 ? /* @__PURE__ */ h(Oe, {
|
|
@@ -568,92 +577,92 @@ function Ke() {
|
|
|
568
577
|
count: 6
|
|
569
578
|
}) : Q.length > 0 ? /* @__PURE__ */ h(f, {
|
|
570
579
|
mode: "wait",
|
|
571
|
-
children:
|
|
580
|
+
children: E === "grid" ? /* @__PURE__ */ h(Ue, {
|
|
572
581
|
stagger: .04,
|
|
573
582
|
className: "grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",
|
|
574
|
-
children: Q.map((e) => /* @__PURE__ */ h(
|
|
583
|
+
children: Q.map((e) => /* @__PURE__ */ h(_, {
|
|
575
584
|
className: "h-full",
|
|
576
585
|
children: /* @__PURE__ */ h(ke, {
|
|
577
586
|
agent: e,
|
|
578
|
-
onSelect:
|
|
579
|
-
onStart:
|
|
580
|
-
onStop:
|
|
581
|
-
onDisconnect:
|
|
582
|
-
onConfigure:
|
|
583
|
-
onEditTunnelUrl:
|
|
584
|
-
selected:
|
|
585
|
-
onToggleSelect: () =>
|
|
587
|
+
onSelect: Ut,
|
|
588
|
+
onStart: Gt,
|
|
589
|
+
onStop: Kt,
|
|
590
|
+
onDisconnect: qt,
|
|
591
|
+
onConfigure: Yt,
|
|
592
|
+
onEditTunnelUrl: Xt,
|
|
593
|
+
selected: R.has(e.id),
|
|
594
|
+
onToggleSelect: () => Qt(e.id),
|
|
586
595
|
healthErrorMessage: e.healthError ?? null
|
|
587
596
|
})
|
|
588
597
|
}, e.id))
|
|
589
598
|
}, "grid-view") : /* @__PURE__ */ h(Ue, {
|
|
590
599
|
stagger: .04,
|
|
591
|
-
children: /* @__PURE__ */ h(
|
|
600
|
+
children: /* @__PURE__ */ h(_, {
|
|
592
601
|
variant: "fadeRight",
|
|
593
602
|
children: /* @__PURE__ */ h(Ae, {
|
|
594
603
|
agents: Q,
|
|
595
|
-
onSelect:
|
|
596
|
-
onStart:
|
|
597
|
-
onStop:
|
|
598
|
-
onDisconnect:
|
|
599
|
-
onSettings:
|
|
604
|
+
onSelect: Ut,
|
|
605
|
+
onStart: Gt,
|
|
606
|
+
onStop: Kt,
|
|
607
|
+
onDisconnect: qt,
|
|
608
|
+
onSettings: Yt
|
|
600
609
|
})
|
|
601
610
|
})
|
|
602
611
|
}, "list-view")
|
|
603
612
|
}) : /* @__PURE__ */ h(xe, {
|
|
604
613
|
icon: /* @__PURE__ */ h(Pe, { className: "size-8 text-text-secondary" }),
|
|
605
|
-
title:
|
|
606
|
-
description:
|
|
607
|
-
action: !
|
|
614
|
+
title: S || C !== "all" || w !== "all" ? x("agentsPage.emptyNoAgentsFound", "No agents found") : x("agentsPage.emptyNoAgentsConfigured", "No agents configured"),
|
|
615
|
+
description: S || C !== "all" || w !== "all" ? x("agentsPage.emptyAdjustSearch", "Try adjusting your search or filters") : x("agentsPage.emptyNoAgentsDescription", "Install the CLI agent on your machine, then add it here. You can create a target inline while adding the agent."),
|
|
616
|
+
action: !S && C === "all" && w === "all" ? /* @__PURE__ */ g("div", {
|
|
608
617
|
className: "flex flex-wrap items-center gap-3",
|
|
609
618
|
children: [
|
|
610
619
|
/* @__PURE__ */ g("button", {
|
|
611
620
|
type: "button",
|
|
612
621
|
onClick: $,
|
|
613
622
|
className: "flex items-center gap-2 px-4 py-2 bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg-hover transition-colors",
|
|
614
|
-
children: [/* @__PURE__ */ h(d, { className: "size-4" }),
|
|
623
|
+
children: [/* @__PURE__ */ h(d, { className: "size-4" }), x("agentsPage.addAgent", "Add Agent")]
|
|
615
624
|
}),
|
|
616
625
|
/* @__PURE__ */ h("button", {
|
|
617
626
|
type: "button",
|
|
618
|
-
onClick: () =>
|
|
627
|
+
onClick: () => b("/getting-started"),
|
|
619
628
|
className: "flex items-center gap-2 px-4 py-2 border border-border-default text-text-primary rounded-md hover:bg-bg-sunken transition-colors text-sm",
|
|
620
|
-
children:
|
|
629
|
+
children: x("agentsPage.setupGuide", "Setup guide")
|
|
621
630
|
}),
|
|
622
631
|
/* @__PURE__ */ h(Te, { prompt: "What is an Agent in VibeControls and how do I add one?" })
|
|
623
632
|
]
|
|
624
633
|
}) : void 0
|
|
625
634
|
}),
|
|
626
635
|
at && /* @__PURE__ */ h(je, {
|
|
627
|
-
onSubmit:
|
|
628
|
-
onCancel: () =>
|
|
636
|
+
onSubmit: Wt,
|
|
637
|
+
onCancel: () => D(!1),
|
|
629
638
|
isLoading: ot,
|
|
630
639
|
onNavigate: (e) => {
|
|
631
|
-
|
|
640
|
+
D(!1), b(e);
|
|
632
641
|
},
|
|
633
|
-
targets:
|
|
642
|
+
targets: Nt.map((e) => ({
|
|
634
643
|
id: e.id,
|
|
635
644
|
name: e.name,
|
|
636
645
|
type: e.type || "DIRECT",
|
|
637
646
|
status: e.status
|
|
638
647
|
})),
|
|
639
|
-
targetsLoading:
|
|
640
|
-
onCreateTarget:
|
|
648
|
+
targetsLoading: jt,
|
|
649
|
+
onCreateTarget: Rt,
|
|
641
650
|
extraSection: /* @__PURE__ */ g("div", { children: [/* @__PURE__ */ h("h3", {
|
|
642
651
|
className: "text-sm font-medium text-text-secondary mb-2",
|
|
643
|
-
children:
|
|
652
|
+
children: x("agents.tags", "Tags")
|
|
644
653
|
}), /* @__PURE__ */ h(ye, {
|
|
645
654
|
entityType: "VIBECONTROLS_AGENT",
|
|
646
|
-
onDraftChange:
|
|
655
|
+
onDraftChange: xt
|
|
647
656
|
})] })
|
|
648
657
|
}),
|
|
649
|
-
/* @__PURE__ */ h(f, { children:
|
|
658
|
+
/* @__PURE__ */ h(f, { children: P && /* @__PURE__ */ h("div", {
|
|
650
659
|
role: "button",
|
|
651
660
|
tabIndex: 0,
|
|
652
661
|
onKeyDown: (e) => {
|
|
653
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), !
|
|
662
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), !I && F(null));
|
|
654
663
|
},
|
|
655
664
|
className: "fixed inset-0 bg-bg-overlay flex items-center justify-center z-50 p-4 sm:p-6",
|
|
656
|
-
onClick: () => !
|
|
665
|
+
onClick: () => !I && F(null),
|
|
657
666
|
children: /* @__PURE__ */ g(p.div, {
|
|
658
667
|
initial: {
|
|
659
668
|
opacity: 0,
|
|
@@ -677,14 +686,14 @@ function Ke() {
|
|
|
677
686
|
}),
|
|
678
687
|
/* @__PURE__ */ h("p", {
|
|
679
688
|
className: "text-sm text-text-secondary mb-4",
|
|
680
|
-
children: Me(
|
|
689
|
+
children: Me(P) === "OFFLINE" ? /* @__PURE__ */ g(m, { children: [
|
|
681
690
|
"Clear the stored tunnel connection for",
|
|
682
691
|
" ",
|
|
683
|
-
/* @__PURE__ */ h("strong", { children:
|
|
692
|
+
/* @__PURE__ */ h("strong", { children: P.name }),
|
|
684
693
|
"? This will remove the tunnel URL and API key from this offline agent."
|
|
685
694
|
] }) : /* @__PURE__ */ g(m, { children: [
|
|
686
695
|
"Mark ",
|
|
687
|
-
/* @__PURE__ */ h("strong", { children:
|
|
696
|
+
/* @__PURE__ */ h("strong", { children: P.name }),
|
|
688
697
|
" as offline and clear its tunnel connection? The agent process will not be stopped automatically — you may need to stop it manually on the host machine."
|
|
689
698
|
] })
|
|
690
699
|
}),
|
|
@@ -692,29 +701,29 @@ function Ke() {
|
|
|
692
701
|
className: "flex justify-end gap-2",
|
|
693
702
|
children: [/* @__PURE__ */ h("button", {
|
|
694
703
|
type: "button",
|
|
695
|
-
onClick: () =>
|
|
696
|
-
disabled:
|
|
704
|
+
onClick: () => F(null),
|
|
705
|
+
disabled: I,
|
|
697
706
|
className: "px-4 py-2 text-sm text-text-secondary hover:bg-bg-sunken rounded-md transition-colors disabled:opacity-50",
|
|
698
707
|
children: "Cancel"
|
|
699
708
|
}), /* @__PURE__ */ h("button", {
|
|
700
709
|
type: "button",
|
|
701
|
-
onClick:
|
|
702
|
-
disabled:
|
|
710
|
+
onClick: Jt,
|
|
711
|
+
disabled: I,
|
|
703
712
|
className: "px-4 py-2 text-sm bg-action-danger-bg text-action-danger-text rounded-md hover:bg-action-danger-bg-hover transition-colors disabled:opacity-50",
|
|
704
|
-
children:
|
|
713
|
+
children: I ? "Disconnecting..." : "Disconnect"
|
|
705
714
|
})]
|
|
706
715
|
})
|
|
707
716
|
]
|
|
708
717
|
})
|
|
709
718
|
}) }),
|
|
710
|
-
/* @__PURE__ */ h(f, { children:
|
|
719
|
+
/* @__PURE__ */ h(f, { children: k && /* @__PURE__ */ h("div", {
|
|
711
720
|
role: "button",
|
|
712
721
|
tabIndex: 0,
|
|
713
722
|
onKeyDown: (e) => {
|
|
714
|
-
(e.key === "Enter" || e.key === " ") && (e.preventDefault(),
|
|
723
|
+
(e.key === "Enter" || e.key === " ") && (e.preventDefault(), A(null));
|
|
715
724
|
},
|
|
716
725
|
className: "fixed inset-0 bg-bg-overlay flex items-center justify-center z-50 p-4 sm:p-6",
|
|
717
|
-
onClick: () =>
|
|
726
|
+
onClick: () => A(null),
|
|
718
727
|
children: /* @__PURE__ */ g(p.div, {
|
|
719
728
|
initial: {
|
|
720
729
|
opacity: 0,
|
|
@@ -734,47 +743,47 @@ function Ke() {
|
|
|
734
743
|
children: [
|
|
735
744
|
/* @__PURE__ */ h("h3", {
|
|
736
745
|
className: "text-lg font-semibold text-text-primary mb-1",
|
|
737
|
-
children:
|
|
746
|
+
children: x("agentsPage.editTunnelTitle", "Edit Tunnel")
|
|
738
747
|
}),
|
|
739
748
|
/* @__PURE__ */ h("p", {
|
|
740
749
|
className: "text-sm text-text-secondary mb-4",
|
|
741
|
-
children:
|
|
750
|
+
children: x("agentsPage.editTunnelDescription", "Configure the cloudflared tunnel URL and API key for {{name}}.", { name: k.name })
|
|
742
751
|
}),
|
|
743
752
|
/* @__PURE__ */ g("div", {
|
|
744
753
|
className: "space-y-4",
|
|
745
754
|
children: [/* @__PURE__ */ g("div", { children: [
|
|
746
755
|
/* @__PURE__ */ h("label", {
|
|
747
756
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
748
|
-
children:
|
|
757
|
+
children: x("agentsPage.tunnelUrlLabel", "Tunnel URL")
|
|
749
758
|
}),
|
|
750
759
|
/* @__PURE__ */ h("input", {
|
|
751
760
|
"aria-label": "control",
|
|
752
761
|
ref: pt,
|
|
753
762
|
type: "url",
|
|
754
|
-
defaultValue:
|
|
755
|
-
placeholder:
|
|
763
|
+
defaultValue: k.tunnelUrl || "",
|
|
764
|
+
placeholder: x("agentsPage.tunnelUrlPlaceholder", "https://example.trycloudflare.com"),
|
|
756
765
|
className: "w-full px-3 py-2 border border-border-default rounded-md bg-bg-sunken text-text-primary placeholder:text-text-placeholder focus:outline-none focus:border-border-strong"
|
|
757
766
|
}),
|
|
758
767
|
/* @__PURE__ */ h("p", {
|
|
759
768
|
className: "text-xs text-text-muted mt-1",
|
|
760
|
-
children:
|
|
769
|
+
children: x("agentsPage.tunnelUrlHint", "Leave empty to clear. Agents with auto-tunnel report this automatically on startup.")
|
|
761
770
|
})
|
|
762
771
|
] }), /* @__PURE__ */ g("div", { children: [
|
|
763
772
|
/* @__PURE__ */ h("label", {
|
|
764
773
|
className: "block text-sm font-medium text-text-primary mb-1",
|
|
765
|
-
children:
|
|
774
|
+
children: x("agentsPage.agentApiKeyLabel", "Agent API Key")
|
|
766
775
|
}),
|
|
767
776
|
/* @__PURE__ */ h("input", {
|
|
768
777
|
"aria-label": "control",
|
|
769
778
|
ref: mt,
|
|
770
779
|
type: "text",
|
|
771
|
-
defaultValue:
|
|
772
|
-
placeholder:
|
|
780
|
+
defaultValue: k.agentApiKey || "",
|
|
781
|
+
placeholder: x("agentsPage.agentApiKeyPlaceholder", "sk-agent-..."),
|
|
773
782
|
className: "w-full px-3 py-2 border border-border-default rounded-md bg-bg-sunken text-text-primary font-mono text-sm placeholder:text-text-placeholder focus:outline-none focus:border-border-strong"
|
|
774
783
|
}),
|
|
775
784
|
/* @__PURE__ */ h("p", {
|
|
776
785
|
className: "text-xs text-text-muted mt-1",
|
|
777
|
-
children:
|
|
786
|
+
children: x("agentsPage.agentApiKeyHint", "Authenticates requests to the agent. Typically changes on each agent restart.")
|
|
778
787
|
})
|
|
779
788
|
] })]
|
|
780
789
|
}),
|
|
@@ -782,25 +791,25 @@ function Ke() {
|
|
|
782
791
|
className: "flex justify-end gap-2 mt-5",
|
|
783
792
|
children: [/* @__PURE__ */ h("button", {
|
|
784
793
|
type: "button",
|
|
785
|
-
onClick: () =>
|
|
794
|
+
onClick: () => A(null),
|
|
786
795
|
className: "px-4 py-2 text-sm text-text-secondary hover:bg-bg-sunken rounded-md transition-colors",
|
|
787
|
-
children:
|
|
796
|
+
children: x("agentsPage.cancel", "Cancel")
|
|
788
797
|
}), /* @__PURE__ */ h("button", {
|
|
789
798
|
type: "button",
|
|
790
|
-
onClick:
|
|
791
|
-
disabled:
|
|
799
|
+
onClick: Zt,
|
|
800
|
+
disabled: j,
|
|
792
801
|
className: "px-4 py-2 text-sm bg-action-primary-bg text-action-primary-text rounded-md hover:bg-action-primary-bg-hover transition-colors disabled:opacity-50",
|
|
793
|
-
children:
|
|
802
|
+
children: j ? x("agentsPage.saving", "Saving...") : x("agentsPage.save", "Save")
|
|
794
803
|
})]
|
|
795
804
|
})
|
|
796
805
|
]
|
|
797
806
|
})
|
|
798
807
|
}) }),
|
|
799
808
|
/* @__PURE__ */ h(e, {
|
|
800
|
-
isOpen:
|
|
801
|
-
onClose: () =>
|
|
809
|
+
isOpen: yt,
|
|
810
|
+
onClose: () => H(!1),
|
|
802
811
|
onConfirm: () => {
|
|
803
|
-
|
|
812
|
+
H(!1), b("/billing");
|
|
804
813
|
},
|
|
805
814
|
title: "Agent Quota Reached",
|
|
806
815
|
message: "You've used all available agent slots on your current plan. Upgrade your plan to register more agents."
|