@llmnative/runner 1.4.0 → 2.0.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/README.md +10 -1
- package/dist/client.js +2 -2
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +42 -23
- package/dist/client.mjs.map +1 -1
- package/dist/setup-app/assets/{NetworkCanvasImpl-DIYuzg6x-Be3lb8aE.js → NetworkCanvasImpl--7M6QHBl-BJlQ1Jxm.js} +1 -1
- package/dist/setup-app/assets/{index-C8qoeNuR.js → index-CdEnLJdB.js} +3 -3
- package/dist/setup-app/assets/{index.es-DuFO70Jd.js → index.es-CyY_APIX.js} +1 -1
- package/dist/setup-app/assets/{lucide-react-BhRrMOuZ.js → lucide-react-nUjfsPoS.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 +68 -7
- package/dist/types/ui/texts.d.ts +45 -0
- package/dist/ui.js +3 -3
- package/dist/ui.js.map +1 -1
- package/dist/ui.mjs +560 -475
- package/dist/ui.mjs.map +1 -1
- package/install/coolify.yaml +2 -2
- package/install/install.sh +1 -1
- package/llms.txt +1 -0
- package/openapi/v1.yaml +38 -9
- 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 { Fragment 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.",
|
|
@@ -34,6 +34,11 @@ var M = {
|
|
|
34
34
|
termsNote: "A Pro or Max subscription is personal: connect only your own.",
|
|
35
35
|
accountsSection: "{name} ({count})",
|
|
36
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",
|
|
37
42
|
accountsAdd: "Add subscription",
|
|
38
43
|
accountsAvailable: "Available",
|
|
39
44
|
accountsAddedOn: "Added on {date}",
|
|
@@ -164,6 +169,16 @@ var M = {
|
|
|
164
169
|
consolePlatformSave: "Save",
|
|
165
170
|
consolePlatformRevokeConfirm: "Disconnect {name}? It will no longer reach this runner.",
|
|
166
171
|
consoleRequestMatch: "The request you opened",
|
|
172
|
+
consoleRequestApp: "For the app «{app}»: it will see the organizations it makes and those you grant it.",
|
|
173
|
+
consolePlatformApp: "app «{app}»",
|
|
174
|
+
consoleGrants: "Organizations asked for",
|
|
175
|
+
consoleGrantsHint: "An app asked for an organization that another app made on this runner. Granting it, the app uses its accounts too.",
|
|
176
|
+
consoleGrantFrom: "{name} ({app}) asks for the organization «{tenant}», at {at}",
|
|
177
|
+
consoleGrantApproved: "{name} now sees «{tenant}».",
|
|
178
|
+
consoleGrantDenied: "Refused.",
|
|
179
|
+
consoleTenantPlatforms: "Apps that see it",
|
|
180
|
+
consoleTenantPlatformsNone: "Only the admin and the platforms connected before 2.0.",
|
|
181
|
+
consoleUngrant: "Take away",
|
|
167
182
|
consoleApprove: "Approve",
|
|
168
183
|
consoleDeny: "Refuse",
|
|
169
184
|
consoleApproved: "Approved: {name} is connected.",
|
|
@@ -171,7 +186,7 @@ var M = {
|
|
|
171
186
|
consoleRemember: "Remember on this browser",
|
|
172
187
|
close: "Close",
|
|
173
188
|
cancel: "Cancel"
|
|
174
|
-
},
|
|
189
|
+
}, P = {
|
|
175
190
|
accountsTitleUser: "I miei abbonamenti",
|
|
176
191
|
accountsTitleTenant: "Abbonamenti del tenant",
|
|
177
192
|
accountsIntroUser: "Collega il tuo abbonamento: lo usano solo le tue richieste. Senza, si usano le API key del workspace.",
|
|
@@ -200,6 +215,11 @@ var M = {
|
|
|
200
215
|
termsNote: "Un abbonamento Pro o Max è personale: collega solo il tuo.",
|
|
201
216
|
accountsSection: "{name} ({count})",
|
|
202
217
|
accountsByUse: "API key dei provider a consumo ({count})",
|
|
218
|
+
boxClaudeCode: "Un abbonamento Claude (Pro, Max, Team): si accede con Anthropic.",
|
|
219
|
+
boxOpencodeGo: "L'abbonamento OpenCode Go, con la sua API key.",
|
|
220
|
+
boxByUse: "A consumo, con una API key di {provider}.",
|
|
221
|
+
groupSubscriptions: "Abbonamenti",
|
|
222
|
+
groupUsage: "A consumo",
|
|
203
223
|
accountsAdd: "Aggiungi abbonamento",
|
|
204
224
|
accountsAvailable: "Disponibile",
|
|
205
225
|
accountsAddedOn: "Aggiunto il {date}",
|
|
@@ -330,6 +350,16 @@ var M = {
|
|
|
330
350
|
consolePlatformSave: "Salva",
|
|
331
351
|
consolePlatformRevokeConfirm: "Scollegare {name}? Non raggiungerà più questo runner.",
|
|
332
352
|
consoleRequestMatch: "La richiesta che hai aperto",
|
|
353
|
+
consoleRequestApp: "Per l'app «{app}»: vedrà le organizzazioni che crea e quelle che le concedi.",
|
|
354
|
+
consolePlatformApp: "app «{app}»",
|
|
355
|
+
consoleGrants: "Organizzazioni richieste",
|
|
356
|
+
consoleGrantsHint: "Un'app ha chiesto un'organizzazione che un'altra app ha creato su questo runner. Concedendola, l'app usa anche i suoi account.",
|
|
357
|
+
consoleGrantFrom: "{name} ({app}) chiede l'organizzazione «{tenant}», alle {at}",
|
|
358
|
+
consoleGrantApproved: "{name} ora vede «{tenant}».",
|
|
359
|
+
consoleGrantDenied: "Rifiutata.",
|
|
360
|
+
consoleTenantPlatforms: "App che la vedono",
|
|
361
|
+
consoleTenantPlatformsNone: "Solo l'admin e le piattaforme collegate prima della 2.0.",
|
|
362
|
+
consoleUngrant: "Togli",
|
|
333
363
|
consoleApprove: "Approva",
|
|
334
364
|
consoleDeny: "Rifiuta",
|
|
335
365
|
consoleApproved: "Approvata: {name} è collegato.",
|
|
@@ -337,18 +367,18 @@ var M = {
|
|
|
337
367
|
consoleRemember: "Ricorda su questo browser",
|
|
338
368
|
close: "Chiudi",
|
|
339
369
|
cancel: "Annulla"
|
|
340
|
-
},
|
|
341
|
-
en:
|
|
342
|
-
it:
|
|
370
|
+
}, F = {
|
|
371
|
+
en: N,
|
|
372
|
+
it: P
|
|
343
373
|
};
|
|
344
|
-
function
|
|
345
|
-
let n = e && e.toLowerCase().startsWith("it") ?
|
|
374
|
+
function I(e, t) {
|
|
375
|
+
let n = e && e.toLowerCase().startsWith("it") ? P : N;
|
|
346
376
|
return t ? {
|
|
347
377
|
...n,
|
|
348
378
|
...t
|
|
349
379
|
} : n;
|
|
350
380
|
}
|
|
351
|
-
var
|
|
381
|
+
var L = (e, t) => e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : e), R = {
|
|
352
382
|
"claude-code": "Claude Code",
|
|
353
383
|
"opencode-go": "OpenCode Go",
|
|
354
384
|
opencode: "OpenCode Zen",
|
|
@@ -358,264 +388,202 @@ var I = (e, t) => e.replace(/\{(\w+)\}/g, (e, n) => n in t ? String(t[n]) : e),
|
|
|
358
388
|
mistral: "Mistral",
|
|
359
389
|
deepseek: "DeepSeek",
|
|
360
390
|
openrouter: "OpenRouter"
|
|
361
|
-
},
|
|
391
|
+
}, 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, {
|
|
362
392
|
dateStyle: "short",
|
|
363
393
|
timeStyle: "short"
|
|
364
394
|
});
|
|
365
|
-
function
|
|
366
|
-
let
|
|
367
|
-
...
|
|
395
|
+
function H({ client: n, scope: r, locale: i, texts: a, onChange: o, providers: s, renderProvider: u, onStack: g }) {
|
|
396
|
+
let v = I(i, a), y = s ?? (r === "tenant" ? [
|
|
397
|
+
...z,
|
|
368
398
|
"opencode",
|
|
369
399
|
...e
|
|
370
|
-
] :
|
|
400
|
+
] : z), [b, x] = d(null), [C, w] = d(null), [T, E] = d(null), [D, O] = d(!1), k = (e) => {
|
|
401
|
+
E(e), g?.(e !== null);
|
|
402
|
+
}, M = c(async () => {
|
|
371
403
|
try {
|
|
372
404
|
let { accounts: e } = await n.accounts.list();
|
|
373
|
-
return
|
|
405
|
+
return x(e), w(null), e;
|
|
374
406
|
} catch (e) {
|
|
375
|
-
return
|
|
407
|
+
return w(e instanceof t ? e.code : String(e)), x([]), [];
|
|
376
408
|
}
|
|
377
409
|
}, [n]);
|
|
378
410
|
l(() => {
|
|
379
|
-
|
|
380
|
-
}, [
|
|
381
|
-
let
|
|
382
|
-
let t = e ?? await
|
|
383
|
-
e &&
|
|
384
|
-
};
|
|
385
|
-
return /* @__PURE__ */
|
|
386
|
-
title: r === "user" ?
|
|
387
|
-
loading:
|
|
411
|
+
M();
|
|
412
|
+
}, [M]);
|
|
413
|
+
let N = async (e) => {
|
|
414
|
+
let t = e ?? await M();
|
|
415
|
+
e && x(e), o?.(t);
|
|
416
|
+
}, 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) });
|
|
417
|
+
return /* @__PURE__ */ j(h, {
|
|
418
|
+
title: r === "user" ? v.accountsTitleUser : v.accountsTitleTenant,
|
|
419
|
+
loading: b === null,
|
|
388
420
|
loaderMinHeight: 120,
|
|
389
|
-
children: /* @__PURE__ */
|
|
390
|
-
className: "flex flex-col gap-
|
|
421
|
+
children: [/* @__PURE__ */ j("div", {
|
|
422
|
+
className: "flex flex-col gap-4",
|
|
391
423
|
children: [
|
|
392
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ A("p", {
|
|
393
425
|
className: "text-sm text-muted-foreground",
|
|
394
|
-
children: r === "user" ?
|
|
426
|
+
children: r === "user" ? v.accountsIntroUser : v.accountsIntroTenant
|
|
395
427
|
}),
|
|
396
|
-
|
|
428
|
+
C && /* @__PURE__ */ A(p, {
|
|
397
429
|
variant: "danger",
|
|
398
|
-
children:
|
|
430
|
+
children: L(v.error, { error: C })
|
|
399
431
|
}),
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
432
|
+
b && /* @__PURE__ */ A(_, {
|
|
433
|
+
items: y.map((e) => {
|
|
434
|
+
let t = P(e), n = t.filter((e) => e.noCreditUntil);
|
|
435
|
+
return {
|
|
436
|
+
id: e,
|
|
437
|
+
label: B(e),
|
|
438
|
+
description: F(e),
|
|
439
|
+
icon: e === "claude-code" ? "user" : "key-round",
|
|
440
|
+
group: z.includes(e) ? "subscription" : "usage",
|
|
441
|
+
count: t.length,
|
|
442
|
+
status: t.length > 0 && n.length === t.length ? /* @__PURE__ */ A(m, {
|
|
443
|
+
variant: "warning",
|
|
444
|
+
children: L(v.accountsNoCredit, { at: ee(n.map((e) => e.noCreditUntil).sort()[0]) })
|
|
445
|
+
}) : void 0
|
|
446
|
+
};
|
|
447
|
+
}),
|
|
448
|
+
titles: {
|
|
449
|
+
subscription: v.groupSubscriptions,
|
|
450
|
+
usage: v.groupUsage
|
|
451
|
+
},
|
|
452
|
+
onOpen: (e) => k(e)
|
|
416
453
|
}),
|
|
417
|
-
/* @__PURE__ */
|
|
454
|
+
/* @__PURE__ */ A("p", {
|
|
418
455
|
className: "text-xs text-muted-foreground",
|
|
419
|
-
children:
|
|
456
|
+
children: v.termsNote
|
|
420
457
|
})
|
|
421
458
|
]
|
|
422
|
-
})
|
|
459
|
+
}), T && b && /* @__PURE__ */ A(S, {
|
|
460
|
+
title: B(T),
|
|
461
|
+
position: "right",
|
|
462
|
+
size: "lg",
|
|
463
|
+
stackedBehind: D,
|
|
464
|
+
onClose: () => k(null),
|
|
465
|
+
footer: /* @__PURE__ */ A(f, {
|
|
466
|
+
variant: "link",
|
|
467
|
+
label: v.close,
|
|
468
|
+
onClick: () => k(null)
|
|
469
|
+
}),
|
|
470
|
+
children: /* @__PURE__ */ A(te, {
|
|
471
|
+
client: n,
|
|
472
|
+
t: v,
|
|
473
|
+
provider: T,
|
|
474
|
+
accounts: P(T),
|
|
475
|
+
onChanged: N,
|
|
476
|
+
onStack: O,
|
|
477
|
+
extra: u?.(T, P(T))
|
|
478
|
+
})
|
|
479
|
+
})]
|
|
423
480
|
});
|
|
424
481
|
}
|
|
425
|
-
function
|
|
426
|
-
let c =
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
}) : I(n.accountsByUse, { count: String(i.length) }), [u, h] = d(!1), [g, _] = d(null), v = (e) => {
|
|
430
|
-
_(e), o?.(e !== null);
|
|
431
|
-
}, [y, b] = d(null), [S, C] = d(null), T = (e, t) => e.label || I(n.accountsUnnamed, { n: String(t + 1) }), E = (e) => C(I(n.error, { error: e instanceof t ? e.code : String(e) }));
|
|
432
|
-
return /* @__PURE__ */ A("section", {
|
|
433
|
-
className: "flex flex-col gap-3",
|
|
482
|
+
function te({ client: e, t: n, provider: r, accounts: i, onChanged: a, onStack: o, extra: s }) {
|
|
483
|
+
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);
|
|
484
|
+
return /* @__PURE__ */ j("div", {
|
|
485
|
+
className: "flex flex-col gap-5",
|
|
434
486
|
children: [
|
|
435
|
-
/* @__PURE__ */ A("
|
|
436
|
-
className: "
|
|
437
|
-
children:
|
|
438
|
-
className: "text-sm font-semibold",
|
|
439
|
-
children: l
|
|
440
|
-
}), !u && /* @__PURE__ */ k(f, {
|
|
441
|
-
icon: "plus",
|
|
442
|
-
variant: "outline-primary",
|
|
443
|
-
label: c ? n.accountsAdd : n.keyConnect,
|
|
444
|
-
onClick: () => {
|
|
445
|
-
C(null), h(!0);
|
|
446
|
-
}
|
|
447
|
-
})]
|
|
487
|
+
/* @__PURE__ */ A("p", {
|
|
488
|
+
className: "text-sm text-muted-foreground",
|
|
489
|
+
children: r === "claude-code" ? n.boxClaudeCode : r === "opencode-go" ? n.boxOpencodeGo : L(n.boxByUse, { provider: B(r) })
|
|
448
490
|
}),
|
|
449
|
-
|
|
491
|
+
c && /* @__PURE__ */ A(p, {
|
|
450
492
|
variant: "danger",
|
|
451
|
-
children:
|
|
493
|
+
children: c
|
|
452
494
|
}),
|
|
453
|
-
/* @__PURE__ */
|
|
454
|
-
items: i
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
495
|
+
/* @__PURE__ */ A(v, {
|
|
496
|
+
items: i.map((e) => ({
|
|
497
|
+
id: e.id,
|
|
498
|
+
label: e.label,
|
|
499
|
+
icon: e.provider === "claude-code" ? "user" : "key-round",
|
|
500
|
+
meta: L(n.accountsAddedOn, { date: V(e.at) }),
|
|
501
|
+
exhaustedUntil: e.noCreditUntil
|
|
502
|
+
})),
|
|
503
|
+
title: L(n.accountsSection, {
|
|
504
|
+
name: B(r),
|
|
505
|
+
count: String(i.length)
|
|
462
506
|
}),
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
variant: "warning",
|
|
472
|
-
children: I(n.accountsNoCredit, { at: ee(e.noCreditUntil) })
|
|
473
|
-
}) : /* @__PURE__ */ k(m, {
|
|
474
|
-
variant: "success",
|
|
475
|
-
children: n.accountsAvailable
|
|
476
|
-
}),
|
|
477
|
-
trailing: /* @__PURE__ */ A("div", {
|
|
478
|
-
className: "flex items-center gap-1",
|
|
479
|
-
children: [/* @__PURE__ */ k(f, {
|
|
480
|
-
icon: "pencil",
|
|
481
|
-
variant: "link",
|
|
482
|
-
ariaLabel: I(n.accountsRenameAria, { name: T(e, t) }),
|
|
483
|
-
onClick: () => v(e)
|
|
484
|
-
}), /* @__PURE__ */ k(f, {
|
|
485
|
-
icon: "trash-2",
|
|
486
|
-
variant: "link",
|
|
487
|
-
ariaLabel: I(n.accountsRemoveAria, { name: T(e, t) }),
|
|
488
|
-
onClick: () => b(e)
|
|
489
|
-
})]
|
|
490
|
-
})
|
|
491
|
-
})
|
|
492
|
-
}),
|
|
493
|
-
c && i.length > 1 && /* @__PURE__ */ k("p", {
|
|
494
|
-
className: "text-xs text-muted-foreground",
|
|
495
|
-
children: n.accountsOrderHint
|
|
496
|
-
}),
|
|
497
|
-
u && (c === "claude-code" ? /* @__PURE__ */ k(ne, {
|
|
498
|
-
client: e,
|
|
499
|
-
t: n,
|
|
500
|
-
others: i.length,
|
|
501
|
-
onDone: async () => {
|
|
502
|
-
h(!1), await a();
|
|
507
|
+
emptyText: n.accountsEmpty,
|
|
508
|
+
unnamed: n.accountsUnnamed,
|
|
509
|
+
orderHint: n.accountsOrderHint,
|
|
510
|
+
addLabel: r === "claude-code" ? n.accountsAdd : n.keyConnect,
|
|
511
|
+
onStack: o,
|
|
512
|
+
onReorder: (t) => e.accounts.order(r, t).then((e) => a(e), u),
|
|
513
|
+
onRename: async (t, n) => {
|
|
514
|
+
await a(await e.accounts.rename(r, t, n));
|
|
503
515
|
},
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
client: e,
|
|
507
|
-
t: n,
|
|
508
|
-
providers: c ? [c] : r,
|
|
509
|
-
onDone: async () => {
|
|
510
|
-
h(!1), await a();
|
|
516
|
+
onRemove: async (t) => {
|
|
517
|
+
await e.accounts.remove(f(t).provider, t).catch(u), await a();
|
|
511
518
|
},
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
519
|
+
renderAdd: (t) => r === "claude-code" ? /* @__PURE__ */ A(ne, {
|
|
520
|
+
client: e,
|
|
521
|
+
t: n,
|
|
522
|
+
others: i.length,
|
|
523
|
+
onDone: async () => {
|
|
524
|
+
t(), await a();
|
|
525
|
+
},
|
|
526
|
+
onCancel: t
|
|
527
|
+
}) : /* @__PURE__ */ A(re, {
|
|
528
|
+
client: e,
|
|
529
|
+
t: n,
|
|
530
|
+
providers: [r],
|
|
531
|
+
onDone: async () => {
|
|
532
|
+
t(), await a();
|
|
533
|
+
},
|
|
534
|
+
onCancel: t
|
|
535
|
+
})
|
|
523
536
|
}),
|
|
524
|
-
|
|
525
|
-
title: n.accountsRemove,
|
|
526
|
-
danger: !0,
|
|
527
|
-
onClose: () => b(null),
|
|
528
|
-
onYes: async () => (await e.accounts.remove(y.provider, y.id).catch(() => !1), b(null), await a(), !0),
|
|
529
|
-
children: I(n.accountsRemoveConfirm, { name: y.label ?? z(y.provider) })
|
|
530
|
-
})
|
|
537
|
+
s
|
|
531
538
|
]
|
|
532
539
|
});
|
|
533
540
|
}
|
|
534
|
-
function te({ client: e, t: n, account: r, onClose: i, onDone: a }) {
|
|
535
|
-
let [o, s] = d(r.label ?? ""), [c, l] = d(null);
|
|
536
|
-
return /* @__PURE__ */ A(b, {
|
|
537
|
-
title: n.accountsRenameTitle,
|
|
538
|
-
position: "right",
|
|
539
|
-
size: "sm",
|
|
540
|
-
onClose: i,
|
|
541
|
-
footer: /* @__PURE__ */ A(O, { children: [/* @__PURE__ */ k(f, {
|
|
542
|
-
variant: "link",
|
|
543
|
-
label: n.cancel,
|
|
544
|
-
onClick: i
|
|
545
|
-
}), /* @__PURE__ */ k(y, {
|
|
546
|
-
variant: "primary",
|
|
547
|
-
label: n.accountsSave,
|
|
548
|
-
onClick: async () => {
|
|
549
|
-
try {
|
|
550
|
-
await a(await e.accounts.rename(r.provider, r.id, o.trim()));
|
|
551
|
-
} catch (e) {
|
|
552
|
-
l(I(n.error, { error: e instanceof t ? e.code : String(e) }));
|
|
553
|
-
}
|
|
554
|
-
}
|
|
555
|
-
})] }),
|
|
556
|
-
children: [c && /* @__PURE__ */ k(p, {
|
|
557
|
-
variant: "danger",
|
|
558
|
-
children: c
|
|
559
|
-
}), /* @__PURE__ */ k(v, {
|
|
560
|
-
appearance: "empty",
|
|
561
|
-
showNotice: !1,
|
|
562
|
-
defaultValues: { label: r.label ?? "" },
|
|
563
|
-
onSubmit: () => !1,
|
|
564
|
-
children: /* @__PURE__ */ k(T, {
|
|
565
|
-
name: "label",
|
|
566
|
-
label: n.accountsName,
|
|
567
|
-
placeholder: n.claudeLabelPlaceholder,
|
|
568
|
-
onChange: ({ value: e }) => s(String(e ?? ""))
|
|
569
|
-
})
|
|
570
|
-
})]
|
|
571
|
-
});
|
|
572
|
-
}
|
|
573
541
|
function ne({ client: e, t: n, others: r, onDone: i, onCancel: a }) {
|
|
574
|
-
let [o, s] = d(!1), [c, u] = d(null), [m, g] = d(!1), [_,
|
|
542
|
+
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);
|
|
575
543
|
return l(() => {
|
|
576
544
|
if (o) return;
|
|
577
545
|
let t = !1;
|
|
578
|
-
return e.accounts.startClaudeLogin().then(({ url: e }) => !t && u(e)).catch(() => !t &&
|
|
546
|
+
return e.accounts.startClaudeLogin().then(({ url: e }) => !t && u(e)).catch(() => !t && O(n.claudeNoLink)), () => {
|
|
579
547
|
t = !0;
|
|
580
548
|
};
|
|
581
549
|
}, [
|
|
582
550
|
e,
|
|
583
551
|
n,
|
|
584
552
|
o
|
|
585
|
-
]), /* @__PURE__ */
|
|
553
|
+
]), /* @__PURE__ */ j(h, {
|
|
586
554
|
headerClassName: "px-4 py-3",
|
|
587
555
|
bodyClassName: "flex flex-col gap-3",
|
|
588
|
-
header: /* @__PURE__ */
|
|
556
|
+
header: /* @__PURE__ */ A("span", {
|
|
589
557
|
className: "text-sm font-medium",
|
|
590
558
|
children: n.claudeConnect
|
|
591
559
|
}),
|
|
592
560
|
children: [
|
|
593
|
-
r > 0 && /* @__PURE__ */
|
|
561
|
+
r > 0 && /* @__PURE__ */ A(p, {
|
|
594
562
|
variant: "warning",
|
|
595
563
|
children: n.claudeMultiWarning
|
|
596
564
|
}),
|
|
597
|
-
D && /* @__PURE__ */
|
|
565
|
+
D && /* @__PURE__ */ A(p, {
|
|
598
566
|
variant: "danger",
|
|
599
567
|
children: D
|
|
600
568
|
}),
|
|
601
|
-
o ? /* @__PURE__ */
|
|
569
|
+
o ? /* @__PURE__ */ A("p", {
|
|
602
570
|
className: "text-sm",
|
|
603
571
|
children: n.claudeTokenIntro
|
|
604
|
-
}) : /* @__PURE__ */
|
|
605
|
-
/* @__PURE__ */
|
|
572
|
+
}) : /* @__PURE__ */ j(k, { children: [
|
|
573
|
+
/* @__PURE__ */ A("p", {
|
|
606
574
|
className: "text-sm",
|
|
607
575
|
children: n.claudeStep1
|
|
608
576
|
}),
|
|
609
|
-
/* @__PURE__ */
|
|
577
|
+
/* @__PURE__ */ j("div", {
|
|
610
578
|
className: "grid grid-cols-2 gap-2",
|
|
611
|
-
children: [/* @__PURE__ */
|
|
579
|
+
children: [/* @__PURE__ */ A(f, {
|
|
612
580
|
icon: "external-link",
|
|
613
581
|
variant: "outline-primary",
|
|
614
582
|
className: "w-full justify-center whitespace-nowrap",
|
|
615
583
|
label: n.claudeOpen,
|
|
616
584
|
disabled: !c,
|
|
617
585
|
onClick: () => c && window.open(c, "_blank", "noopener,noreferrer")
|
|
618
|
-
}), /* @__PURE__ */
|
|
586
|
+
}), /* @__PURE__ */ A(f, {
|
|
619
587
|
icon: m ? "check" : "copy",
|
|
620
588
|
variant: "outline-secondary",
|
|
621
589
|
className: "w-full justify-center whitespace-nowrap",
|
|
@@ -626,58 +594,58 @@ function ne({ client: e, t: n, others: r, onDone: i, onCancel: a }) {
|
|
|
626
594
|
}
|
|
627
595
|
})]
|
|
628
596
|
}),
|
|
629
|
-
/* @__PURE__ */
|
|
597
|
+
/* @__PURE__ */ A("p", {
|
|
630
598
|
className: "text-sm",
|
|
631
599
|
children: n.claudeStep2
|
|
632
600
|
})
|
|
633
601
|
] }),
|
|
634
|
-
/* @__PURE__ */
|
|
602
|
+
/* @__PURE__ */ j(b, {
|
|
635
603
|
appearance: "empty",
|
|
636
604
|
showNotice: !1,
|
|
637
605
|
onSubmit: () => !1,
|
|
638
|
-
children: [o ? /* @__PURE__ */
|
|
606
|
+
children: [o ? /* @__PURE__ */ A(w, {
|
|
639
607
|
name: "token",
|
|
640
608
|
label: n.claudeToken,
|
|
641
609
|
placeholder: "sk-ant-oat01-…",
|
|
642
610
|
autoComplete: "off",
|
|
643
|
-
onChange: ({ value: e }) =>
|
|
644
|
-
}) : /* @__PURE__ */
|
|
611
|
+
onChange: ({ value: e }) => S(String(e ?? ""))
|
|
612
|
+
}) : /* @__PURE__ */ A(E, {
|
|
645
613
|
name: "code",
|
|
646
614
|
label: n.claudeCode,
|
|
647
615
|
autoComplete: "off",
|
|
648
|
-
onChange: ({ value: e }) =>
|
|
649
|
-
}), /* @__PURE__ */
|
|
616
|
+
onChange: ({ value: e }) => v(String(e ?? ""))
|
|
617
|
+
}), /* @__PURE__ */ A(E, {
|
|
650
618
|
name: "label",
|
|
651
619
|
label: n.accountsName,
|
|
652
620
|
placeholder: n.claudeLabelPlaceholder,
|
|
653
|
-
onChange: ({ value: e }) =>
|
|
621
|
+
onChange: ({ value: e }) => T(String(e ?? ""))
|
|
654
622
|
})]
|
|
655
623
|
}),
|
|
656
|
-
/* @__PURE__ */
|
|
624
|
+
/* @__PURE__ */ A(f, {
|
|
657
625
|
variant: "link",
|
|
658
626
|
className: "h-auto self-start p-0 text-xs",
|
|
659
627
|
label: o ? n.claudeBackToLogin : n.claudeManual,
|
|
660
628
|
onClick: () => {
|
|
661
|
-
s(!o),
|
|
629
|
+
s(!o), O(null);
|
|
662
630
|
}
|
|
663
631
|
}),
|
|
664
|
-
/* @__PURE__ */
|
|
632
|
+
/* @__PURE__ */ j("div", {
|
|
665
633
|
className: "flex flex-wrap justify-end gap-2",
|
|
666
|
-
children: [/* @__PURE__ */
|
|
634
|
+
children: [/* @__PURE__ */ A(f, {
|
|
667
635
|
label: n.cancel,
|
|
668
636
|
variant: "link",
|
|
669
637
|
onClick: a
|
|
670
|
-
}), /* @__PURE__ */
|
|
638
|
+
}), /* @__PURE__ */ A(x, {
|
|
671
639
|
label: n.claudeFinish,
|
|
672
640
|
variant: "primary",
|
|
673
|
-
disabled: o ? !
|
|
641
|
+
disabled: o ? !y.trim() : !c || !_.trim(),
|
|
674
642
|
onClick: async () => {
|
|
675
|
-
|
|
643
|
+
O(null);
|
|
676
644
|
try {
|
|
677
|
-
o ? await e.accounts.addClaudeToken(
|
|
645
|
+
o ? await e.accounts.addClaudeToken(y.trim(), C.trim() || void 0) : await e.accounts.finishClaudeLogin(_.trim(), C.trim() || void 0), i();
|
|
678
646
|
} catch (r) {
|
|
679
647
|
let i = r instanceof t && r.code === "refused";
|
|
680
|
-
|
|
648
|
+
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)));
|
|
681
649
|
}
|
|
682
650
|
}
|
|
683
651
|
})]
|
|
@@ -687,53 +655,53 @@ function ne({ client: e, t: n, others: r, onDone: i, onCancel: a }) {
|
|
|
687
655
|
}
|
|
688
656
|
function re({ client: e, t: n, providers: r, onDone: i, onCancel: a }) {
|
|
689
657
|
let [o, s] = d(r[0]), [c, l] = d(""), [u, m] = d(""), [g, _] = d(null);
|
|
690
|
-
return /* @__PURE__ */
|
|
658
|
+
return /* @__PURE__ */ j(h, {
|
|
691
659
|
headerClassName: "px-4 py-3",
|
|
692
660
|
bodyClassName: "flex flex-col gap-3",
|
|
693
|
-
header: /* @__PURE__ */
|
|
661
|
+
header: /* @__PURE__ */ A("span", {
|
|
694
662
|
className: "text-sm font-medium",
|
|
695
|
-
children: r.length === 1 ?
|
|
663
|
+
children: r.length === 1 ? L(n.keyAddOf, { provider: B(r[0]) }) : n.keyConnect
|
|
696
664
|
}),
|
|
697
665
|
children: [
|
|
698
|
-
g && /* @__PURE__ */
|
|
666
|
+
g && /* @__PURE__ */ A(p, {
|
|
699
667
|
variant: "danger",
|
|
700
668
|
children: g
|
|
701
669
|
}),
|
|
702
|
-
/* @__PURE__ */
|
|
670
|
+
/* @__PURE__ */ j(b, {
|
|
703
671
|
appearance: "empty",
|
|
704
672
|
showNotice: !1,
|
|
705
673
|
onSubmit: () => !1,
|
|
706
674
|
children: [
|
|
707
|
-
r.length > 1 && /* @__PURE__ */
|
|
675
|
+
r.length > 1 && /* @__PURE__ */ A(T, {
|
|
708
676
|
name: "provider",
|
|
709
677
|
label: n.keyProvider,
|
|
710
678
|
defaultValue: o,
|
|
711
679
|
options: r.map((e) => ({
|
|
712
|
-
label:
|
|
680
|
+
label: B(e),
|
|
713
681
|
value: e
|
|
714
682
|
})),
|
|
715
683
|
onChange: ({ value: e }) => s(String(e ?? r[0]))
|
|
716
684
|
}),
|
|
717
|
-
/* @__PURE__ */
|
|
685
|
+
/* @__PURE__ */ A(w, {
|
|
718
686
|
name: "key",
|
|
719
|
-
label:
|
|
687
|
+
label: L(n.keyLabel, { provider: B(o) }),
|
|
720
688
|
autoComplete: "off",
|
|
721
689
|
onChange: ({ value: e }) => l(String(e ?? ""))
|
|
722
690
|
}),
|
|
723
|
-
/* @__PURE__ */
|
|
691
|
+
/* @__PURE__ */ A(E, {
|
|
724
692
|
name: "label",
|
|
725
693
|
label: n.accountsName,
|
|
726
694
|
onChange: ({ value: e }) => m(String(e ?? ""))
|
|
727
695
|
})
|
|
728
696
|
]
|
|
729
697
|
}),
|
|
730
|
-
/* @__PURE__ */
|
|
698
|
+
/* @__PURE__ */ j("div", {
|
|
731
699
|
className: "flex flex-wrap justify-end gap-2",
|
|
732
|
-
children: [/* @__PURE__ */
|
|
700
|
+
children: [/* @__PURE__ */ A(f, {
|
|
733
701
|
label: n.cancel,
|
|
734
702
|
variant: "link",
|
|
735
703
|
onClick: a
|
|
736
|
-
}), /* @__PURE__ */
|
|
704
|
+
}), /* @__PURE__ */ A(x, {
|
|
737
705
|
label: n.opencodeAdd,
|
|
738
706
|
variant: "primary",
|
|
739
707
|
disabled: !c.trim(),
|
|
@@ -741,7 +709,7 @@ function re({ client: e, t: n, providers: r, onDone: i, onCancel: a }) {
|
|
|
741
709
|
try {
|
|
742
710
|
await e.accounts.addKey(o, c.trim(), u.trim() || void 0), i();
|
|
743
711
|
} catch (e) {
|
|
744
|
-
_(
|
|
712
|
+
_(L(n.error, { error: e instanceof t ? e.code : String(e) }));
|
|
745
713
|
}
|
|
746
714
|
}
|
|
747
715
|
})]
|
|
@@ -751,11 +719,11 @@ function re({ client: e, t: n, providers: r, onDone: i, onCancel: a }) {
|
|
|
751
719
|
}
|
|
752
720
|
// src/ui/InstallGuide.tsx
|
|
753
721
|
function U({ title: e, children: t, done: n }) {
|
|
754
|
-
return /* @__PURE__ */
|
|
722
|
+
return /* @__PURE__ */ j("section", {
|
|
755
723
|
className: "flex flex-col gap-2 border-l-2 border-border pl-4",
|
|
756
|
-
children: [/* @__PURE__ */
|
|
724
|
+
children: [/* @__PURE__ */ j("h4", {
|
|
757
725
|
className: "flex items-center gap-2 text-sm font-semibold",
|
|
758
|
-
children: [e, n && /* @__PURE__ */
|
|
726
|
+
children: [e, n && /* @__PURE__ */ A(m, {
|
|
759
727
|
variant: "success",
|
|
760
728
|
children: "✓"
|
|
761
729
|
})]
|
|
@@ -763,15 +731,15 @@ function U({ title: e, children: t, done: n }) {
|
|
|
763
731
|
});
|
|
764
732
|
}
|
|
765
733
|
function W({ locale: e, texts: t, onPair: c, lookup: l = (e) => o(e), check: u = r, version: m }) {
|
|
766
|
-
let h =
|
|
767
|
-
return /* @__PURE__ */
|
|
734
|
+
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;
|
|
735
|
+
return /* @__PURE__ */ j("div", {
|
|
768
736
|
className: "flex flex-col gap-5",
|
|
769
737
|
children: [
|
|
770
|
-
/* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ A(U, {
|
|
771
739
|
title: h.guideServerTitle,
|
|
772
|
-
children: /* @__PURE__ */
|
|
740
|
+
children: /* @__PURE__ */ A("p", {
|
|
773
741
|
className: "text-sm",
|
|
774
|
-
children:
|
|
742
|
+
children: L(h.guideServer, {
|
|
775
743
|
systems: R.systems.join(", "),
|
|
776
744
|
cpus: R.cpus,
|
|
777
745
|
memory: R.memoryGb,
|
|
@@ -780,40 +748,40 @@ function W({ locale: e, texts: t, onPair: c, lookup: l = (e) => o(e), check: u =
|
|
|
780
748
|
})
|
|
781
749
|
})
|
|
782
750
|
}),
|
|
783
|
-
/* @__PURE__ */
|
|
751
|
+
/* @__PURE__ */ j(U, {
|
|
784
752
|
title: h.guideDnsTitle,
|
|
785
|
-
done: !!
|
|
753
|
+
done: !!y?.ips.length,
|
|
786
754
|
children: [
|
|
787
|
-
/* @__PURE__ */
|
|
755
|
+
/* @__PURE__ */ A("p", {
|
|
788
756
|
className: "text-sm",
|
|
789
757
|
children: h.guideDns
|
|
790
758
|
}),
|
|
791
|
-
/* @__PURE__ */
|
|
759
|
+
/* @__PURE__ */ A(b, {
|
|
792
760
|
appearance: "empty",
|
|
793
761
|
showNotice: !1,
|
|
794
762
|
onSubmit: () => !1,
|
|
795
|
-
children: /* @__PURE__ */
|
|
763
|
+
children: /* @__PURE__ */ A(E, {
|
|
796
764
|
name: "domain",
|
|
797
765
|
label: h.guideDomain,
|
|
798
766
|
placeholder: "runner.example.com",
|
|
799
767
|
autoComplete: "off",
|
|
800
768
|
onChange: ({ value: e }) => {
|
|
801
|
-
|
|
769
|
+
v(String(e ?? "")), S(null), w(null);
|
|
802
770
|
}
|
|
803
771
|
})
|
|
804
772
|
}),
|
|
805
|
-
/* @__PURE__ */
|
|
773
|
+
/* @__PURE__ */ j("div", {
|
|
806
774
|
className: "flex flex-wrap items-center gap-2",
|
|
807
|
-
children: [/* @__PURE__ */
|
|
775
|
+
children: [/* @__PURE__ */ A(x, {
|
|
808
776
|
label: h.guideCheckDns,
|
|
809
777
|
variant: "outline-secondary",
|
|
810
778
|
disabled: !P,
|
|
811
779
|
onClick: async () => S({ ips: await l(_.trim().toLowerCase()).catch(() => []) })
|
|
812
|
-
}),
|
|
780
|
+
}), y && (y.ips.length ? /* @__PURE__ */ A(p, {
|
|
813
781
|
variant: "success",
|
|
814
782
|
appearance: "text",
|
|
815
|
-
children:
|
|
816
|
-
}) : /* @__PURE__ */
|
|
783
|
+
children: L(h.guideDnsOk, { ips: y.ips.join(", ") })
|
|
784
|
+
}) : /* @__PURE__ */ A(p, {
|
|
817
785
|
variant: "warning",
|
|
818
786
|
appearance: "text",
|
|
819
787
|
children: h.guideDnsMissing
|
|
@@ -821,21 +789,21 @@ function W({ locale: e, texts: t, onPair: c, lookup: l = (e) => o(e), check: u =
|
|
|
821
789
|
})
|
|
822
790
|
]
|
|
823
791
|
}),
|
|
824
|
-
/* @__PURE__ */
|
|
792
|
+
/* @__PURE__ */ A(U, {
|
|
825
793
|
title: h.guideAccessTitle,
|
|
826
|
-
children: /* @__PURE__ */
|
|
794
|
+
children: /* @__PURE__ */ A("p", {
|
|
827
795
|
className: "text-sm",
|
|
828
796
|
children: h.guideAccess
|
|
829
797
|
})
|
|
830
798
|
}),
|
|
831
|
-
/* @__PURE__ */
|
|
799
|
+
/* @__PURE__ */ j(U, {
|
|
832
800
|
title: h.guideInstallTitle,
|
|
833
801
|
children: [
|
|
834
|
-
/* @__PURE__ */
|
|
802
|
+
/* @__PURE__ */ A("p", {
|
|
835
803
|
className: "text-sm",
|
|
836
804
|
children: h.guideInstall
|
|
837
805
|
}),
|
|
838
|
-
/* @__PURE__ */
|
|
806
|
+
/* @__PURE__ */ A(g, {
|
|
839
807
|
language: "bash",
|
|
840
808
|
showCopy: !0,
|
|
841
809
|
children: i({
|
|
@@ -843,12 +811,12 @@ function W({ locale: e, texts: t, onPair: c, lookup: l = (e) => o(e), check: u =
|
|
|
843
811
|
...m ? { version: m } : {}
|
|
844
812
|
})
|
|
845
813
|
}),
|
|
846
|
-
/* @__PURE__ */
|
|
814
|
+
/* @__PURE__ */ A("div", { children: /* @__PURE__ */ A(f, {
|
|
847
815
|
label: h.guideVerified,
|
|
848
816
|
variant: "link",
|
|
849
|
-
onClick: () =>
|
|
817
|
+
onClick: () => k((e) => !e)
|
|
850
818
|
}) }),
|
|
851
|
-
O && /* @__PURE__ */
|
|
819
|
+
O && /* @__PURE__ */ A(g, {
|
|
852
820
|
language: "bash",
|
|
853
821
|
showCopy: !0,
|
|
854
822
|
children: s({
|
|
@@ -858,19 +826,19 @@ function W({ locale: e, texts: t, onPair: c, lookup: l = (e) => o(e), check: u =
|
|
|
858
826
|
})
|
|
859
827
|
]
|
|
860
828
|
}),
|
|
861
|
-
/* @__PURE__ */
|
|
829
|
+
/* @__PURE__ */ j(U, {
|
|
862
830
|
title: h.guidePairTitle,
|
|
863
831
|
done: C?.ok,
|
|
864
832
|
children: [
|
|
865
|
-
/* @__PURE__ */
|
|
833
|
+
/* @__PURE__ */ A("p", {
|
|
866
834
|
className: "text-sm",
|
|
867
835
|
children: h.guidePair
|
|
868
836
|
}),
|
|
869
|
-
/* @__PURE__ */
|
|
837
|
+
/* @__PURE__ */ A(b, {
|
|
870
838
|
appearance: "empty",
|
|
871
839
|
showNotice: !1,
|
|
872
840
|
onSubmit: () => !1,
|
|
873
|
-
children: /* @__PURE__ */
|
|
841
|
+
children: /* @__PURE__ */ A(E, {
|
|
874
842
|
name: "code",
|
|
875
843
|
label: h.addCode,
|
|
876
844
|
placeholder: "ABCD-EFGH",
|
|
@@ -878,55 +846,55 @@ function W({ locale: e, texts: t, onPair: c, lookup: l = (e) => o(e), check: u =
|
|
|
878
846
|
onChange: ({ value: e }) => D(String(e ?? ""))
|
|
879
847
|
})
|
|
880
848
|
}),
|
|
881
|
-
C && /* @__PURE__ */
|
|
849
|
+
C && /* @__PURE__ */ A(p, {
|
|
882
850
|
variant: C.ok ? "success" : "warning",
|
|
883
851
|
appearance: "text",
|
|
884
852
|
children: C.text
|
|
885
853
|
}),
|
|
886
|
-
M && /* @__PURE__ */
|
|
854
|
+
M && /* @__PURE__ */ A(p, {
|
|
887
855
|
variant: "danger",
|
|
888
856
|
children: M
|
|
889
857
|
}),
|
|
890
|
-
/* @__PURE__ */
|
|
858
|
+
/* @__PURE__ */ j("div", {
|
|
891
859
|
className: "flex flex-wrap gap-2",
|
|
892
|
-
children: [/* @__PURE__ */
|
|
860
|
+
children: [/* @__PURE__ */ A(x, {
|
|
893
861
|
label: h.guideCheckHealth,
|
|
894
862
|
variant: "outline-secondary",
|
|
895
863
|
disabled: !P,
|
|
896
864
|
onClick: async () => {
|
|
897
|
-
let e = await u(
|
|
865
|
+
let e = await u(F);
|
|
898
866
|
w(e.ok ? {
|
|
899
867
|
ok: !0,
|
|
900
|
-
text:
|
|
868
|
+
text: L(h.guideHealthOk, {
|
|
901
869
|
version: e.version,
|
|
902
|
-
url:
|
|
870
|
+
url: F
|
|
903
871
|
})
|
|
904
872
|
} : {
|
|
905
873
|
ok: !1,
|
|
906
|
-
text:
|
|
874
|
+
text: L(h.guideHealthKo, { url: F })
|
|
907
875
|
});
|
|
908
876
|
}
|
|
909
|
-
}), /* @__PURE__ */
|
|
877
|
+
}), /* @__PURE__ */ A(x, {
|
|
910
878
|
label: h.addConnect,
|
|
911
879
|
variant: "primary",
|
|
912
|
-
disabled: !P ||
|
|
880
|
+
disabled: !P || T.trim().length < 8,
|
|
913
881
|
onClick: async () => {
|
|
914
882
|
try {
|
|
915
883
|
N(null), await c({
|
|
916
|
-
url:
|
|
917
|
-
code:
|
|
884
|
+
url: F,
|
|
885
|
+
code: T.trim()
|
|
918
886
|
});
|
|
919
887
|
} catch (e) {
|
|
920
|
-
N(
|
|
888
|
+
N(L(h.error, { error: e.message }));
|
|
921
889
|
}
|
|
922
890
|
}
|
|
923
891
|
})]
|
|
924
892
|
})
|
|
925
893
|
]
|
|
926
894
|
}),
|
|
927
|
-
/* @__PURE__ */
|
|
895
|
+
/* @__PURE__ */ A(U, {
|
|
928
896
|
title: h.guideTroubleTitle,
|
|
929
|
-
children: /* @__PURE__ */
|
|
897
|
+
children: /* @__PURE__ */ A("p", {
|
|
930
898
|
className: "text-sm text-muted-foreground",
|
|
931
899
|
children: h.guideTrouble
|
|
932
900
|
})
|
|
@@ -936,7 +904,7 @@ function W({ locale: e, texts: t, onPair: c, lookup: l = (e) => o(e), check: u =
|
|
|
936
904
|
}
|
|
937
905
|
// src/ui/RunnersSettings.tsx
|
|
938
906
|
function ie({ fleet: e, locale: t, texts: n }) {
|
|
939
|
-
let r =
|
|
907
|
+
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 () => {
|
|
940
908
|
try {
|
|
941
909
|
let t = await e.list();
|
|
942
910
|
a(t);
|
|
@@ -946,25 +914,25 @@ function ie({ fleet: e, locale: t, texts: n }) {
|
|
|
946
914
|
status: n[t]
|
|
947
915
|
}))), e.tenants && s(await e.tenants.list());
|
|
948
916
|
} catch (e) {
|
|
949
|
-
|
|
917
|
+
x(L(r.error, { error: e.message })), a([]);
|
|
950
918
|
}
|
|
951
919
|
}, [e, r]);
|
|
952
920
|
l(() => {
|
|
953
|
-
|
|
954
|
-
}, [
|
|
955
|
-
let
|
|
956
|
-
await e.update(t, n), await
|
|
921
|
+
S();
|
|
922
|
+
}, [S]);
|
|
923
|
+
let w = async (t, n) => {
|
|
924
|
+
await e.update(t, n), await S();
|
|
957
925
|
};
|
|
958
|
-
return /* @__PURE__ */
|
|
926
|
+
return /* @__PURE__ */ j("div", {
|
|
959
927
|
className: "flex flex-col gap-4",
|
|
960
928
|
children: [
|
|
961
|
-
/* @__PURE__ */
|
|
962
|
-
header: /* @__PURE__ */
|
|
929
|
+
/* @__PURE__ */ A(h, {
|
|
930
|
+
header: /* @__PURE__ */ j("div", {
|
|
963
931
|
className: "flex flex-wrap items-center gap-2",
|
|
964
|
-
children: [/* @__PURE__ */
|
|
932
|
+
children: [/* @__PURE__ */ A("h3", {
|
|
965
933
|
className: "flex-1 text-base font-semibold",
|
|
966
934
|
children: r.runnersTitle
|
|
967
|
-
}), /* @__PURE__ */
|
|
935
|
+
}), /* @__PURE__ */ A(f, {
|
|
968
936
|
icon: "plus",
|
|
969
937
|
label: r.runnersAdd,
|
|
970
938
|
variant: "primary",
|
|
@@ -973,64 +941,64 @@ function ie({ fleet: e, locale: t, texts: n }) {
|
|
|
973
941
|
}),
|
|
974
942
|
loading: i === null,
|
|
975
943
|
loaderMinHeight: 120,
|
|
976
|
-
children: /* @__PURE__ */
|
|
944
|
+
children: /* @__PURE__ */ j("div", {
|
|
977
945
|
className: "flex flex-col gap-3",
|
|
978
946
|
children: [
|
|
979
|
-
/* @__PURE__ */
|
|
947
|
+
/* @__PURE__ */ A("p", {
|
|
980
948
|
className: "text-sm text-muted-foreground",
|
|
981
949
|
children: r.runnersIntro
|
|
982
950
|
}),
|
|
983
|
-
|
|
951
|
+
y && /* @__PURE__ */ A(p, {
|
|
984
952
|
variant: "danger",
|
|
985
|
-
children:
|
|
953
|
+
children: y
|
|
986
954
|
}),
|
|
987
|
-
i?.length === 0 && /* @__PURE__ */
|
|
955
|
+
i?.length === 0 && /* @__PURE__ */ A("p", {
|
|
988
956
|
className: "text-sm text-muted-foreground",
|
|
989
957
|
children: r.runnersEmpty
|
|
990
958
|
}),
|
|
991
|
-
i?.map((e) => /* @__PURE__ */
|
|
959
|
+
i?.map((e) => /* @__PURE__ */ j("div", {
|
|
992
960
|
className: "flex flex-col gap-2 rounded-md border border-border p-3",
|
|
993
|
-
children: [/* @__PURE__ */
|
|
961
|
+
children: [/* @__PURE__ */ j("div", {
|
|
994
962
|
className: "flex flex-wrap items-center gap-2",
|
|
995
963
|
children: [
|
|
996
|
-
/* @__PURE__ */
|
|
964
|
+
/* @__PURE__ */ A("span", {
|
|
997
965
|
className: "font-medium",
|
|
998
966
|
children: e.name
|
|
999
967
|
}),
|
|
1000
|
-
/* @__PURE__ */
|
|
968
|
+
/* @__PURE__ */ A("span", {
|
|
1001
969
|
className: "text-xs text-muted-foreground",
|
|
1002
970
|
children: e.url
|
|
1003
971
|
}),
|
|
1004
|
-
e.status === null && /* @__PURE__ */
|
|
972
|
+
e.status === null && /* @__PURE__ */ A(m, {
|
|
1005
973
|
variant: "danger",
|
|
1006
974
|
children: r.runnersUnreachable
|
|
1007
975
|
}),
|
|
1008
|
-
e.status && /* @__PURE__ */
|
|
976
|
+
e.status && /* @__PURE__ */ A(m, {
|
|
1009
977
|
variant: "secondary",
|
|
1010
|
-
children:
|
|
978
|
+
children: L(r.runnersVersion, { version: e.status.version })
|
|
1011
979
|
}),
|
|
1012
|
-
e.status && /* @__PURE__ */
|
|
980
|
+
e.status && /* @__PURE__ */ A(m, {
|
|
1013
981
|
variant: "info",
|
|
1014
|
-
children:
|
|
982
|
+
children: L(r.runnersLoad, {
|
|
1015
983
|
chats: e.status.load.chats,
|
|
1016
984
|
max: e.status.load.maxChats
|
|
1017
985
|
})
|
|
1018
986
|
}),
|
|
1019
|
-
e.status && /* @__PURE__ */
|
|
987
|
+
e.status && /* @__PURE__ */ A(m, {
|
|
1020
988
|
variant: "light",
|
|
1021
|
-
children:
|
|
989
|
+
children: L(r.runnersTenants, { count: e.status.tenants.length })
|
|
1022
990
|
}),
|
|
1023
|
-
/* @__PURE__ */
|
|
991
|
+
/* @__PURE__ */ A("div", {
|
|
1024
992
|
className: "ml-auto",
|
|
1025
|
-
children: /* @__PURE__ */
|
|
993
|
+
children: /* @__PURE__ */ A(f, {
|
|
1026
994
|
icon: "trash",
|
|
1027
995
|
label: r.runnersRemove,
|
|
1028
996
|
variant: "outline-danger",
|
|
1029
|
-
onClick: () =>
|
|
997
|
+
onClick: () => v(e)
|
|
1030
998
|
})
|
|
1031
999
|
})
|
|
1032
1000
|
]
|
|
1033
|
-
}), /* @__PURE__ */
|
|
1001
|
+
}), /* @__PURE__ */ A(b, {
|
|
1034
1002
|
appearance: "empty",
|
|
1035
1003
|
showNotice: !1,
|
|
1036
1004
|
onSubmit: () => !1,
|
|
@@ -1038,18 +1006,18 @@ function ie({ fleet: e, locale: t, texts: n }) {
|
|
|
1038
1006
|
isDefault: e.isDefault ? "true" : "",
|
|
1039
1007
|
draining: e.draining ? "true" : ""
|
|
1040
1008
|
},
|
|
1041
|
-
children: /* @__PURE__ */
|
|
1009
|
+
children: /* @__PURE__ */ j("div", {
|
|
1042
1010
|
className: "flex flex-wrap gap-4",
|
|
1043
|
-
children: [/* @__PURE__ */
|
|
1011
|
+
children: [/* @__PURE__ */ A(D, {
|
|
1044
1012
|
name: "isDefault",
|
|
1045
1013
|
label: r.runnersDefault,
|
|
1046
1014
|
valueChecked: "true",
|
|
1047
|
-
onChange: ({ value: t }) => void
|
|
1048
|
-
}), /* @__PURE__ */
|
|
1015
|
+
onChange: ({ value: t }) => void w(e.id, { isDefault: !!t })
|
|
1016
|
+
}), /* @__PURE__ */ A(D, {
|
|
1049
1017
|
name: "draining",
|
|
1050
1018
|
label: r.runnersDraining,
|
|
1051
1019
|
valueChecked: "true",
|
|
1052
|
-
onChange: ({ value: t }) => void
|
|
1020
|
+
onChange: ({ value: t }) => void w(e.id, { draining: !!t })
|
|
1053
1021
|
})]
|
|
1054
1022
|
})
|
|
1055
1023
|
})]
|
|
@@ -1057,26 +1025,26 @@ function ie({ fleet: e, locale: t, texts: n }) {
|
|
|
1057
1025
|
]
|
|
1058
1026
|
})
|
|
1059
1027
|
}),
|
|
1060
|
-
e.tenants && i && i.length > 0 && /* @__PURE__ */
|
|
1028
|
+
e.tenants && i && i.length > 0 && /* @__PURE__ */ A(h, {
|
|
1061
1029
|
title: r.distributionTitle,
|
|
1062
1030
|
loading: o === null,
|
|
1063
1031
|
loaderMinHeight: 80,
|
|
1064
|
-
children: /* @__PURE__ */
|
|
1032
|
+
children: /* @__PURE__ */ j("div", {
|
|
1065
1033
|
className: "flex flex-col gap-2",
|
|
1066
|
-
children: [/* @__PURE__ */
|
|
1034
|
+
children: [/* @__PURE__ */ A("p", {
|
|
1067
1035
|
className: "text-sm text-muted-foreground",
|
|
1068
1036
|
children: r.distributionIntro
|
|
1069
|
-
}), /* @__PURE__ */
|
|
1037
|
+
}), /* @__PURE__ */ A(b, {
|
|
1070
1038
|
appearance: "empty",
|
|
1071
1039
|
showNotice: !1,
|
|
1072
1040
|
onSubmit: () => !1,
|
|
1073
1041
|
defaultValues: Object.fromEntries((o ?? []).map((e) => [`runner_${e.id}`, e.runnerId ?? ""])),
|
|
1074
|
-
children: (o ?? []).map((t) => /* @__PURE__ */
|
|
1042
|
+
children: (o ?? []).map((t) => /* @__PURE__ */ j("div", {
|
|
1075
1043
|
className: "flex flex-wrap items-center gap-2",
|
|
1076
|
-
children: [/* @__PURE__ */
|
|
1044
|
+
children: [/* @__PURE__ */ A("span", {
|
|
1077
1045
|
className: "min-w-40 flex-1 text-sm",
|
|
1078
1046
|
children: t.name
|
|
1079
|
-
}), /* @__PURE__ */
|
|
1047
|
+
}), /* @__PURE__ */ A(T, {
|
|
1080
1048
|
name: `runner_${t.id}`,
|
|
1081
1049
|
title: r.distributionRunner,
|
|
1082
1050
|
placeholderOption: {
|
|
@@ -1088,34 +1056,34 @@ function ie({ fleet: e, locale: t, texts: n }) {
|
|
|
1088
1056
|
value: e.id
|
|
1089
1057
|
})),
|
|
1090
1058
|
onChange: ({ value: n }) => {
|
|
1091
|
-
n && e.tenants.assign(t.id, String(n)).then(
|
|
1059
|
+
n && e.tenants.assign(t.id, String(n)).then(S);
|
|
1092
1060
|
}
|
|
1093
1061
|
})]
|
|
1094
1062
|
}, t.id))
|
|
1095
1063
|
})]
|
|
1096
1064
|
})
|
|
1097
1065
|
}),
|
|
1098
|
-
u && /* @__PURE__ */
|
|
1066
|
+
u && /* @__PURE__ */ A(q, {
|
|
1099
1067
|
fleet: e,
|
|
1100
1068
|
t: r,
|
|
1101
1069
|
locale: t,
|
|
1102
1070
|
onClose: () => g(!1),
|
|
1103
1071
|
onAdded: async () => {
|
|
1104
|
-
g(!1), await
|
|
1072
|
+
g(!1), await S();
|
|
1105
1073
|
}
|
|
1106
1074
|
}),
|
|
1107
|
-
_ && /* @__PURE__ */
|
|
1075
|
+
_ && /* @__PURE__ */ A(C, {
|
|
1108
1076
|
title: r.runnersRemove,
|
|
1109
1077
|
danger: !0,
|
|
1110
|
-
onClose: () =>
|
|
1111
|
-
onYes: async () => (await e.remove(_.id).catch((e) =>
|
|
1112
|
-
children:
|
|
1078
|
+
onClose: () => v(null),
|
|
1079
|
+
onYes: async () => (await e.remove(_.id).catch((e) => x(L(r.error, { error: e.message }))), v(null), await S(), !0),
|
|
1080
|
+
children: L(r.runnersRemoveConfirm, { name: _.name })
|
|
1113
1081
|
})
|
|
1114
1082
|
]
|
|
1115
1083
|
});
|
|
1116
1084
|
}
|
|
1117
1085
|
function G({ target: e, children: t }) {
|
|
1118
|
-
return e ?
|
|
1086
|
+
return e ? M(t, e) : null;
|
|
1119
1087
|
}
|
|
1120
1088
|
var K = (e) => {
|
|
1121
1089
|
try {
|
|
@@ -1125,44 +1093,44 @@ var K = (e) => {
|
|
|
1125
1093
|
}
|
|
1126
1094
|
};
|
|
1127
1095
|
function q({ fleet: e, t, locale: n, onClose: r, onAdded: i, position: a }) {
|
|
1128
|
-
let [o, s] = d("choose"), [l, u] = d(null), [m, h] = d(null), g = c((e) => u(
|
|
1129
|
-
return /* @__PURE__ */
|
|
1096
|
+
let [o, s] = d("choose"), [l, u] = d(null), [m, h] = d(null), g = c((e) => u(L(t.error, { error: e.message })), [t]);
|
|
1097
|
+
return /* @__PURE__ */ A(S, {
|
|
1130
1098
|
title: t.addTitle,
|
|
1131
1099
|
...a === "right" ? { position: "right" } : {},
|
|
1132
1100
|
size: "lg",
|
|
1133
1101
|
onClose: r,
|
|
1134
|
-
footer: o === "choose" || o === "guided" ? !1 : /* @__PURE__ */
|
|
1102
|
+
footer: o === "choose" || o === "guided" ? !1 : /* @__PURE__ */ A("div", {
|
|
1135
1103
|
ref: h,
|
|
1136
1104
|
className: "flex w-full flex-wrap items-center justify-end gap-3"
|
|
1137
1105
|
}),
|
|
1138
|
-
children: /* @__PURE__ */
|
|
1106
|
+
children: /* @__PURE__ */ j("div", {
|
|
1139
1107
|
className: "flex flex-col gap-4",
|
|
1140
1108
|
children: [
|
|
1141
|
-
l && /* @__PURE__ */
|
|
1109
|
+
l && /* @__PURE__ */ A(p, {
|
|
1142
1110
|
variant: "danger",
|
|
1143
1111
|
children: l
|
|
1144
1112
|
}),
|
|
1145
|
-
o === "choose" && /* @__PURE__ */
|
|
1113
|
+
o === "choose" && /* @__PURE__ */ j("div", {
|
|
1146
1114
|
className: "grid gap-3 sm:grid-cols-3",
|
|
1147
1115
|
children: [
|
|
1148
|
-
e.install && /* @__PURE__ */
|
|
1116
|
+
e.install && /* @__PURE__ */ A(J, {
|
|
1149
1117
|
title: t.addAutomatic,
|
|
1150
1118
|
hint: t.addAutomaticHint,
|
|
1151
1119
|
onClick: () => s("automatic")
|
|
1152
1120
|
}),
|
|
1153
|
-
/* @__PURE__ */
|
|
1121
|
+
/* @__PURE__ */ A(J, {
|
|
1154
1122
|
title: t.addGuided,
|
|
1155
1123
|
hint: t.addGuidedHint,
|
|
1156
1124
|
onClick: () => s("guided")
|
|
1157
1125
|
}),
|
|
1158
|
-
/* @__PURE__ */
|
|
1126
|
+
/* @__PURE__ */ A(J, {
|
|
1159
1127
|
title: t.addExisting,
|
|
1160
1128
|
hint: t.addExistingHint,
|
|
1161
1129
|
onClick: () => s("existing")
|
|
1162
1130
|
})
|
|
1163
1131
|
]
|
|
1164
1132
|
}),
|
|
1165
|
-
o !== "choose" && /* @__PURE__ */
|
|
1133
|
+
o !== "choose" && /* @__PURE__ */ A("div", { children: /* @__PURE__ */ A(f, {
|
|
1166
1134
|
icon: "arrow-left",
|
|
1167
1135
|
label: t.addBack,
|
|
1168
1136
|
variant: "link",
|
|
@@ -1170,7 +1138,7 @@ function q({ fleet: e, t, locale: n, onClose: r, onAdded: i, position: a }) {
|
|
|
1170
1138
|
s("choose"), u(null);
|
|
1171
1139
|
}
|
|
1172
1140
|
}) }),
|
|
1173
|
-
o === "automatic" && e.install && /* @__PURE__ */
|
|
1141
|
+
o === "automatic" && e.install && /* @__PURE__ */ A(ce, {
|
|
1174
1142
|
t,
|
|
1175
1143
|
footer: m,
|
|
1176
1144
|
localKeys: !!e.localKeys,
|
|
@@ -1182,7 +1150,7 @@ function q({ fleet: e, t, locale: n, onClose: r, onAdded: i, position: a }) {
|
|
|
1182
1150
|
onDone: i,
|
|
1183
1151
|
onError: g
|
|
1184
1152
|
}),
|
|
1185
|
-
o === "guided" && /* @__PURE__ */
|
|
1153
|
+
o === "guided" && /* @__PURE__ */ A(W, {
|
|
1186
1154
|
locale: n,
|
|
1187
1155
|
texts: t,
|
|
1188
1156
|
onPair: async ({ url: t, code: n }) => {
|
|
@@ -1193,7 +1161,7 @@ function q({ fleet: e, t, locale: n, onClose: r, onAdded: i, position: a }) {
|
|
|
1193
1161
|
}));
|
|
1194
1162
|
}
|
|
1195
1163
|
}),
|
|
1196
|
-
o === "existing" && /* @__PURE__ */
|
|
1164
|
+
o === "existing" && /* @__PURE__ */ A(se, {
|
|
1197
1165
|
t,
|
|
1198
1166
|
footer: m,
|
|
1199
1167
|
pairing: e.startPairing && e.pairingStatus ? {
|
|
@@ -1220,14 +1188,14 @@ function q({ fleet: e, t, locale: n, onClose: r, onAdded: i, position: a }) {
|
|
|
1220
1188
|
});
|
|
1221
1189
|
}
|
|
1222
1190
|
function J({ title: e, hint: t, onClick: n }) {
|
|
1223
|
-
return /* @__PURE__ */
|
|
1191
|
+
return /* @__PURE__ */ j("button", {
|
|
1224
1192
|
type: "button",
|
|
1225
1193
|
onClick: n,
|
|
1226
1194
|
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",
|
|
1227
|
-
children: [/* @__PURE__ */
|
|
1195
|
+
children: [/* @__PURE__ */ A("span", {
|
|
1228
1196
|
className: "block font-medium",
|
|
1229
1197
|
children: e
|
|
1230
|
-
}), /* @__PURE__ */
|
|
1198
|
+
}), /* @__PURE__ */ A("span", {
|
|
1231
1199
|
className: "mt-1 block text-sm text-muted-foreground",
|
|
1232
1200
|
children: t
|
|
1233
1201
|
})]
|
|
@@ -1238,7 +1206,7 @@ var Y = (e) => (/^https?:\/\//.test(e.trim()) ? e.trim() : `https://${e.trim()}`
|
|
|
1238
1206
|
minute: "2-digit"
|
|
1239
1207
|
}), oe = 5;
|
|
1240
1208
|
function se({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError: a, onConnect: o }) {
|
|
1241
|
-
let [s, c] = d(""), [u, m] = d(""), [h, g] = d(!n), [_,
|
|
1209
|
+
let [s, c] = d(""), [u, m] = d(""), [h, g] = d(!n), [_, v] = d(null), [y, S] = d(null);
|
|
1242
1210
|
return l(() => {
|
|
1243
1211
|
if (!_ || !n) return;
|
|
1244
1212
|
let e = !1, t = 0, a, o = async () => {
|
|
@@ -1250,7 +1218,7 @@ function se({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
|
|
|
1250
1218
|
return;
|
|
1251
1219
|
}
|
|
1252
1220
|
if (i.status !== "pending") {
|
|
1253
|
-
S(i.status),
|
|
1221
|
+
S(i.status), v(null);
|
|
1254
1222
|
return;
|
|
1255
1223
|
}
|
|
1256
1224
|
} catch (n) {
|
|
@@ -1266,28 +1234,28 @@ function se({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
|
|
|
1266
1234
|
n,
|
|
1267
1235
|
r,
|
|
1268
1236
|
i
|
|
1269
|
-
]), _ ? /* @__PURE__ */
|
|
1237
|
+
]), _ ? /* @__PURE__ */ j("div", {
|
|
1270
1238
|
className: "flex flex-col gap-3",
|
|
1271
1239
|
children: [
|
|
1272
|
-
/* @__PURE__ */
|
|
1240
|
+
/* @__PURE__ */ A("h4", {
|
|
1273
1241
|
className: "font-semibold",
|
|
1274
1242
|
children: e.pairWaitingTitle
|
|
1275
1243
|
}),
|
|
1276
|
-
/* @__PURE__ */
|
|
1244
|
+
/* @__PURE__ */ A("p", {
|
|
1277
1245
|
className: "text-sm text-muted-foreground",
|
|
1278
1246
|
children: e.pairWaitingHint
|
|
1279
1247
|
}),
|
|
1280
|
-
/* @__PURE__ */
|
|
1248
|
+
/* @__PURE__ */ A("div", {
|
|
1281
1249
|
className: "rounded-lg border border-border p-4 text-center font-mono text-3xl font-semibold tracking-widest",
|
|
1282
1250
|
children: _.code
|
|
1283
1251
|
}),
|
|
1284
|
-
/* @__PURE__ */
|
|
1252
|
+
/* @__PURE__ */ A("p", {
|
|
1285
1253
|
className: "text-sm text-muted-foreground",
|
|
1286
|
-
children:
|
|
1254
|
+
children: L(e.pairWaiting, { at: ae(_.expiresAt) })
|
|
1287
1255
|
}),
|
|
1288
|
-
/* @__PURE__ */
|
|
1256
|
+
/* @__PURE__ */ A(G, {
|
|
1289
1257
|
target: t,
|
|
1290
|
-
children: /* @__PURE__ */
|
|
1258
|
+
children: /* @__PURE__ */ A(f, {
|
|
1291
1259
|
icon: "external-link",
|
|
1292
1260
|
label: e.pairOpen,
|
|
1293
1261
|
variant: "primary",
|
|
@@ -1295,14 +1263,14 @@ function se({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
|
|
|
1295
1263
|
})
|
|
1296
1264
|
})
|
|
1297
1265
|
]
|
|
1298
|
-
}) : /* @__PURE__ */
|
|
1266
|
+
}) : /* @__PURE__ */ j("div", {
|
|
1299
1267
|
className: "flex flex-col gap-3",
|
|
1300
1268
|
children: [
|
|
1301
|
-
|
|
1302
|
-
variant:
|
|
1303
|
-
children:
|
|
1269
|
+
y && /* @__PURE__ */ A(p, {
|
|
1270
|
+
variant: y === "denied" ? "danger" : "warning",
|
|
1271
|
+
children: y === "denied" ? e.pairDenied : e.pairExpired
|
|
1304
1272
|
}),
|
|
1305
|
-
/* @__PURE__ */
|
|
1273
|
+
/* @__PURE__ */ j(b, {
|
|
1306
1274
|
appearance: "empty",
|
|
1307
1275
|
showNotice: !1,
|
|
1308
1276
|
onSubmit: () => !1,
|
|
@@ -1310,12 +1278,12 @@ function se({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
|
|
|
1310
1278
|
url: s,
|
|
1311
1279
|
code: u
|
|
1312
1280
|
},
|
|
1313
|
-
children: [/* @__PURE__ */
|
|
1281
|
+
children: [/* @__PURE__ */ A(E, {
|
|
1314
1282
|
name: "url",
|
|
1315
1283
|
label: e.addUrl,
|
|
1316
1284
|
placeholder: "https://runner.example.com",
|
|
1317
1285
|
onChange: ({ value: e }) => c(String(e ?? ""))
|
|
1318
|
-
}), h && /* @__PURE__ */
|
|
1286
|
+
}), h && /* @__PURE__ */ A(E, {
|
|
1319
1287
|
name: "code",
|
|
1320
1288
|
label: e.addCode,
|
|
1321
1289
|
placeholder: "ABCD-EFGH",
|
|
@@ -1323,26 +1291,26 @@ function se({ t: e, footer: t, pairing: n, onAdded: r, onError: i, onClearError:
|
|
|
1323
1291
|
onChange: ({ value: e }) => m(String(e ?? ""))
|
|
1324
1292
|
})]
|
|
1325
1293
|
}),
|
|
1326
|
-
/* @__PURE__ */
|
|
1294
|
+
/* @__PURE__ */ j(G, {
|
|
1327
1295
|
target: t,
|
|
1328
|
-
children: [n && /* @__PURE__ */
|
|
1296
|
+
children: [n && /* @__PURE__ */ A(f, {
|
|
1329
1297
|
label: h ? e.pairWithApproval : e.pairWithCode,
|
|
1330
1298
|
variant: "link",
|
|
1331
1299
|
onClick: () => g((e) => !e)
|
|
1332
|
-
}), h ? /* @__PURE__ */
|
|
1300
|
+
}), h ? /* @__PURE__ */ A(x, {
|
|
1333
1301
|
label: e.addConnect,
|
|
1334
1302
|
variant: "primary",
|
|
1335
1303
|
disabled: !s.trim() || u.trim().length < 8,
|
|
1336
1304
|
onClick: () => o(Y(s), u.trim())
|
|
1337
|
-
}) : /* @__PURE__ */
|
|
1338
|
-
label:
|
|
1305
|
+
}) : /* @__PURE__ */ A(x, {
|
|
1306
|
+
label: y ? e.pairAgain : e.pairNext,
|
|
1339
1307
|
variant: "primary",
|
|
1340
1308
|
disabled: !s.trim(),
|
|
1341
1309
|
onClick: async () => {
|
|
1342
1310
|
S(null), a();
|
|
1343
1311
|
try {
|
|
1344
1312
|
let e = Y(s);
|
|
1345
|
-
|
|
1313
|
+
v(await n.start({
|
|
1346
1314
|
name: K(e),
|
|
1347
1315
|
url: e
|
|
1348
1316
|
}));
|
|
@@ -1379,43 +1347,43 @@ function ce({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }
|
|
|
1379
1347
|
...n,
|
|
1380
1348
|
[e]: String(t ?? "")
|
|
1381
1349
|
})), _ = o.host.trim() && o.domain.trim() && (o.auth === "local" || o.username.trim()) && (o.auth === "local" || (o.auth === "key" ? o.privateKey.trim() : o.password));
|
|
1382
|
-
return /* @__PURE__ */
|
|
1350
|
+
return /* @__PURE__ */ j("div", {
|
|
1383
1351
|
className: "flex flex-col gap-3",
|
|
1384
1352
|
children: [
|
|
1385
|
-
!p && /* @__PURE__ */
|
|
1353
|
+
!p && /* @__PURE__ */ j(b, {
|
|
1386
1354
|
appearance: "empty",
|
|
1387
1355
|
showNotice: !1,
|
|
1388
1356
|
onSubmit: () => !1,
|
|
1389
1357
|
defaultValues: o,
|
|
1390
1358
|
children: [
|
|
1391
|
-
/* @__PURE__ */
|
|
1359
|
+
/* @__PURE__ */ A(E, {
|
|
1392
1360
|
name: "domain",
|
|
1393
1361
|
label: e.guideDomain,
|
|
1394
1362
|
placeholder: "runner.example.com",
|
|
1395
1363
|
onChange: g("domain")
|
|
1396
1364
|
}),
|
|
1397
|
-
/* @__PURE__ */
|
|
1365
|
+
/* @__PURE__ */ j("div", {
|
|
1398
1366
|
className: "grid gap-3 sm:grid-cols-3",
|
|
1399
1367
|
children: [
|
|
1400
|
-
/* @__PURE__ */
|
|
1368
|
+
/* @__PURE__ */ A(E, {
|
|
1401
1369
|
name: "host",
|
|
1402
1370
|
label: e.addHost,
|
|
1403
1371
|
placeholder: "203.0.113.10",
|
|
1404
1372
|
onChange: g("host")
|
|
1405
1373
|
}),
|
|
1406
|
-
/* @__PURE__ */
|
|
1374
|
+
/* @__PURE__ */ A(E, {
|
|
1407
1375
|
name: "port",
|
|
1408
1376
|
label: e.addPort,
|
|
1409
1377
|
onChange: g("port")
|
|
1410
1378
|
}),
|
|
1411
|
-
/* @__PURE__ */
|
|
1379
|
+
/* @__PURE__ */ A(E, {
|
|
1412
1380
|
name: "username",
|
|
1413
1381
|
label: e.addUser,
|
|
1414
1382
|
onChange: g("username")
|
|
1415
1383
|
})
|
|
1416
1384
|
]
|
|
1417
1385
|
}),
|
|
1418
|
-
/* @__PURE__ */
|
|
1386
|
+
/* @__PURE__ */ A(T, {
|
|
1419
1387
|
name: "auth",
|
|
1420
1388
|
label: e.addAuth,
|
|
1421
1389
|
options: [
|
|
@@ -1434,16 +1402,16 @@ function ce({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }
|
|
|
1434
1402
|
],
|
|
1435
1403
|
onChange: g("auth")
|
|
1436
1404
|
}),
|
|
1437
|
-
o.auth === "local" && /* @__PURE__ */
|
|
1405
|
+
o.auth === "local" && /* @__PURE__ */ A("p", {
|
|
1438
1406
|
className: "text-xs text-muted-foreground",
|
|
1439
1407
|
children: e.addLocalKeyHint
|
|
1440
1408
|
}),
|
|
1441
|
-
o.auth === "local" ? null : o.auth === "key" ? /* @__PURE__ */
|
|
1409
|
+
o.auth === "local" ? null : o.auth === "key" ? /* @__PURE__ */ A(O, {
|
|
1442
1410
|
name: "privateKey",
|
|
1443
1411
|
label: e.addKey,
|
|
1444
1412
|
placeholder: "-----BEGIN OPENSSH PRIVATE KEY-----",
|
|
1445
1413
|
onChange: g("privateKey")
|
|
1446
|
-
}) : /* @__PURE__ */
|
|
1414
|
+
}) : /* @__PURE__ */ A(w, {
|
|
1447
1415
|
name: "password",
|
|
1448
1416
|
label: e.addPassword,
|
|
1449
1417
|
autoComplete: "off",
|
|
@@ -1451,24 +1419,24 @@ function ce({ t: e, footer: t, localKeys: n, install: r, onDone: i, onError: a }
|
|
|
1451
1419
|
})
|
|
1452
1420
|
]
|
|
1453
1421
|
}),
|
|
1454
|
-
/* @__PURE__ */
|
|
1422
|
+
/* @__PURE__ */ A("p", {
|
|
1455
1423
|
className: "text-xs text-muted-foreground",
|
|
1456
1424
|
children: e.addCredentialsNote
|
|
1457
1425
|
}),
|
|
1458
|
-
p && /* @__PURE__ */
|
|
1426
|
+
p && /* @__PURE__ */ A("div", {
|
|
1459
1427
|
className: "flex flex-wrap gap-1",
|
|
1460
|
-
children: X.map((e) => /* @__PURE__ */
|
|
1428
|
+
children: X.map((e) => /* @__PURE__ */ A(m, {
|
|
1461
1429
|
variant: u === e ? "primary" : X.indexOf(e) < X.indexOf(u ?? "check") ? "success" : "light",
|
|
1462
1430
|
children: e
|
|
1463
1431
|
}, e))
|
|
1464
1432
|
}),
|
|
1465
|
-
c.length > 0 && /* @__PURE__ */
|
|
1433
|
+
c.length > 0 && /* @__PURE__ */ A("pre", {
|
|
1466
1434
|
className: "max-h-64 overflow-auto rounded-md bg-muted p-2 text-xs",
|
|
1467
1435
|
children: c.slice(-200).join("\n")
|
|
1468
1436
|
}),
|
|
1469
|
-
/* @__PURE__ */
|
|
1437
|
+
/* @__PURE__ */ A(G, {
|
|
1470
1438
|
target: t,
|
|
1471
|
-
children: /* @__PURE__ */
|
|
1439
|
+
children: /* @__PURE__ */ A(x, {
|
|
1472
1440
|
label: p ? e.addInstalling : e.addInstall,
|
|
1473
1441
|
variant: "primary",
|
|
1474
1442
|
disabled: !_ || p,
|
|
@@ -1500,48 +1468,53 @@ var Z = (e) => (e / 1024 ** 3).toFixed(1), Q = (e) => new Date(e).toLocaleString
|
|
|
1500
1468
|
timeStyle: "short"
|
|
1501
1469
|
});
|
|
1502
1470
|
function le({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
|
|
1503
|
-
let o =
|
|
1471
|
+
let o = I(n, r), [s, u] = d(null), [m, _] = d(null), [v, S] = d(null), [C, w] = d({
|
|
1504
1472
|
id: "",
|
|
1505
1473
|
name: ""
|
|
1506
|
-
}), [
|
|
1474
|
+
}), [T, D] = d(null), O = c(async () => {
|
|
1507
1475
|
try {
|
|
1508
|
-
u(await e.platform.status()),
|
|
1476
|
+
u(await e.platform.status()), _(null);
|
|
1509
1477
|
} catch (e) {
|
|
1510
|
-
|
|
1478
|
+
_(L(o.error, { error: e instanceof t ? e.code : String(e) }));
|
|
1511
1479
|
}
|
|
1512
1480
|
}, [e, o]);
|
|
1513
1481
|
return l(() => {
|
|
1514
1482
|
O();
|
|
1515
|
-
}, [O]), /* @__PURE__ */
|
|
1483
|
+
}, [O]), /* @__PURE__ */ j("div", {
|
|
1516
1484
|
className: "mx-auto flex max-w-4xl flex-col gap-4 p-4",
|
|
1517
1485
|
children: [
|
|
1518
|
-
/* @__PURE__ */
|
|
1486
|
+
/* @__PURE__ */ j("div", {
|
|
1519
1487
|
className: "flex items-center gap-2",
|
|
1520
|
-
children: [/* @__PURE__ */
|
|
1488
|
+
children: [/* @__PURE__ */ A("h1", {
|
|
1521
1489
|
className: "flex-1 text-xl font-semibold",
|
|
1522
1490
|
children: o.consoleTitle
|
|
1523
|
-
}), i && /* @__PURE__ */
|
|
1491
|
+
}), i && /* @__PURE__ */ A(f, {
|
|
1524
1492
|
icon: "log-out",
|
|
1525
1493
|
label: o.consoleSignOut,
|
|
1526
1494
|
variant: "outline-secondary",
|
|
1527
1495
|
onClick: i
|
|
1528
1496
|
})]
|
|
1529
1497
|
}),
|
|
1530
|
-
m && /* @__PURE__ */
|
|
1498
|
+
m && /* @__PURE__ */ A(p, {
|
|
1531
1499
|
variant: "danger",
|
|
1532
1500
|
children: m
|
|
1533
1501
|
}),
|
|
1534
|
-
/* @__PURE__ */
|
|
1502
|
+
/* @__PURE__ */ A(fe, {
|
|
1535
1503
|
client: e,
|
|
1536
1504
|
t: o,
|
|
1537
1505
|
approve: a,
|
|
1538
1506
|
onAnswered: O
|
|
1539
1507
|
}),
|
|
1540
|
-
/* @__PURE__ */
|
|
1508
|
+
/* @__PURE__ */ A(pe, {
|
|
1509
|
+
client: e,
|
|
1510
|
+
t: o,
|
|
1511
|
+
onAnswered: O
|
|
1512
|
+
}),
|
|
1513
|
+
/* @__PURE__ */ A(h, {
|
|
1541
1514
|
title: o.consoleStatus,
|
|
1542
1515
|
loading: !s && !m,
|
|
1543
1516
|
loaderMinHeight: 100,
|
|
1544
|
-
children: s && /* @__PURE__ */
|
|
1517
|
+
children: s && /* @__PURE__ */ A(y, { items: [
|
|
1545
1518
|
{
|
|
1546
1519
|
label: "Version",
|
|
1547
1520
|
value: s.version
|
|
@@ -1556,7 +1529,7 @@ function le({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
|
|
|
1556
1529
|
},
|
|
1557
1530
|
{
|
|
1558
1531
|
label: "Machine",
|
|
1559
|
-
value:
|
|
1532
|
+
value: L(o.consoleMachine, {
|
|
1560
1533
|
memory: Z(s.machine.availableBytes),
|
|
1561
1534
|
total: Z(s.machine.totalBytes),
|
|
1562
1535
|
cpus: s.machine.cpus
|
|
@@ -1568,27 +1541,27 @@ function le({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
|
|
|
1568
1541
|
}
|
|
1569
1542
|
] })
|
|
1570
1543
|
}),
|
|
1571
|
-
/* @__PURE__ */
|
|
1544
|
+
/* @__PURE__ */ A(h, {
|
|
1572
1545
|
title: o.consolePairing,
|
|
1573
|
-
children: /* @__PURE__ */
|
|
1546
|
+
children: /* @__PURE__ */ j("div", {
|
|
1574
1547
|
className: "flex flex-col gap-2",
|
|
1575
1548
|
children: [
|
|
1576
|
-
/* @__PURE__ */
|
|
1549
|
+
/* @__PURE__ */ A("p", {
|
|
1577
1550
|
className: "text-sm text-muted-foreground",
|
|
1578
1551
|
children: o.consolePairingHint
|
|
1579
1552
|
}),
|
|
1580
|
-
|
|
1553
|
+
v && /* @__PURE__ */ A(g, {
|
|
1581
1554
|
showCopy: !0,
|
|
1582
|
-
children:
|
|
1555
|
+
children: v.code
|
|
1583
1556
|
}),
|
|
1584
|
-
|
|
1557
|
+
v && /* @__PURE__ */ A("p", {
|
|
1585
1558
|
className: "text-xs text-muted-foreground",
|
|
1586
|
-
children:
|
|
1587
|
-
code:
|
|
1588
|
-
at: Q(
|
|
1559
|
+
children: L(o.consoleCode, {
|
|
1560
|
+
code: v.code,
|
|
1561
|
+
at: Q(v.expiresAt)
|
|
1589
1562
|
})
|
|
1590
1563
|
}),
|
|
1591
|
-
/* @__PURE__ */
|
|
1564
|
+
/* @__PURE__ */ A("div", { children: /* @__PURE__ */ A(x, {
|
|
1592
1565
|
label: o.consoleNewCode,
|
|
1593
1566
|
variant: "outline-primary",
|
|
1594
1567
|
onClick: async () => S(await e.createPairing())
|
|
@@ -1596,24 +1569,24 @@ function le({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
|
|
|
1596
1569
|
]
|
|
1597
1570
|
})
|
|
1598
1571
|
}),
|
|
1599
|
-
/* @__PURE__ */
|
|
1572
|
+
/* @__PURE__ */ A(ue, {
|
|
1600
1573
|
client: e,
|
|
1601
1574
|
t: o
|
|
1602
1575
|
}),
|
|
1603
|
-
/* @__PURE__ */
|
|
1576
|
+
/* @__PURE__ */ A(h, {
|
|
1604
1577
|
title: o.consoleTenants,
|
|
1605
|
-
children: /* @__PURE__ */
|
|
1578
|
+
children: /* @__PURE__ */ j("div", {
|
|
1606
1579
|
className: "flex flex-col gap-3",
|
|
1607
1580
|
children: [
|
|
1608
|
-
|
|
1581
|
+
T && /* @__PURE__ */ A(p, {
|
|
1609
1582
|
variant: "warning",
|
|
1610
1583
|
onClose: () => D(null),
|
|
1611
|
-
children: /* @__PURE__ */
|
|
1584
|
+
children: /* @__PURE__ */ A("span", {
|
|
1612
1585
|
className: "break-all",
|
|
1613
|
-
children:
|
|
1586
|
+
children: L(o.consoleKeyShown, { key: T })
|
|
1614
1587
|
})
|
|
1615
1588
|
}),
|
|
1616
|
-
s?.tenants.map((t) => /* @__PURE__ */
|
|
1589
|
+
s?.tenants.map((t) => /* @__PURE__ */ A(de, {
|
|
1617
1590
|
client: e,
|
|
1618
1591
|
tenant: t,
|
|
1619
1592
|
t: o,
|
|
@@ -1621,14 +1594,14 @@ function le({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
|
|
|
1621
1594
|
onKey: D,
|
|
1622
1595
|
onChange: O
|
|
1623
1596
|
}, t.id)),
|
|
1624
|
-
/* @__PURE__ */
|
|
1597
|
+
/* @__PURE__ */ A(b, {
|
|
1625
1598
|
appearance: "empty",
|
|
1626
1599
|
showNotice: !1,
|
|
1627
1600
|
onSubmit: () => !1,
|
|
1628
|
-
children: /* @__PURE__ */
|
|
1601
|
+
children: /* @__PURE__ */ j("div", {
|
|
1629
1602
|
className: "grid gap-2 sm:grid-cols-[1fr_1fr_auto] sm:items-end",
|
|
1630
1603
|
children: [
|
|
1631
|
-
/* @__PURE__ */
|
|
1604
|
+
/* @__PURE__ */ A(E, {
|
|
1632
1605
|
name: "tenantId",
|
|
1633
1606
|
label: o.consoleTenantId,
|
|
1634
1607
|
placeholder: "acme",
|
|
@@ -1637,7 +1610,7 @@ function le({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
|
|
|
1637
1610
|
id: String(e ?? "")
|
|
1638
1611
|
}))
|
|
1639
1612
|
}),
|
|
1640
|
-
/* @__PURE__ */
|
|
1613
|
+
/* @__PURE__ */ A(E, {
|
|
1641
1614
|
name: "tenantName",
|
|
1642
1615
|
label: o.consoleTenantName,
|
|
1643
1616
|
placeholder: "Acme",
|
|
@@ -1646,7 +1619,7 @@ function le({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
|
|
|
1646
1619
|
name: String(e ?? "")
|
|
1647
1620
|
}))
|
|
1648
1621
|
}),
|
|
1649
|
-
/* @__PURE__ */
|
|
1622
|
+
/* @__PURE__ */ A(x, {
|
|
1650
1623
|
label: o.consoleCreate,
|
|
1651
1624
|
variant: "primary",
|
|
1652
1625
|
disabled: !/^[a-z0-9][a-z0-9-]{0,62}$/.test(C.id),
|
|
@@ -1655,7 +1628,7 @@ function le({ client: e, locale: n, texts: r, onSignOut: i, approve: a }) {
|
|
|
1655
1628
|
let t = await e.platform.createTenant(C.id, { name: C.name || void 0 });
|
|
1656
1629
|
t.key && D(t.key), await O();
|
|
1657
1630
|
} catch (e) {
|
|
1658
|
-
|
|
1631
|
+
_(L(o.error, { error: e instanceof t ? e.code : String(e) }));
|
|
1659
1632
|
}
|
|
1660
1633
|
}
|
|
1661
1634
|
})
|
|
@@ -1672,36 +1645,57 @@ function ue({ client: e, t }) {
|
|
|
1672
1645
|
let [n, r] = d(null), [i, a] = d({}), [o, s] = d(null), u = c(async () => r(await e.platform.platformKeys()), [e]);
|
|
1673
1646
|
return l(() => {
|
|
1674
1647
|
u();
|
|
1675
|
-
}, [u]), /* @__PURE__ */
|
|
1648
|
+
}, [u]), /* @__PURE__ */ j(h, {
|
|
1676
1649
|
title: t.consolePlatforms,
|
|
1677
1650
|
loading: !n,
|
|
1678
1651
|
loaderMinHeight: 60,
|
|
1679
|
-
children: [/* @__PURE__ */
|
|
1652
|
+
children: [/* @__PURE__ */ j("div", {
|
|
1680
1653
|
className: "flex flex-col gap-3",
|
|
1681
1654
|
children: [
|
|
1682
|
-
/* @__PURE__ */
|
|
1655
|
+
/* @__PURE__ */ A("p", {
|
|
1683
1656
|
className: "text-sm text-muted-foreground",
|
|
1684
1657
|
children: t.consolePlatformsHint
|
|
1685
1658
|
}),
|
|
1686
|
-
n && !n.length && /* @__PURE__ */
|
|
1659
|
+
n && !n.length && /* @__PURE__ */ A("p", {
|
|
1687
1660
|
className: "text-sm text-muted-foreground",
|
|
1688
1661
|
children: t.consolePlatformsEmpty
|
|
1689
1662
|
}),
|
|
1690
1663
|
n?.map((n) => {
|
|
1691
1664
|
let r = i[n.id] ?? n.project ?? "";
|
|
1692
|
-
return /* @__PURE__ */
|
|
1665
|
+
return n.app ? /* @__PURE__ */ j("div", {
|
|
1666
|
+
className: "flex flex-wrap items-center gap-2 rounded-md border border-border p-3",
|
|
1667
|
+
children: [/* @__PURE__ */ j("div", {
|
|
1668
|
+
className: "flex flex-1 flex-col gap-1",
|
|
1669
|
+
children: [/* @__PURE__ */ A("span", {
|
|
1670
|
+
className: "font-medium",
|
|
1671
|
+
children: n.name
|
|
1672
|
+
}), /* @__PURE__ */ j("span", {
|
|
1673
|
+
className: "text-xs text-muted-foreground",
|
|
1674
|
+
children: [
|
|
1675
|
+
Q(n.createdAt),
|
|
1676
|
+
" · ",
|
|
1677
|
+
L(t.consolePlatformApp, { app: n.app })
|
|
1678
|
+
]
|
|
1679
|
+
})]
|
|
1680
|
+
}), /* @__PURE__ */ A(f, {
|
|
1681
|
+
icon: "trash",
|
|
1682
|
+
label: t.consoleRevoke,
|
|
1683
|
+
variant: "outline-danger",
|
|
1684
|
+
onClick: () => s(n)
|
|
1685
|
+
})]
|
|
1686
|
+
}, n.id) : /* @__PURE__ */ A(b, {
|
|
1693
1687
|
appearance: "empty",
|
|
1694
1688
|
showNotice: !1,
|
|
1695
1689
|
onSubmit: () => !1,
|
|
1696
|
-
children: /* @__PURE__ */
|
|
1690
|
+
children: /* @__PURE__ */ j("div", {
|
|
1697
1691
|
className: "grid gap-2 rounded-md border border-border p-3 sm:grid-cols-[1fr_12rem_auto] sm:items-end",
|
|
1698
1692
|
children: [
|
|
1699
|
-
/* @__PURE__ */
|
|
1693
|
+
/* @__PURE__ */ j("div", {
|
|
1700
1694
|
className: "flex flex-col gap-1",
|
|
1701
|
-
children: [/* @__PURE__ */
|
|
1695
|
+
children: [/* @__PURE__ */ A("span", {
|
|
1702
1696
|
className: "font-medium",
|
|
1703
1697
|
children: n.name
|
|
1704
|
-
}), /* @__PURE__ */
|
|
1698
|
+
}), /* @__PURE__ */ j("span", {
|
|
1705
1699
|
className: "text-xs text-muted-foreground",
|
|
1706
1700
|
children: [
|
|
1707
1701
|
Q(n.createdAt),
|
|
@@ -1710,7 +1704,7 @@ function ue({ client: e, t }) {
|
|
|
1710
1704
|
]
|
|
1711
1705
|
})]
|
|
1712
1706
|
}),
|
|
1713
|
-
/* @__PURE__ */
|
|
1707
|
+
/* @__PURE__ */ A(E, {
|
|
1714
1708
|
name: `project-${n.id}`,
|
|
1715
1709
|
label: t.consolePlatformProject,
|
|
1716
1710
|
value: r,
|
|
@@ -1720,16 +1714,16 @@ function ue({ client: e, t }) {
|
|
|
1720
1714
|
[n.id]: String(e ?? "").trim()
|
|
1721
1715
|
}))
|
|
1722
1716
|
}),
|
|
1723
|
-
/* @__PURE__ */
|
|
1717
|
+
/* @__PURE__ */ j("div", {
|
|
1724
1718
|
className: "flex gap-2",
|
|
1725
|
-
children: [/* @__PURE__ */
|
|
1719
|
+
children: [/* @__PURE__ */ A(x, {
|
|
1726
1720
|
label: t.consolePlatformSave,
|
|
1727
1721
|
variant: "outline-primary",
|
|
1728
1722
|
disabled: r === (n.project ?? "") || r !== "" && !/^[a-z0-9]{1,32}$/.test(r),
|
|
1729
1723
|
onClick: async () => {
|
|
1730
1724
|
await e.setKeyProject(n.id, r || null), await u();
|
|
1731
1725
|
}
|
|
1732
|
-
}), /* @__PURE__ */
|
|
1726
|
+
}), /* @__PURE__ */ A(f, {
|
|
1733
1727
|
icon: "trash",
|
|
1734
1728
|
label: t.consoleRevoke,
|
|
1735
1729
|
variant: "outline-danger",
|
|
@@ -1741,33 +1735,38 @@ function ue({ client: e, t }) {
|
|
|
1741
1735
|
}, n.id);
|
|
1742
1736
|
})
|
|
1743
1737
|
]
|
|
1744
|
-
}), o && /* @__PURE__ */
|
|
1738
|
+
}), o && /* @__PURE__ */ A(C, {
|
|
1745
1739
|
title: t.consoleRevoke,
|
|
1746
1740
|
danger: !0,
|
|
1747
1741
|
onClose: () => s(null),
|
|
1748
1742
|
onYes: async () => (await e.platform.revokePlatformKey(o.id), s(null), await u(), !0),
|
|
1749
|
-
children:
|
|
1743
|
+
children: L(t.consolePlatformRevokeConfirm, { name: o.name })
|
|
1750
1744
|
})]
|
|
1751
1745
|
});
|
|
1752
1746
|
}
|
|
1753
1747
|
function de({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
|
|
1754
|
-
let [o, s] = d(!1), [p, h] = d(null), [g, _] = d(!1), v = u(() => e.as({ tenant: t.id }), [e, t.id]),
|
|
1748
|
+
let [o, s] = d(!1), [p, h] = d(null), [g, _] = d(!1), [v, y] = d({}), b = u(() => e.as({ tenant: t.id }), [e, t.id]), S = c(async () => h(await e.platform.keys(t.id)), [e, t.id]);
|
|
1755
1749
|
return l(() => {
|
|
1756
|
-
o &&
|
|
1757
|
-
}, [
|
|
1750
|
+
o && (S(), t.platforms?.length && e.platform.platformKeys().then((e) => y(Object.fromEntries(e.map((e) => [e.id, e.app ? `${e.name} (${e.app})` : e.name])))).catch(() => void 0));
|
|
1751
|
+
}, [
|
|
1752
|
+
o,
|
|
1753
|
+
S,
|
|
1754
|
+
e,
|
|
1755
|
+
t.platforms
|
|
1756
|
+
]), /* @__PURE__ */ j("div", {
|
|
1758
1757
|
className: "rounded-md border border-border p-3",
|
|
1759
1758
|
children: [
|
|
1760
|
-
/* @__PURE__ */
|
|
1759
|
+
/* @__PURE__ */ j("div", {
|
|
1761
1760
|
className: "flex flex-wrap items-center gap-2",
|
|
1762
1761
|
children: [
|
|
1763
|
-
/* @__PURE__ */
|
|
1762
|
+
/* @__PURE__ */ j("button", {
|
|
1764
1763
|
type: "button",
|
|
1765
1764
|
className: "flex-1 text-left font-medium",
|
|
1766
1765
|
onClick: () => s((e) => !e),
|
|
1767
1766
|
children: [
|
|
1768
1767
|
t.name,
|
|
1769
1768
|
" ",
|
|
1770
|
-
/* @__PURE__ */
|
|
1769
|
+
/* @__PURE__ */ j("span", {
|
|
1771
1770
|
className: "text-xs text-muted-foreground",
|
|
1772
1771
|
children: [
|
|
1773
1772
|
"(",
|
|
@@ -1777,11 +1776,11 @@ function de({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
|
|
|
1777
1776
|
})
|
|
1778
1777
|
]
|
|
1779
1778
|
}),
|
|
1780
|
-
t.usersWithAccounts !== void 0 && /* @__PURE__ */
|
|
1779
|
+
t.usersWithAccounts !== void 0 && /* @__PURE__ */ j(m, {
|
|
1781
1780
|
variant: "light",
|
|
1782
1781
|
children: [t.usersWithAccounts, " 👤"]
|
|
1783
1782
|
}),
|
|
1784
|
-
/* @__PURE__ */
|
|
1783
|
+
/* @__PURE__ */ A(f, {
|
|
1785
1784
|
icon: "trash",
|
|
1786
1785
|
label: n.consoleRemoveTenant,
|
|
1787
1786
|
variant: "outline-danger",
|
|
@@ -1789,34 +1788,54 @@ function de({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
|
|
|
1789
1788
|
})
|
|
1790
1789
|
]
|
|
1791
1790
|
}),
|
|
1792
|
-
o && /* @__PURE__ */
|
|
1791
|
+
o && /* @__PURE__ */ j("div", {
|
|
1793
1792
|
className: "mt-3 flex flex-col gap-3",
|
|
1794
1793
|
children: [
|
|
1795
|
-
/* @__PURE__ */
|
|
1794
|
+
/* @__PURE__ */ A("h4", {
|
|
1795
|
+
className: "text-sm font-semibold",
|
|
1796
|
+
children: n.consoleTenantPlatforms
|
|
1797
|
+
}),
|
|
1798
|
+
t.platforms?.length ? t.platforms.map((r) => /* @__PURE__ */ j("div", {
|
|
1799
|
+
className: "flex flex-wrap items-center gap-2 text-sm",
|
|
1800
|
+
children: [/* @__PURE__ */ A("span", {
|
|
1801
|
+
className: "flex-1",
|
|
1802
|
+
children: v[r] ?? r
|
|
1803
|
+
}), /* @__PURE__ */ A(f, {
|
|
1804
|
+
label: n.consoleUngrant,
|
|
1805
|
+
variant: "outline-danger",
|
|
1806
|
+
onClick: async () => {
|
|
1807
|
+
await e.grantTenant(t.id, r, !1), await a();
|
|
1808
|
+
}
|
|
1809
|
+
})]
|
|
1810
|
+
}, r)) : /* @__PURE__ */ A("p", {
|
|
1811
|
+
className: "text-sm text-muted-foreground",
|
|
1812
|
+
children: n.consoleTenantPlatformsNone
|
|
1813
|
+
}),
|
|
1814
|
+
/* @__PURE__ */ A("h4", {
|
|
1796
1815
|
className: "text-sm font-semibold",
|
|
1797
1816
|
children: n.consoleKeys
|
|
1798
1817
|
}),
|
|
1799
|
-
p?.map((r) => /* @__PURE__ */
|
|
1818
|
+
p?.map((r) => /* @__PURE__ */ j("div", {
|
|
1800
1819
|
className: "flex flex-wrap items-center gap-2 text-sm",
|
|
1801
1820
|
children: [
|
|
1802
|
-
/* @__PURE__ */
|
|
1821
|
+
/* @__PURE__ */ A("span", {
|
|
1803
1822
|
className: "flex-1",
|
|
1804
1823
|
children: r.name
|
|
1805
1824
|
}),
|
|
1806
|
-
r.permissions.map((e) => /* @__PURE__ */
|
|
1825
|
+
r.permissions.map((e) => /* @__PURE__ */ A(m, {
|
|
1807
1826
|
variant: "info",
|
|
1808
1827
|
children: e
|
|
1809
1828
|
}, e)),
|
|
1810
|
-
/* @__PURE__ */
|
|
1829
|
+
/* @__PURE__ */ A(f, {
|
|
1811
1830
|
label: n.consoleRevoke,
|
|
1812
1831
|
variant: "outline-danger",
|
|
1813
1832
|
onClick: async () => {
|
|
1814
|
-
await e.platform.revokeKey(t.id, r.id), await
|
|
1833
|
+
await e.platform.revokeKey(t.id, r.id), await S();
|
|
1815
1834
|
}
|
|
1816
1835
|
})
|
|
1817
1836
|
]
|
|
1818
1837
|
}, r.id)),
|
|
1819
|
-
/* @__PURE__ */
|
|
1838
|
+
/* @__PURE__ */ A("div", { children: /* @__PURE__ */ A(x, {
|
|
1820
1839
|
label: n.consoleNewKey,
|
|
1821
1840
|
variant: "outline-secondary",
|
|
1822
1841
|
onClick: async () => {
|
|
@@ -1829,27 +1848,27 @@ function de({ client: e, tenant: t, t: n, locale: r, onKey: i, onChange: a }) {
|
|
|
1829
1848
|
"accounts",
|
|
1830
1849
|
"act-as-user"
|
|
1831
1850
|
]
|
|
1832
|
-
})).key), await
|
|
1851
|
+
})).key), await S();
|
|
1833
1852
|
}
|
|
1834
1853
|
}) }),
|
|
1835
|
-
/* @__PURE__ */
|
|
1854
|
+
/* @__PURE__ */ A("h4", {
|
|
1836
1855
|
className: "text-sm font-semibold",
|
|
1837
1856
|
children: n.consoleAccounts
|
|
1838
1857
|
}),
|
|
1839
|
-
/* @__PURE__ */
|
|
1840
|
-
client:
|
|
1858
|
+
/* @__PURE__ */ A(H, {
|
|
1859
|
+
client: b,
|
|
1841
1860
|
scope: "tenant",
|
|
1842
1861
|
locale: r,
|
|
1843
1862
|
texts: n
|
|
1844
1863
|
})
|
|
1845
1864
|
]
|
|
1846
1865
|
}),
|
|
1847
|
-
g && /* @__PURE__ */
|
|
1866
|
+
g && /* @__PURE__ */ A(C, {
|
|
1848
1867
|
title: n.consoleRemoveTenant,
|
|
1849
1868
|
danger: !0,
|
|
1850
1869
|
onClose: () => _(!1),
|
|
1851
1870
|
onYes: async () => (await e.platform.removeTenant(t.id), _(!1), await a(), !0),
|
|
1852
|
-
children:
|
|
1871
|
+
children: L(n.consoleRemoveTenantConfirm, { name: t.name })
|
|
1853
1872
|
})
|
|
1854
1873
|
]
|
|
1855
1874
|
});
|
|
@@ -1868,22 +1887,22 @@ function fe({ client: e, t, approve: n, onAnswered: r }) {
|
|
|
1868
1887
|
u();
|
|
1869
1888
|
let e = setInterval(() => void u(), 5e3);
|
|
1870
1889
|
return () => clearInterval(e);
|
|
1871
|
-
}, [u]), !n && !i?.length && !o ? null : /* @__PURE__ */
|
|
1890
|
+
}, [u]), !n && !i?.length && !o ? null : /* @__PURE__ */ A(h, {
|
|
1872
1891
|
title: t.consoleRequests,
|
|
1873
1892
|
loading: i === null,
|
|
1874
1893
|
loaderMinHeight: 80,
|
|
1875
|
-
children: /* @__PURE__ */
|
|
1894
|
+
children: /* @__PURE__ */ j("div", {
|
|
1876
1895
|
className: "flex flex-col gap-3",
|
|
1877
1896
|
children: [
|
|
1878
|
-
/* @__PURE__ */
|
|
1897
|
+
/* @__PURE__ */ A("p", {
|
|
1879
1898
|
className: "text-sm text-muted-foreground",
|
|
1880
1899
|
children: t.consoleRequestsHint
|
|
1881
1900
|
}),
|
|
1882
|
-
o && /* @__PURE__ */
|
|
1901
|
+
o && /* @__PURE__ */ A(p, {
|
|
1883
1902
|
variant: o.variant,
|
|
1884
1903
|
children: o.text
|
|
1885
1904
|
}),
|
|
1886
|
-
i?.length === 0 && !o && /* @__PURE__ */
|
|
1905
|
+
i?.length === 0 && !o && /* @__PURE__ */ A("p", {
|
|
1887
1906
|
className: "text-sm text-muted-foreground",
|
|
1888
1907
|
children: t.consoleRequestsEmpty
|
|
1889
1908
|
}),
|
|
@@ -1892,42 +1911,42 @@ function fe({ client: e, t, approve: n, onAnswered: r }) {
|
|
|
1892
1911
|
let a = await e.answerPairing(i.code, n);
|
|
1893
1912
|
s(n ? {
|
|
1894
1913
|
variant: "success",
|
|
1895
|
-
text:
|
|
1914
|
+
text: L(t.consoleApproved, { name: a.name })
|
|
1896
1915
|
} : {
|
|
1897
1916
|
variant: "info",
|
|
1898
1917
|
text: t.consoleDenied
|
|
1899
1918
|
}), await u(), await r();
|
|
1900
1919
|
};
|
|
1901
|
-
return /* @__PURE__ */
|
|
1920
|
+
return /* @__PURE__ */ j("div", {
|
|
1902
1921
|
className: `flex flex-col gap-2 rounded-md border p-3 ${a ? "border-primary" : "border-border"}`,
|
|
1903
1922
|
children: [
|
|
1904
|
-
a && /* @__PURE__ */
|
|
1923
|
+
a && /* @__PURE__ */ A(m, {
|
|
1905
1924
|
variant: "primary",
|
|
1906
1925
|
children: t.consoleRequestMatch
|
|
1907
1926
|
}),
|
|
1908
|
-
/* @__PURE__ */
|
|
1927
|
+
/* @__PURE__ */ A("div", {
|
|
1909
1928
|
className: "font-mono text-2xl font-semibold tracking-widest",
|
|
1910
1929
|
children: i.code
|
|
1911
1930
|
}),
|
|
1912
|
-
/* @__PURE__ */
|
|
1931
|
+
/* @__PURE__ */ A("p", {
|
|
1913
1932
|
className: "text-sm",
|
|
1914
|
-
children:
|
|
1933
|
+
children: L(t.consoleRequestFrom, {
|
|
1915
1934
|
name: i.name,
|
|
1916
1935
|
from: i.from ?? "?",
|
|
1917
1936
|
at: Q(i.createdAt)
|
|
1918
1937
|
})
|
|
1919
1938
|
}),
|
|
1920
|
-
/* @__PURE__ */
|
|
1939
|
+
/* @__PURE__ */ A("p", {
|
|
1921
1940
|
className: "text-sm text-muted-foreground",
|
|
1922
|
-
children: i.project ?
|
|
1941
|
+
children: i.app ? L(t.consoleRequestApp, { app: i.app }) : i.project ? L(t.consoleRequestProject, { project: i.project }) : t.consoleRequestAll
|
|
1923
1942
|
}),
|
|
1924
|
-
/* @__PURE__ */
|
|
1943
|
+
/* @__PURE__ */ j("div", {
|
|
1925
1944
|
className: "flex flex-wrap gap-2",
|
|
1926
|
-
children: [/* @__PURE__ */
|
|
1945
|
+
children: [/* @__PURE__ */ A(x, {
|
|
1927
1946
|
label: t.consoleApprove,
|
|
1928
1947
|
variant: "primary",
|
|
1929
1948
|
onClick: () => o(!0)
|
|
1930
|
-
}), /* @__PURE__ */
|
|
1949
|
+
}), /* @__PURE__ */ A(x, {
|
|
1931
1950
|
label: t.consoleDeny,
|
|
1932
1951
|
variant: "outline-danger",
|
|
1933
1952
|
onClick: () => o(!1)
|
|
@@ -1940,6 +1959,72 @@ function fe({ client: e, t, approve: n, onAnswered: r }) {
|
|
|
1940
1959
|
})
|
|
1941
1960
|
});
|
|
1942
1961
|
}
|
|
1943
|
-
|
|
1962
|
+
function pe({ client: e, t, onAnswered: n }) {
|
|
1963
|
+
let [r, i] = d([]), [a, o] = d(null), s = c(async () => {
|
|
1964
|
+
try {
|
|
1965
|
+
i(await e.grantRequests());
|
|
1966
|
+
} catch {
|
|
1967
|
+
i([]);
|
|
1968
|
+
}
|
|
1969
|
+
}, [e]);
|
|
1970
|
+
return l(() => {
|
|
1971
|
+
s();
|
|
1972
|
+
let e = setInterval(() => void s(), 5e3);
|
|
1973
|
+
return () => clearInterval(e);
|
|
1974
|
+
}, [s]), !r.length && !a ? null : /* @__PURE__ */ A(h, {
|
|
1975
|
+
title: t.consoleGrants,
|
|
1976
|
+
children: /* @__PURE__ */ j("div", {
|
|
1977
|
+
className: "flex flex-col gap-3",
|
|
1978
|
+
children: [
|
|
1979
|
+
/* @__PURE__ */ A("p", {
|
|
1980
|
+
className: "text-sm text-muted-foreground",
|
|
1981
|
+
children: t.consoleGrantsHint
|
|
1982
|
+
}),
|
|
1983
|
+
a && /* @__PURE__ */ A(p, {
|
|
1984
|
+
variant: a.variant,
|
|
1985
|
+
children: a.text
|
|
1986
|
+
}),
|
|
1987
|
+
r.map((r) => {
|
|
1988
|
+
let i = async (i) => {
|
|
1989
|
+
await e.answerGrant(r.id, i), o(i ? {
|
|
1990
|
+
variant: "success",
|
|
1991
|
+
text: L(t.consoleGrantApproved, {
|
|
1992
|
+
name: r.keyName,
|
|
1993
|
+
tenant: r.tenant
|
|
1994
|
+
})
|
|
1995
|
+
} : {
|
|
1996
|
+
variant: "info",
|
|
1997
|
+
text: t.consoleGrantDenied
|
|
1998
|
+
}), await s(), await n();
|
|
1999
|
+
};
|
|
2000
|
+
return /* @__PURE__ */ j("div", {
|
|
2001
|
+
className: "flex flex-col gap-2 rounded-md border border-border p-3",
|
|
2002
|
+
children: [/* @__PURE__ */ A("p", {
|
|
2003
|
+
className: "text-sm",
|
|
2004
|
+
children: L(t.consoleGrantFrom, {
|
|
2005
|
+
name: r.keyName,
|
|
2006
|
+
app: r.app ?? "?",
|
|
2007
|
+
tenant: r.tenant,
|
|
2008
|
+
at: Q(r.createdAt)
|
|
2009
|
+
})
|
|
2010
|
+
}), /* @__PURE__ */ j("div", {
|
|
2011
|
+
className: "flex flex-wrap gap-2",
|
|
2012
|
+
children: [/* @__PURE__ */ A(x, {
|
|
2013
|
+
label: t.consoleApprove,
|
|
2014
|
+
variant: "primary",
|
|
2015
|
+
onClick: () => i(!0)
|
|
2016
|
+
}), /* @__PURE__ */ A(x, {
|
|
2017
|
+
label: t.consoleDeny,
|
|
2018
|
+
variant: "outline-danger",
|
|
2019
|
+
onClick: () => i(!1)
|
|
2020
|
+
})]
|
|
2021
|
+
})]
|
|
2022
|
+
}, r.id);
|
|
2023
|
+
})
|
|
2024
|
+
]
|
|
2025
|
+
})
|
|
2026
|
+
});
|
|
2027
|
+
}
|
|
2028
|
+
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 };
|
|
1944
2029
|
|
|
1945
2030
|
//# sourceMappingURL=ui.mjs.map
|