@llmnative/runner 1.3.1 → 1.5.0
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/client.js +2 -2
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +2 -0
- package/dist/client.mjs.map +1 -1
- package/dist/setup-app/assets/{NetworkCanvasImpl-DIYuzg6x-CmSzOSsS.js → NetworkCanvasImpl--7M6QHBl-CKRvOQvv.js} +1 -1
- package/dist/setup-app/assets/{index-DlTuUME8.js → index-Da8UbNNk.js} +4 -4
- package/dist/setup-app/assets/{index.es-A5wBsXN0.js → index.es-C1uJwPig.js} +1 -1
- package/dist/setup-app/assets/{lucide-react-CoEgBOt8.js → lucide-react-BO665uFF.js} +1 -1
- package/dist/setup-app/index.html +1 -1
- package/dist/steps.js +1 -1
- package/dist/steps.mjs +2 -2
- package/dist/types/client/index.d.ts +2 -0
- package/dist/types/ui/RunnerAccounts.d.ts +6 -2
- package/dist/types/ui/RunnersSettings.d.ts +3 -2
- package/dist/types/ui/texts.d.ts +75 -0
- package/dist/ui.js +3 -3
- package/dist/ui.js.map +1 -1
- package/dist/ui.mjs +591 -453
- package/dist/ui.mjs.map +1 -1
- package/install/coolify.yaml +2 -2
- package/install/install.sh +1 -1
- package/openapi/v1.yaml +5 -0
- package/package.json +3 -3
package/dist/ui.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { RUNNER_KEY_PROVIDERS as e, RunnerError as t } from "./client.mjs";
|
|
2
2
|
import { RUNNER_REQUIREMENTS as n, checkRunner as r, installCommand as i, isDomain as a, lookupDomain as o, verifiedInstallCommands as s } from "./steps.mjs";
|
|
3
3
|
import { useCallback as c, useEffect as l, useMemo as u, useState as d } from "react";
|
|
4
|
-
import { ActionButton as f, Alert as p, Badge as m, Card as h, Code as g,
|
|
5
|
-
import { jsx as
|
|
6
|
-
import { createPortal as
|
|
4
|
+
import { ActionButton as f, Alert as p, Badge as m, Card as h, Code as g, ConnectionBoard as _, ConnectionList as v, DescriptionList as y, Form as b, LoadingButton as x, Modal as S, ModalYesNo as C, Password as w, Select as T, String as E, Switch as D, TextArea as O } from "@llmnative/react";
|
|
5
|
+
import { Fragment as k, jsx as A, jsxs as j } from "react/jsx-runtime";
|
|
6
|
+
import { createPortal as M } from "react-dom";
|
|
7
7
|
// src/ui/texts.ts
|
|
8
|
-
var
|
|
8
|
+
var N = {
|
|
9
9
|
accountsTitleUser: "My subscriptions",
|
|
10
10
|
accountsTitleTenant: "Subscriptions of the tenant",
|
|
11
11
|
accountsIntroUser: "Connect your own subscription: it is used only for your requests. Without one, the API keys of the workspace are used.",
|
|
@@ -32,6 +32,31 @@ var A = {
|
|
|
32
32
|
keyProvider: "Provider",
|
|
33
33
|
keyLabel: "API key of {provider}",
|
|
34
34
|
termsNote: "A Pro or Max subscription is personal: connect only your own.",
|
|
35
|
+
accountsSection: "{name} ({count})",
|
|
36
|
+
accountsByUse: "API keys of the providers by use ({count})",
|
|
37
|
+
boxClaudeCode: "A Claude subscription (Pro, Max, Team): signed in with Anthropic.",
|
|
38
|
+
boxOpencodeGo: "The OpenCode Go subscription, with its API key.",
|
|
39
|
+
boxByUse: "Paid by use, with an API key of {provider}.",
|
|
40
|
+
groupSubscriptions: "Subscriptions",
|
|
41
|
+
groupUsage: "Pay as you go",
|
|
42
|
+
accountsAdd: "Add subscription",
|
|
43
|
+
accountsAvailable: "Available",
|
|
44
|
+
accountsAddedOn: "Added on {date}",
|
|
45
|
+
accountsUnnamed: "Account {n}",
|
|
46
|
+
accountsOrderHint: "They are used in this order: when one runs out of credit, the turn goes to the next. Drag a card, or use the arrows on its handle, to change it.",
|
|
47
|
+
accountsName: "Name (the email of the account)",
|
|
48
|
+
accountsRenameTitle: "Name of the account",
|
|
49
|
+
accountsRenameAria: "Rename {name}",
|
|
50
|
+
accountsRemoveAria: "Disconnect {name}",
|
|
51
|
+
accountsSave: "Save",
|
|
52
|
+
claudeMultiWarning: "Pro and Max are personal subscriptions: Anthropic does not allow several accounts to get around the limits, and doing so risks suspension. Add only the subscription of another person who makes it available, or seats of Claude Team or Enterprise.",
|
|
53
|
+
claudeCopy: "Copy the link",
|
|
54
|
+
claudeCopied: "Link copied",
|
|
55
|
+
claudeManual: "I have a token made with claude setup-token",
|
|
56
|
+
claudeBackToLogin: "Sign in with Anthropic instead",
|
|
57
|
+
claudeTokenIntro: "Run claude setup-token on a computer signed in to the account, then paste the token it prints.",
|
|
58
|
+
claudeToken: "Token (claude setup-token)",
|
|
59
|
+
keyAddOf: "Add {provider}",
|
|
35
60
|
guideTitle: "Install a runner by hand",
|
|
36
61
|
guideServerTitle: "1. A VPS",
|
|
37
62
|
guideServer: "Any provider works. It needs {systems}, at least {cpus} cores, {memory} GB of memory and {disk} GB of disk, with ports {ports} open.",
|
|
@@ -151,7 +176,7 @@ var A = {
|
|
|
151
176
|
consoleRemember: "Remember on this browser",
|
|
152
177
|
close: "Close",
|
|
153
178
|
cancel: "Cancel"
|
|
154
|
-
},
|
|
179
|
+
}, P = {
|
|
155
180
|
accountsTitleUser: "I miei abbonamenti",
|
|
156
181
|
accountsTitleTenant: "Abbonamenti del tenant",
|
|
157
182
|
accountsIntroUser: "Collega il tuo abbonamento: lo usano solo le tue richieste. Senza, si usano le API key del workspace.",
|
|
@@ -178,6 +203,31 @@ var A = {
|
|
|
178
203
|
keyProvider: "Provider",
|
|
179
204
|
keyLabel: "API key di {provider}",
|
|
180
205
|
termsNote: "Un abbonamento Pro o Max è personale: collega solo il tuo.",
|
|
206
|
+
accountsSection: "{name} ({count})",
|
|
207
|
+
accountsByUse: "API key dei provider a consumo ({count})",
|
|
208
|
+
boxClaudeCode: "Un abbonamento Claude (Pro, Max, Team): si accede con Anthropic.",
|
|
209
|
+
boxOpencodeGo: "L'abbonamento OpenCode Go, con la sua API key.",
|
|
210
|
+
boxByUse: "A consumo, con una API key di {provider}.",
|
|
211
|
+
groupSubscriptions: "Abbonamenti",
|
|
212
|
+
groupUsage: "A consumo",
|
|
213
|
+
accountsAdd: "Aggiungi abbonamento",
|
|
214
|
+
accountsAvailable: "Disponibile",
|
|
215
|
+
accountsAddedOn: "Aggiunto il {date}",
|
|
216
|
+
accountsUnnamed: "Account {n}",
|
|
217
|
+
accountsOrderHint: "Si usano in quest'ordine: quando uno finisce il credito, il turno passa al successivo. Trascina una scheda, o usa le frecce della sua maniglia, per cambiarlo.",
|
|
218
|
+
accountsName: "Nome (l'email dell'account)",
|
|
219
|
+
accountsRenameTitle: "Nome dell'account",
|
|
220
|
+
accountsRenameAria: "Rinomina {name}",
|
|
221
|
+
accountsRemoveAria: "Scollega {name}",
|
|
222
|
+
accountsSave: "Salva",
|
|
223
|
+
claudeMultiWarning: "Pro e Max sono abbonamenti personali: Anthropic non consente più account per aggirare i limiti, e farlo rischia la sospensione. Aggiungi solo l’abbonamento di un’altra persona che lo mette a disposizione, o posti di Claude Team o Enterprise.",
|
|
224
|
+
claudeCopy: "Copia il link",
|
|
225
|
+
claudeCopied: "Link copiato",
|
|
226
|
+
claudeManual: "Ho un token fatto con claude setup-token",
|
|
227
|
+
claudeBackToLogin: "Entra invece con la pagina di Anthropic",
|
|
228
|
+
claudeTokenIntro: "Esegui claude setup-token su un computer collegato all'account, poi incolla il token che stampa.",
|
|
229
|
+
claudeToken: "Token (claude setup-token)",
|
|
230
|
+
keyAddOf: "Aggiungi {provider}",
|
|
181
231
|
guideTitle: "Installa un runner a mano",
|
|
182
232
|
guideServerTitle: "1. Una VPS",
|
|
183
233
|
guideServer: "Va bene qualunque fornitore. Servono {systems}, almeno {cpus} core, {memory} GB di memoria e {disk} GB di disco, con le porte {ports} aperte.",
|
|
@@ -297,18 +347,18 @@ var A = {
|
|
|
297
347
|
consoleRemember: "Ricorda su questo browser",
|
|
298
348
|
close: "Chiudi",
|
|
299
349
|
cancel: "Annulla"
|
|
300
|
-
},
|
|
301
|
-
en:
|
|
302
|
-
it:
|
|
350
|
+
}, F = {
|
|
351
|
+
en: N,
|
|
352
|
+
it: P
|
|
303
353
|
};
|
|
304
|
-
function
|
|
305
|
-
let n = e && e.toLowerCase().startsWith("it") ?
|
|
354
|
+
function I(e, t) {
|
|
355
|
+
let n = e && e.toLowerCase().startsWith("it") ? P : N;
|
|
306
356
|
return t ? {
|
|
307
357
|
...n,
|
|
308
358
|
...t
|
|
309
359
|
} : n;
|
|
310
360
|
}
|
|
311
|
-
var
|
|
361
|
+
var L = (e, t) => e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : e), R = {
|
|
312
362
|
"claude-code": "Claude Code",
|
|
313
363
|
"opencode-go": "OpenCode Go",
|
|
314
364
|
opencode: "OpenCode Zen",
|
|
@@ -318,229 +368,320 @@ var P = (e, t) => e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : e),
|
|
|
318
368
|
mistral: "Mistral",
|
|
319
369
|
deepseek: "DeepSeek",
|
|
320
370
|
openrouter: "OpenRouter"
|
|
321
|
-
},
|
|
322
|
-
dateStyle: "
|
|
371
|
+
}, z = ["claude-code", "opencode-go"], B = (e) => R[e] ?? e, V = (e) => new Date(e).toLocaleDateString(void 0, { dateStyle: "medium" }), ee = (e) => new Date(e).toLocaleString(void 0, {
|
|
372
|
+
dateStyle: "short",
|
|
323
373
|
timeStyle: "short"
|
|
324
374
|
});
|
|
325
|
-
function
|
|
326
|
-
let
|
|
327
|
-
...
|
|
375
|
+
function H({ client: n, scope: r, locale: i, texts: a, onChange: o, providers: s, renderProvider: u, onStack: g }) {
|
|
376
|
+
let v = I(i, a), y = s ?? (r === "tenant" ? [
|
|
377
|
+
...z,
|
|
328
378
|
"opencode",
|
|
329
379
|
...e
|
|
330
|
-
] :
|
|
380
|
+
] : z), [b, x] = d(null), [C, w] = d(null), [T, E] = d(null), [D, O] = d(!1), k = (e) => {
|
|
381
|
+
E(e), g?.(e !== null);
|
|
382
|
+
}, M = c(async () => {
|
|
331
383
|
try {
|
|
332
384
|
let { accounts: e } = await n.accounts.list();
|
|
333
|
-
return
|
|
385
|
+
return x(e), w(null), e;
|
|
334
386
|
} catch (e) {
|
|
335
|
-
return
|
|
387
|
+
return w(e instanceof t ? e.code : String(e)), x([]), [];
|
|
336
388
|
}
|
|
337
389
|
}, [n]);
|
|
338
390
|
l(() => {
|
|
339
|
-
|
|
340
|
-
}, [
|
|
341
|
-
let
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
loading: v === null,
|
|
391
|
+
M();
|
|
392
|
+
}, [M]);
|
|
393
|
+
let N = async (e) => {
|
|
394
|
+
let t = e ?? await M();
|
|
395
|
+
e && x(e), o?.(t);
|
|
396
|
+
}, P = (e) => (b ?? []).filter((t) => t.provider === e), F = (e) => e === "claude-code" ? v.boxClaudeCode : e === "opencode-go" ? v.boxOpencodeGo : L(v.boxByUse, { provider: B(e) });
|
|
397
|
+
return /* @__PURE__ */ j(h, {
|
|
398
|
+
title: r === "user" ? v.accountsTitleUser : v.accountsTitleTenant,
|
|
399
|
+
loading: b === null,
|
|
349
400
|
loaderMinHeight: 120,
|
|
350
|
-
children: [/* @__PURE__ */
|
|
351
|
-
className: "flex flex-col gap-
|
|
401
|
+
children: [/* @__PURE__ */ j("div", {
|
|
402
|
+
className: "flex flex-col gap-4",
|
|
352
403
|
children: [
|
|
353
|
-
/* @__PURE__ */
|
|
404
|
+
/* @__PURE__ */ A("p", {
|
|
354
405
|
className: "text-sm text-muted-foreground",
|
|
355
|
-
children: r === "user" ?
|
|
406
|
+
children: r === "user" ? v.accountsIntroUser : v.accountsIntroTenant
|
|
356
407
|
}),
|
|
357
|
-
|
|
408
|
+
C && /* @__PURE__ */ A(p, {
|
|
358
409
|
variant: "danger",
|
|
359
|
-
children:
|
|
360
|
-
}),
|
|
361
|
-
v?.length === 0 && !b && /* @__PURE__ */ D("p", {
|
|
362
|
-
className: "text-sm text-muted-foreground",
|
|
363
|
-
children: u.accountsEmpty
|
|
364
|
-
}),
|
|
365
|
-
v?.map((e) => /* @__PURE__ */ O("div", {
|
|
366
|
-
className: "flex flex-wrap items-center gap-2 rounded-md border border-border p-3",
|
|
367
|
-
children: [/* @__PURE__ */ O("div", {
|
|
368
|
-
className: "min-w-0 flex-1",
|
|
369
|
-
children: [/* @__PURE__ */ O("div", {
|
|
370
|
-
className: "flex flex-wrap items-center gap-2",
|
|
371
|
-
children: [
|
|
372
|
-
/* @__PURE__ */ D("span", {
|
|
373
|
-
className: "font-medium",
|
|
374
|
-
children: e.label ?? F[e.provider] ?? e.provider
|
|
375
|
-
}),
|
|
376
|
-
/* @__PURE__ */ D(m, {
|
|
377
|
-
variant: "secondary",
|
|
378
|
-
children: F[e.provider] ?? e.provider
|
|
379
|
-
}),
|
|
380
|
-
e.noCreditUntil && /* @__PURE__ */ D(m, {
|
|
381
|
-
variant: "warning",
|
|
382
|
-
children: P(u.accountsNoCredit, { at: L(e.noCreditUntil) })
|
|
383
|
-
})
|
|
384
|
-
]
|
|
385
|
-
}), /* @__PURE__ */ D("p", {
|
|
386
|
-
className: "text-xs text-muted-foreground",
|
|
387
|
-
children: P(u.accountsConnected, { at: L(e.at) })
|
|
388
|
-
})]
|
|
389
|
-
}), /* @__PURE__ */ D(f, {
|
|
390
|
-
icon: "unlink",
|
|
391
|
-
label: u.accountsRemove,
|
|
392
|
-
variant: "outline-danger",
|
|
393
|
-
onClick: () => E(e)
|
|
394
|
-
})]
|
|
395
|
-
}, `${e.provider}/${e.id}`)),
|
|
396
|
-
C === "claude" && /* @__PURE__ */ D(z, {
|
|
397
|
-
client: n,
|
|
398
|
-
t: u,
|
|
399
|
-
onDone: A,
|
|
400
|
-
onCancel: () => w(null)
|
|
401
|
-
}),
|
|
402
|
-
C === "key" && /* @__PURE__ */ D(B, {
|
|
403
|
-
client: n,
|
|
404
|
-
t: u,
|
|
405
|
-
providers: _,
|
|
406
|
-
onDone: A,
|
|
407
|
-
onCancel: () => w(null)
|
|
410
|
+
children: L(v.error, { error: C })
|
|
408
411
|
}),
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
412
|
+
b && /* @__PURE__ */ A(_, {
|
|
413
|
+
items: y.map((e) => {
|
|
414
|
+
let t = P(e), n = t.filter((e) => e.noCreditUntil);
|
|
415
|
+
return {
|
|
416
|
+
id: e,
|
|
417
|
+
label: B(e),
|
|
418
|
+
description: F(e),
|
|
419
|
+
icon: e === "claude-code" ? "user" : "key-round",
|
|
420
|
+
group: z.includes(e) ? "subscription" : "usage",
|
|
421
|
+
count: t.length,
|
|
422
|
+
status: t.length > 0 && n.length === t.length ? /* @__PURE__ */ A(m, {
|
|
423
|
+
variant: "warning",
|
|
424
|
+
children: L(v.accountsNoCredit, { at: ee(n.map((e) => e.noCreditUntil).sort()[0]) })
|
|
425
|
+
}) : void 0
|
|
426
|
+
};
|
|
427
|
+
}),
|
|
428
|
+
titles: {
|
|
429
|
+
subscription: v.groupSubscriptions,
|
|
430
|
+
usage: v.groupUsage
|
|
431
|
+
},
|
|
432
|
+
onOpen: (e) => k(e)
|
|
422
433
|
}),
|
|
423
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ A("p", {
|
|
424
435
|
className: "text-xs text-muted-foreground",
|
|
425
|
-
children:
|
|
436
|
+
children: v.termsNote
|
|
426
437
|
})
|
|
427
438
|
]
|
|
428
|
-
}), T && /* @__PURE__ */
|
|
429
|
-
title:
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
439
|
+
}), T && b && /* @__PURE__ */ A(S, {
|
|
440
|
+
title: B(T),
|
|
441
|
+
position: "right",
|
|
442
|
+
size: "lg",
|
|
443
|
+
stackedBehind: D,
|
|
444
|
+
onClose: () => k(null),
|
|
445
|
+
footer: /* @__PURE__ */ A(f, {
|
|
446
|
+
variant: "link",
|
|
447
|
+
label: v.close,
|
|
448
|
+
onClick: () => k(null)
|
|
449
|
+
}),
|
|
450
|
+
children: /* @__PURE__ */ A(te, {
|
|
451
|
+
client: n,
|
|
452
|
+
t: v,
|
|
453
|
+
provider: T,
|
|
454
|
+
accounts: P(T),
|
|
455
|
+
onChanged: N,
|
|
456
|
+
onStack: O,
|
|
457
|
+
extra: u?.(T, P(T))
|
|
458
|
+
})
|
|
434
459
|
})]
|
|
435
460
|
});
|
|
436
461
|
}
|
|
437
|
-
function
|
|
438
|
-
let [
|
|
462
|
+
function te({ client: e, t: n, provider: r, accounts: i, onChanged: a, onStack: o, extra: s }) {
|
|
463
|
+
let [c, l] = d(null), u = (e) => l(L(n.error, { error: e instanceof t ? e.code : String(e) })), f = (e) => i.find((t) => t.id === e);
|
|
464
|
+
return /* @__PURE__ */ j("div", {
|
|
465
|
+
className: "flex flex-col gap-5",
|
|
466
|
+
children: [
|
|
467
|
+
/* @__PURE__ */ A("p", {
|
|
468
|
+
className: "text-sm text-muted-foreground",
|
|
469
|
+
children: r === "claude-code" ? n.boxClaudeCode : r === "opencode-go" ? n.boxOpencodeGo : L(n.boxByUse, { provider: B(r) })
|
|
470
|
+
}),
|
|
471
|
+
c && /* @__PURE__ */ A(p, {
|
|
472
|
+
variant: "danger",
|
|
473
|
+
children: c
|
|
474
|
+
}),
|
|
475
|
+
/* @__PURE__ */ A(v, {
|
|
476
|
+
items: i.map((e) => ({
|
|
477
|
+
id: e.id,
|
|
478
|
+
label: e.label,
|
|
479
|
+
icon: e.provider === "claude-code" ? "user" : "key-round",
|
|
480
|
+
meta: L(n.accountsAddedOn, { date: V(e.at) }),
|
|
481
|
+
exhaustedUntil: e.noCreditUntil
|
|
482
|
+
})),
|
|
483
|
+
title: L(n.accountsSection, {
|
|
484
|
+
name: B(r),
|
|
485
|
+
count: String(i.length)
|
|
486
|
+
}),
|
|
487
|
+
emptyText: n.accountsEmpty,
|
|
488
|
+
unnamed: n.accountsUnnamed,
|
|
489
|
+
orderHint: n.accountsOrderHint,
|
|
490
|
+
addLabel: r === "claude-code" ? n.accountsAdd : n.keyConnect,
|
|
491
|
+
onStack: o,
|
|
492
|
+
onReorder: (t) => e.accounts.order(r, t).then((e) => a(e), u),
|
|
493
|
+
onRename: async (t, n) => {
|
|
494
|
+
await a(await e.accounts.rename(r, t, n));
|
|
495
|
+
},
|
|
496
|
+
onRemove: async (t) => {
|
|
497
|
+
await e.accounts.remove(f(t).provider, t).catch(u), await a();
|
|
498
|
+
},
|
|
499
|
+
renderAdd: (t) => r === "claude-code" ? /* @__PURE__ */ A(ne, {
|
|
500
|
+
client: e,
|
|
501
|
+
t: n,
|
|
502
|
+
others: i.length,
|
|
503
|
+
onDone: async () => {
|
|
504
|
+
t(), await a();
|
|
505
|
+
},
|
|
506
|
+
onCancel: t
|
|
507
|
+
}) : /* @__PURE__ */ A(re, {
|
|
508
|
+
client: e,
|
|
509
|
+
t: n,
|
|
510
|
+
providers: [r],
|
|
511
|
+
onDone: async () => {
|
|
512
|
+
t(), await a();
|
|
513
|
+
},
|
|
514
|
+
onCancel: t
|
|
515
|
+
})
|
|
516
|
+
}),
|
|
517
|
+
s
|
|
518
|
+
]
|
|
519
|
+
});
|
|
520
|
+
}
|
|
521
|
+
function ne({ client: e, t: n, others: r, onDone: i, onCancel: a }) {
|
|
522
|
+
let [o, s] = d(!1), [c, u] = d(null), [m, g] = d(!1), [_, v] = d(""), [y, S] = d(""), [C, T] = d(""), [D, O] = d(null);
|
|
439
523
|
return l(() => {
|
|
524
|
+
if (o) return;
|
|
440
525
|
let t = !1;
|
|
441
|
-
return e.accounts.startClaudeLogin().then(({ url: e }) => !t &&
|
|
526
|
+
return e.accounts.startClaudeLogin().then(({ url: e }) => !t && u(e)).catch(() => !t && O(n.claudeNoLink)), () => {
|
|
442
527
|
t = !0;
|
|
443
528
|
};
|
|
444
|
-
}, [
|
|
445
|
-
|
|
529
|
+
}, [
|
|
530
|
+
e,
|
|
531
|
+
n,
|
|
532
|
+
o
|
|
533
|
+
]), /* @__PURE__ */ j(h, {
|
|
534
|
+
headerClassName: "px-4 py-3",
|
|
535
|
+
bodyClassName: "flex flex-col gap-3",
|
|
536
|
+
header: /* @__PURE__ */ A("span", {
|
|
537
|
+
className: "text-sm font-medium",
|
|
538
|
+
children: n.claudeConnect
|
|
539
|
+
}),
|
|
446
540
|
children: [
|
|
447
|
-
|
|
448
|
-
variant: "
|
|
449
|
-
children:
|
|
541
|
+
r > 0 && /* @__PURE__ */ A(p, {
|
|
542
|
+
variant: "warning",
|
|
543
|
+
children: n.claudeMultiWarning
|
|
450
544
|
}),
|
|
451
|
-
/* @__PURE__ */
|
|
452
|
-
|
|
453
|
-
children:
|
|
545
|
+
D && /* @__PURE__ */ A(p, {
|
|
546
|
+
variant: "danger",
|
|
547
|
+
children: D
|
|
454
548
|
}),
|
|
455
|
-
/* @__PURE__ */
|
|
456
|
-
icon: "external-link",
|
|
457
|
-
label: n.claudeOpen,
|
|
458
|
-
variant: "primary",
|
|
459
|
-
disabled: !a,
|
|
460
|
-
onClick: () => a && window.open(a, "_blank", "noopener,noreferrer")
|
|
461
|
-
}) }),
|
|
462
|
-
/* @__PURE__ */ D("p", {
|
|
549
|
+
o ? /* @__PURE__ */ A("p", {
|
|
463
550
|
className: "text-sm",
|
|
464
|
-
children: n.
|
|
465
|
-
}),
|
|
466
|
-
|
|
551
|
+
children: n.claudeTokenIntro
|
|
552
|
+
}) : /* @__PURE__ */ j(k, { children: [
|
|
553
|
+
/* @__PURE__ */ A("p", {
|
|
554
|
+
className: "text-sm",
|
|
555
|
+
children: n.claudeStep1
|
|
556
|
+
}),
|
|
557
|
+
/* @__PURE__ */ j("div", {
|
|
558
|
+
className: "grid grid-cols-2 gap-2",
|
|
559
|
+
children: [/* @__PURE__ */ A(f, {
|
|
560
|
+
icon: "external-link",
|
|
561
|
+
variant: "outline-primary",
|
|
562
|
+
className: "w-full justify-center whitespace-nowrap",
|
|
563
|
+
label: n.claudeOpen,
|
|
564
|
+
disabled: !c,
|
|
565
|
+
onClick: () => c && window.open(c, "_blank", "noopener,noreferrer")
|
|
566
|
+
}), /* @__PURE__ */ A(f, {
|
|
567
|
+
icon: m ? "check" : "copy",
|
|
568
|
+
variant: "outline-secondary",
|
|
569
|
+
className: "w-full justify-center whitespace-nowrap",
|
|
570
|
+
label: m ? n.claudeCopied : n.claudeCopy,
|
|
571
|
+
disabled: !c,
|
|
572
|
+
onClick: () => {
|
|
573
|
+
c && navigator.clipboard?.writeText(c).then(() => g(!0), () => g(!1));
|
|
574
|
+
}
|
|
575
|
+
})]
|
|
576
|
+
}),
|
|
577
|
+
/* @__PURE__ */ A("p", {
|
|
578
|
+
className: "text-sm",
|
|
579
|
+
children: n.claudeStep2
|
|
580
|
+
})
|
|
581
|
+
] }),
|
|
582
|
+
/* @__PURE__ */ j(b, {
|
|
467
583
|
appearance: "empty",
|
|
468
584
|
showNotice: !1,
|
|
469
585
|
onSubmit: () => !1,
|
|
470
|
-
children: [/* @__PURE__ */
|
|
586
|
+
children: [o ? /* @__PURE__ */ A(w, {
|
|
587
|
+
name: "token",
|
|
588
|
+
label: n.claudeToken,
|
|
589
|
+
placeholder: "sk-ant-oat01-…",
|
|
590
|
+
autoComplete: "off",
|
|
591
|
+
onChange: ({ value: e }) => S(String(e ?? ""))
|
|
592
|
+
}) : /* @__PURE__ */ A(E, {
|
|
471
593
|
name: "code",
|
|
472
594
|
label: n.claudeCode,
|
|
473
595
|
autoComplete: "off",
|
|
474
|
-
onChange: ({ value: e }) =>
|
|
475
|
-
}), /* @__PURE__ */
|
|
596
|
+
onChange: ({ value: e }) => v(String(e ?? ""))
|
|
597
|
+
}), /* @__PURE__ */ A(E, {
|
|
476
598
|
name: "label",
|
|
477
|
-
label: n.
|
|
599
|
+
label: n.accountsName,
|
|
478
600
|
placeholder: n.claudeLabelPlaceholder,
|
|
479
|
-
onChange: ({ value: e }) =>
|
|
601
|
+
onChange: ({ value: e }) => T(String(e ?? ""))
|
|
480
602
|
})]
|
|
481
603
|
}),
|
|
482
|
-
/* @__PURE__ */
|
|
483
|
-
|
|
484
|
-
|
|
604
|
+
/* @__PURE__ */ A(f, {
|
|
605
|
+
variant: "link",
|
|
606
|
+
className: "h-auto self-start p-0 text-xs",
|
|
607
|
+
label: o ? n.claudeBackToLogin : n.claudeManual,
|
|
608
|
+
onClick: () => {
|
|
609
|
+
s(!o), O(null);
|
|
610
|
+
}
|
|
611
|
+
}),
|
|
612
|
+
/* @__PURE__ */ j("div", {
|
|
613
|
+
className: "flex flex-wrap justify-end gap-2",
|
|
614
|
+
children: [/* @__PURE__ */ A(f, {
|
|
615
|
+
label: n.cancel,
|
|
616
|
+
variant: "link",
|
|
617
|
+
onClick: a
|
|
618
|
+
}), /* @__PURE__ */ A(x, {
|
|
485
619
|
label: n.claudeFinish,
|
|
486
620
|
variant: "primary",
|
|
487
|
-
disabled: !
|
|
621
|
+
disabled: o ? !y.trim() : !c || !_.trim(),
|
|
488
622
|
onClick: async () => {
|
|
623
|
+
O(null);
|
|
489
624
|
try {
|
|
490
|
-
await e.accounts.finishClaudeLogin(
|
|
491
|
-
} catch (
|
|
492
|
-
|
|
625
|
+
o ? await e.accounts.addClaudeToken(y.trim(), C.trim() || void 0) : await e.accounts.finishClaudeLogin(_.trim(), C.trim() || void 0), i();
|
|
626
|
+
} catch (r) {
|
|
627
|
+
let i = r instanceof t && r.code === "refused";
|
|
628
|
+
O(i ? n.claudeRefused : L(n.error, { error: r instanceof t ? r.code : String(r) })), i && !o && (u(null), g(!1), e.accounts.startClaudeLogin().then(({ url: e }) => u(e)).catch(() => O(n.claudeNoLink)));
|
|
493
629
|
}
|
|
494
630
|
}
|
|
495
|
-
}), /* @__PURE__ */ D(f, {
|
|
496
|
-
label: n.cancel,
|
|
497
|
-
variant: "outline-secondary",
|
|
498
|
-
onClick: i
|
|
499
631
|
})]
|
|
500
632
|
})
|
|
501
633
|
]
|
|
502
634
|
});
|
|
503
635
|
}
|
|
504
|
-
function
|
|
505
|
-
let [o, s] = d(r[0]), [c, l] = d(""), [u, m] = d(""), [
|
|
506
|
-
return /* @__PURE__ */
|
|
507
|
-
|
|
636
|
+
function re({ client: e, t: n, providers: r, onDone: i, onCancel: a }) {
|
|
637
|
+
let [o, s] = d(r[0]), [c, l] = d(""), [u, m] = d(""), [g, _] = d(null);
|
|
638
|
+
return /* @__PURE__ */ j(h, {
|
|
639
|
+
headerClassName: "px-4 py-3",
|
|
640
|
+
bodyClassName: "flex flex-col gap-3",
|
|
641
|
+
header: /* @__PURE__ */ A("span", {
|
|
642
|
+
className: "text-sm font-medium",
|
|
643
|
+
children: r.length === 1 ? L(n.keyAddOf, { provider: B(r[0]) }) : n.keyConnect
|
|
644
|
+
}),
|
|
508
645
|
children: [
|
|
509
|
-
|
|
646
|
+
g && /* @__PURE__ */ A(p, {
|
|
510
647
|
variant: "danger",
|
|
511
|
-
children:
|
|
648
|
+
children: g
|
|
512
649
|
}),
|
|
513
|
-
/* @__PURE__ */
|
|
650
|
+
/* @__PURE__ */ j(b, {
|
|
514
651
|
appearance: "empty",
|
|
515
652
|
showNotice: !1,
|
|
516
653
|
onSubmit: () => !1,
|
|
517
654
|
children: [
|
|
518
|
-
r.length > 1 && /* @__PURE__ */
|
|
655
|
+
r.length > 1 && /* @__PURE__ */ A(T, {
|
|
519
656
|
name: "provider",
|
|
520
657
|
label: n.keyProvider,
|
|
521
658
|
defaultValue: o,
|
|
522
659
|
options: r.map((e) => ({
|
|
523
|
-
label:
|
|
660
|
+
label: B(e),
|
|
524
661
|
value: e
|
|
525
662
|
})),
|
|
526
663
|
onChange: ({ value: e }) => s(String(e ?? r[0]))
|
|
527
664
|
}),
|
|
528
|
-
/* @__PURE__ */
|
|
665
|
+
/* @__PURE__ */ A(w, {
|
|
529
666
|
name: "key",
|
|
530
|
-
label:
|
|
667
|
+
label: L(n.keyLabel, { provider: B(o) }),
|
|
531
668
|
autoComplete: "off",
|
|
532
669
|
onChange: ({ value: e }) => l(String(e ?? ""))
|
|
533
670
|
}),
|
|
534
|
-
/* @__PURE__ */
|
|
671
|
+
/* @__PURE__ */ A(E, {
|
|
535
672
|
name: "label",
|
|
536
|
-
label: n.
|
|
673
|
+
label: n.accountsName,
|
|
537
674
|
onChange: ({ value: e }) => m(String(e ?? ""))
|
|
538
675
|
})
|
|
539
676
|
]
|
|
540
677
|
}),
|
|
541
|
-
/* @__PURE__ */
|
|
542
|
-
className: "flex gap-2",
|
|
543
|
-
children: [/* @__PURE__ */
|
|
678
|
+
/* @__PURE__ */ j("div", {
|
|
679
|
+
className: "flex flex-wrap justify-end gap-2",
|
|
680
|
+
children: [/* @__PURE__ */ A(f, {
|
|
681
|
+
label: n.cancel,
|
|
682
|
+
variant: "link",
|
|
683
|
+
onClick: a
|
|
684
|
+
}), /* @__PURE__ */ A(x, {
|
|
544
685
|
label: n.opencodeAdd,
|
|
545
686
|
variant: "primary",
|
|
546
687
|
disabled: !c.trim(),
|
|
@@ -548,41 +689,37 @@ function B({ client: e, t: n, providers: r, onDone: i, onCancel: a }) {
|
|
|
548
689
|
try {
|
|
549
690
|
await e.accounts.addKey(o, c.trim(), u.trim() || void 0), i();
|
|
550
691
|
} catch (e) {
|
|
551
|
-
|
|
692
|
+
_(L(n.error, { error: e instanceof t ? e.code : String(e) }));
|
|
552
693
|
}
|
|
553
694
|
}
|
|
554
|
-
}), /* @__PURE__ */ D(f, {
|
|
555
|
-
label: n.cancel,
|
|
556
|
-
variant: "outline-secondary",
|
|
557
|
-
onClick: a
|
|
558
695
|
})]
|
|
559
696
|
})
|
|
560
697
|
]
|
|
561
698
|
});
|
|
562
699
|
}
|
|
563
700
|
// src/ui/InstallGuide.tsx
|
|
564
|
-
function
|
|
565
|
-
return /* @__PURE__ */
|
|
701
|
+
function U({ title: e, children: t, done: n }) {
|
|
702
|
+
return /* @__PURE__ */ j("section", {
|
|
566
703
|
className: "flex flex-col gap-2 border-l-2 border-border pl-4",
|
|
567
|
-
children: [/* @__PURE__ */
|
|
704
|
+
children: [/* @__PURE__ */ j("h4", {
|
|
568
705
|
className: "flex items-center gap-2 text-sm font-semibold",
|
|
569
|
-
children: [e, n && /* @__PURE__ */
|
|
706
|
+
children: [e, n && /* @__PURE__ */ A(m, {
|
|
570
707
|
variant: "success",
|
|
571
708
|
children: "✓"
|
|
572
709
|
})]
|
|
573
710
|
}), t]
|
|
574
711
|
});
|
|
575
712
|
}
|
|
576
|
-
function
|
|
577
|
-
let h =
|
|
578
|
-
return /* @__PURE__ */
|
|
713
|
+
function W({ locale: e, texts: t, onPair: c, lookup: l = (e) => o(e), check: u = r, version: m }) {
|
|
714
|
+
let h = I(e, t), [_, v] = d(""), [y, S] = d(null), [C, w] = d(null), [T, D] = d(""), [O, k] = d(!1), [M, N] = d(null), P = a(_), F = `https://${_.trim().toLowerCase()}`, R = n;
|
|
715
|
+
return /* @__PURE__ */ j("div", {
|
|
579
716
|
className: "flex flex-col gap-5",
|
|
580
717
|
children: [
|
|
581
|
-
/* @__PURE__ */
|
|
718
|
+
/* @__PURE__ */ A(U, {
|
|
582
719
|
title: h.guideServerTitle,
|
|
583
|
-
children: /* @__PURE__ */
|
|
720
|
+
children: /* @__PURE__ */ A("p", {
|
|
584
721
|
className: "text-sm",
|
|
585
|
-
children:
|
|
722
|
+
children: L(h.guideServer, {
|
|
586
723
|
systems: R.systems.join(", "),
|
|
587
724
|
cpus: R.cpus,
|
|
588
725
|
memory: R.memoryGb,
|
|
@@ -591,40 +728,40 @@ function H({ locale: e, texts: t, onPair: c, lookup: l = (e) => o(e), check: u =
|
|
|
591
728
|
})
|
|
592
729
|
})
|
|
593
730
|
}),
|
|
594
|
-
/* @__PURE__ */
|
|
731
|
+
/* @__PURE__ */ j(U, {
|
|
595
732
|
title: h.guideDnsTitle,
|
|
596
|
-
done: !!
|
|
733
|
+
done: !!y?.ips.length,
|
|
597
734
|
children: [
|
|
598
|
-
/* @__PURE__ */
|
|
735
|
+
/* @__PURE__ */ A("p", {
|
|
599
736
|
className: "text-sm",
|
|
600
737
|
children: h.guideDns
|
|
601
738
|
}),
|
|
602
|
-
/* @__PURE__ */
|
|
739
|
+
/* @__PURE__ */ A(b, {
|
|
603
740
|
appearance: "empty",
|
|
604
741
|
showNotice: !1,
|
|
605
742
|
onSubmit: () => !1,
|
|
606
|
-
children: /* @__PURE__ */
|
|
743
|
+
children: /* @__PURE__ */ A(E, {
|
|
607
744
|
name: "domain",
|
|
608
745
|
label: h.guideDomain,
|
|
609
746
|
placeholder: "runner.example.com",
|
|
610
747
|
autoComplete: "off",
|
|
611
748
|
onChange: ({ value: e }) => {
|
|
612
|
-
|
|
749
|
+
v(String(e ?? "")), S(null), w(null);
|
|
613
750
|
}
|
|
614
751
|
})
|
|
615
752
|
}),
|
|
616
|
-
/* @__PURE__ */
|
|
753
|
+
/* @__PURE__ */ j("div", {
|
|
617
754
|
className: "flex flex-wrap items-center gap-2",
|
|
618
|
-
children: [/* @__PURE__ */
|
|
755
|
+
children: [/* @__PURE__ */ A(x, {
|
|
619
756
|
label: h.guideCheckDns,
|
|
620
757
|
variant: "outline-secondary",
|
|
621
|
-
disabled: !
|
|
758
|
+
disabled: !P,
|
|
622
759
|
onClick: async () => S({ ips: await l(_.trim().toLowerCase()).catch(() => []) })
|
|
623
|
-
}),
|
|
760
|
+
}), y && (y.ips.length ? /* @__PURE__ */ A(p, {
|
|
624
761
|
variant: "success",
|
|
625
762
|
appearance: "text",
|
|
626
|
-
children:
|
|
627
|
-
}) : /* @__PURE__ */
|
|
763
|
+
children: L(h.guideDnsOk, { ips: y.ips.join(", ") })
|
|
764
|
+
}) : /* @__PURE__ */ A(p, {
|
|
628
765
|
variant: "warning",
|
|
629
766
|
appearance: "text",
|
|
630
767
|
children: h.guideDnsMissing
|
|
@@ -632,112 +769,112 @@ function H({ locale: e, texts: t, onPair: c, lookup: l = (e) => o(e), check: u =
|
|
|
632
769
|
})
|
|
633
770
|
]
|
|
634
771
|
}),
|
|
635
|
-
/* @__PURE__ */
|
|
772
|
+
/* @__PURE__ */ A(U, {
|
|
636
773
|
title: h.guideAccessTitle,
|
|
637
|
-
children: /* @__PURE__ */
|
|
774
|
+
children: /* @__PURE__ */ A("p", {
|
|
638
775
|
className: "text-sm",
|
|
639
776
|
children: h.guideAccess
|
|
640
777
|
})
|
|
641
778
|
}),
|
|
642
|
-
/* @__PURE__ */
|
|
779
|
+
/* @__PURE__ */ j(U, {
|
|
643
780
|
title: h.guideInstallTitle,
|
|
644
781
|
children: [
|
|
645
|
-
/* @__PURE__ */
|
|
782
|
+
/* @__PURE__ */ A("p", {
|
|
646
783
|
className: "text-sm",
|
|
647
784
|
children: h.guideInstall
|
|
648
785
|
}),
|
|
649
|
-
/* @__PURE__ */
|
|
786
|
+
/* @__PURE__ */ A(g, {
|
|
650
787
|
language: "bash",
|
|
651
788
|
showCopy: !0,
|
|
652
789
|
children: i({
|
|
653
|
-
domain:
|
|
790
|
+
domain: P ? _ : "runner.example.com",
|
|
654
791
|
...m ? { version: m } : {}
|
|
655
792
|
})
|
|
656
793
|
}),
|
|
657
|
-
/* @__PURE__ */
|
|
794
|
+
/* @__PURE__ */ A("div", { children: /* @__PURE__ */ A(f, {
|
|
658
795
|
label: h.guideVerified,
|
|
659
796
|
variant: "link",
|
|
660
|
-
onClick: () =>
|
|
797
|
+
onClick: () => k((e) => !e)
|
|
661
798
|
}) }),
|
|
662
|
-
|
|
799
|
+
O && /* @__PURE__ */ A(g, {
|
|
663
800
|
language: "bash",
|
|
664
801
|
showCopy: !0,
|
|
665
802
|
children: s({
|
|
666
|
-
domain:
|
|
803
|
+
domain: P ? _ : "runner.example.com",
|
|
667
804
|
...m ? { version: m } : {}
|
|
668
805
|
}).join("\n")
|
|
669
806
|
})
|
|
670
807
|
]
|
|
671
808
|
}),
|
|
672
|
-
/* @__PURE__ */
|
|
809
|
+
/* @__PURE__ */ j(U, {
|
|
673
810
|
title: h.guidePairTitle,
|
|
674
811
|
done: C?.ok,
|
|
675
812
|
children: [
|
|
676
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ A("p", {
|
|
677
814
|
className: "text-sm",
|
|
678
815
|
children: h.guidePair
|
|
679
816
|
}),
|
|
680
|
-
/* @__PURE__ */
|
|
817
|
+
/* @__PURE__ */ A(b, {
|
|
681
818
|
appearance: "empty",
|
|
682
819
|
showNotice: !1,
|
|
683
820
|
onSubmit: () => !1,
|
|
684
|
-
children: /* @__PURE__ */
|
|
821
|
+
children: /* @__PURE__ */ A(E, {
|
|
685
822
|
name: "code",
|
|
686
823
|
label: h.addCode,
|
|
687
824
|
placeholder: "ABCD-EFGH",
|
|
688
825
|
autoComplete: "off",
|
|
689
|
-
onChange: ({ value: e }) =>
|
|
826
|
+
onChange: ({ value: e }) => D(String(e ?? ""))
|
|
690
827
|
})
|
|
691
828
|
}),
|
|
692
|
-
C && /* @__PURE__ */
|
|
829
|
+
C && /* @__PURE__ */ A(p, {
|
|
693
830
|
variant: C.ok ? "success" : "warning",
|
|
694
831
|
appearance: "text",
|
|
695
832
|
children: C.text
|
|
696
833
|
}),
|
|
697
|
-
M && /* @__PURE__ */
|
|
834
|
+
M && /* @__PURE__ */ A(p, {
|
|
698
835
|
variant: "danger",
|
|
699
836
|
children: M
|
|
700
837
|
}),
|
|
701
|
-
/* @__PURE__ */
|
|
838
|
+
/* @__PURE__ */ j("div", {
|
|
702
839
|
className: "flex flex-wrap gap-2",
|
|
703
|
-
children: [/* @__PURE__ */
|
|
840
|
+
children: [/* @__PURE__ */ A(x, {
|
|
704
841
|
label: h.guideCheckHealth,
|
|
705
842
|
variant: "outline-secondary",
|
|
706
|
-
disabled: !
|
|
843
|
+
disabled: !P,
|
|
707
844
|
onClick: async () => {
|
|
708
|
-
let e = await u(
|
|
709
|
-
|
|
845
|
+
let e = await u(F);
|
|
846
|
+
w(e.ok ? {
|
|
710
847
|
ok: !0,
|
|
711
|
-
text:
|
|
848
|
+
text: L(h.guideHealthOk, {
|
|
712
849
|
version: e.version,
|
|
713
|
-
url:
|
|
850
|
+
url: F
|
|
714
851
|
})
|
|
715
852
|
} : {
|
|
716
853
|
ok: !1,
|
|
717
|
-
text:
|
|
854
|
+
text: L(h.guideHealthKo, { url: F })
|
|
718
855
|
});
|
|
719
856
|
}
|
|
720
|
-
}), /* @__PURE__ */
|
|
857
|
+
}), /* @__PURE__ */ A(x, {
|
|
721
858
|
label: h.addConnect,
|
|
722
859
|
variant: "primary",
|
|
723
|
-
disabled: !
|
|
860
|
+
disabled: !P || T.trim().length < 8,
|
|
724
861
|
onClick: async () => {
|
|
725
862
|
try {
|
|
726
|
-
|
|
727
|
-
url:
|
|
728
|
-
code:
|
|
863
|
+
N(null), await c({
|
|
864
|
+
url: F,
|
|
865
|
+
code: T.trim()
|
|
729
866
|
});
|
|
730
867
|
} catch (e) {
|
|
731
|
-
|
|
868
|
+
N(L(h.error, { error: e.message }));
|
|
732
869
|
}
|
|
733
870
|
}
|
|
734
871
|
})]
|
|
735
872
|
})
|
|
736
873
|
]
|
|
737
874
|
}),
|
|
738
|
-
/* @__PURE__ */
|
|
875
|
+
/* @__PURE__ */ A(U, {
|
|
739
876
|
title: h.guideTroubleTitle,
|
|
740
|
-
children: /* @__PURE__ */
|
|
877
|
+
children: /* @__PURE__ */ A("p", {
|
|
741
878
|
className: "text-sm text-muted-foreground",
|
|
742
879
|
children: h.guideTrouble
|
|
743
880
|
})
|
|
@@ -746,8 +883,8 @@ function H({ locale: e, texts: t, onPair: c, lookup: l = (e) => o(e), check: u =
|
|
|
746
883
|
});
|
|
747
884
|
}
|
|
748
885
|
// src/ui/RunnersSettings.tsx
|
|
749
|
-
function
|
|
750
|
-
let r =
|
|
886
|
+
function ie({ fleet: e, locale: t, texts: n }) {
|
|
887
|
+
let r = I(t, n), [i, a] = d(null), [o, s] = d(null), [u, g] = d(!1), [_, v] = d(null), [y, x] = d(null), S = c(async () => {
|
|
751
888
|
try {
|
|
752
889
|
let t = await e.list();
|
|
753
890
|
a(t);
|
|
@@ -757,25 +894,25 @@ function U({ fleet: e, locale: t, texts: n }) {
|
|
|
757
894
|
status: n[t]
|
|
758
895
|
}))), e.tenants && s(await e.tenants.list());
|
|
759
896
|
} catch (e) {
|
|
760
|
-
|
|
897
|
+
x(L(r.error, { error: e.message })), a([]);
|
|
761
898
|
}
|
|
762
899
|
}, [e, r]);
|
|
763
900
|
l(() => {
|
|
764
|
-
|
|
765
|
-
}, [
|
|
766
|
-
let
|
|
767
|
-
await e.update(t, n), await
|
|
901
|
+
S();
|
|
902
|
+
}, [S]);
|
|
903
|
+
let w = async (t, n) => {
|
|
904
|
+
await e.update(t, n), await S();
|
|
768
905
|
};
|
|
769
|
-
return /* @__PURE__ */
|
|
906
|
+
return /* @__PURE__ */ j("div", {
|
|
770
907
|
className: "flex flex-col gap-4",
|
|
771
908
|
children: [
|
|
772
|
-
/* @__PURE__ */
|
|
773
|
-
header: /* @__PURE__ */
|
|
909
|
+
/* @__PURE__ */ A(h, {
|
|
910
|
+
header: /* @__PURE__ */ j("div", {
|
|
774
911
|
className: "flex flex-wrap items-center gap-2",
|
|
775
|
-
children: [/* @__PURE__ */
|
|
912
|
+
children: [/* @__PURE__ */ A("h3", {
|
|
776
913
|
className: "flex-1 text-base font-semibold",
|
|
777
914
|
children: r.runnersTitle
|
|
778
|
-
}), /* @__PURE__ */
|
|
915
|
+
}), /* @__PURE__ */ A(f, {
|
|
779
916
|
icon: "plus",
|
|
780
917
|
label: r.runnersAdd,
|
|
781
918
|
variant: "primary",
|
|
@@ -784,64 +921,64 @@ function U({ fleet: e, locale: t, texts: n }) {
|
|
|
784
921
|
}),
|
|
785
922
|
loading: i === null,
|
|
786
923
|
loaderMinHeight: 120,
|
|
787
|
-
children: /* @__PURE__ */
|
|
924
|
+
children: /* @__PURE__ */ j("div", {
|
|
788
925
|
className: "flex flex-col gap-3",
|
|
789
926
|
children: [
|
|
790
|
-
/* @__PURE__ */
|
|
927
|
+
/* @__PURE__ */ A("p", {
|
|
791
928
|
className: "text-sm text-muted-foreground",
|
|
792
929
|
children: r.runnersIntro
|
|
793
930
|
}),
|
|
794
|
-
|
|
931
|
+
y && /* @__PURE__ */ A(p, {
|
|
795
932
|
variant: "danger",
|
|
796
|
-
children:
|
|
933
|
+
children: y
|
|
797
934
|
}),
|
|
798
|
-
i?.length === 0 && /* @__PURE__ */
|
|
935
|
+
i?.length === 0 && /* @__PURE__ */ A("p", {
|
|
799
936
|
className: "text-sm text-muted-foreground",
|
|
800
937
|
children: r.runnersEmpty
|
|
801
938
|
}),
|
|
802
|
-
i?.map((e) => /* @__PURE__ */
|
|
939
|
+
i?.map((e) => /* @__PURE__ */ j("div", {
|
|
803
940
|
className: "flex flex-col gap-2 rounded-md border border-border p-3",
|
|
804
|
-
children: [/* @__PURE__ */
|
|
941
|
+
children: [/* @__PURE__ */ j("div", {
|
|
805
942
|
className: "flex flex-wrap items-center gap-2",
|
|
806
943
|
children: [
|
|
807
|
-
/* @__PURE__ */
|
|
944
|
+
/* @__PURE__ */ A("span", {
|
|
808
945
|
className: "font-medium",
|
|
809
946
|
children: e.name
|
|
810
947
|
}),
|
|
811
|
-
/* @__PURE__ */
|
|
948
|
+
/* @__PURE__ */ A("span", {
|
|
812
949
|
className: "text-xs text-muted-foreground",
|
|
813
950
|
children: e.url
|
|
814
951
|
}),
|
|
815
|
-
e.status === null && /* @__PURE__ */
|
|
952
|
+
e.status === null && /* @__PURE__ */ A(m, {
|
|
816
953
|
variant: "danger",
|
|
817
954
|
children: r.runnersUnreachable
|
|
818
955
|
}),
|
|
819
|
-
e.status && /* @__PURE__ */
|
|
956
|
+
e.status && /* @__PURE__ */ A(m, {
|
|
820
957
|
variant: "secondary",
|
|
821
|
-
children:
|
|
958
|
+
children: L(r.runnersVersion, { version: e.status.version })
|
|
822
959
|
}),
|
|
823
|
-
e.status && /* @__PURE__ */
|
|
960
|
+
e.status && /* @__PURE__ */ A(m, {
|
|
824
961
|
variant: "info",
|
|
825
|
-
children:
|
|
962
|
+
children: L(r.runnersLoad, {
|
|
826
963
|
chats: e.status.load.chats,
|
|
827
964
|
max: e.status.load.maxChats
|
|
828
965
|
})
|
|
829
966
|
}),
|
|
830
|
-
e.status && /* @__PURE__ */
|
|
967
|
+
e.status && /* @__PURE__ */ A(m, {
|
|
831
968
|
variant: "light",
|
|
832
|
-
children:
|
|
969
|
+
children: L(r.runnersTenants, { count: e.status.tenants.length })
|
|
833
970
|
}),
|
|
834
|
-
/* @__PURE__ */
|
|
971
|
+
/* @__PURE__ */ A("div", {
|
|
835
972
|
className: "ml-auto",
|
|
836
|
-
children: /* @__PURE__ */
|
|
973
|
+
children: /* @__PURE__ */ A(f, {
|
|
837
974
|
icon: "trash",
|
|
838
975
|
label: r.runnersRemove,
|
|
839
976
|
variant: "outline-danger",
|
|
840
|
-
onClick: () =>
|
|
977
|
+
onClick: () => v(e)
|
|
841
978
|
})
|
|
842
979
|
})
|
|
843
980
|
]
|
|
844
|
-
}), /* @__PURE__ */
|
|
981
|
+
}), /* @__PURE__ */ A(b, {
|
|
845
982
|
appearance: "empty",
|
|
846
983
|
showNotice: !1,
|
|
847
984
|
onSubmit: () => !1,
|
|
@@ -849,18 +986,18 @@ function U({ fleet: e, locale: t, texts: n }) {
|
|
|
849
986
|
isDefault: e.isDefault ? "true" : "",
|
|
850
987
|
draining: e.draining ? "true" : ""
|
|
851
988
|
},
|
|
852
|
-
children: /* @__PURE__ */
|
|
989
|
+
children: /* @__PURE__ */ j("div", {
|
|
853
990
|
className: "flex flex-wrap gap-4",
|
|
854
|
-
children: [/* @__PURE__ */ D
|
|
991
|
+
children: [/* @__PURE__ */ A(D, {
|
|
855
992
|
name: "isDefault",
|
|
856
993
|
label: r.runnersDefault,
|
|
857
994
|
valueChecked: "true",
|
|
858
|
-
onChange: ({ value: t }) => void
|
|
859
|
-
}), /* @__PURE__ */ D
|
|
995
|
+
onChange: ({ value: t }) => void w(e.id, { isDefault: !!t })
|
|
996
|
+
}), /* @__PURE__ */ A(D, {
|
|
860
997
|
name: "draining",
|
|
861
998
|
label: r.runnersDraining,
|
|
862
999
|
valueChecked: "true",
|
|
863
|
-
onChange: ({ value: t }) => void
|
|
1000
|
+
onChange: ({ value: t }) => void w(e.id, { draining: !!t })
|
|
864
1001
|
})]
|
|
865
1002
|
})
|
|
866
1003
|
})]
|
|
@@ -868,26 +1005,26 @@ function U({ fleet: e, locale: t, texts: n }) {
|
|
|
868
1005
|
]
|
|
869
1006
|
})
|
|
870
1007
|
}),
|
|
871
|
-
e.tenants && i && i.length > 0 && /* @__PURE__ */
|
|
1008
|
+
e.tenants && i && i.length > 0 && /* @__PURE__ */ A(h, {
|
|
872
1009
|
title: r.distributionTitle,
|
|
873
1010
|
loading: o === null,
|
|
874
1011
|
loaderMinHeight: 80,
|
|
875
|
-
children: /* @__PURE__ */
|
|
1012
|
+
children: /* @__PURE__ */ j("div", {
|
|
876
1013
|
className: "flex flex-col gap-2",
|
|
877
|
-
children: [/* @__PURE__ */
|
|
1014
|
+
children: [/* @__PURE__ */ A("p", {
|
|
878
1015
|
className: "text-sm text-muted-foreground",
|
|
879
1016
|
children: r.distributionIntro
|
|
880
|
-
}), /* @__PURE__ */
|
|
1017
|
+
}), /* @__PURE__ */ A(b, {
|
|
881
1018
|
appearance: "empty",
|
|
882
1019
|
showNotice: !1,
|
|
883
1020
|
onSubmit: () => !1,
|
|
884
1021
|
defaultValues: Object.fromEntries((o ?? []).map((e) => [`runner_${e.id}`, e.runnerId ?? ""])),
|
|
885
|
-
children: (o ?? []).map((t) => /* @__PURE__ */
|
|
1022
|
+
children: (o ?? []).map((t) => /* @__PURE__ */ j("div", {
|
|
886
1023
|
className: "flex flex-wrap items-center gap-2",
|
|
887
|
-
children: [/* @__PURE__ */
|
|
1024
|
+
children: [/* @__PURE__ */ A("span", {
|
|
888
1025
|
className: "min-w-40 flex-1 text-sm",
|
|
889
1026
|
children: t.name
|
|
890
|
-
}), /* @__PURE__ */
|
|
1027
|
+
}), /* @__PURE__ */ A(T, {
|
|
891
1028
|
name: `runner_${t.id}`,
|
|
892
1029
|
title: r.distributionRunner,
|
|
893
1030
|
placeholderOption: {
|
|
@@ -899,90 +1036,91 @@ function U({ fleet: e, locale: t, texts: n }) {
|
|
|
899
1036
|
value: e.id
|
|
900
1037
|
})),
|
|
901
1038
|
onChange: ({ value: n }) => {
|
|
902
|
-
n && e.tenants.assign(t.id, String(n)).then(
|
|
1039
|
+
n && e.tenants.assign(t.id, String(n)).then(S);
|
|
903
1040
|
}
|
|
904
1041
|
})]
|
|
905
1042
|
}, t.id))
|
|
906
1043
|
})]
|
|
907
1044
|
})
|
|
908
1045
|
}),
|
|
909
|
-
u && /* @__PURE__ */
|
|
1046
|
+
u && /* @__PURE__ */ A(q, {
|
|
910
1047
|
fleet: e,
|
|
911
1048
|
t: r,
|
|
912
1049
|
locale: t,
|
|
913
1050
|
onClose: () => g(!1),
|
|
914
1051
|
onAdded: async () => {
|
|
915
|
-
g(!1), await
|
|
1052
|
+
g(!1), await S();
|
|
916
1053
|
}
|
|
917
1054
|
}),
|
|
918
|
-
_ && /* @__PURE__ */
|
|
1055
|
+
_ && /* @__PURE__ */ A(C, {
|
|
919
1056
|
title: r.runnersRemove,
|
|
920
1057
|
danger: !0,
|
|
921
|
-
onClose: () =>
|
|
922
|
-
onYes: async () => (await e.remove(_.id).catch((e) =>
|
|
923
|
-
children:
|
|
1058
|
+
onClose: () => v(null),
|
|
1059
|
+
onYes: async () => (await e.remove(_.id).catch((e) => x(L(r.error, { error: e.message }))), v(null), await S(), !0),
|
|
1060
|
+
children: L(r.runnersRemoveConfirm, { name: _.name })
|
|
924
1061
|
})
|
|
925
1062
|
]
|
|
926
1063
|
});
|
|
927
1064
|
}
|
|
928
|
-
function
|
|
929
|
-
return e ?
|
|
1065
|
+
function G({ target: e, children: t }) {
|
|
1066
|
+
return e ? M(t, e) : null;
|
|
930
1067
|
}
|
|
931
|
-
var
|
|
1068
|
+
var K = (e) => {
|
|
932
1069
|
try {
|
|
933
1070
|
return new URL(e).hostname;
|
|
934
1071
|
} catch {
|
|
935
1072
|
return e;
|
|
936
1073
|
}
|
|
937
1074
|
};
|
|
938
|
-
function
|
|
939
|
-
let [
|
|
940
|
-
return /* @__PURE__ */
|
|
1075
|
+
function q({ fleet: e, t, locale: n, onClose: r, onAdded: i, position: a }) {
|
|
1076
|
+
let [o, s] = d("choose"), [l, u] = d(null), [m, h] = d(null), g = c((e) => u(L(t.error, { error: e.message })), [t]);
|
|
1077
|
+
return /* @__PURE__ */ A(S, {
|
|
941
1078
|
title: t.addTitle,
|
|
1079
|
+
...a === "right" ? { position: "right" } : {},
|
|
942
1080
|
size: "lg",
|
|
943
1081
|
onClose: r,
|
|
944
|
-
footer:
|
|
945
|
-
ref:
|
|
1082
|
+
footer: o === "choose" || o === "guided" ? !1 : /* @__PURE__ */ A("div", {
|
|
1083
|
+
ref: h,
|
|
946
1084
|
className: "flex w-full flex-wrap items-center justify-end gap-3"
|
|
947
1085
|
}),
|
|
948
|
-
children: /* @__PURE__ */
|
|
1086
|
+
children: /* @__PURE__ */ j("div", {
|
|
949
1087
|
className: "flex flex-col gap-4",
|
|
950
1088
|
children: [
|
|
951
|
-
|
|
1089
|
+
l && /* @__PURE__ */ A(p, {
|
|
952
1090
|
variant: "danger",
|
|
953
|
-
children:
|
|
1091
|
+
children: l
|
|
954
1092
|
}),
|
|
955
|
-
|
|
1093
|
+
o === "choose" && /* @__PURE__ */ j("div", {
|
|
956
1094
|
className: "grid gap-3 sm:grid-cols-3",
|
|
957
1095
|
children: [
|
|
958
|
-
e.install && /* @__PURE__ */
|
|
1096
|
+
e.install && /* @__PURE__ */ A(J, {
|
|
959
1097
|
title: t.addAutomatic,
|
|
960
1098
|
hint: t.addAutomaticHint,
|
|
961
|
-
onClick: () =>
|
|
1099
|
+
onClick: () => s("automatic")
|
|
962
1100
|
}),
|
|
963
|
-
/* @__PURE__ */
|
|
1101
|
+
/* @__PURE__ */ A(J, {
|
|
964
1102
|
title: t.addGuided,
|
|
965
1103
|
hint: t.addGuidedHint,
|
|
966
|
-
onClick: () =>
|
|
1104
|
+
onClick: () => s("guided")
|
|
967
1105
|
}),
|
|
968
|
-
/* @__PURE__ */
|
|
1106
|
+
/* @__PURE__ */ A(J, {
|
|
969
1107
|
title: t.addExisting,
|
|
970
1108
|
hint: t.addExistingHint,
|
|
971
|
-
onClick: () =>
|
|
1109
|
+
onClick: () => s("existing")
|
|
972
1110
|
})
|
|
973
1111
|
]
|
|
974
1112
|
}),
|
|
975
|
-
|
|
1113
|
+
o !== "choose" && /* @__PURE__ */ A("div", { children: /* @__PURE__ */ A(f, {
|
|
976
1114
|
icon: "arrow-left",
|
|
977
1115
|
label: t.addBack,
|
|
978
1116
|
variant: "link",
|
|
979
1117
|
onClick: () => {
|
|
980
|
-
|
|
1118
|
+
s("choose"), u(null);
|
|
981
1119
|
}
|
|
982
1120
|
}) }),
|
|
983
|
-
|
|
1121
|
+
o === "automatic" && e.install && /* @__PURE__ */ A(ce, {
|
|
984
1122
|
t,
|
|
985
|
-
footer:
|
|
1123
|
+
footer: m,
|
|
986
1124
|
localKeys: !!e.localKeys,
|
|
987
1125
|
install: (t, n, r) => e.install({
|
|
988
1126
|
name: t,
|
|
@@ -990,38 +1128,38 @@ function K({ fleet: e, t, locale: n, onClose: r, onAdded: i }) {
|
|
|
990
1128
|
access: n
|
|
991
1129
|
}, r),
|
|
992
1130
|
onDone: i,
|
|
993
|
-
onError:
|
|
1131
|
+
onError: g
|
|
994
1132
|
}),
|
|
995
|
-
|
|
1133
|
+
o === "guided" && /* @__PURE__ */ A(W, {
|
|
996
1134
|
locale: n,
|
|
997
1135
|
texts: t,
|
|
998
1136
|
onPair: async ({ url: t, code: n }) => {
|
|
999
1137
|
await i(await e.add({
|
|
1000
|
-
name:
|
|
1138
|
+
name: K(t),
|
|
1001
1139
|
url: t,
|
|
1002
1140
|
code: n
|
|
1003
1141
|
}));
|
|
1004
1142
|
}
|
|
1005
1143
|
}),
|
|
1006
|
-
|
|
1144
|
+
o === "existing" && /* @__PURE__ */ A(se, {
|
|
1007
1145
|
t,
|
|
1008
|
-
footer:
|
|
1146
|
+
footer: m,
|
|
1009
1147
|
pairing: e.startPairing && e.pairingStatus ? {
|
|
1010
1148
|
start: e.startPairing.bind(e),
|
|
1011
1149
|
status: e.pairingStatus.bind(e)
|
|
1012
1150
|
} : void 0,
|
|
1013
1151
|
onAdded: i,
|
|
1014
|
-
onError:
|
|
1015
|
-
onClearError: () =>
|
|
1152
|
+
onError: g,
|
|
1153
|
+
onClearError: () => u(null),
|
|
1016
1154
|
onConnect: async (t, n) => {
|
|
1017
1155
|
try {
|
|
1018
1156
|
await i(await e.add({
|
|
1019
|
-
name:
|
|
1157
|
+
name: K(t),
|
|
1020
1158
|
url: t,
|
|
1021
1159
|
code: n
|
|
1022
1160
|
}));
|
|
1023
1161
|
} catch (e) {
|
|
1024
|
-
|
|
1162
|
+
g(e);
|
|
1025
1163
|
}
|
|
1026
1164
|
}
|
|
1027
1165
|
})
|
|
@@ -1029,26 +1167,26 @@ function K({ fleet: e, t, locale: n, onClose: r, onAdded: i }) {
|
|
|
1029
1167
|
})
|
|
1030
1168
|
});
|
|
1031
1169
|
}
|
|
1032
|
-
function
|
|
1033
|
-
return /* @__PURE__ */
|
|
1170
|
+
function J({ title: e, hint: t, onClick: n }) {
|
|
1171
|
+
return /* @__PURE__ */ j("button", {
|
|
1034
1172
|
type: "button",
|
|
1035
1173
|
onClick: n,
|
|
1036
1174
|
className: "rounded-lg border border-border p-4 text-left transition-colors hover:border-primary hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
|
|
1037
|
-
children: [/* @__PURE__ */
|
|
1175
|
+
children: [/* @__PURE__ */ A("span", {
|
|
1038
1176
|
className: "block font-medium",
|
|
1039
1177
|
children: e
|
|
1040
|
-
}), /* @__PURE__ */
|
|
1178
|
+
}), /* @__PURE__ */ A("span", {
|
|
1041
1179
|
className: "mt-1 block text-sm text-muted-foreground",
|
|
1042
1180
|
children: t
|
|
1043
1181
|
})]
|
|
1044
1182
|
});
|
|
1045
1183
|
}
|
|
1046
|
-
var
|
|
1184
|
+
var Y = (e) => (/^https?:\/\//.test(e.trim()) ? e.trim() : `https://${e.trim()}`).replace(/\/+$/, ""), ae = (e) => new Date(e).toLocaleTimeString(void 0, {
|
|
1047
1185
|
hour: "2-digit",
|
|
1048
1186
|
minute: "2-digit"
|
|
1049
|
-
}),
|
|
1050
|
-
function
|
|
1051
|
-
let [s, c] = d(""), [u, m] = d(""), [h, g] = d(!n), [_,
|
|
1187
|
+
}), oe = 5;
|
|
1188
|
+
function se({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError: a, onConnect: o }) {
|
|
1189
|
+
let [s, c] = d(""), [u, m] = d(""), [h, g] = d(!n), [_, v] = d(null), [y, S] = d(null);
|
|
1052
1190
|
return l(() => {
|
|
1053
1191
|
if (!_ || !n) return;
|
|
1054
1192
|
let e = !1, t = 0, a, o = async () => {
|
|
@@ -1060,11 +1198,11 @@ function te({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
|
|
|
1060
1198
|
return;
|
|
1061
1199
|
}
|
|
1062
1200
|
if (i.status !== "pending") {
|
|
1063
|
-
S(i.status),
|
|
1201
|
+
S(i.status), v(null);
|
|
1064
1202
|
return;
|
|
1065
1203
|
}
|
|
1066
1204
|
} catch (n) {
|
|
1067
|
-
t += 1, !e && t >=
|
|
1205
|
+
t += 1, !e && t >= oe && i(n);
|
|
1068
1206
|
}
|
|
1069
1207
|
e || (a = setTimeout(() => void o(), 2e3));
|
|
1070
1208
|
};
|
|
@@ -1076,28 +1214,28 @@ function te({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
|
|
|
1076
1214
|
n,
|
|
1077
1215
|
r,
|
|
1078
1216
|
i
|
|
1079
|
-
]), _ ? /* @__PURE__ */
|
|
1217
|
+
]), _ ? /* @__PURE__ */ j("div", {
|
|
1080
1218
|
className: "flex flex-col gap-3",
|
|
1081
1219
|
children: [
|
|
1082
|
-
/* @__PURE__ */
|
|
1220
|
+
/* @__PURE__ */ A("h4", {
|
|
1083
1221
|
className: "font-semibold",
|
|
1084
1222
|
children: e.pairWaitingTitle
|
|
1085
1223
|
}),
|
|
1086
|
-
/* @__PURE__ */
|
|
1224
|
+
/* @__PURE__ */ A("p", {
|
|
1087
1225
|
className: "text-sm text-muted-foreground",
|
|
1088
1226
|
children: e.pairWaitingHint
|
|
1089
1227
|
}),
|
|
1090
|
-
/* @__PURE__ */
|
|
1228
|
+
/* @__PURE__ */ A("div", {
|
|
1091
1229
|
className: "rounded-lg border border-border p-4 text-center font-mono text-3xl font-semibold tracking-widest",
|
|
1092
1230
|
children: _.code
|
|
1093
1231
|
}),
|
|
1094
|
-
/* @__PURE__ */
|
|
1232
|
+
/* @__PURE__ */ A("p", {
|
|
1095
1233
|
className: "text-sm text-muted-foreground",
|
|
1096
|
-
children:
|
|
1234
|
+
children: L(e.pairWaiting, { at: ae(_.expiresAt) })
|
|
1097
1235
|
}),
|
|
1098
|
-
/* @__PURE__ */
|
|
1236
|
+
/* @__PURE__ */ A(G, {
|
|
1099
1237
|
target: t,
|
|
1100
|
-
children: /* @__PURE__ */
|
|
1238
|
+
children: /* @__PURE__ */ A(f, {
|
|
1101
1239
|
icon: "external-link",
|
|
1102
1240
|
label: e.pairOpen,
|
|
1103
1241
|
variant: "primary",
|
|
@@ -1105,14 +1243,14 @@ function te({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
|
|
|
1105
1243
|
})
|
|
1106
1244
|
})
|
|
1107
1245
|
]
|
|
1108
|
-
}) : /* @__PURE__ */
|
|
1246
|
+
}) : /* @__PURE__ */ j("div", {
|
|
1109
1247
|
className: "flex flex-col gap-3",
|
|
1110
1248
|
children: [
|
|
1111
|
-
|
|
1112
|
-
variant:
|
|
1113
|
-
children:
|
|
1249
|
+
y && /* @__PURE__ */ A(p, {
|
|
1250
|
+
variant: y === "denied" ? "danger" : "warning",
|
|
1251
|
+
children: y === "denied" ? e.pairDenied : e.pairExpired
|
|
1114
1252
|
}),
|
|
1115
|
-
/* @__PURE__ */
|
|
1253
|
+
/* @__PURE__ */ j(b, {
|
|
1116
1254
|
appearance: "empty",
|
|
1117
1255
|
showNotice: !1,
|
|
1118
1256
|
onSubmit: () => !1,
|
|
@@ -1120,12 +1258,12 @@ function te({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
|
|
|
1120
1258
|
url: s,
|
|
1121
1259
|
code: u
|
|
1122
1260
|
},
|
|
1123
|
-
children: [/* @__PURE__ */
|
|
1261
|
+
children: [/* @__PURE__ */ A(E, {
|
|
1124
1262
|
name: "url",
|
|
1125
1263
|
label: e.addUrl,
|
|
1126
1264
|
placeholder: "https://runner.example.com",
|
|
1127
1265
|
onChange: ({ value: e }) => c(String(e ?? ""))
|
|
1128
|
-
}), h && /* @__PURE__ */
|
|
1266
|
+
}), h && /* @__PURE__ */ A(E, {
|
|
1129
1267
|
name: "code",
|
|
1130
1268
|
label: e.addCode,
|
|
1131
1269
|
placeholder: "ABCD-EFGH",
|
|
@@ -1133,27 +1271,27 @@ function te({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
|
|
|
1133
1271
|
onChange: ({ value: e }) => m(String(e ?? ""))
|
|
1134
1272
|
})]
|
|
1135
1273
|
}),
|
|
1136
|
-
/* @__PURE__ */
|
|
1274
|
+
/* @__PURE__ */ j(G, {
|
|
1137
1275
|
target: t,
|
|
1138
|
-
children: [n && /* @__PURE__ */
|
|
1276
|
+
children: [n && /* @__PURE__ */ A(f, {
|
|
1139
1277
|
label: h ? e.pairWithApproval : e.pairWithCode,
|
|
1140
1278
|
variant: "link",
|
|
1141
1279
|
onClick: () => g((e) => !e)
|
|
1142
|
-
}), h ? /* @__PURE__ */
|
|
1280
|
+
}), h ? /* @__PURE__ */ A(x, {
|
|
1143
1281
|
label: e.addConnect,
|
|
1144
1282
|
variant: "primary",
|
|
1145
1283
|
disabled: !s.trim() || u.trim().length < 8,
|
|
1146
|
-
onClick: () => o(
|
|
1147
|
-
}) : /* @__PURE__ */
|
|
1148
|
-
label:
|
|
1284
|
+
onClick: () => o(Y(s), u.trim())
|
|
1285
|
+
}) : /* @__PURE__ */ A(x, {
|
|
1286
|
+
label: y ? e.pairAgain : e.pairNext,
|
|
1149
1287
|
variant: "primary",
|
|
1150
1288
|
disabled: !s.trim(),
|
|
1151
1289
|
onClick: async () => {
|
|
1152
1290
|
S(null), a();
|
|
1153
1291
|
try {
|
|
1154
|
-
let e =
|
|
1155
|
-
|
|
1156
|
-
name:
|
|
1292
|
+
let e = Y(s);
|
|
1293
|
+
v(await n.start({
|
|
1294
|
+
name: K(e),
|
|
1157
1295
|
url: e
|
|
1158
1296
|
}));
|
|
1159
1297
|
} catch (e) {
|
|
@@ -1176,7 +1314,7 @@ var X = [
|
|
|
1176
1314
|
"tls",
|
|
1177
1315
|
"done"
|
|
1178
1316
|
];
|
|
1179
|
-
function
|
|
1317
|
+
function ce({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }) {
|
|
1180
1318
|
let [o, s] = d({
|
|
1181
1319
|
host: "",
|
|
1182
1320
|
port: "22",
|
|
@@ -1189,43 +1327,43 @@ function ne({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }
|
|
|
1189
1327
|
...n,
|
|
1190
1328
|
[e]: String(t ?? "")
|
|
1191
1329
|
})), _ = o.host.trim() && o.domain.trim() && (o.auth === "local" || o.username.trim()) && (o.auth === "local" || (o.auth === "key" ? o.privateKey.trim() : o.password));
|
|
1192
|
-
return /* @__PURE__ */
|
|
1330
|
+
return /* @__PURE__ */ j("div", {
|
|
1193
1331
|
className: "flex flex-col gap-3",
|
|
1194
1332
|
children: [
|
|
1195
|
-
!p && /* @__PURE__ */
|
|
1333
|
+
!p && /* @__PURE__ */ j(b, {
|
|
1196
1334
|
appearance: "empty",
|
|
1197
1335
|
showNotice: !1,
|
|
1198
1336
|
onSubmit: () => !1,
|
|
1199
1337
|
defaultValues: o,
|
|
1200
1338
|
children: [
|
|
1201
|
-
/* @__PURE__ */
|
|
1339
|
+
/* @__PURE__ */ A(E, {
|
|
1202
1340
|
name: "domain",
|
|
1203
1341
|
label: e.guideDomain,
|
|
1204
1342
|
placeholder: "runner.example.com",
|
|
1205
1343
|
onChange: g("domain")
|
|
1206
1344
|
}),
|
|
1207
|
-
/* @__PURE__ */
|
|
1345
|
+
/* @__PURE__ */ j("div", {
|
|
1208
1346
|
className: "grid gap-3 sm:grid-cols-3",
|
|
1209
1347
|
children: [
|
|
1210
|
-
/* @__PURE__ */
|
|
1348
|
+
/* @__PURE__ */ A(E, {
|
|
1211
1349
|
name: "host",
|
|
1212
1350
|
label: e.addHost,
|
|
1213
1351
|
placeholder: "203.0.113.10",
|
|
1214
1352
|
onChange: g("host")
|
|
1215
1353
|
}),
|
|
1216
|
-
/* @__PURE__ */
|
|
1354
|
+
/* @__PURE__ */ A(E, {
|
|
1217
1355
|
name: "port",
|
|
1218
1356
|
label: e.addPort,
|
|
1219
1357
|
onChange: g("port")
|
|
1220
1358
|
}),
|
|
1221
|
-
/* @__PURE__ */
|
|
1359
|
+
/* @__PURE__ */ A(E, {
|
|
1222
1360
|
name: "username",
|
|
1223
1361
|
label: e.addUser,
|
|
1224
1362
|
onChange: g("username")
|
|
1225
1363
|
})
|
|
1226
1364
|
]
|
|
1227
1365
|
}),
|
|
1228
|
-
/* @__PURE__ */
|
|
1366
|
+
/* @__PURE__ */ A(T, {
|
|
1229
1367
|
name: "auth",
|
|
1230
1368
|
label: e.addAuth,
|
|
1231
1369
|
options: [
|
|
@@ -1244,16 +1382,16 @@ function ne({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }
|
|
|
1244
1382
|
],
|
|
1245
1383
|
onChange: g("auth")
|
|
1246
1384
|
}),
|
|
1247
|
-
o.auth === "local" && /* @__PURE__ */
|
|
1385
|
+
o.auth === "local" && /* @__PURE__ */ A("p", {
|
|
1248
1386
|
className: "text-xs text-muted-foreground",
|
|
1249
1387
|
children: e.addLocalKeyHint
|
|
1250
1388
|
}),
|
|
1251
|
-
o.auth === "local" ? null : o.auth === "key" ? /* @__PURE__ */
|
|
1389
|
+
o.auth === "local" ? null : o.auth === "key" ? /* @__PURE__ */ A(O, {
|
|
1252
1390
|
name: "privateKey",
|
|
1253
1391
|
label: e.addKey,
|
|
1254
1392
|
placeholder: "-----BEGIN OPENSSH PRIVATE KEY-----",
|
|
1255
1393
|
onChange: g("privateKey")
|
|
1256
|
-
}) : /* @__PURE__ */
|
|
1394
|
+
}) : /* @__PURE__ */ A(w, {
|
|
1257
1395
|
name: "password",
|
|
1258
1396
|
label: e.addPassword,
|
|
1259
1397
|
autoComplete: "off",
|
|
@@ -1261,24 +1399,24 @@ function ne({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }
|
|
|
1261
1399
|
})
|
|
1262
1400
|
]
|
|
1263
1401
|
}),
|
|
1264
|
-
/* @__PURE__ */
|
|
1402
|
+
/* @__PURE__ */ A("p", {
|
|
1265
1403
|
className: "text-xs text-muted-foreground",
|
|
1266
1404
|
children: e.addCredentialsNote
|
|
1267
1405
|
}),
|
|
1268
|
-
p && /* @__PURE__ */
|
|
1406
|
+
p && /* @__PURE__ */ A("div", {
|
|
1269
1407
|
className: "flex flex-wrap gap-1",
|
|
1270
|
-
children: X.map((e) => /* @__PURE__ */
|
|
1408
|
+
children: X.map((e) => /* @__PURE__ */ A(m, {
|
|
1271
1409
|
variant: u === e ? "primary" : X.indexOf(e) < X.indexOf(u ?? "check") ? "success" : "light",
|
|
1272
1410
|
children: e
|
|
1273
1411
|
}, e))
|
|
1274
1412
|
}),
|
|
1275
|
-
c.length > 0 && /* @__PURE__ */
|
|
1413
|
+
c.length > 0 && /* @__PURE__ */ A("pre", {
|
|
1276
1414
|
className: "max-h-64 overflow-auto rounded-md bg-muted p-2 text-xs",
|
|
1277
1415
|
children: c.slice(-200).join("\n")
|
|
1278
1416
|
}),
|
|
1279
|
-
/* @__PURE__ */
|
|
1417
|
+
/* @__PURE__ */ A(G, {
|
|
1280
1418
|
target: t,
|
|
1281
|
-
children: /* @__PURE__ */
|
|
1419
|
+
children: /* @__PURE__ */ A(x, {
|
|
1282
1420
|
label: p ? e.addInstalling : e.addInstall,
|
|
1283
1421
|
variant: "primary",
|
|
1284
1422
|
disabled: !_ || p,
|
|
@@ -1309,49 +1447,49 @@ var Z = (e) => (e / 1024 ** 3).toFixed(1), Q = (e) => new Date(e).toLocaleString
|
|
|
1309
1447
|
dateStyle: "short",
|
|
1310
1448
|
timeStyle: "short"
|
|
1311
1449
|
});
|
|
1312
|
-
function
|
|
1313
|
-
let o =
|
|
1450
|
+
function le({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
|
|
1451
|
+
let o = I(n, r), [s, u] = d(null), [m, _] = d(null), [v, S] = d(null), [C, w] = d({
|
|
1314
1452
|
id: "",
|
|
1315
1453
|
name: ""
|
|
1316
|
-
}), [
|
|
1454
|
+
}), [T, D] = d(null), O = c(async () => {
|
|
1317
1455
|
try {
|
|
1318
|
-
u(await e.platform.status()),
|
|
1456
|
+
u(await e.platform.status()), _(null);
|
|
1319
1457
|
} catch (e) {
|
|
1320
|
-
|
|
1458
|
+
_(L(o.error, { error: e instanceof t ? e.code : String(e) }));
|
|
1321
1459
|
}
|
|
1322
1460
|
}, [e, o]);
|
|
1323
1461
|
return l(() => {
|
|
1324
|
-
|
|
1325
|
-
}, [
|
|
1462
|
+
O();
|
|
1463
|
+
}, [O]), /* @__PURE__ */ j("div", {
|
|
1326
1464
|
className: "mx-auto flex max-w-4xl flex-col gap-4 p-4",
|
|
1327
1465
|
children: [
|
|
1328
|
-
/* @__PURE__ */
|
|
1466
|
+
/* @__PURE__ */ j("div", {
|
|
1329
1467
|
className: "flex items-center gap-2",
|
|
1330
|
-
children: [/* @__PURE__ */
|
|
1468
|
+
children: [/* @__PURE__ */ A("h1", {
|
|
1331
1469
|
className: "flex-1 text-xl font-semibold",
|
|
1332
1470
|
children: o.consoleTitle
|
|
1333
|
-
}), i && /* @__PURE__ */
|
|
1471
|
+
}), i && /* @__PURE__ */ A(f, {
|
|
1334
1472
|
icon: "log-out",
|
|
1335
1473
|
label: o.consoleSignOut,
|
|
1336
1474
|
variant: "outline-secondary",
|
|
1337
1475
|
onClick: i
|
|
1338
1476
|
})]
|
|
1339
1477
|
}),
|
|
1340
|
-
m && /* @__PURE__ */
|
|
1478
|
+
m && /* @__PURE__ */ A(p, {
|
|
1341
1479
|
variant: "danger",
|
|
1342
1480
|
children: m
|
|
1343
1481
|
}),
|
|
1344
|
-
/* @__PURE__ */
|
|
1482
|
+
/* @__PURE__ */ A(fe, {
|
|
1345
1483
|
client: e,
|
|
1346
1484
|
t: o,
|
|
1347
1485
|
approve: a,
|
|
1348
|
-
onAnswered:
|
|
1486
|
+
onAnswered: O
|
|
1349
1487
|
}),
|
|
1350
|
-
/* @__PURE__ */
|
|
1488
|
+
/* @__PURE__ */ A(h, {
|
|
1351
1489
|
title: o.consoleStatus,
|
|
1352
1490
|
loading: !s && !m,
|
|
1353
1491
|
loaderMinHeight: 100,
|
|
1354
|
-
children: s && /* @__PURE__ */
|
|
1492
|
+
children: s && /* @__PURE__ */ A(y, { items: [
|
|
1355
1493
|
{
|
|
1356
1494
|
label: "Version",
|
|
1357
1495
|
value: s.version
|
|
@@ -1366,7 +1504,7 @@ function re({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
|
|
|
1366
1504
|
},
|
|
1367
1505
|
{
|
|
1368
1506
|
label: "Machine",
|
|
1369
|
-
value:
|
|
1507
|
+
value: L(o.consoleMachine, {
|
|
1370
1508
|
memory: Z(s.machine.availableBytes),
|
|
1371
1509
|
total: Z(s.machine.totalBytes),
|
|
1372
1510
|
cpus: s.machine.cpus
|
|
@@ -1378,27 +1516,27 @@ function re({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
|
|
|
1378
1516
|
}
|
|
1379
1517
|
] })
|
|
1380
1518
|
}),
|
|
1381
|
-
/* @__PURE__ */
|
|
1519
|
+
/* @__PURE__ */ A(h, {
|
|
1382
1520
|
title: o.consolePairing,
|
|
1383
|
-
children: /* @__PURE__ */
|
|
1521
|
+
children: /* @__PURE__ */ j("div", {
|
|
1384
1522
|
className: "flex flex-col gap-2",
|
|
1385
1523
|
children: [
|
|
1386
|
-
/* @__PURE__ */
|
|
1524
|
+
/* @__PURE__ */ A("p", {
|
|
1387
1525
|
className: "text-sm text-muted-foreground",
|
|
1388
1526
|
children: o.consolePairingHint
|
|
1389
1527
|
}),
|
|
1390
|
-
|
|
1528
|
+
v && /* @__PURE__ */ A(g, {
|
|
1391
1529
|
showCopy: !0,
|
|
1392
|
-
children:
|
|
1530
|
+
children: v.code
|
|
1393
1531
|
}),
|
|
1394
|
-
|
|
1532
|
+
v && /* @__PURE__ */ A("p", {
|
|
1395
1533
|
className: "text-xs text-muted-foreground",
|
|
1396
|
-
children:
|
|
1397
|
-
code:
|
|
1398
|
-
at: Q(
|
|
1534
|
+
children: L(o.consoleCode, {
|
|
1535
|
+
code: v.code,
|
|
1536
|
+
at: Q(v.expiresAt)
|
|
1399
1537
|
})
|
|
1400
1538
|
}),
|
|
1401
|
-
/* @__PURE__ */
|
|
1539
|
+
/* @__PURE__ */ A("div", { children: /* @__PURE__ */ A(x, {
|
|
1402
1540
|
label: o.consoleNewCode,
|
|
1403
1541
|
variant: "outline-primary",
|
|
1404
1542
|
onClick: async () => S(await e.createPairing())
|
|
@@ -1406,66 +1544,66 @@ function re({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
|
|
|
1406
1544
|
]
|
|
1407
1545
|
})
|
|
1408
1546
|
}),
|
|
1409
|
-
/* @__PURE__ */
|
|
1547
|
+
/* @__PURE__ */ A(ue, {
|
|
1410
1548
|
client: e,
|
|
1411
1549
|
t: o
|
|
1412
1550
|
}),
|
|
1413
|
-
/* @__PURE__ */
|
|
1551
|
+
/* @__PURE__ */ A(h, {
|
|
1414
1552
|
title: o.consoleTenants,
|
|
1415
|
-
children: /* @__PURE__ */
|
|
1553
|
+
children: /* @__PURE__ */ j("div", {
|
|
1416
1554
|
className: "flex flex-col gap-3",
|
|
1417
1555
|
children: [
|
|
1418
|
-
|
|
1556
|
+
T && /* @__PURE__ */ A(p, {
|
|
1419
1557
|
variant: "warning",
|
|
1420
|
-
onClose: () =>
|
|
1421
|
-
children: /* @__PURE__ */
|
|
1558
|
+
onClose: () => D(null),
|
|
1559
|
+
children: /* @__PURE__ */ A("span", {
|
|
1422
1560
|
className: "break-all",
|
|
1423
|
-
children:
|
|
1561
|
+
children: L(o.consoleKeyShown, { key: T })
|
|
1424
1562
|
})
|
|
1425
1563
|
}),
|
|
1426
|
-
s?.tenants.map((t) => /* @__PURE__ */
|
|
1564
|
+
s?.tenants.map((t) => /* @__PURE__ */ A(de, {
|
|
1427
1565
|
client: e,
|
|
1428
1566
|
tenant: t,
|
|
1429
1567
|
t: o,
|
|
1430
1568
|
locale: n,
|
|
1431
|
-
onKey:
|
|
1432
|
-
onChange:
|
|
1569
|
+
onKey: D,
|
|
1570
|
+
onChange: O
|
|
1433
1571
|
}, t.id)),
|
|
1434
|
-
/* @__PURE__ */
|
|
1572
|
+
/* @__PURE__ */ A(b, {
|
|
1435
1573
|
appearance: "empty",
|
|
1436
1574
|
showNotice: !1,
|
|
1437
1575
|
onSubmit: () => !1,
|
|
1438
|
-
children: /* @__PURE__ */
|
|
1576
|
+
children: /* @__PURE__ */ j("div", {
|
|
1439
1577
|
className: "grid gap-2 sm:grid-cols-[1fr_1fr_auto] sm:items-end",
|
|
1440
1578
|
children: [
|
|
1441
|
-
/* @__PURE__ */
|
|
1579
|
+
/* @__PURE__ */ A(E, {
|
|
1442
1580
|
name: "tenantId",
|
|
1443
1581
|
label: o.consoleTenantId,
|
|
1444
1582
|
placeholder: "acme",
|
|
1445
|
-
onChange: ({ value: e }) =>
|
|
1583
|
+
onChange: ({ value: e }) => w((t) => ({
|
|
1446
1584
|
...t,
|
|
1447
1585
|
id: String(e ?? "")
|
|
1448
1586
|
}))
|
|
1449
1587
|
}),
|
|
1450
|
-
/* @__PURE__ */
|
|
1588
|
+
/* @__PURE__ */ A(E, {
|
|
1451
1589
|
name: "tenantName",
|
|
1452
1590
|
label: o.consoleTenantName,
|
|
1453
1591
|
placeholder: "Acme",
|
|
1454
|
-
onChange: ({ value: e }) =>
|
|
1592
|
+
onChange: ({ value: e }) => w((t) => ({
|
|
1455
1593
|
...t,
|
|
1456
1594
|
name: String(e ?? "")
|
|
1457
1595
|
}))
|
|
1458
1596
|
}),
|
|
1459
|
-
/* @__PURE__ */
|
|
1597
|
+
/* @__PURE__ */ A(x, {
|
|
1460
1598
|
label: o.consoleCreate,
|
|
1461
1599
|
variant: "primary",
|
|
1462
1600
|
disabled: !/^[a-z0-9][a-z0-9-]{0,62}$/.test(C.id),
|
|
1463
1601
|
onClick: async () => {
|
|
1464
1602
|
try {
|
|
1465
1603
|
let t = await e.platform.createTenant(C.id, { name: C.name || void 0 });
|
|
1466
|
-
t.key &&
|
|
1604
|
+
t.key && D(t.key), await O();
|
|
1467
1605
|
} catch (e) {
|
|
1468
|
-
|
|
1606
|
+
_(L(o.error, { error: e instanceof t ? e.code : String(e) }));
|
|
1469
1607
|
}
|
|
1470
1608
|
}
|
|
1471
1609
|
})
|
|
@@ -1478,40 +1616,40 @@ function re({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
|
|
|
1478
1616
|
]
|
|
1479
1617
|
});
|
|
1480
1618
|
}
|
|
1481
|
-
function
|
|
1619
|
+
function ue({ client: e, t }) {
|
|
1482
1620
|
let [n, r] = d(null), [i, a] = d({}), [o, s] = d(null), u = c(async () => r(await e.platform.platformKeys()), [e]);
|
|
1483
1621
|
return l(() => {
|
|
1484
1622
|
u();
|
|
1485
|
-
}, [u]), /* @__PURE__ */
|
|
1623
|
+
}, [u]), /* @__PURE__ */ j(h, {
|
|
1486
1624
|
title: t.consolePlatforms,
|
|
1487
1625
|
loading: !n,
|
|
1488
1626
|
loaderMinHeight: 60,
|
|
1489
|
-
children: [/* @__PURE__ */
|
|
1627
|
+
children: [/* @__PURE__ */ j("div", {
|
|
1490
1628
|
className: "flex flex-col gap-3",
|
|
1491
1629
|
children: [
|
|
1492
|
-
/* @__PURE__ */
|
|
1630
|
+
/* @__PURE__ */ A("p", {
|
|
1493
1631
|
className: "text-sm text-muted-foreground",
|
|
1494
1632
|
children: t.consolePlatformsHint
|
|
1495
1633
|
}),
|
|
1496
|
-
n && !n.length && /* @__PURE__ */
|
|
1634
|
+
n && !n.length && /* @__PURE__ */ A("p", {
|
|
1497
1635
|
className: "text-sm text-muted-foreground",
|
|
1498
1636
|
children: t.consolePlatformsEmpty
|
|
1499
1637
|
}),
|
|
1500
1638
|
n?.map((n) => {
|
|
1501
1639
|
let r = i[n.id] ?? n.project ?? "";
|
|
1502
|
-
return /* @__PURE__ */
|
|
1640
|
+
return /* @__PURE__ */ A(b, {
|
|
1503
1641
|
appearance: "empty",
|
|
1504
1642
|
showNotice: !1,
|
|
1505
1643
|
onSubmit: () => !1,
|
|
1506
|
-
children: /* @__PURE__ */
|
|
1644
|
+
children: /* @__PURE__ */ j("div", {
|
|
1507
1645
|
className: "grid gap-2 rounded-md border border-border p-3 sm:grid-cols-[1fr_12rem_auto] sm:items-end",
|
|
1508
1646
|
children: [
|
|
1509
|
-
/* @__PURE__ */
|
|
1647
|
+
/* @__PURE__ */ j("div", {
|
|
1510
1648
|
className: "flex flex-col gap-1",
|
|
1511
|
-
children: [/* @__PURE__ */
|
|
1649
|
+
children: [/* @__PURE__ */ A("span", {
|
|
1512
1650
|
className: "font-medium",
|
|
1513
1651
|
children: n.name
|
|
1514
|
-
}), /* @__PURE__ */
|
|
1652
|
+
}), /* @__PURE__ */ j("span", {
|
|
1515
1653
|
className: "text-xs text-muted-foreground",
|
|
1516
1654
|
children: [
|
|
1517
1655
|
Q(n.createdAt),
|
|
@@ -1520,7 +1658,7 @@ function ie({ client: e, t }) {
|
|
|
1520
1658
|
]
|
|
1521
1659
|
})]
|
|
1522
1660
|
}),
|
|
1523
|
-
/* @__PURE__ */
|
|
1661
|
+
/* @__PURE__ */ A(E, {
|
|
1524
1662
|
name: `project-${n.id}`,
|
|
1525
1663
|
label: t.consolePlatformProject,
|
|
1526
1664
|
value: r,
|
|
@@ -1530,16 +1668,16 @@ function ie({ client: e, t }) {
|
|
|
1530
1668
|
[n.id]: String(e ?? "").trim()
|
|
1531
1669
|
}))
|
|
1532
1670
|
}),
|
|
1533
|
-
/* @__PURE__ */
|
|
1671
|
+
/* @__PURE__ */ j("div", {
|
|
1534
1672
|
className: "flex gap-2",
|
|
1535
|
-
children: [/* @__PURE__ */
|
|
1673
|
+
children: [/* @__PURE__ */ A(x, {
|
|
1536
1674
|
label: t.consolePlatformSave,
|
|
1537
1675
|
variant: "outline-primary",
|
|
1538
1676
|
disabled: r === (n.project ?? "") || r !== "" && !/^[a-z0-9]{1,32}$/.test(r),
|
|
1539
1677
|
onClick: async () => {
|
|
1540
1678
|
await e.setKeyProject(n.id, r || null), await u();
|
|
1541
1679
|
}
|
|
1542
|
-
}), /* @__PURE__ */
|
|
1680
|
+
}), /* @__PURE__ */ A(f, {
|
|
1543
1681
|
icon: "trash",
|
|
1544
1682
|
label: t.consoleRevoke,
|
|
1545
1683
|
variant: "outline-danger",
|
|
@@ -1551,33 +1689,33 @@ function ie({ client: e, t }) {
|
|
|
1551
1689
|
}, n.id);
|
|
1552
1690
|
})
|
|
1553
1691
|
]
|
|
1554
|
-
}), o && /* @__PURE__ */
|
|
1692
|
+
}), o && /* @__PURE__ */ A(C, {
|
|
1555
1693
|
title: t.consoleRevoke,
|
|
1556
1694
|
danger: !0,
|
|
1557
1695
|
onClose: () => s(null),
|
|
1558
1696
|
onYes: async () => (await e.platform.revokePlatformKey(o.id), s(null), await u(), !0),
|
|
1559
|
-
children:
|
|
1697
|
+
children: L(t.consolePlatformRevokeConfirm, { name: o.name })
|
|
1560
1698
|
})]
|
|
1561
1699
|
});
|
|
1562
1700
|
}
|
|
1563
|
-
function
|
|
1564
|
-
let [o, s] = d(!1), [p, h] = d(null), [g, _] = d(!1), v = u(() => e.as({ tenant: t.id }), [e, t.id]),
|
|
1701
|
+
function de({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
|
|
1702
|
+
let [o, s] = d(!1), [p, h] = d(null), [g, _] = d(!1), v = u(() => e.as({ tenant: t.id }), [e, t.id]), y = c(async () => h(await e.platform.keys(t.id)), [e, t.id]);
|
|
1565
1703
|
return l(() => {
|
|
1566
|
-
o &&
|
|
1567
|
-
}, [o,
|
|
1704
|
+
o && y();
|
|
1705
|
+
}, [o, y]), /* @__PURE__ */ j("div", {
|
|
1568
1706
|
className: "rounded-md border border-border p-3",
|
|
1569
1707
|
children: [
|
|
1570
|
-
/* @__PURE__ */
|
|
1708
|
+
/* @__PURE__ */ j("div", {
|
|
1571
1709
|
className: "flex flex-wrap items-center gap-2",
|
|
1572
1710
|
children: [
|
|
1573
|
-
/* @__PURE__ */
|
|
1711
|
+
/* @__PURE__ */ j("button", {
|
|
1574
1712
|
type: "button",
|
|
1575
1713
|
className: "flex-1 text-left font-medium",
|
|
1576
1714
|
onClick: () => s((e) => !e),
|
|
1577
1715
|
children: [
|
|
1578
1716
|
t.name,
|
|
1579
1717
|
" ",
|
|
1580
|
-
/* @__PURE__ */
|
|
1718
|
+
/* @__PURE__ */ j("span", {
|
|
1581
1719
|
className: "text-xs text-muted-foreground",
|
|
1582
1720
|
children: [
|
|
1583
1721
|
"(",
|
|
@@ -1587,11 +1725,11 @@ function ae({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
|
|
|
1587
1725
|
})
|
|
1588
1726
|
]
|
|
1589
1727
|
}),
|
|
1590
|
-
t.usersWithAccounts !== void 0 && /* @__PURE__ */
|
|
1728
|
+
t.usersWithAccounts !== void 0 && /* @__PURE__ */ j(m, {
|
|
1591
1729
|
variant: "light",
|
|
1592
1730
|
children: [t.usersWithAccounts, " 👤"]
|
|
1593
1731
|
}),
|
|
1594
|
-
/* @__PURE__ */
|
|
1732
|
+
/* @__PURE__ */ A(f, {
|
|
1595
1733
|
icon: "trash",
|
|
1596
1734
|
label: n.consoleRemoveTenant,
|
|
1597
1735
|
variant: "outline-danger",
|
|
@@ -1599,34 +1737,34 @@ function ae({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
|
|
|
1599
1737
|
})
|
|
1600
1738
|
]
|
|
1601
1739
|
}),
|
|
1602
|
-
o && /* @__PURE__ */
|
|
1740
|
+
o && /* @__PURE__ */ j("div", {
|
|
1603
1741
|
className: "mt-3 flex flex-col gap-3",
|
|
1604
1742
|
children: [
|
|
1605
|
-
/* @__PURE__ */
|
|
1743
|
+
/* @__PURE__ */ A("h4", {
|
|
1606
1744
|
className: "text-sm font-semibold",
|
|
1607
1745
|
children: n.consoleKeys
|
|
1608
1746
|
}),
|
|
1609
|
-
p?.map((r) => /* @__PURE__ */
|
|
1747
|
+
p?.map((r) => /* @__PURE__ */ j("div", {
|
|
1610
1748
|
className: "flex flex-wrap items-center gap-2 text-sm",
|
|
1611
1749
|
children: [
|
|
1612
|
-
/* @__PURE__ */
|
|
1750
|
+
/* @__PURE__ */ A("span", {
|
|
1613
1751
|
className: "flex-1",
|
|
1614
1752
|
children: r.name
|
|
1615
1753
|
}),
|
|
1616
|
-
r.permissions.map((e) => /* @__PURE__ */
|
|
1754
|
+
r.permissions.map((e) => /* @__PURE__ */ A(m, {
|
|
1617
1755
|
variant: "info",
|
|
1618
1756
|
children: e
|
|
1619
1757
|
}, e)),
|
|
1620
|
-
/* @__PURE__ */
|
|
1758
|
+
/* @__PURE__ */ A(f, {
|
|
1621
1759
|
label: n.consoleRevoke,
|
|
1622
1760
|
variant: "outline-danger",
|
|
1623
1761
|
onClick: async () => {
|
|
1624
|
-
await e.platform.revokeKey(t.id, r.id), await
|
|
1762
|
+
await e.platform.revokeKey(t.id, r.id), await y();
|
|
1625
1763
|
}
|
|
1626
1764
|
})
|
|
1627
1765
|
]
|
|
1628
1766
|
}, r.id)),
|
|
1629
|
-
/* @__PURE__ */
|
|
1767
|
+
/* @__PURE__ */ A("div", { children: /* @__PURE__ */ A(x, {
|
|
1630
1768
|
label: n.consoleNewKey,
|
|
1631
1769
|
variant: "outline-secondary",
|
|
1632
1770
|
onClick: async () => {
|
|
@@ -1639,14 +1777,14 @@ function ae({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
|
|
|
1639
1777
|
"accounts",
|
|
1640
1778
|
"act-as-user"
|
|
1641
1779
|
]
|
|
1642
|
-
})).key), await
|
|
1780
|
+
})).key), await y();
|
|
1643
1781
|
}
|
|
1644
1782
|
}) }),
|
|
1645
|
-
/* @__PURE__ */
|
|
1783
|
+
/* @__PURE__ */ A("h4", {
|
|
1646
1784
|
className: "text-sm font-semibold",
|
|
1647
1785
|
children: n.consoleAccounts
|
|
1648
1786
|
}),
|
|
1649
|
-
/* @__PURE__ */
|
|
1787
|
+
/* @__PURE__ */ A(H, {
|
|
1650
1788
|
client: v,
|
|
1651
1789
|
scope: "tenant",
|
|
1652
1790
|
locale: r,
|
|
@@ -1654,18 +1792,18 @@ function ae({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
|
|
|
1654
1792
|
})
|
|
1655
1793
|
]
|
|
1656
1794
|
}),
|
|
1657
|
-
g && /* @__PURE__ */
|
|
1795
|
+
g && /* @__PURE__ */ A(C, {
|
|
1658
1796
|
title: n.consoleRemoveTenant,
|
|
1659
1797
|
danger: !0,
|
|
1660
1798
|
onClose: () => _(!1),
|
|
1661
1799
|
onYes: async () => (await e.platform.removeTenant(t.id), _(!1), await a(), !0),
|
|
1662
|
-
children:
|
|
1800
|
+
children: L(n.consoleRemoveTenantConfirm, { name: t.name })
|
|
1663
1801
|
})
|
|
1664
1802
|
]
|
|
1665
1803
|
});
|
|
1666
1804
|
}
|
|
1667
1805
|
var $ = (e) => e.toUpperCase().replace(/[^A-Z0-9]/g, "");
|
|
1668
|
-
function
|
|
1806
|
+
function fe({ client: e, t, approve: n, onAnswered: r }) {
|
|
1669
1807
|
let [i, a] = d(null), [o, s] = d(null), u = c(async () => {
|
|
1670
1808
|
try {
|
|
1671
1809
|
let t = await e.pairingRequests(), r = n ? $(n) : "";
|
|
@@ -1678,22 +1816,22 @@ function oe({ client: e, t, approve: n, onAnswered: r }) {
|
|
|
1678
1816
|
u();
|
|
1679
1817
|
let e = setInterval(() => void u(), 5e3);
|
|
1680
1818
|
return () => clearInterval(e);
|
|
1681
|
-
}, [u]), !n && !i?.length && !o ? null : /* @__PURE__ */
|
|
1819
|
+
}, [u]), !n && !i?.length && !o ? null : /* @__PURE__ */ A(h, {
|
|
1682
1820
|
title: t.consoleRequests,
|
|
1683
1821
|
loading: i === null,
|
|
1684
1822
|
loaderMinHeight: 80,
|
|
1685
|
-
children: /* @__PURE__ */
|
|
1823
|
+
children: /* @__PURE__ */ j("div", {
|
|
1686
1824
|
className: "flex flex-col gap-3",
|
|
1687
1825
|
children: [
|
|
1688
|
-
/* @__PURE__ */
|
|
1826
|
+
/* @__PURE__ */ A("p", {
|
|
1689
1827
|
className: "text-sm text-muted-foreground",
|
|
1690
1828
|
children: t.consoleRequestsHint
|
|
1691
1829
|
}),
|
|
1692
|
-
o && /* @__PURE__ */
|
|
1830
|
+
o && /* @__PURE__ */ A(p, {
|
|
1693
1831
|
variant: o.variant,
|
|
1694
1832
|
children: o.text
|
|
1695
1833
|
}),
|
|
1696
|
-
i?.length === 0 && !o && /* @__PURE__ */
|
|
1834
|
+
i?.length === 0 && !o && /* @__PURE__ */ A("p", {
|
|
1697
1835
|
className: "text-sm text-muted-foreground",
|
|
1698
1836
|
children: t.consoleRequestsEmpty
|
|
1699
1837
|
}),
|
|
@@ -1702,42 +1840,42 @@ function oe({ client: e, t, approve: n, onAnswered: r }) {
|
|
|
1702
1840
|
let a = await e.answerPairing(i.code, n);
|
|
1703
1841
|
s(n ? {
|
|
1704
1842
|
variant: "success",
|
|
1705
|
-
text:
|
|
1843
|
+
text: L(t.consoleApproved, { name: a.name })
|
|
1706
1844
|
} : {
|
|
1707
1845
|
variant: "info",
|
|
1708
1846
|
text: t.consoleDenied
|
|
1709
1847
|
}), await u(), await r();
|
|
1710
1848
|
};
|
|
1711
|
-
return /* @__PURE__ */
|
|
1849
|
+
return /* @__PURE__ */ j("div", {
|
|
1712
1850
|
className: `flex flex-col gap-2 rounded-md border p-3 ${a ? "border-primary" : "border-border"}`,
|
|
1713
1851
|
children: [
|
|
1714
|
-
a && /* @__PURE__ */
|
|
1852
|
+
a && /* @__PURE__ */ A(m, {
|
|
1715
1853
|
variant: "primary",
|
|
1716
1854
|
children: t.consoleRequestMatch
|
|
1717
1855
|
}),
|
|
1718
|
-
/* @__PURE__ */
|
|
1856
|
+
/* @__PURE__ */ A("div", {
|
|
1719
1857
|
className: "font-mono text-2xl font-semibold tracking-widest",
|
|
1720
1858
|
children: i.code
|
|
1721
1859
|
}),
|
|
1722
|
-
/* @__PURE__ */
|
|
1860
|
+
/* @__PURE__ */ A("p", {
|
|
1723
1861
|
className: "text-sm",
|
|
1724
|
-
children:
|
|
1862
|
+
children: L(t.consoleRequestFrom, {
|
|
1725
1863
|
name: i.name,
|
|
1726
1864
|
from: i.from ?? "?",
|
|
1727
1865
|
at: Q(i.createdAt)
|
|
1728
1866
|
})
|
|
1729
1867
|
}),
|
|
1730
|
-
/* @__PURE__ */
|
|
1868
|
+
/* @__PURE__ */ A("p", {
|
|
1731
1869
|
className: "text-sm text-muted-foreground",
|
|
1732
|
-
children: i.project ?
|
|
1870
|
+
children: i.project ? L(t.consoleRequestProject, { project: i.project }) : t.consoleRequestAll
|
|
1733
1871
|
}),
|
|
1734
|
-
/* @__PURE__ */
|
|
1872
|
+
/* @__PURE__ */ j("div", {
|
|
1735
1873
|
className: "flex flex-wrap gap-2",
|
|
1736
|
-
children: [/* @__PURE__ */
|
|
1874
|
+
children: [/* @__PURE__ */ A(x, {
|
|
1737
1875
|
label: t.consoleApprove,
|
|
1738
1876
|
variant: "primary",
|
|
1739
1877
|
onClick: () => o(!0)
|
|
1740
|
-
}), /* @__PURE__ */
|
|
1878
|
+
}), /* @__PURE__ */ A(x, {
|
|
1741
1879
|
label: t.consoleDeny,
|
|
1742
1880
|
variant: "outline-danger",
|
|
1743
1881
|
onClick: () => o(!1)
|
|
@@ -1750,6 +1888,6 @@ function oe({ client: e, t, approve: n, onAnswered: r }) {
|
|
|
1750
1888
|
})
|
|
1751
1889
|
});
|
|
1752
1890
|
}
|
|
1753
|
-
export {
|
|
1891
|
+
export { q as AddRunner, W as InstallGuide, H as RunnerAccounts, le as RunnerConsole, ie as RunnersSettings, L as fill, F as runnerTexts, I as textsFor };
|
|
1754
1892
|
|
|
1755
1893
|
//# sourceMappingURL=ui.mjs.map
|