@kukeon/console 0.0.0-stage → 0.10.0-edge.g21af9f59
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/auth.d.ts +39 -0
- package/dist/bulk-ui.d.ts +49 -0
- package/dist/bulk.d.mts +14 -0
- package/dist/catalog-CBVxh9uQ.js +5005 -0
- package/dist/catalog-url-Dr9e92Yq.js +19 -0
- package/dist/catalog-url.d.mts +4 -0
- package/dist/catalog.d.ts +40 -0
- package/dist/cell-filter.d.ts +10 -0
- package/dist/cell-sidebar.d.ts +26 -0
- package/dist/cells.d.mts +29 -0
- package/dist/cgroup-format.d.ts +17 -0
- package/dist/cgroup.d.ts +4 -0
- package/dist/config-form.d.mts +66 -0
- package/dist/connector-ui-lYy-1M3l.js +2692 -0
- package/dist/connector-ui.d.ts +127 -0
- package/dist/connectors-page-Z7acjRvr.js +1460 -0
- package/dist/connectors-page.d.ts +14 -0
- package/dist/connectors.d.mts +153 -0
- package/dist/container-log.d.ts +11 -0
- package/dist/create.d.ts +11 -0
- package/dist/creation-schema.d.mts +15 -0
- package/dist/daemon.d.ts +24 -0
- package/dist/display-name.d.ts +10 -0
- package/dist/drift-diff.d.ts +4 -0
- package/dist/exec.d.ts +15 -0
- package/dist/extensions.d.ts +111 -0
- package/dist/get-started.d.ts +9 -0
- package/dist/health.d.ts +22 -0
- package/dist/image-format.d.ts +6 -0
- package/dist/image-inventory.d.ts +12 -0
- package/dist/images.d.ts +5 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.js +5595 -0
- package/dist/initialize-CGmYWoaj.js +146 -0
- package/dist/initialize.d.ts +21 -0
- package/dist/inventory.d.ts +66 -0
- package/dist/lifecycle-policy.d.ts +11 -0
- package/dist/lifecycle.d.ts +24 -0
- package/dist/log-buffer.d.ts +8 -0
- package/dist/main.d.ts +13 -0
- package/dist/majordomo.d.ts +102 -0
- package/dist/manage-nav.d.ts +4 -0
- package/dist/manifest-diff.d.mts +11 -0
- package/dist/merged-values-BhW2-nlA.js +739 -0
- package/dist/merged-values.d.ts +24 -0
- package/dist/network-format.d.ts +30 -0
- package/dist/network.d.ts +13 -0
- package/dist/new-agent-24Fcf0PI.js +201 -0
- package/dist/new-agent.d.ts +27 -0
- package/dist/new-cell-u87hB9wV.js +1985 -0
- package/dist/new-cell.d.ts +29 -0
- package/dist/new-config-B_uf4R4e.js +1541 -0
- package/dist/new-config.d.ts +7 -0
- package/dist/notifications.d.ts +26 -0
- package/dist/onboarding-CPDpnS7K.js +395 -0
- package/dist/onboarding.d.mts +40 -0
- package/dist/panel-cells.d.mts +8 -0
- package/dist/registry-credentials.d.ts +13 -0
- package/dist/relationships.d.mts +12 -0
- package/dist/request.d.ts +16 -0
- package/dist/router.d.ts +12 -0
- package/dist/routes.d.ts +41 -0
- package/dist/schedule-B08uvsJe.js +113 -0
- package/dist/schedule-format.d.mts +9 -0
- package/dist/schedule.d.ts +16 -0
- package/dist/scope-actions.d.ts +9 -0
- package/dist/screens.d.ts +6 -0
- package/dist/secret-form.d.ts +24 -0
- package/dist/settings-nav.d.ts +5 -0
- package/dist/settings-page.d.ts +4 -0
- package/dist/settings-values.d.mts +18 -0
- package/dist/settings.d.ts +50 -0
- package/dist/sidebar-shell.d.ts +55 -0
- package/dist/sources-page-C4t29wxJ.js +423 -0
- package/dist/sources-page.d.ts +5 -0
- package/dist/space-subnets.d.ts +3 -0
- package/dist/style.css +2 -0
- package/dist/team-form.d.mts +56 -0
- package/dist/team-plan-CaBIrof0.js +735 -0
- package/dist/team-plan.d.ts +22 -0
- package/dist/team-wizard.d.ts +8 -0
- package/dist/teams-page-CLdQhhgo.js +2206 -0
- package/dist/teams-page.d.ts +9 -0
- package/dist/teams.d.mts +112 -0
- package/dist/terminal-palette.d.ts +8 -0
- package/dist/terminal.d.ts +98 -0
- package/dist/unread.d.mts +19 -0
- package/dist/use-unread.d.ts +4 -0
- package/dist/user-menu.d.ts +7 -0
- package/dist/views.d.mts +8 -0
- package/dist/workbench.d.ts +16 -0
- package/package.json +45 -4
- package/README.md +0 -3
|
@@ -0,0 +1,1985 @@
|
|
|
1
|
+
import { At as e, Fn as t, Lt as n, Mn as r, Mt as i, Nn as a, Nt as o, Pt as s, Rn as c, Rt as l, Un as u, Xt as d, Zt as f, a as p, an as m, g as h, gn as ee, i as te, l as ne, ln as re, mt as g, n as ie, s as ae, tn as _, un as oe, yt as v } from "./connector-ui-lYy-1M3l.js";
|
|
2
|
+
import { d as se, n as y, r as b } from "./merged-values-BhW2-nlA.js";
|
|
3
|
+
import { r as x, t as S } from "./catalog-url-Dr9e92Yq.js";
|
|
4
|
+
import { useEffect as ce, useMemo as le, useRef as C, useState as w } from "react";
|
|
5
|
+
import { apiFetch as ue } from "@kukeon/api-client";
|
|
6
|
+
import { Fragment as T, jsx as E, jsxs as D } from "react/jsx-runtime";
|
|
7
|
+
import { Disclosure as O } from "@kukeon/ui";
|
|
8
|
+
// src/creation-schema.mjs
|
|
9
|
+
var k = [{
|
|
10
|
+
key: "name",
|
|
11
|
+
label: "Name",
|
|
12
|
+
kind: "text",
|
|
13
|
+
required: !0
|
|
14
|
+
}, {
|
|
15
|
+
key: "email",
|
|
16
|
+
label: "Email",
|
|
17
|
+
kind: "text",
|
|
18
|
+
required: !0
|
|
19
|
+
}], A = [
|
|
20
|
+
{
|
|
21
|
+
key: "id",
|
|
22
|
+
label: "Container ID / name",
|
|
23
|
+
kind: "text",
|
|
24
|
+
required: !0
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
key: "image",
|
|
28
|
+
label: "OCI image",
|
|
29
|
+
kind: "text",
|
|
30
|
+
required: !0,
|
|
31
|
+
help: "For example: ghcr.io/example/app:latest"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
key: "command",
|
|
35
|
+
label: "Command",
|
|
36
|
+
kind: "text"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
key: "args",
|
|
40
|
+
label: "Arguments",
|
|
41
|
+
kind: "strings",
|
|
42
|
+
help: "One argument per row."
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
key: "workingDir",
|
|
46
|
+
label: "Working directory",
|
|
47
|
+
kind: "text"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
key: "env",
|
|
51
|
+
label: "Environment variables",
|
|
52
|
+
kind: "env",
|
|
53
|
+
help: "Values are redacted in previews and server errors. Prefer Secret references for credentials."
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
key: "attachable",
|
|
57
|
+
label: "Attachable terminal",
|
|
58
|
+
kind: "boolean"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
key: "root",
|
|
62
|
+
label: "Explicitly mark this container as the root",
|
|
63
|
+
kind: "boolean",
|
|
64
|
+
advanced: !0,
|
|
65
|
+
help: "Leave off to let kukeon add its default root container."
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
key: "volumes",
|
|
69
|
+
label: "Volumes and mounts",
|
|
70
|
+
kind: "objects",
|
|
71
|
+
advanced: !0,
|
|
72
|
+
itemLabel: "Mount",
|
|
73
|
+
fields: [
|
|
74
|
+
{
|
|
75
|
+
key: "kind",
|
|
76
|
+
label: "Mount kind",
|
|
77
|
+
kind: "enum",
|
|
78
|
+
options: [
|
|
79
|
+
"bind",
|
|
80
|
+
"tmpfs",
|
|
81
|
+
"volume"
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
key: "source",
|
|
86
|
+
label: "Source / volume name",
|
|
87
|
+
kind: "text"
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
key: "target",
|
|
91
|
+
label: "Container target",
|
|
92
|
+
kind: "text",
|
|
93
|
+
required: !0
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
key: "readOnly",
|
|
97
|
+
label: "Read only",
|
|
98
|
+
kind: "boolean"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
key: "sizeBytes",
|
|
102
|
+
label: "Size (bytes)",
|
|
103
|
+
kind: "number"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
key: "mode",
|
|
107
|
+
label: "Mode",
|
|
108
|
+
kind: "number"
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
key: "ensure",
|
|
112
|
+
label: "Create referenced volume if missing",
|
|
113
|
+
kind: "boolean"
|
|
114
|
+
},
|
|
115
|
+
{
|
|
116
|
+
key: "volumeRef",
|
|
117
|
+
label: "Scoped volume reference",
|
|
118
|
+
kind: "object",
|
|
119
|
+
fields: [
|
|
120
|
+
{
|
|
121
|
+
key: "name",
|
|
122
|
+
label: "Volume name",
|
|
123
|
+
kind: "text",
|
|
124
|
+
required: !0
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
key: "realm",
|
|
128
|
+
label: "Realm",
|
|
129
|
+
kind: "text",
|
|
130
|
+
required: !0
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
key: "space",
|
|
134
|
+
label: "Space",
|
|
135
|
+
kind: "text"
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
key: "stack",
|
|
139
|
+
label: "Stack",
|
|
140
|
+
kind: "text"
|
|
141
|
+
}
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
]
|
|
145
|
+
},
|
|
146
|
+
{
|
|
147
|
+
key: "privileged",
|
|
148
|
+
label: "Privileged mode",
|
|
149
|
+
kind: "boolean",
|
|
150
|
+
advanced: !0
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
key: "hostNetwork",
|
|
154
|
+
label: "Host network namespace",
|
|
155
|
+
kind: "boolean",
|
|
156
|
+
advanced: !0
|
|
157
|
+
},
|
|
158
|
+
{
|
|
159
|
+
key: "hostPID",
|
|
160
|
+
label: "Host PID namespace",
|
|
161
|
+
kind: "boolean",
|
|
162
|
+
advanced: !0
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
key: "hostCgroup",
|
|
166
|
+
label: "Host cgroup namespace",
|
|
167
|
+
kind: "boolean",
|
|
168
|
+
advanced: !0
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
key: "user",
|
|
172
|
+
label: "User",
|
|
173
|
+
kind: "text",
|
|
174
|
+
advanced: !0
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
key: "readOnlyRootFilesystem",
|
|
178
|
+
label: "Read-only root filesystem",
|
|
179
|
+
kind: "boolean",
|
|
180
|
+
advanced: !0
|
|
181
|
+
},
|
|
182
|
+
{
|
|
183
|
+
key: "capabilities",
|
|
184
|
+
label: "Linux capabilities",
|
|
185
|
+
kind: "object",
|
|
186
|
+
advanced: !0,
|
|
187
|
+
fields: [{
|
|
188
|
+
key: "add",
|
|
189
|
+
label: "Add",
|
|
190
|
+
kind: "strings"
|
|
191
|
+
}, {
|
|
192
|
+
key: "drop",
|
|
193
|
+
label: "Drop",
|
|
194
|
+
kind: "strings"
|
|
195
|
+
}]
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
key: "securityOpts",
|
|
199
|
+
label: "Security options",
|
|
200
|
+
kind: "strings",
|
|
201
|
+
advanced: !0
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
key: "devices",
|
|
205
|
+
label: "Device passthrough paths",
|
|
206
|
+
kind: "strings",
|
|
207
|
+
advanced: !0
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
key: "tmpfs",
|
|
211
|
+
label: "Tmpfs mounts",
|
|
212
|
+
kind: "objects",
|
|
213
|
+
advanced: !0,
|
|
214
|
+
itemLabel: "Tmpfs mount",
|
|
215
|
+
fields: [
|
|
216
|
+
{
|
|
217
|
+
key: "path",
|
|
218
|
+
label: "Container path",
|
|
219
|
+
kind: "text",
|
|
220
|
+
required: !0
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
key: "sizeBytes",
|
|
224
|
+
label: "Size (bytes)",
|
|
225
|
+
kind: "number"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
key: "options",
|
|
229
|
+
label: "Mount options",
|
|
230
|
+
kind: "strings"
|
|
231
|
+
}
|
|
232
|
+
]
|
|
233
|
+
},
|
|
234
|
+
{
|
|
235
|
+
key: "resources",
|
|
236
|
+
label: "Resource limits",
|
|
237
|
+
kind: "object",
|
|
238
|
+
advanced: !0,
|
|
239
|
+
fields: [
|
|
240
|
+
{
|
|
241
|
+
key: "memoryLimitBytes",
|
|
242
|
+
label: "Memory limit (bytes)",
|
|
243
|
+
kind: "number"
|
|
244
|
+
},
|
|
245
|
+
{
|
|
246
|
+
key: "cpuShares",
|
|
247
|
+
label: "CPU shares",
|
|
248
|
+
kind: "number"
|
|
249
|
+
},
|
|
250
|
+
{
|
|
251
|
+
key: "pidsLimit",
|
|
252
|
+
label: "PIDs limit",
|
|
253
|
+
kind: "number"
|
|
254
|
+
}
|
|
255
|
+
]
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
key: "secrets",
|
|
259
|
+
label: "Secret references",
|
|
260
|
+
kind: "objects",
|
|
261
|
+
advanced: !0,
|
|
262
|
+
itemLabel: "Secret",
|
|
263
|
+
fields: [
|
|
264
|
+
{
|
|
265
|
+
key: "name",
|
|
266
|
+
label: "Container secret name",
|
|
267
|
+
kind: "text",
|
|
268
|
+
required: !0
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
key: "fromFile",
|
|
272
|
+
label: "Read host file",
|
|
273
|
+
kind: "text"
|
|
274
|
+
},
|
|
275
|
+
{
|
|
276
|
+
key: "fromEnv",
|
|
277
|
+
label: "Read host environment variable",
|
|
278
|
+
kind: "text"
|
|
279
|
+
},
|
|
280
|
+
{
|
|
281
|
+
key: "mountPath",
|
|
282
|
+
label: "Mount path",
|
|
283
|
+
kind: "text"
|
|
284
|
+
},
|
|
285
|
+
{
|
|
286
|
+
key: "secretRef",
|
|
287
|
+
label: "kukeon Secret reference",
|
|
288
|
+
kind: "object",
|
|
289
|
+
fields: [
|
|
290
|
+
{
|
|
291
|
+
key: "name",
|
|
292
|
+
label: "Secret name",
|
|
293
|
+
kind: "text",
|
|
294
|
+
required: !0
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
key: "realm",
|
|
298
|
+
label: "Realm",
|
|
299
|
+
kind: "text",
|
|
300
|
+
required: !0
|
|
301
|
+
},
|
|
302
|
+
{
|
|
303
|
+
key: "space",
|
|
304
|
+
label: "Space",
|
|
305
|
+
kind: "text"
|
|
306
|
+
},
|
|
307
|
+
{
|
|
308
|
+
key: "stack",
|
|
309
|
+
label: "Stack",
|
|
310
|
+
kind: "text"
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
key: "cell",
|
|
314
|
+
label: "Cell",
|
|
315
|
+
kind: "text"
|
|
316
|
+
}
|
|
317
|
+
]
|
|
318
|
+
}
|
|
319
|
+
]
|
|
320
|
+
},
|
|
321
|
+
{
|
|
322
|
+
key: "repos",
|
|
323
|
+
label: "Repository configuration",
|
|
324
|
+
kind: "objects",
|
|
325
|
+
advanced: !0,
|
|
326
|
+
itemLabel: "Repository",
|
|
327
|
+
sourcePicker: !0,
|
|
328
|
+
fields: [
|
|
329
|
+
{
|
|
330
|
+
key: "name",
|
|
331
|
+
label: "Name",
|
|
332
|
+
kind: "text",
|
|
333
|
+
required: !0
|
|
334
|
+
},
|
|
335
|
+
{
|
|
336
|
+
key: "target",
|
|
337
|
+
label: "Target path",
|
|
338
|
+
kind: "text",
|
|
339
|
+
required: !0
|
|
340
|
+
},
|
|
341
|
+
{
|
|
342
|
+
key: "url",
|
|
343
|
+
label: "Repository URL",
|
|
344
|
+
kind: "text",
|
|
345
|
+
required: !0
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
key: "branch",
|
|
349
|
+
label: "Branch",
|
|
350
|
+
kind: "text"
|
|
351
|
+
},
|
|
352
|
+
{
|
|
353
|
+
key: "ref",
|
|
354
|
+
label: "Tag or commit ref",
|
|
355
|
+
kind: "text"
|
|
356
|
+
},
|
|
357
|
+
{
|
|
358
|
+
key: "required",
|
|
359
|
+
label: "Fail if setup fails",
|
|
360
|
+
kind: "boolean"
|
|
361
|
+
}
|
|
362
|
+
]
|
|
363
|
+
},
|
|
364
|
+
{
|
|
365
|
+
key: "git",
|
|
366
|
+
label: "Git identity and signing",
|
|
367
|
+
kind: "object",
|
|
368
|
+
advanced: !0,
|
|
369
|
+
fields: [
|
|
370
|
+
{
|
|
371
|
+
key: "author",
|
|
372
|
+
label: "Author",
|
|
373
|
+
kind: "object",
|
|
374
|
+
fields: k
|
|
375
|
+
},
|
|
376
|
+
{
|
|
377
|
+
key: "committer",
|
|
378
|
+
label: "Committer",
|
|
379
|
+
kind: "object",
|
|
380
|
+
fields: k
|
|
381
|
+
},
|
|
382
|
+
{
|
|
383
|
+
key: "signingKey",
|
|
384
|
+
label: "Signing key path",
|
|
385
|
+
kind: "text"
|
|
386
|
+
},
|
|
387
|
+
{
|
|
388
|
+
key: "sign",
|
|
389
|
+
label: "Sign",
|
|
390
|
+
kind: "strings"
|
|
391
|
+
},
|
|
392
|
+
{
|
|
393
|
+
key: "allowedSigners",
|
|
394
|
+
label: "Allowed signers file",
|
|
395
|
+
kind: "text"
|
|
396
|
+
}
|
|
397
|
+
]
|
|
398
|
+
},
|
|
399
|
+
{
|
|
400
|
+
key: "cniConfigPath",
|
|
401
|
+
label: "CNI configuration path",
|
|
402
|
+
kind: "text",
|
|
403
|
+
advanced: !0
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
key: "restartPolicy",
|
|
407
|
+
label: "Restart policy",
|
|
408
|
+
kind: "enum",
|
|
409
|
+
options: [
|
|
410
|
+
"",
|
|
411
|
+
"never",
|
|
412
|
+
"always",
|
|
413
|
+
"on-failure"
|
|
414
|
+
],
|
|
415
|
+
advanced: !0
|
|
416
|
+
},
|
|
417
|
+
{
|
|
418
|
+
key: "restartBackoffSeconds",
|
|
419
|
+
label: "Restart backoff (seconds)",
|
|
420
|
+
kind: "number",
|
|
421
|
+
advanced: !0
|
|
422
|
+
},
|
|
423
|
+
{
|
|
424
|
+
key: "restartMaxRetries",
|
|
425
|
+
label: "Maximum restart retries",
|
|
426
|
+
kind: "number",
|
|
427
|
+
advanced: !0
|
|
428
|
+
},
|
|
429
|
+
{
|
|
430
|
+
key: "tty",
|
|
431
|
+
label: "Attachable TTY configuration",
|
|
432
|
+
kind: "object",
|
|
433
|
+
advanced: !0,
|
|
434
|
+
fields: [
|
|
435
|
+
{
|
|
436
|
+
key: "prompt",
|
|
437
|
+
label: "Prompt",
|
|
438
|
+
kind: "text"
|
|
439
|
+
},
|
|
440
|
+
{
|
|
441
|
+
key: "logFile",
|
|
442
|
+
label: "Log file",
|
|
443
|
+
kind: "text"
|
|
444
|
+
},
|
|
445
|
+
{
|
|
446
|
+
key: "logLevel",
|
|
447
|
+
label: "Log level",
|
|
448
|
+
kind: "enum",
|
|
449
|
+
options: [
|
|
450
|
+
"debug",
|
|
451
|
+
"info",
|
|
452
|
+
"warn",
|
|
453
|
+
"error"
|
|
454
|
+
]
|
|
455
|
+
},
|
|
456
|
+
{
|
|
457
|
+
key: "onInit",
|
|
458
|
+
label: "Initialization scripts",
|
|
459
|
+
kind: "objects",
|
|
460
|
+
itemLabel: "Script",
|
|
461
|
+
fields: [{
|
|
462
|
+
key: "script",
|
|
463
|
+
label: "Script",
|
|
464
|
+
kind: "text",
|
|
465
|
+
required: !0
|
|
466
|
+
}, {
|
|
467
|
+
key: "runOn",
|
|
468
|
+
label: "Run on",
|
|
469
|
+
kind: "enum",
|
|
470
|
+
options: ["start", "create"]
|
|
471
|
+
}]
|
|
472
|
+
}
|
|
473
|
+
]
|
|
474
|
+
}
|
|
475
|
+
], de = [
|
|
476
|
+
{
|
|
477
|
+
key: "rootContainerId",
|
|
478
|
+
label: "Explicit root container ID",
|
|
479
|
+
kind: "text",
|
|
480
|
+
help: "Leave empty to use an explicitly marked root or kukeon's generated default."
|
|
481
|
+
},
|
|
482
|
+
{
|
|
483
|
+
key: "tty",
|
|
484
|
+
label: "Cell TTY settings",
|
|
485
|
+
kind: "object",
|
|
486
|
+
fields: [{
|
|
487
|
+
key: "default",
|
|
488
|
+
label: "Default attachable container",
|
|
489
|
+
kind: "text"
|
|
490
|
+
}]
|
|
491
|
+
},
|
|
492
|
+
{
|
|
493
|
+
key: "nestedCgroupRuntime",
|
|
494
|
+
label: "Nested cgroup runtime",
|
|
495
|
+
kind: "boolean"
|
|
496
|
+
},
|
|
497
|
+
{
|
|
498
|
+
key: "ignoreDiskPressure",
|
|
499
|
+
label: "Ignore disk pressure for this creation",
|
|
500
|
+
kind: "boolean"
|
|
501
|
+
}
|
|
502
|
+
];
|
|
503
|
+
// src/new-cell.tsx
|
|
504
|
+
function fe(e) {
|
|
505
|
+
return [
|
|
506
|
+
e.realm,
|
|
507
|
+
e.space,
|
|
508
|
+
e.stack,
|
|
509
|
+
e.name
|
|
510
|
+
].filter((e) => !!e);
|
|
511
|
+
}
|
|
512
|
+
function j(t, n, r = !1) {
|
|
513
|
+
return e(`/${t}/` + n.map(encodeURIComponent).join("/") + (r ? "?document=1" : ""));
|
|
514
|
+
}
|
|
515
|
+
function M(e) {
|
|
516
|
+
return e.join(" / ");
|
|
517
|
+
}
|
|
518
|
+
function pe(e) {
|
|
519
|
+
return typeof e.name != "string" || typeof e.realm != "string" ? null : S("blueprints", x(e));
|
|
520
|
+
}
|
|
521
|
+
function N(e, t, n) {
|
|
522
|
+
return {
|
|
523
|
+
...e,
|
|
524
|
+
[t]: n
|
|
525
|
+
};
|
|
526
|
+
}
|
|
527
|
+
function P(e) {
|
|
528
|
+
return Object.fromEntries(e.filter((e) => e.kind !== "objects").map((e) => [e.key, e.kind === "boolean" ? !1 : e.kind === "strings" || e.kind === "env" ? [] : e.kind === "map" ? {} : e.kind === "number" || e.kind === "object" ? void 0 : ""]));
|
|
529
|
+
}
|
|
530
|
+
function F(e, t, n) {
|
|
531
|
+
let r = {};
|
|
532
|
+
for (let i of t) {
|
|
533
|
+
let t = `${n}.${i.key}`, a = e[i.key];
|
|
534
|
+
i.required && (a == null || String(a).trim() === "") && (r[t] = "This field is required."), i.kind === "object" && i.fields && a && typeof a == "object" && Object.assign(r, F(a, i.fields, t)), i.kind === "objects" && i.fields && Array.isArray(a) && a.forEach((e, n) => Object.assign(r, F(e, i.fields, `${t}.${n}`)));
|
|
535
|
+
}
|
|
536
|
+
return r;
|
|
537
|
+
}
|
|
538
|
+
function me({ document: e, connectors: t }) {
|
|
539
|
+
let n = e.spec.containers ?? [], r = [...new Set(n.map((e) => e.image).filter((e) => !!e))];
|
|
540
|
+
return /* @__PURE__ */ D("dl", {
|
|
541
|
+
className: "details-grid creation-summary",
|
|
542
|
+
children: [
|
|
543
|
+
/* @__PURE__ */ E("dt", { children: "Name" }),
|
|
544
|
+
/* @__PURE__ */ E("dd", { children: e.metadata.name }),
|
|
545
|
+
/* @__PURE__ */ E("dt", { children: "Scope" }),
|
|
546
|
+
/* @__PURE__ */ E("dd", {
|
|
547
|
+
className: "mono-id",
|
|
548
|
+
children: M([
|
|
549
|
+
e.spec.realmId,
|
|
550
|
+
e.spec.spaceId,
|
|
551
|
+
e.spec.stackId
|
|
552
|
+
])
|
|
553
|
+
}),
|
|
554
|
+
/* @__PURE__ */ E("dt", { children: "Containers" }),
|
|
555
|
+
/* @__PURE__ */ E("dd", { children: n.length ? `${n.length} (${n.map((e) => e.id).join(", ")})` : "None declared" }),
|
|
556
|
+
/* @__PURE__ */ E("dt", { children: "Images" }),
|
|
557
|
+
/* @__PURE__ */ E("dd", { children: r.length ? r.map((e) => /* @__PURE__ */ E("code", {
|
|
558
|
+
className: "creation-summary-image",
|
|
559
|
+
children: e
|
|
560
|
+
}, e)) : "None declared" }),
|
|
561
|
+
/* @__PURE__ */ E("dt", { children: "Connectors" }),
|
|
562
|
+
/* @__PURE__ */ E("dd", { children: t?.length ? t.map((e) => `${l(e)}${e.method ? ` (${e.method})` : ""}`).join(", ") : "None" })
|
|
563
|
+
]
|
|
564
|
+
});
|
|
565
|
+
}
|
|
566
|
+
function he({ document: e, label: t }) {
|
|
567
|
+
return /* @__PURE__ */ D("details", {
|
|
568
|
+
className: "creation-json",
|
|
569
|
+
children: [/* @__PURE__ */ E("summary", { children: "Full preview (JSON)" }), /* @__PURE__ */ E("pre", {
|
|
570
|
+
tabIndex: 0,
|
|
571
|
+
"aria-label": t,
|
|
572
|
+
children: JSON.stringify(e, null, 2)
|
|
573
|
+
})]
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
function ge(e) {
|
|
577
|
+
let t = C(null);
|
|
578
|
+
return ce(() => {
|
|
579
|
+
e && t.current?.scrollIntoView({ block: "nearest" });
|
|
580
|
+
}, [e]), t;
|
|
581
|
+
}
|
|
582
|
+
var _e = ({ review: e, onHide: t, children: n }) => /* @__PURE__ */ D("section", {
|
|
583
|
+
className: "panel preview-panel",
|
|
584
|
+
"aria-label": "Preview",
|
|
585
|
+
ref: e,
|
|
586
|
+
children: [/* @__PURE__ */ D("div", {
|
|
587
|
+
className: "panel-heading",
|
|
588
|
+
children: [
|
|
589
|
+
/* @__PURE__ */ E("h2", { children: "Preview" }),
|
|
590
|
+
/* @__PURE__ */ E("span", {
|
|
591
|
+
className: "badge",
|
|
592
|
+
children: "Not created yet"
|
|
593
|
+
}),
|
|
594
|
+
/* @__PURE__ */ E("button", {
|
|
595
|
+
type: "button",
|
|
596
|
+
className: "subtle-button",
|
|
597
|
+
onClick: t,
|
|
598
|
+
children: "Hide preview"
|
|
599
|
+
})
|
|
600
|
+
]
|
|
601
|
+
}), /* @__PURE__ */ E("div", {
|
|
602
|
+
className: "panel-body creation-review",
|
|
603
|
+
children: n
|
|
604
|
+
})]
|
|
605
|
+
});
|
|
606
|
+
function ve({ start: e, attach: t, onStart: n, onAttach: r, pending: i, hasPreview: a, previewLabel: o, canPreview: s, canCreate: c, onPreview: l, onCreate: u }) {
|
|
607
|
+
return /* @__PURE__ */ D("div", {
|
|
608
|
+
className: "form-actions",
|
|
609
|
+
children: [
|
|
610
|
+
/* @__PURE__ */ D("label", {
|
|
611
|
+
className: "schema-check",
|
|
612
|
+
children: [/* @__PURE__ */ E("input", {
|
|
613
|
+
type: "checkbox",
|
|
614
|
+
checked: e,
|
|
615
|
+
disabled: i,
|
|
616
|
+
onChange: (e) => n(e.target.checked)
|
|
617
|
+
}), " Start the cell"]
|
|
618
|
+
}),
|
|
619
|
+
/* @__PURE__ */ D("label", {
|
|
620
|
+
className: "schema-check",
|
|
621
|
+
children: [/* @__PURE__ */ E("input", {
|
|
622
|
+
type: "checkbox",
|
|
623
|
+
checked: e && t,
|
|
624
|
+
disabled: i || !e,
|
|
625
|
+
onChange: (e) => r(e.target.checked)
|
|
626
|
+
}), " Attach a terminal"]
|
|
627
|
+
}),
|
|
628
|
+
/* @__PURE__ */ E("button", {
|
|
629
|
+
type: "button",
|
|
630
|
+
disabled: !s,
|
|
631
|
+
onClick: l,
|
|
632
|
+
children: a ? "Refresh preview" : o
|
|
633
|
+
}),
|
|
634
|
+
/* @__PURE__ */ E("button", {
|
|
635
|
+
type: "button",
|
|
636
|
+
className: "primary-action",
|
|
637
|
+
disabled: !c,
|
|
638
|
+
onClick: u,
|
|
639
|
+
children: "Create Cell"
|
|
640
|
+
})
|
|
641
|
+
]
|
|
642
|
+
});
|
|
643
|
+
}
|
|
644
|
+
function ye({ label: e, value: t, options: n, pinned: r, disabled: i, onChange: a }) {
|
|
645
|
+
let o = n.includes(t) ? n : [t, ...n];
|
|
646
|
+
return /* @__PURE__ */ D("label", {
|
|
647
|
+
className: "schema-field",
|
|
648
|
+
children: [
|
|
649
|
+
e,
|
|
650
|
+
/* @__PURE__ */ E("select", {
|
|
651
|
+
value: t,
|
|
652
|
+
disabled: i || r,
|
|
653
|
+
onChange: (e) => a(e.target.value),
|
|
654
|
+
children: o.map((e) => /* @__PURE__ */ E("option", {
|
|
655
|
+
value: e,
|
|
656
|
+
children: e
|
|
657
|
+
}, e))
|
|
658
|
+
}),
|
|
659
|
+
r && /* @__PURE__ */ E("small", { children: "Set by the Config's scope." })
|
|
660
|
+
]
|
|
661
|
+
});
|
|
662
|
+
}
|
|
663
|
+
function be(e, t) {
|
|
664
|
+
return e || (t.includes("default") || !t.length ? "default" : t[0]);
|
|
665
|
+
}
|
|
666
|
+
function I({ label: e, disabled: t, onPick: n }) {
|
|
667
|
+
let r = u(v(), 0), [i, a] = w(""), o = r.data?.sources.find((e) => e.name === i);
|
|
668
|
+
return /* @__PURE__ */ D("div", {
|
|
669
|
+
className: "schema-field repository-source",
|
|
670
|
+
children: [/* @__PURE__ */ D("label", { children: [/* @__PURE__ */ E("span", { children: "From source" }), /* @__PURE__ */ D("select", {
|
|
671
|
+
"aria-label": `From source for ${e}`,
|
|
672
|
+
value: i,
|
|
673
|
+
disabled: t || !r.data?.sources.length,
|
|
674
|
+
onChange: (e) => {
|
|
675
|
+
a(e.target.value);
|
|
676
|
+
let t = r.data?.sources.find((t) => t.name === e.target.value);
|
|
677
|
+
t && n(g(t));
|
|
678
|
+
},
|
|
679
|
+
children: [/* @__PURE__ */ E("option", {
|
|
680
|
+
value: "",
|
|
681
|
+
children: r.data?.sources.length ? "Choose a stored Source…" : "No Source is stored"
|
|
682
|
+
}), r.data?.sources.map((e) => /* @__PURE__ */ D("option", {
|
|
683
|
+
value: e.name,
|
|
684
|
+
children: [
|
|
685
|
+
e.name,
|
|
686
|
+
" — ",
|
|
687
|
+
e.url
|
|
688
|
+
]
|
|
689
|
+
}, e.name))]
|
|
690
|
+
})] }), o && /* @__PURE__ */ D("small", { children: [
|
|
691
|
+
"Identity: ",
|
|
692
|
+
o.identity || "Default",
|
|
693
|
+
". The fields are copied; the cell does not follow the Source afterwards."
|
|
694
|
+
] })]
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
function L({ field: e, value: t, onChange: n, path: r, errors: i, disabled: a = !1 }) {
|
|
698
|
+
let o = i[r], s = `field-${r.replace(/[^a-zA-Z0-9_-]/g, "-")}`, c = e.help ? `${s}-help` : void 0, l = o ? `${s}-error` : void 0, u = [c, l].filter(Boolean).join(" ") || void 0;
|
|
699
|
+
if (e.kind === "boolean") return /* @__PURE__ */ D("label", {
|
|
700
|
+
className: "schema-check",
|
|
701
|
+
children: [
|
|
702
|
+
/* @__PURE__ */ E("input", {
|
|
703
|
+
id: s,
|
|
704
|
+
type: "checkbox",
|
|
705
|
+
checked: t === !0,
|
|
706
|
+
disabled: a,
|
|
707
|
+
onChange: (e) => n(e.target.checked),
|
|
708
|
+
"aria-describedby": u
|
|
709
|
+
}),
|
|
710
|
+
e.label,
|
|
711
|
+
e.help && /* @__PURE__ */ E("small", {
|
|
712
|
+
id: c,
|
|
713
|
+
children: e.help
|
|
714
|
+
}),
|
|
715
|
+
o && /* @__PURE__ */ E("small", {
|
|
716
|
+
className: "field-error",
|
|
717
|
+
id: l,
|
|
718
|
+
children: o
|
|
719
|
+
})
|
|
720
|
+
]
|
|
721
|
+
});
|
|
722
|
+
if (e.kind === "object") {
|
|
723
|
+
let o = t && typeof t == "object" ? t : void 0;
|
|
724
|
+
return /* @__PURE__ */ D("fieldset", {
|
|
725
|
+
className: "schema-object",
|
|
726
|
+
children: [
|
|
727
|
+
/* @__PURE__ */ E("legend", { children: e.label }),
|
|
728
|
+
e.help && /* @__PURE__ */ E("p", {
|
|
729
|
+
className: "description",
|
|
730
|
+
children: e.help
|
|
731
|
+
}),
|
|
732
|
+
o ? /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ E("div", {
|
|
733
|
+
className: "schema-fields",
|
|
734
|
+
children: (e.fields ?? []).map((e) => /* @__PURE__ */ E(L, {
|
|
735
|
+
field: e,
|
|
736
|
+
value: o[e.key],
|
|
737
|
+
path: `${r}.${e.key}`,
|
|
738
|
+
errors: i,
|
|
739
|
+
disabled: a,
|
|
740
|
+
onChange: (t) => n(N(o, e.key, t))
|
|
741
|
+
}, `${r}.${e.key}`))
|
|
742
|
+
}), /* @__PURE__ */ D("button", {
|
|
743
|
+
type: "button",
|
|
744
|
+
className: "subtle-button",
|
|
745
|
+
disabled: a,
|
|
746
|
+
onClick: () => n(void 0),
|
|
747
|
+
children: ["Remove ", e.label.toLowerCase()]
|
|
748
|
+
})] }) : /* @__PURE__ */ D("button", {
|
|
749
|
+
type: "button",
|
|
750
|
+
disabled: a,
|
|
751
|
+
onClick: () => n(P(e.fields ?? [])),
|
|
752
|
+
children: ["Add ", e.label.toLowerCase()]
|
|
753
|
+
})
|
|
754
|
+
]
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
if (e.kind === "objects") {
|
|
758
|
+
let o = Array.isArray(t) ? t : [];
|
|
759
|
+
return /* @__PURE__ */ D("fieldset", {
|
|
760
|
+
className: "schema-array",
|
|
761
|
+
children: [
|
|
762
|
+
/* @__PURE__ */ E("legend", { children: e.label }),
|
|
763
|
+
e.help && /* @__PURE__ */ E("p", {
|
|
764
|
+
className: "description",
|
|
765
|
+
children: e.help
|
|
766
|
+
}),
|
|
767
|
+
o.map((t, s) => /* @__PURE__ */ D("section", {
|
|
768
|
+
className: "schema-array-item",
|
|
769
|
+
children: [
|
|
770
|
+
/* @__PURE__ */ D("div", {
|
|
771
|
+
className: "schema-array-heading",
|
|
772
|
+
children: [/* @__PURE__ */ D("h4", { children: [
|
|
773
|
+
e.itemLabel ?? e.label.slice(0, -1),
|
|
774
|
+
" ",
|
|
775
|
+
s + 1
|
|
776
|
+
] }), /* @__PURE__ */ E("button", {
|
|
777
|
+
type: "button",
|
|
778
|
+
className: "subtle-button",
|
|
779
|
+
disabled: a,
|
|
780
|
+
onClick: () => n(o.filter((e, t) => t !== s)),
|
|
781
|
+
children: "Remove"
|
|
782
|
+
})]
|
|
783
|
+
}),
|
|
784
|
+
e.sourcePicker && /* @__PURE__ */ E(I, {
|
|
785
|
+
label: `${e.itemLabel ?? "Item"} ${s + 1}`,
|
|
786
|
+
disabled: a,
|
|
787
|
+
onPick: (e) => n(o.map((t, n) => n === s ? {
|
|
788
|
+
...t,
|
|
789
|
+
...e
|
|
790
|
+
} : t))
|
|
791
|
+
}),
|
|
792
|
+
/* @__PURE__ */ E("div", {
|
|
793
|
+
className: "schema-fields",
|
|
794
|
+
children: (e.fields ?? []).map((e) => /* @__PURE__ */ E(L, {
|
|
795
|
+
field: e,
|
|
796
|
+
value: t[e.key],
|
|
797
|
+
path: `${r}.${s}.${e.key}`,
|
|
798
|
+
errors: i,
|
|
799
|
+
disabled: a,
|
|
800
|
+
onChange: (t) => n(o.map((n, r) => r === s ? N(n, e.key, t) : n))
|
|
801
|
+
}, `${r}.${s}.${e.key}`))
|
|
802
|
+
})
|
|
803
|
+
]
|
|
804
|
+
}, `${r}.${s}`)),
|
|
805
|
+
/* @__PURE__ */ D("button", {
|
|
806
|
+
type: "button",
|
|
807
|
+
disabled: a,
|
|
808
|
+
onClick: () => n([...o, P(e.fields ?? [])]),
|
|
809
|
+
children: ["Add ", e.itemLabel?.toLowerCase() ?? "item"]
|
|
810
|
+
})
|
|
811
|
+
]
|
|
812
|
+
});
|
|
813
|
+
}
|
|
814
|
+
if (e.kind === "map") {
|
|
815
|
+
let i = Object.entries(t && typeof t == "object" ? t : {}), o = (e, t, r) => {
|
|
816
|
+
let a = { ...Object.fromEntries(i) }, o = i[e]?.[0];
|
|
817
|
+
delete a[o], t.trim() && (a[t] = r), n(a);
|
|
818
|
+
};
|
|
819
|
+
return /* @__PURE__ */ D("fieldset", {
|
|
820
|
+
className: "schema-array",
|
|
821
|
+
children: [
|
|
822
|
+
/* @__PURE__ */ E("legend", { children: e.label }),
|
|
823
|
+
i.map(([e, t], s) => /* @__PURE__ */ D("div", {
|
|
824
|
+
className: "map-entry",
|
|
825
|
+
children: [
|
|
826
|
+
/* @__PURE__ */ D("label", { children: ["Key", /* @__PURE__ */ E("input", {
|
|
827
|
+
value: e,
|
|
828
|
+
disabled: a,
|
|
829
|
+
onChange: (e) => o(s, e.target.value, t)
|
|
830
|
+
})] }),
|
|
831
|
+
/* @__PURE__ */ D("label", { children: ["Value", /* @__PURE__ */ E("input", {
|
|
832
|
+
value: t,
|
|
833
|
+
disabled: a,
|
|
834
|
+
onChange: (t) => o(s, e, t.target.value)
|
|
835
|
+
})] }),
|
|
836
|
+
/* @__PURE__ */ E("button", {
|
|
837
|
+
type: "button",
|
|
838
|
+
className: "subtle-button",
|
|
839
|
+
disabled: a,
|
|
840
|
+
onClick: () => n(Object.fromEntries(i.filter((e, t) => t !== s))),
|
|
841
|
+
children: "Remove"
|
|
842
|
+
})
|
|
843
|
+
]
|
|
844
|
+
}, `${r}.${s}`)),
|
|
845
|
+
/* @__PURE__ */ E("button", {
|
|
846
|
+
type: "button",
|
|
847
|
+
disabled: a,
|
|
848
|
+
onClick: () => n({
|
|
849
|
+
...Object.fromEntries(i),
|
|
850
|
+
[`key-${i.length + 1}`]: ""
|
|
851
|
+
}),
|
|
852
|
+
children: "Add key/value"
|
|
853
|
+
})
|
|
854
|
+
]
|
|
855
|
+
});
|
|
856
|
+
}
|
|
857
|
+
if (e.kind === "strings" || e.kind === "env") {
|
|
858
|
+
let i = Array.isArray(t) ? t : [], o = (e, t) => n(i.map((n, r) => r === e ? t : n));
|
|
859
|
+
return e.kind === "env" ? /* @__PURE__ */ D("fieldset", {
|
|
860
|
+
className: "schema-array",
|
|
861
|
+
children: [
|
|
862
|
+
/* @__PURE__ */ E("legend", { children: e.label }),
|
|
863
|
+
e.help && /* @__PURE__ */ E("p", {
|
|
864
|
+
className: "description",
|
|
865
|
+
children: e.help
|
|
866
|
+
}),
|
|
867
|
+
i.map((e, t) => {
|
|
868
|
+
let [s, ...c] = e.split("="), l = c.join("=");
|
|
869
|
+
return /* @__PURE__ */ D("div", {
|
|
870
|
+
className: "map-entry",
|
|
871
|
+
children: [
|
|
872
|
+
/* @__PURE__ */ D("label", { children: ["Variable", /* @__PURE__ */ E("input", {
|
|
873
|
+
value: s,
|
|
874
|
+
disabled: a,
|
|
875
|
+
onChange: (e) => o(t, `${e.target.value}=${l}`)
|
|
876
|
+
})] }),
|
|
877
|
+
/* @__PURE__ */ D("label", { children: ["Value", /* @__PURE__ */ E("input", {
|
|
878
|
+
value: l,
|
|
879
|
+
disabled: a,
|
|
880
|
+
onChange: (e) => o(t, `${s}=${e.target.value}`)
|
|
881
|
+
})] }),
|
|
882
|
+
/* @__PURE__ */ E("button", {
|
|
883
|
+
type: "button",
|
|
884
|
+
className: "subtle-button",
|
|
885
|
+
disabled: a,
|
|
886
|
+
onClick: () => n(i.filter((e, n) => n !== t)),
|
|
887
|
+
children: "Remove"
|
|
888
|
+
})
|
|
889
|
+
]
|
|
890
|
+
}, `${r}.${t}`);
|
|
891
|
+
}),
|
|
892
|
+
/* @__PURE__ */ E("button", {
|
|
893
|
+
type: "button",
|
|
894
|
+
disabled: a,
|
|
895
|
+
onClick: () => n([...i, "="]),
|
|
896
|
+
children: "Add environment variable"
|
|
897
|
+
})
|
|
898
|
+
]
|
|
899
|
+
}) : /* @__PURE__ */ D("fieldset", {
|
|
900
|
+
className: "schema-array",
|
|
901
|
+
children: [
|
|
902
|
+
/* @__PURE__ */ E("legend", { children: e.label }),
|
|
903
|
+
e.help && /* @__PURE__ */ E("p", {
|
|
904
|
+
className: "description",
|
|
905
|
+
children: e.help
|
|
906
|
+
}),
|
|
907
|
+
i.map((t, s) => /* @__PURE__ */ D("div", {
|
|
908
|
+
className: "string-entry",
|
|
909
|
+
children: [/* @__PURE__ */ E("input", {
|
|
910
|
+
"aria-label": `${e.label} ${s + 1}`,
|
|
911
|
+
value: t,
|
|
912
|
+
disabled: a,
|
|
913
|
+
onChange: (e) => o(s, e.target.value)
|
|
914
|
+
}), /* @__PURE__ */ E("button", {
|
|
915
|
+
type: "button",
|
|
916
|
+
className: "subtle-button",
|
|
917
|
+
disabled: a,
|
|
918
|
+
onClick: () => n(i.filter((e, t) => t !== s)),
|
|
919
|
+
children: "Remove"
|
|
920
|
+
})]
|
|
921
|
+
}, `${r}.${s}`)),
|
|
922
|
+
/* @__PURE__ */ D("button", {
|
|
923
|
+
type: "button",
|
|
924
|
+
disabled: a,
|
|
925
|
+
onClick: () => n([...i, ""]),
|
|
926
|
+
children: ["Add ", e.label.toLowerCase().replace(/s$/, "")]
|
|
927
|
+
})
|
|
928
|
+
]
|
|
929
|
+
});
|
|
930
|
+
}
|
|
931
|
+
let d = e.kind === "enum" ? /* @__PURE__ */ D("select", {
|
|
932
|
+
id: s,
|
|
933
|
+
value: typeof t == "string" ? t : "",
|
|
934
|
+
disabled: a,
|
|
935
|
+
onChange: (e) => n(e.target.value),
|
|
936
|
+
"aria-invalid": !!o,
|
|
937
|
+
"aria-describedby": u,
|
|
938
|
+
children: [/* @__PURE__ */ E("option", {
|
|
939
|
+
value: "",
|
|
940
|
+
children: "Select…"
|
|
941
|
+
}), (e.options ?? []).filter((e) => e !== "").map((e) => /* @__PURE__ */ E("option", { children: e }, e))]
|
|
942
|
+
}) : /* @__PURE__ */ E("input", {
|
|
943
|
+
id: s,
|
|
944
|
+
type: e.kind === "number" ? "number" : "text",
|
|
945
|
+
min: e.kind === "number" ? 0 : void 0,
|
|
946
|
+
value: t == null ? "" : String(t),
|
|
947
|
+
disabled: a,
|
|
948
|
+
"aria-invalid": !!o,
|
|
949
|
+
"aria-describedby": u,
|
|
950
|
+
onChange: (t) => n(e.kind === "number" ? t.target.value === "" ? void 0 : Number(t.target.value) : t.target.value)
|
|
951
|
+
});
|
|
952
|
+
return /* @__PURE__ */ D("label", {
|
|
953
|
+
className: "schema-field",
|
|
954
|
+
htmlFor: s,
|
|
955
|
+
children: [
|
|
956
|
+
/* @__PURE__ */ D("span", { children: [e.label, e.required && /* @__PURE__ */ E("b", {
|
|
957
|
+
"aria-label": "required",
|
|
958
|
+
children: " *"
|
|
959
|
+
})] }),
|
|
960
|
+
d,
|
|
961
|
+
e.help && /* @__PURE__ */ E("small", {
|
|
962
|
+
id: c,
|
|
963
|
+
children: e.help
|
|
964
|
+
}),
|
|
965
|
+
o && /* @__PURE__ */ E("small", {
|
|
966
|
+
className: "field-error",
|
|
967
|
+
id: l,
|
|
968
|
+
children: o
|
|
969
|
+
})
|
|
970
|
+
]
|
|
971
|
+
});
|
|
972
|
+
}
|
|
973
|
+
function R({ revision: e, inventory: g, configScope: v, onCreated: le }) {
|
|
974
|
+
let C = u("/catalog/configs", e), [k, A] = w(""), [de, N] = w(v ? JSON.stringify(v) : ""), [P, F] = w(!v), I = (C.data ?? []).map((e) => ({
|
|
975
|
+
doc: e,
|
|
976
|
+
scope: fe(e.metadata)
|
|
977
|
+
})), L = I.filter(({ scope: e }) => M(e).toLowerCase().includes(k.toLowerCase())), R = I.find((e) => JSON.stringify(e.scope) === de), xe = P || !C.loading && !R, [z, Se] = w(0), B = u(R ? S("configs", R.scope) : null, e + z), V = n(B.data), Ce = u(V.length ? "/connectors" : null, e), [we, Te] = w({}), H = o(V, we), U = oe(V, Ce.data, we), W = u(U.some((e) => a(e.delivery)) ? "/catalog/secrets" : null, e + z), Ee = u(U.some(_) ? "/connectors/logins" : null, e + z), [De, Oe] = w({}), [ke, Ae] = w(""), G = V.find((e) => !!e.harnessState)?.harnessState ?? "", je = U.some(_), Me = !!G && !je, Ne = Me && ke !== G ? ke : "", Pe = s(U, De), K = c(U, De), q = t(B.data), J = B.data?.spec?.blueprint, Fe = !!J && typeof J.name == "string" && !!J.name && typeof J.realm == "string" && !!J.realm && !(J.stack && !J.space), Ie = Fe && J ? pe(J) : null, Y = u(Ie, e), X = x(J), [Le, Re] = w(""), [ze, Be] = w(""), [Ve, He] = w(!1), [Ue, We] = w(!0), [Ge, Ke] = w(!0), [Z, qe] = w(), [Q, Je] = w(!1), [Ye, Xe] = w("preview"), [Ze, Qe] = w(""), [$e, et] = w(!1), [tt, nt] = w(!1), [rt, it] = w(!1), [at, ot] = w(!1), st = K.length > 0;
|
|
978
|
+
ce(() => {
|
|
979
|
+
st && et(!0);
|
|
980
|
+
}, [st]);
|
|
981
|
+
let ct = R?.doc.metadata.realm || "default", lt = R?.doc.metadata.space || "", ut = R?.doc.metadata.stack || "", [dt, ft] = w(), [pt, mt] = w(), ht = (g.data?.rows[1] ?? []).filter((e) => e.scope[0] === ct).map((e) => e.scope[1]), gt = lt || dt || be("", ht), _t = (g.data?.rows[2] ?? []).filter((e) => e.scope[0] === ct && e.scope[1] === gt).map((e) => e.scope[2]), vt = ut || pt || be("", _t), yt = !!R && !!g.data && !g.data.rows[2].some((e) => e.scope[0] === ct && e.scope[1] === gt && e.scope[2] === vt), bt = ge(Z);
|
|
982
|
+
function $() {
|
|
983
|
+
qe(void 0);
|
|
984
|
+
}
|
|
985
|
+
function xt(e) {
|
|
986
|
+
let t = Z?.connectors ?? [];
|
|
987
|
+
return t.find((t) => t.connector === e.connector && t.component === e.component) ?? t.find((t) => t.connector === e.connector);
|
|
988
|
+
}
|
|
989
|
+
async function St(e) {
|
|
990
|
+
if (R && !Q) {
|
|
991
|
+
Je(!0), Xe(e ? "create" : "preview"), Qe("");
|
|
992
|
+
try {
|
|
993
|
+
let t = {
|
|
994
|
+
config: {
|
|
995
|
+
name: R.doc.metadata.name,
|
|
996
|
+
realm: R.doc.metadata.realm,
|
|
997
|
+
space: R.doc.metadata.space,
|
|
998
|
+
stack: R.doc.metadata.stack
|
|
999
|
+
},
|
|
1000
|
+
name: Le.trim(),
|
|
1001
|
+
...e && Z ? {
|
|
1002
|
+
resolvedName: Z.document.metadata.name,
|
|
1003
|
+
preview: Z.preview
|
|
1004
|
+
} : {},
|
|
1005
|
+
env: ze.split("\n").filter(Boolean),
|
|
1006
|
+
ignoreDiskPressure: Ve,
|
|
1007
|
+
targetSpace: gt,
|
|
1008
|
+
targetStack: vt,
|
|
1009
|
+
...Object.keys(Pe).length ? { connectors: Pe } : {},
|
|
1010
|
+
...Object.keys(H).length ? { methods: H } : {},
|
|
1011
|
+
...Ne ? { state: Ne } : {}
|
|
1012
|
+
}, n = await ue(`/cells/from-config/${e ? "create" : "preview"}`, {
|
|
1013
|
+
method: "POST",
|
|
1014
|
+
headers: {
|
|
1015
|
+
"Content-Type": "application/json",
|
|
1016
|
+
Accept: "application/json"
|
|
1017
|
+
},
|
|
1018
|
+
body: JSON.stringify(t)
|
|
1019
|
+
}), r = await n.json();
|
|
1020
|
+
if (!n.ok) {
|
|
1021
|
+
let t = r.error?.message ?? r.message ?? `Request failed (HTTP ${n.status})`;
|
|
1022
|
+
throw (r.error?.code === "connector_unresolved" || r.error?.code === "connector_invalid") && Se((e) => e + 1), Error(e && (r.error?.code === "unavailable" || n.status >= 500) ? `The creation outcome could not be confirmed. Refresh the Cell inventory before retrying. ${t}` : t);
|
|
1023
|
+
}
|
|
1024
|
+
e ? le(r, {
|
|
1025
|
+
start: Ue,
|
|
1026
|
+
attach: Ue && Ge,
|
|
1027
|
+
warnings: ee(r)
|
|
1028
|
+
}) : qe(r);
|
|
1029
|
+
} catch (t) {
|
|
1030
|
+
let n = t instanceof Error ? t.message : "The request could not reach the web server.";
|
|
1031
|
+
Qe(e && t instanceof TypeError ? `The creation outcome could not be confirmed. Refresh the Cell inventory before retrying. ${n}` : n);
|
|
1032
|
+
} finally {
|
|
1033
|
+
Je(!1);
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
}
|
|
1037
|
+
let Ct = (Z?.connectors ?? []).some(i), wt = !!B.data && !!Y.data && !yt && K.length === 0, Tt = !Q && wt && !Ct, Et = Object.keys(Pe).length + Object.keys(H).length + +!!Ne, Dt = ze.split("\n").filter((e) => e.trim()).length, Ot = J ? Fe ? Y.loading ? /* @__PURE__ */ E("p", {
|
|
1038
|
+
role: "status",
|
|
1039
|
+
children: "Checking referenced Blueprint…"
|
|
1040
|
+
}) : Y.error ? /* @__PURE__ */ D("div", {
|
|
1041
|
+
className: "error",
|
|
1042
|
+
role: "alert",
|
|
1043
|
+
children: [
|
|
1044
|
+
/* @__PURE__ */ E("strong", { children: Y.error.code === "not_found" ? "Blueprint reference is missing" : "Blueprint could not be loaded" }),
|
|
1045
|
+
/* @__PURE__ */ E("p", { children: Y.error.message }),
|
|
1046
|
+
/* @__PURE__ */ D("p", { children: ["Reference: ", M(X)] })
|
|
1047
|
+
]
|
|
1048
|
+
}) : null : /* @__PURE__ */ D("p", {
|
|
1049
|
+
className: "error",
|
|
1050
|
+
role: "alert",
|
|
1051
|
+
children: ["The Blueprint reference is incomplete: ", M(X)]
|
|
1052
|
+
}) : /* @__PURE__ */ E("p", {
|
|
1053
|
+
className: "error",
|
|
1054
|
+
role: "alert",
|
|
1055
|
+
children: "This config does not contain a Blueprint reference."
|
|
1056
|
+
}), kt = R && B.data && U.length > 0 && /* @__PURE__ */ E(O, {
|
|
1057
|
+
className: "cell-connectors",
|
|
1058
|
+
label: "Connectors",
|
|
1059
|
+
title: "Connectors",
|
|
1060
|
+
open: $e,
|
|
1061
|
+
onToggle: et,
|
|
1062
|
+
summary: K.length ? void 0 : `${U.length} resolved${Et ? `, ${Et} picked for this cell` : ""}`,
|
|
1063
|
+
badge: K.length ? /* @__PURE__ */ D("span", {
|
|
1064
|
+
className: "badge needs-connector",
|
|
1065
|
+
children: ["Needs connector: ", [...new Set(K.map(l))].join(", ")]
|
|
1066
|
+
}) : void 0,
|
|
1067
|
+
children: /* @__PURE__ */ D("div", {
|
|
1068
|
+
className: "panel-body",
|
|
1069
|
+
children: [
|
|
1070
|
+
/* @__PURE__ */ E("p", {
|
|
1071
|
+
className: "description",
|
|
1072
|
+
children: "A method or identity picked here applies to this cell only."
|
|
1073
|
+
}),
|
|
1074
|
+
q && /* @__PURE__ */ D("p", {
|
|
1075
|
+
className: "connector-team",
|
|
1076
|
+
role: "note",
|
|
1077
|
+
children: [
|
|
1078
|
+
"This Config's identities are set by team ",
|
|
1079
|
+
/* @__PURE__ */ E("code", { children: q }),
|
|
1080
|
+
". A pick here still applies to this cell only."
|
|
1081
|
+
]
|
|
1082
|
+
}),
|
|
1083
|
+
W.error && /* @__PURE__ */ D("p", {
|
|
1084
|
+
className: "stale",
|
|
1085
|
+
children: [
|
|
1086
|
+
"Identities could not be listed: ",
|
|
1087
|
+
W.error.message,
|
|
1088
|
+
". Name a secret by hand instead."
|
|
1089
|
+
]
|
|
1090
|
+
}),
|
|
1091
|
+
/* @__PURE__ */ E("ul", {
|
|
1092
|
+
className: "state-list connector-status-list",
|
|
1093
|
+
children: U.map((e) => {
|
|
1094
|
+
let t = l(e), n = Pe[e.connector], i = H[e.connector], o = V.find((t) => t.connector === e.connector) ?? e, s = o.method ? re(Ce.data?.find((t) => t.name === e.connector)) : [], c = K.includes(e);
|
|
1095
|
+
return /* @__PURE__ */ E("li", {
|
|
1096
|
+
"aria-label": `${t} connector`,
|
|
1097
|
+
children: /* @__PURE__ */ D("div", {
|
|
1098
|
+
className: "connector-status",
|
|
1099
|
+
children: [
|
|
1100
|
+
/* @__PURE__ */ D("div", { children: [
|
|
1101
|
+
/* @__PURE__ */ E("strong", { children: t }),
|
|
1102
|
+
" ",
|
|
1103
|
+
/* @__PURE__ */ E("span", {
|
|
1104
|
+
className: "badge",
|
|
1105
|
+
children: e.connector
|
|
1106
|
+
}),
|
|
1107
|
+
e.method && /* @__PURE__ */ D(T, { children: [" ", /* @__PURE__ */ E("span", {
|
|
1108
|
+
className: "badge",
|
|
1109
|
+
children: e.method
|
|
1110
|
+
})] }),
|
|
1111
|
+
" ",
|
|
1112
|
+
n || i ? /* @__PURE__ */ E("span", {
|
|
1113
|
+
className: "badge",
|
|
1114
|
+
children: "Picked for this cell"
|
|
1115
|
+
}) : /* @__PURE__ */ E(te, { status: e })
|
|
1116
|
+
] }),
|
|
1117
|
+
s.length > 0 && /* @__PURE__ */ D("label", {
|
|
1118
|
+
className: "schema-field",
|
|
1119
|
+
children: [
|
|
1120
|
+
"Method",
|
|
1121
|
+
/* @__PURE__ */ E("select", {
|
|
1122
|
+
"aria-label": `${t} method`,
|
|
1123
|
+
value: i ?? o.method,
|
|
1124
|
+
disabled: Q,
|
|
1125
|
+
onChange: (t) => {
|
|
1126
|
+
let n = t.target.value;
|
|
1127
|
+
Te((t) => ({
|
|
1128
|
+
...t,
|
|
1129
|
+
[e.connector]: n === o.method ? void 0 : n
|
|
1130
|
+
})), Oe((t) => ({
|
|
1131
|
+
...t,
|
|
1132
|
+
[e.connector]: void 0
|
|
1133
|
+
})), $();
|
|
1134
|
+
},
|
|
1135
|
+
children: s.map((e) => /* @__PURE__ */ D("option", {
|
|
1136
|
+
value: e.name,
|
|
1137
|
+
children: [e.name, e.name === o.method ? " (the Config's)" : ""]
|
|
1138
|
+
}, e.name))
|
|
1139
|
+
}),
|
|
1140
|
+
/* @__PURE__ */ E("small", { children: i ? `${s.find((e) => e.name === i)?.description ?? ""} Used for this cell only; the Config uses ${o.method}.` : s.find((e) => e.name === o.method)?.description })
|
|
1141
|
+
]
|
|
1142
|
+
}),
|
|
1143
|
+
a(e.delivery) ? /* @__PURE__ */ E(ae, {
|
|
1144
|
+
label: `${t} identity`,
|
|
1145
|
+
identities: f(W.data, e.connector),
|
|
1146
|
+
value: De[e.connector] ?? e.identity,
|
|
1147
|
+
extra: [e.identity],
|
|
1148
|
+
emptyLabel: i ? "Use the default identity for this method" : e.identity ? "Use the Config's identity" : e.required ? "No identity — required" : "No identity",
|
|
1149
|
+
disabled: Q,
|
|
1150
|
+
required: e.required,
|
|
1151
|
+
realm: R.doc.metadata.realm,
|
|
1152
|
+
onChange: (t) => {
|
|
1153
|
+
Oe((n) => ({
|
|
1154
|
+
...n,
|
|
1155
|
+
[e.connector]: t
|
|
1156
|
+
})), $();
|
|
1157
|
+
},
|
|
1158
|
+
help: i ? /* @__PURE__ */ D(T, { children: [
|
|
1159
|
+
"The ",
|
|
1160
|
+
i,
|
|
1161
|
+
" method resolves its identity from the Realm, Space or Stack defaults unless one is picked here; the preview shows which."
|
|
1162
|
+
] }) : /* @__PURE__ */ D(T, { children: ["The Config resolves to: ", /* @__PURE__ */ E(h, {
|
|
1163
|
+
status: e,
|
|
1164
|
+
team: q
|
|
1165
|
+
})] })
|
|
1166
|
+
}) : _(e) ? /* @__PURE__ */ E(ne, {
|
|
1167
|
+
label: `${t} login identity`,
|
|
1168
|
+
identities: m(Ee.data, e.connector),
|
|
1169
|
+
value: De[e.connector] ?? r(e),
|
|
1170
|
+
extra: [r(e)],
|
|
1171
|
+
emptyLabel: "Use the Config's login identity",
|
|
1172
|
+
disabled: Q,
|
|
1173
|
+
onChange: (t) => {
|
|
1174
|
+
Oe((n) => ({
|
|
1175
|
+
...n,
|
|
1176
|
+
[e.connector]: t
|
|
1177
|
+
})), $();
|
|
1178
|
+
},
|
|
1179
|
+
help: /* @__PURE__ */ D(T, { children: [
|
|
1180
|
+
"The Config resolves to: ",
|
|
1181
|
+
/* @__PURE__ */ E(h, {
|
|
1182
|
+
status: e,
|
|
1183
|
+
team: q
|
|
1184
|
+
}),
|
|
1185
|
+
". A login identity picked here becomes this cell's state volume. ",
|
|
1186
|
+
"A login identity normally serves one role; another role may share it at your risk (its start rewrites role content in the state directory, and a Codex refresh token is single-use)."
|
|
1187
|
+
] })
|
|
1188
|
+
}) : /* @__PURE__ */ E("p", {
|
|
1189
|
+
className: "description",
|
|
1190
|
+
children: /* @__PURE__ */ E(h, {
|
|
1191
|
+
status: e,
|
|
1192
|
+
team: q
|
|
1193
|
+
})
|
|
1194
|
+
}),
|
|
1195
|
+
/* @__PURE__ */ E(p, { warning: xt(e)?.warning }),
|
|
1196
|
+
c && /* @__PURE__ */ D("p", {
|
|
1197
|
+
className: "field-error",
|
|
1198
|
+
role: "alert",
|
|
1199
|
+
children: [
|
|
1200
|
+
t,
|
|
1201
|
+
" has no usable identity",
|
|
1202
|
+
e.message ? `: ${e.message}` : "",
|
|
1203
|
+
". Pick one for this cell above, set a default, or pick one for the Config."
|
|
1204
|
+
]
|
|
1205
|
+
}),
|
|
1206
|
+
!i && e.state !== "resolved" && /* @__PURE__ */ E(ie, {
|
|
1207
|
+
status: e,
|
|
1208
|
+
connector: Ce.data?.find((t) => t.name === e.connector),
|
|
1209
|
+
config: B.data.metadata,
|
|
1210
|
+
identities: f(W.data, e.connector),
|
|
1211
|
+
logins: m(Ee.data, e.connector),
|
|
1212
|
+
secrets: W.data,
|
|
1213
|
+
onChanged: () => {
|
|
1214
|
+
Se((e) => e + 1), $();
|
|
1215
|
+
}
|
|
1216
|
+
})
|
|
1217
|
+
]
|
|
1218
|
+
})
|
|
1219
|
+
}, `${e.connector}:${e.component}`);
|
|
1220
|
+
})
|
|
1221
|
+
}),
|
|
1222
|
+
Me && /* @__PURE__ */ D("label", {
|
|
1223
|
+
className: "schema-field",
|
|
1224
|
+
children: [
|
|
1225
|
+
"Harness state",
|
|
1226
|
+
/* @__PURE__ */ E("select", {
|
|
1227
|
+
"aria-label": "Harness state",
|
|
1228
|
+
value: ke || G,
|
|
1229
|
+
disabled: Q,
|
|
1230
|
+
onChange: (e) => {
|
|
1231
|
+
Ae(e.target.value), $();
|
|
1232
|
+
},
|
|
1233
|
+
children: d.map((e) => /* @__PURE__ */ D("option", {
|
|
1234
|
+
value: e,
|
|
1235
|
+
children: [e, e === G ? " (the Config's)" : ""]
|
|
1236
|
+
}, e))
|
|
1237
|
+
}),
|
|
1238
|
+
/* @__PURE__ */ D("small", { children: [(ke || G) === "ephemeral" ? "Ephemeral: this cell mounts no state volume; the harness state directory lives and dies with the cell, and the cell authenticates from its Secret." : "Persistent: this cell mounts the Config's state volume, so sessions and settings survive the cell.", Ne ? ` Used for this cell only; the Config uses ${G || "persistent"}.` : ""] })
|
|
1239
|
+
]
|
|
1240
|
+
}),
|
|
1241
|
+
!!G && je && /* @__PURE__ */ E("p", {
|
|
1242
|
+
className: "description",
|
|
1243
|
+
children: "Harness state is persistent: a method that keeps its login in the state volume cannot use ephemeral state."
|
|
1244
|
+
})
|
|
1245
|
+
]
|
|
1246
|
+
})
|
|
1247
|
+
}), At = se(Z?.values);
|
|
1248
|
+
return /* @__PURE__ */ D("div", {
|
|
1249
|
+
className: "creation-layout",
|
|
1250
|
+
children: [/* @__PURE__ */ D("section", {
|
|
1251
|
+
className: "panel",
|
|
1252
|
+
"aria-label": "Config",
|
|
1253
|
+
children: [/* @__PURE__ */ D("div", {
|
|
1254
|
+
className: "panel-heading",
|
|
1255
|
+
children: [/* @__PURE__ */ E("h2", { children: "Config" }), R && !xe && /* @__PURE__ */ E("button", {
|
|
1256
|
+
type: "button",
|
|
1257
|
+
className: "subtle-button",
|
|
1258
|
+
onClick: () => F(!0),
|
|
1259
|
+
children: "Change"
|
|
1260
|
+
})]
|
|
1261
|
+
}), /* @__PURE__ */ D("div", {
|
|
1262
|
+
className: "panel-body creation-form",
|
|
1263
|
+
children: [xe ? /* @__PURE__ */ D(T, { children: [
|
|
1264
|
+
C.loading && /* @__PURE__ */ E("p", {
|
|
1265
|
+
role: "status",
|
|
1266
|
+
children: "Loading CellConfigs…"
|
|
1267
|
+
}),
|
|
1268
|
+
C.error && /* @__PURE__ */ D("div", {
|
|
1269
|
+
className: "error",
|
|
1270
|
+
role: "alert",
|
|
1271
|
+
children: [/* @__PURE__ */ E("strong", { children: "CellConfigs unavailable" }), /* @__PURE__ */ E("p", { children: C.error.message })]
|
|
1272
|
+
}),
|
|
1273
|
+
C.error && C.data && /* @__PURE__ */ E("p", {
|
|
1274
|
+
className: "stale",
|
|
1275
|
+
children: "Showing stale CellConfigs."
|
|
1276
|
+
}),
|
|
1277
|
+
/* @__PURE__ */ D("label", { children: ["Search CellConfigs", /* @__PURE__ */ E("input", {
|
|
1278
|
+
type: "search",
|
|
1279
|
+
value: k,
|
|
1280
|
+
placeholder: "Name or full scope",
|
|
1281
|
+
onChange: (e) => A(e.target.value)
|
|
1282
|
+
})] }),
|
|
1283
|
+
/* @__PURE__ */ D("label", { children: ["CellConfig", /* @__PURE__ */ D("select", {
|
|
1284
|
+
value: de,
|
|
1285
|
+
onChange: (e) => {
|
|
1286
|
+
N(e.target.value), Oe({}), Te({}), Ae(""), ft(void 0), mt(void 0), qe(void 0), Qe("");
|
|
1287
|
+
},
|
|
1288
|
+
children: [/* @__PURE__ */ E("option", {
|
|
1289
|
+
value: "",
|
|
1290
|
+
children: "Select a CellConfig…"
|
|
1291
|
+
}), L.map((e) => /* @__PURE__ */ D("option", {
|
|
1292
|
+
value: JSON.stringify(e.scope),
|
|
1293
|
+
children: [
|
|
1294
|
+
e.doc.metadata.name,
|
|
1295
|
+
" — ",
|
|
1296
|
+
M(e.scope.slice(0, -1))
|
|
1297
|
+
]
|
|
1298
|
+
}, JSON.stringify(e.scope)))]
|
|
1299
|
+
})] }),
|
|
1300
|
+
!C.loading && !C.error && !I.length && /* @__PURE__ */ E("p", {
|
|
1301
|
+
className: "description",
|
|
1302
|
+
children: "No CellConfigs are available."
|
|
1303
|
+
})
|
|
1304
|
+
] }) : R ? null : /* @__PURE__ */ E("p", {
|
|
1305
|
+
role: "status",
|
|
1306
|
+
children: "Loading CellConfigs…"
|
|
1307
|
+
}), R && /* @__PURE__ */ D(T, { children: [
|
|
1308
|
+
B.loading && /* @__PURE__ */ E("p", {
|
|
1309
|
+
role: "status",
|
|
1310
|
+
children: B.data ? "Refreshing CellConfig details…" : "Loading CellConfig details…"
|
|
1311
|
+
}),
|
|
1312
|
+
B.error && /* @__PURE__ */ D("div", {
|
|
1313
|
+
className: "error",
|
|
1314
|
+
role: "alert",
|
|
1315
|
+
children: [/* @__PURE__ */ E("strong", { children: "CellConfig details unavailable" }), /* @__PURE__ */ E("p", { children: B.error.message })]
|
|
1316
|
+
}),
|
|
1317
|
+
B.error && B.data && /* @__PURE__ */ E("p", {
|
|
1318
|
+
className: "stale",
|
|
1319
|
+
children: "Showing stale CellConfig details."
|
|
1320
|
+
}),
|
|
1321
|
+
B.data && /* @__PURE__ */ D("p", {
|
|
1322
|
+
className: "config-summary",
|
|
1323
|
+
children: [
|
|
1324
|
+
"Config ",
|
|
1325
|
+
/* @__PURE__ */ E("a", {
|
|
1326
|
+
className: "resource-name",
|
|
1327
|
+
href: j("configs", R.scope, !0),
|
|
1328
|
+
children: B.data.metadata.name
|
|
1329
|
+
}),
|
|
1330
|
+
" ",
|
|
1331
|
+
/* @__PURE__ */ E("span", {
|
|
1332
|
+
className: "description",
|
|
1333
|
+
children: M(R.scope.slice(0, -1))
|
|
1334
|
+
}),
|
|
1335
|
+
Y.data && Fe && /* @__PURE__ */ D(T, { children: [
|
|
1336
|
+
" · Blueprint ",
|
|
1337
|
+
/* @__PURE__ */ E("a", {
|
|
1338
|
+
className: "resource-name",
|
|
1339
|
+
href: j("blueprints", X),
|
|
1340
|
+
children: Y.data.metadata.name
|
|
1341
|
+
}),
|
|
1342
|
+
" ",
|
|
1343
|
+
/* @__PURE__ */ E("span", {
|
|
1344
|
+
className: "description",
|
|
1345
|
+
children: M(X.slice(0, -1))
|
|
1346
|
+
})
|
|
1347
|
+
] })
|
|
1348
|
+
]
|
|
1349
|
+
}),
|
|
1350
|
+
B.data && Ot
|
|
1351
|
+
] })]
|
|
1352
|
+
})]
|
|
1353
|
+
}), R && /* @__PURE__ */ D(T, { children: [
|
|
1354
|
+
/* @__PURE__ */ D("section", {
|
|
1355
|
+
className: "panel",
|
|
1356
|
+
"aria-label": "Cell",
|
|
1357
|
+
children: [/* @__PURE__ */ E("div", {
|
|
1358
|
+
className: "panel-heading",
|
|
1359
|
+
children: /* @__PURE__ */ E("h2", { children: "Cell" })
|
|
1360
|
+
}), /* @__PURE__ */ D("form", {
|
|
1361
|
+
className: "panel-body creation-form",
|
|
1362
|
+
onSubmit: (e) => {
|
|
1363
|
+
e.preventDefault(), wt && St(!1);
|
|
1364
|
+
},
|
|
1365
|
+
children: [
|
|
1366
|
+
/* @__PURE__ */ D("label", { children: [
|
|
1367
|
+
"Cell name (optional)",
|
|
1368
|
+
/* @__PURE__ */ E("input", {
|
|
1369
|
+
value: Le,
|
|
1370
|
+
disabled: Q,
|
|
1371
|
+
onChange: (e) => {
|
|
1372
|
+
Re(e.target.value), $();
|
|
1373
|
+
}
|
|
1374
|
+
}),
|
|
1375
|
+
/* @__PURE__ */ E("small", { children: "Leave blank to let kukeon pick a name." })
|
|
1376
|
+
] }),
|
|
1377
|
+
/* @__PURE__ */ D("div", {
|
|
1378
|
+
className: "schema-fields",
|
|
1379
|
+
children: [
|
|
1380
|
+
/* @__PURE__ */ D("p", {
|
|
1381
|
+
className: "schema-field",
|
|
1382
|
+
children: ["Realm", /* @__PURE__ */ E("strong", { children: ct })]
|
|
1383
|
+
}),
|
|
1384
|
+
/* @__PURE__ */ E(ye, {
|
|
1385
|
+
label: "Target space",
|
|
1386
|
+
value: gt,
|
|
1387
|
+
options: ht,
|
|
1388
|
+
pinned: !!lt,
|
|
1389
|
+
disabled: Q,
|
|
1390
|
+
onChange: (e) => {
|
|
1391
|
+
ft(e), mt(void 0), $();
|
|
1392
|
+
}
|
|
1393
|
+
}),
|
|
1394
|
+
/* @__PURE__ */ E(ye, {
|
|
1395
|
+
label: "Target stack",
|
|
1396
|
+
value: vt,
|
|
1397
|
+
options: _t,
|
|
1398
|
+
pinned: !!ut,
|
|
1399
|
+
disabled: Q,
|
|
1400
|
+
onChange: (e) => {
|
|
1401
|
+
mt(e), $();
|
|
1402
|
+
}
|
|
1403
|
+
})
|
|
1404
|
+
]
|
|
1405
|
+
}),
|
|
1406
|
+
yt && /* @__PURE__ */ E("p", {
|
|
1407
|
+
className: "error",
|
|
1408
|
+
role: "alert",
|
|
1409
|
+
children: "The target Stack is not present in the loaded inventory."
|
|
1410
|
+
}),
|
|
1411
|
+
g.data?.failures.length ? /* @__PURE__ */ E("p", {
|
|
1412
|
+
className: "stale",
|
|
1413
|
+
children: "Inventory is incomplete. Target scope may be unavailable."
|
|
1414
|
+
}) : null
|
|
1415
|
+
]
|
|
1416
|
+
})]
|
|
1417
|
+
}),
|
|
1418
|
+
kt,
|
|
1419
|
+
/* @__PURE__ */ E(O, {
|
|
1420
|
+
title: "Environment overrides",
|
|
1421
|
+
level: 3,
|
|
1422
|
+
summary: Dt ? `${Dt} set` : "None",
|
|
1423
|
+
open: tt,
|
|
1424
|
+
onToggle: nt,
|
|
1425
|
+
children: /* @__PURE__ */ E("div", {
|
|
1426
|
+
className: "panel-body creation-form",
|
|
1427
|
+
children: /* @__PURE__ */ D("label", { children: [
|
|
1428
|
+
"Environment overrides",
|
|
1429
|
+
/* @__PURE__ */ E("textarea", {
|
|
1430
|
+
value: ze,
|
|
1431
|
+
disabled: Q,
|
|
1432
|
+
placeholder: "KEY=VALUE, one per line",
|
|
1433
|
+
onChange: (e) => {
|
|
1434
|
+
Be(e.target.value), $();
|
|
1435
|
+
}
|
|
1436
|
+
}),
|
|
1437
|
+
/* @__PURE__ */ E("small", { children: "Values are redacted in the preview." })
|
|
1438
|
+
] })
|
|
1439
|
+
})
|
|
1440
|
+
}),
|
|
1441
|
+
/* @__PURE__ */ E(O, {
|
|
1442
|
+
title: "Advanced",
|
|
1443
|
+
level: 3,
|
|
1444
|
+
summary: Ve ? "Ignoring disk pressure" : "Defaults",
|
|
1445
|
+
open: rt,
|
|
1446
|
+
onToggle: it,
|
|
1447
|
+
children: /* @__PURE__ */ E("div", {
|
|
1448
|
+
className: "panel-body creation-form",
|
|
1449
|
+
children: /* @__PURE__ */ D("label", {
|
|
1450
|
+
className: "schema-check",
|
|
1451
|
+
children: [/* @__PURE__ */ E("input", {
|
|
1452
|
+
type: "checkbox",
|
|
1453
|
+
checked: Ve,
|
|
1454
|
+
disabled: Q,
|
|
1455
|
+
onChange: (e) => {
|
|
1456
|
+
He(e.target.checked), $();
|
|
1457
|
+
}
|
|
1458
|
+
}), " Ignore disk pressure for this creation"]
|
|
1459
|
+
})
|
|
1460
|
+
})
|
|
1461
|
+
}),
|
|
1462
|
+
Ze && /* @__PURE__ */ E("p", {
|
|
1463
|
+
className: "error",
|
|
1464
|
+
role: "alert",
|
|
1465
|
+
children: Ze
|
|
1466
|
+
}),
|
|
1467
|
+
Q && /* @__PURE__ */ E("p", {
|
|
1468
|
+
role: "status",
|
|
1469
|
+
children: Ye === "create" ? "Creating Cell…" : "Preparing preview…"
|
|
1470
|
+
}),
|
|
1471
|
+
Z && /* @__PURE__ */ D(_e, {
|
|
1472
|
+
review: bt,
|
|
1473
|
+
onHide: () => qe(void 0),
|
|
1474
|
+
children: [
|
|
1475
|
+
/* @__PURE__ */ E(me, {
|
|
1476
|
+
document: Z.document,
|
|
1477
|
+
connectors: Z.connectors
|
|
1478
|
+
}),
|
|
1479
|
+
/* @__PURE__ */ E(y, {
|
|
1480
|
+
values: Z.values,
|
|
1481
|
+
connectors: Z.connectors,
|
|
1482
|
+
team: q,
|
|
1483
|
+
sources: {
|
|
1484
|
+
blueprint: Y.data && Fe ? /* @__PURE__ */ E("a", {
|
|
1485
|
+
className: "resource-name",
|
|
1486
|
+
href: j("blueprints", X),
|
|
1487
|
+
children: Y.data.metadata.name
|
|
1488
|
+
}) : void 0,
|
|
1489
|
+
config: /* @__PURE__ */ E("a", {
|
|
1490
|
+
className: "resource-name",
|
|
1491
|
+
href: j("configs", R.scope, !0),
|
|
1492
|
+
children: R.doc.metadata.name
|
|
1493
|
+
}),
|
|
1494
|
+
realm: Z.document.spec.realmId,
|
|
1495
|
+
space: Z.document.spec.spaceId,
|
|
1496
|
+
stack: Z.document.spec.stackId
|
|
1497
|
+
}
|
|
1498
|
+
}),
|
|
1499
|
+
(At.repos.length > 0 || At.defaults.length > 0) && /* @__PURE__ */ E(O, {
|
|
1500
|
+
title: "Git identity per repository",
|
|
1501
|
+
level: 3,
|
|
1502
|
+
open: at,
|
|
1503
|
+
onToggle: ot,
|
|
1504
|
+
children: /* @__PURE__ */ E("div", {
|
|
1505
|
+
className: "panel-body",
|
|
1506
|
+
children: /* @__PURE__ */ E(b, { values: Z.values ?? [] })
|
|
1507
|
+
})
|
|
1508
|
+
}),
|
|
1509
|
+
/* @__PURE__ */ E(he, {
|
|
1510
|
+
document: Z.document,
|
|
1511
|
+
label: "Complete Cell preview"
|
|
1512
|
+
}),
|
|
1513
|
+
Z.digest && /* @__PURE__ */ D("p", {
|
|
1514
|
+
className: "description",
|
|
1515
|
+
children: ["Render digest: ", /* @__PURE__ */ E("code", { children: Z.digest })]
|
|
1516
|
+
})
|
|
1517
|
+
]
|
|
1518
|
+
}),
|
|
1519
|
+
K.length > 0 && /* @__PURE__ */ D("p", {
|
|
1520
|
+
className: "field-error",
|
|
1521
|
+
role: "alert",
|
|
1522
|
+
children: [
|
|
1523
|
+
"Create is disabled until every required connector resolves: ",
|
|
1524
|
+
[...new Set(K.map(l))].join(", "),
|
|
1525
|
+
"."
|
|
1526
|
+
]
|
|
1527
|
+
}),
|
|
1528
|
+
/* @__PURE__ */ E(ve, {
|
|
1529
|
+
start: Ue,
|
|
1530
|
+
attach: Ge,
|
|
1531
|
+
onStart: We,
|
|
1532
|
+
onAttach: Ke,
|
|
1533
|
+
pending: Q,
|
|
1534
|
+
hasPreview: !!Z,
|
|
1535
|
+
previewLabel: "Preview Cell",
|
|
1536
|
+
canPreview: !Q && wt,
|
|
1537
|
+
canCreate: Tt,
|
|
1538
|
+
onPreview: () => void St(!1),
|
|
1539
|
+
onCreate: () => void St(!0)
|
|
1540
|
+
})
|
|
1541
|
+
] })]
|
|
1542
|
+
});
|
|
1543
|
+
}
|
|
1544
|
+
function xe({ inventory: e, onCreated: t }) {
|
|
1545
|
+
let n = e.data?.rows[0] ?? [], [r, i] = w(() => ({
|
|
1546
|
+
name: "",
|
|
1547
|
+
realm: "",
|
|
1548
|
+
space: "",
|
|
1549
|
+
stack: "",
|
|
1550
|
+
labels: {},
|
|
1551
|
+
annotations: {},
|
|
1552
|
+
spec: {
|
|
1553
|
+
containers: [],
|
|
1554
|
+
autoDelete: !1,
|
|
1555
|
+
nestedCgroupRuntime: !1,
|
|
1556
|
+
ignoreDiskPressure: !1
|
|
1557
|
+
}
|
|
1558
|
+
})), [a, o] = w(!1), [s, c] = w({}), [l, u] = w({}), [d, f] = w(), [p, m] = w(!1), [h, ee] = w("preview"), [te, ne] = w(!0), [re, g] = w(!0), [ie, ae] = w(""), _ = String(r.realm ?? ""), oe = (e.data?.rows[1] ?? []).filter((e) => e.scope[0] === _), v = String(r.space ?? ""), se = (e.data?.rows[2] ?? []).filter((e) => e.scope[0] === _ && e.scope[1] === v), y = r.spec, b = y.containers ?? [];
|
|
1559
|
+
ce(() => {
|
|
1560
|
+
if (!e.data || r.realm) return;
|
|
1561
|
+
let t = n.find((e) => e.doc.metadata.name === "default") ?? n[0];
|
|
1562
|
+
if (!t) return;
|
|
1563
|
+
let a = e.data.rows[1].find((e) => e.scope[0] === t.scope[0] && e.doc.metadata.name === "default") ?? e.data.rows[1].find((e) => e.scope[0] === t.scope[0]), o = a && (e.data.rows[2].find((e) => e.scope[0] === a.scope[0] && e.scope[1] === a.scope[1] && e.doc.metadata.name === "default") ?? e.data.rows[2].find((e) => e.scope[0] === a.scope[0] && e.scope[1] === a.scope[1]));
|
|
1564
|
+
i((e) => e.realm ? e : {
|
|
1565
|
+
...e,
|
|
1566
|
+
realm: t.scope[0],
|
|
1567
|
+
space: a?.scope[1] ?? "",
|
|
1568
|
+
stack: o?.scope[2] ?? ""
|
|
1569
|
+
});
|
|
1570
|
+
}, [
|
|
1571
|
+
e.data,
|
|
1572
|
+
r.realm,
|
|
1573
|
+
n
|
|
1574
|
+
]);
|
|
1575
|
+
let x = le(() => ({
|
|
1576
|
+
...F({ name: r.name }, [{
|
|
1577
|
+
key: "name",
|
|
1578
|
+
label: "Cell name",
|
|
1579
|
+
kind: "text",
|
|
1580
|
+
required: !0
|
|
1581
|
+
}], "cell"),
|
|
1582
|
+
...F({
|
|
1583
|
+
realm: _,
|
|
1584
|
+
space: v,
|
|
1585
|
+
stack: r.stack
|
|
1586
|
+
}, [
|
|
1587
|
+
"realm",
|
|
1588
|
+
"space",
|
|
1589
|
+
"stack"
|
|
1590
|
+
].map((e) => ({
|
|
1591
|
+
key: e,
|
|
1592
|
+
label: e,
|
|
1593
|
+
kind: "text",
|
|
1594
|
+
required: !0
|
|
1595
|
+
})), "cell"),
|
|
1596
|
+
...F({ containers: b }, [{
|
|
1597
|
+
key: "containers",
|
|
1598
|
+
label: "Containers",
|
|
1599
|
+
kind: "objects",
|
|
1600
|
+
fields: A.filter((e) => e.required)
|
|
1601
|
+
}], "cell.spec")
|
|
1602
|
+
}), [
|
|
1603
|
+
r,
|
|
1604
|
+
_,
|
|
1605
|
+
v,
|
|
1606
|
+
y,
|
|
1607
|
+
b
|
|
1608
|
+
]);
|
|
1609
|
+
function S(e, t) {
|
|
1610
|
+
i((n) => N(n, e, t)), f(void 0), u({});
|
|
1611
|
+
}
|
|
1612
|
+
function C(e, t) {
|
|
1613
|
+
i((n) => N(n, "spec", N(n.spec, e, t))), f(void 0), u({});
|
|
1614
|
+
}
|
|
1615
|
+
function T(e, t, n) {
|
|
1616
|
+
C("containers", b.map((r, i) => i === e ? N(r, t, n) : r));
|
|
1617
|
+
}
|
|
1618
|
+
async function O(e) {
|
|
1619
|
+
if (!p) {
|
|
1620
|
+
if ((!e || !d) && Object.keys(x).length) u(x);
|
|
1621
|
+
else {
|
|
1622
|
+
m(!0), ee(e ? "create" : "preview"), ae("");
|
|
1623
|
+
try {
|
|
1624
|
+
let n = {
|
|
1625
|
+
name: String(r.name).trim(),
|
|
1626
|
+
realm: _,
|
|
1627
|
+
space: v,
|
|
1628
|
+
stack: String(r.stack ?? ""),
|
|
1629
|
+
labels: r.labels,
|
|
1630
|
+
annotations: r.annotations,
|
|
1631
|
+
spec: y
|
|
1632
|
+
}, i = await ue(`/cells/manual/${e ? "create" : "preview"}`, {
|
|
1633
|
+
method: "POST",
|
|
1634
|
+
headers: {
|
|
1635
|
+
"Content-Type": "application/json",
|
|
1636
|
+
Accept: "application/json"
|
|
1637
|
+
},
|
|
1638
|
+
body: JSON.stringify({
|
|
1639
|
+
...n,
|
|
1640
|
+
...e && d ? { preview: d.preview } : {}
|
|
1641
|
+
})
|
|
1642
|
+
}), a = await i.json();
|
|
1643
|
+
if (!i.ok) {
|
|
1644
|
+
let t = a.error?.message ?? a.message ?? `Request failed (HTTP ${i.status})`;
|
|
1645
|
+
throw Error(e && (a.error?.code === "unavailable" || i.status >= 500) ? `The creation outcome could not be confirmed. Refresh the Cell inventory before retrying. ${t}` : t);
|
|
1646
|
+
}
|
|
1647
|
+
e ? t(a, {
|
|
1648
|
+
start: te,
|
|
1649
|
+
attach: te && re
|
|
1650
|
+
}) : f(a);
|
|
1651
|
+
} catch (t) {
|
|
1652
|
+
let n = t instanceof Error ? t.message : "The request could not reach the web server.";
|
|
1653
|
+
ae(e && t instanceof TypeError ? `The creation outcome could not be confirmed. Refresh the Cell inventory before retrying. ${n}` : n);
|
|
1654
|
+
} finally {
|
|
1655
|
+
m(!1);
|
|
1656
|
+
}
|
|
1657
|
+
}
|
|
1658
|
+
}
|
|
1659
|
+
}
|
|
1660
|
+
let k = ge(d);
|
|
1661
|
+
return /* @__PURE__ */ D("div", {
|
|
1662
|
+
className: "creation-layout",
|
|
1663
|
+
children: [
|
|
1664
|
+
/* @__PURE__ */ D("section", {
|
|
1665
|
+
className: "panel",
|
|
1666
|
+
children: [/* @__PURE__ */ D("div", {
|
|
1667
|
+
className: "panel-heading",
|
|
1668
|
+
children: [/* @__PURE__ */ E("h2", { children: "Build a Cell specification" }), /* @__PURE__ */ E("span", {
|
|
1669
|
+
className: "badge",
|
|
1670
|
+
children: "No Config or Blueprint"
|
|
1671
|
+
})]
|
|
1672
|
+
}), /* @__PURE__ */ D("form", {
|
|
1673
|
+
className: "panel-body creation-form",
|
|
1674
|
+
onSubmit: (e) => {
|
|
1675
|
+
e.preventDefault(), O(!1);
|
|
1676
|
+
},
|
|
1677
|
+
children: [
|
|
1678
|
+
/* @__PURE__ */ D("div", {
|
|
1679
|
+
className: "schema-section",
|
|
1680
|
+
children: [/* @__PURE__ */ E("h3", { children: "Basic Cell configuration" }), /* @__PURE__ */ D("div", {
|
|
1681
|
+
className: "schema-fields",
|
|
1682
|
+
children: [
|
|
1683
|
+
/* @__PURE__ */ D("label", {
|
|
1684
|
+
className: "schema-field",
|
|
1685
|
+
htmlFor: "manual-name",
|
|
1686
|
+
children: [
|
|
1687
|
+
/* @__PURE__ */ D("span", { children: ["Cell name ", /* @__PURE__ */ E("b", {
|
|
1688
|
+
"aria-label": "required",
|
|
1689
|
+
children: " *"
|
|
1690
|
+
})] }),
|
|
1691
|
+
/* @__PURE__ */ E("input", {
|
|
1692
|
+
id: "manual-name",
|
|
1693
|
+
value: String(r.name),
|
|
1694
|
+
disabled: p,
|
|
1695
|
+
"aria-invalid": !!l["cell.name"],
|
|
1696
|
+
"aria-describedby": l["cell.name"] ? "manual-name-error" : void 0,
|
|
1697
|
+
onChange: (e) => S("name", e.target.value)
|
|
1698
|
+
}),
|
|
1699
|
+
l["cell.name"] && /* @__PURE__ */ E("small", {
|
|
1700
|
+
id: "manual-name-error",
|
|
1701
|
+
className: "field-error",
|
|
1702
|
+
children: l["cell.name"]
|
|
1703
|
+
})
|
|
1704
|
+
]
|
|
1705
|
+
}),
|
|
1706
|
+
/* @__PURE__ */ D("label", {
|
|
1707
|
+
className: "schema-field",
|
|
1708
|
+
children: [
|
|
1709
|
+
/* @__PURE__ */ D("span", { children: ["Realm ", /* @__PURE__ */ E("b", {
|
|
1710
|
+
"aria-label": "required",
|
|
1711
|
+
children: " *"
|
|
1712
|
+
})] }),
|
|
1713
|
+
/* @__PURE__ */ D("select", {
|
|
1714
|
+
value: _,
|
|
1715
|
+
disabled: p,
|
|
1716
|
+
onChange: (e) => {
|
|
1717
|
+
S("realm", e.target.value), S("space", ""), S("stack", "");
|
|
1718
|
+
},
|
|
1719
|
+
children: [/* @__PURE__ */ E("option", {
|
|
1720
|
+
value: "",
|
|
1721
|
+
children: "Select a Realm…"
|
|
1722
|
+
}), n.map((e) => /* @__PURE__ */ E("option", { children: e.scope[0] }, e.scope[0]))]
|
|
1723
|
+
}),
|
|
1724
|
+
l["cell.realm"] && /* @__PURE__ */ E("small", {
|
|
1725
|
+
className: "field-error",
|
|
1726
|
+
children: l["cell.realm"]
|
|
1727
|
+
})
|
|
1728
|
+
]
|
|
1729
|
+
}),
|
|
1730
|
+
/* @__PURE__ */ D("label", {
|
|
1731
|
+
className: "schema-field",
|
|
1732
|
+
children: [
|
|
1733
|
+
/* @__PURE__ */ D("span", { children: ["Space ", /* @__PURE__ */ E("b", {
|
|
1734
|
+
"aria-label": "required",
|
|
1735
|
+
children: " *"
|
|
1736
|
+
})] }),
|
|
1737
|
+
/* @__PURE__ */ D("select", {
|
|
1738
|
+
value: v,
|
|
1739
|
+
disabled: p || !_,
|
|
1740
|
+
onChange: (e) => {
|
|
1741
|
+
S("space", e.target.value), S("stack", "");
|
|
1742
|
+
},
|
|
1743
|
+
children: [/* @__PURE__ */ E("option", {
|
|
1744
|
+
value: "",
|
|
1745
|
+
children: "Select a Space…"
|
|
1746
|
+
}), oe.map((e) => /* @__PURE__ */ E("option", { children: e.scope[1] }, e.scope[1]))]
|
|
1747
|
+
}),
|
|
1748
|
+
l["cell.space"] && /* @__PURE__ */ E("small", {
|
|
1749
|
+
className: "field-error",
|
|
1750
|
+
children: l["cell.space"]
|
|
1751
|
+
})
|
|
1752
|
+
]
|
|
1753
|
+
}),
|
|
1754
|
+
/* @__PURE__ */ D("label", {
|
|
1755
|
+
className: "schema-field",
|
|
1756
|
+
children: [
|
|
1757
|
+
/* @__PURE__ */ D("span", { children: ["Stack ", /* @__PURE__ */ E("b", {
|
|
1758
|
+
"aria-label": "required",
|
|
1759
|
+
children: " *"
|
|
1760
|
+
})] }),
|
|
1761
|
+
/* @__PURE__ */ D("select", {
|
|
1762
|
+
value: String(r.stack ?? ""),
|
|
1763
|
+
disabled: p || !v,
|
|
1764
|
+
onChange: (e) => S("stack", e.target.value),
|
|
1765
|
+
children: [/* @__PURE__ */ E("option", {
|
|
1766
|
+
value: "",
|
|
1767
|
+
children: "Select a Stack…"
|
|
1768
|
+
}), se.map((e) => /* @__PURE__ */ E("option", { children: e.scope[2] }, e.scope[2]))]
|
|
1769
|
+
}),
|
|
1770
|
+
l["cell.stack"] && /* @__PURE__ */ E("small", {
|
|
1771
|
+
className: "field-error",
|
|
1772
|
+
children: l["cell.stack"]
|
|
1773
|
+
})
|
|
1774
|
+
]
|
|
1775
|
+
})
|
|
1776
|
+
]
|
|
1777
|
+
})]
|
|
1778
|
+
}),
|
|
1779
|
+
/* @__PURE__ */ D("div", {
|
|
1780
|
+
className: "schema-section",
|
|
1781
|
+
children: [/* @__PURE__ */ E("h3", { children: "Metadata" }), /* @__PURE__ */ E("div", {
|
|
1782
|
+
className: "schema-fields",
|
|
1783
|
+
children: ["labels", "annotations"].map((e) => /* @__PURE__ */ E(L, {
|
|
1784
|
+
field: {
|
|
1785
|
+
key: e,
|
|
1786
|
+
label: e === "labels" ? "Labels" : "Annotations",
|
|
1787
|
+
kind: "map"
|
|
1788
|
+
},
|
|
1789
|
+
value: r[e],
|
|
1790
|
+
path: `cell.${e}`,
|
|
1791
|
+
errors: l,
|
|
1792
|
+
disabled: p,
|
|
1793
|
+
onChange: (t) => S(e, t)
|
|
1794
|
+
}, e))
|
|
1795
|
+
})]
|
|
1796
|
+
}),
|
|
1797
|
+
/* @__PURE__ */ D("div", {
|
|
1798
|
+
className: "schema-section",
|
|
1799
|
+
children: [
|
|
1800
|
+
/* @__PURE__ */ D("div", {
|
|
1801
|
+
className: "schema-section-heading",
|
|
1802
|
+
children: [/* @__PURE__ */ E("h3", { children: "Workload containers" }), /* @__PURE__ */ E("button", {
|
|
1803
|
+
type: "button",
|
|
1804
|
+
disabled: p,
|
|
1805
|
+
onClick: () => C("containers", [...b, P(A)]),
|
|
1806
|
+
children: "Add container"
|
|
1807
|
+
})]
|
|
1808
|
+
}),
|
|
1809
|
+
/* @__PURE__ */ E("p", {
|
|
1810
|
+
className: "description",
|
|
1811
|
+
children: "Define workload containers only; kukeon adds its default root container unless one is marked as root."
|
|
1812
|
+
}),
|
|
1813
|
+
!b.length && /* @__PURE__ */ E("p", {
|
|
1814
|
+
className: "empty-state compact-empty",
|
|
1815
|
+
children: "No workload containers added. kukeon will add its default root container when the Cell is created."
|
|
1816
|
+
}),
|
|
1817
|
+
b.map((e, t) => /* @__PURE__ */ D("section", {
|
|
1818
|
+
className: "container-editor",
|
|
1819
|
+
children: [
|
|
1820
|
+
/* @__PURE__ */ D("div", {
|
|
1821
|
+
className: "schema-array-heading",
|
|
1822
|
+
children: [/* @__PURE__ */ D("h4", { children: [
|
|
1823
|
+
"Container ",
|
|
1824
|
+
t + 1,
|
|
1825
|
+
e.id ? ` · ${String(e.id)}` : ""
|
|
1826
|
+
] }), /* @__PURE__ */ E("button", {
|
|
1827
|
+
type: "button",
|
|
1828
|
+
className: "subtle-button",
|
|
1829
|
+
disabled: p,
|
|
1830
|
+
onClick: () => C("containers", b.filter((e, n) => n !== t)),
|
|
1831
|
+
children: "Remove container"
|
|
1832
|
+
})]
|
|
1833
|
+
}),
|
|
1834
|
+
/* @__PURE__ */ E("div", {
|
|
1835
|
+
className: "schema-fields",
|
|
1836
|
+
children: A.filter((e) => !e.advanced).map((n) => /* @__PURE__ */ E(L, {
|
|
1837
|
+
field: n,
|
|
1838
|
+
value: e[n.key],
|
|
1839
|
+
path: `cell.spec.containers.${t}.${n.key}`,
|
|
1840
|
+
errors: l,
|
|
1841
|
+
disabled: p,
|
|
1842
|
+
onChange: (e) => T(t, n.key, e)
|
|
1843
|
+
}, n.key))
|
|
1844
|
+
}),
|
|
1845
|
+
/* @__PURE__ */ D("button", {
|
|
1846
|
+
type: "button",
|
|
1847
|
+
className: "subtle-button",
|
|
1848
|
+
"aria-expanded": !!s[t],
|
|
1849
|
+
onClick: () => c((e) => ({
|
|
1850
|
+
...e,
|
|
1851
|
+
[t]: !e[t]
|
|
1852
|
+
})),
|
|
1853
|
+
children: [s[t] ? "Hide" : "Show", " advanced container fields"]
|
|
1854
|
+
}),
|
|
1855
|
+
s[t] && /* @__PURE__ */ E("div", {
|
|
1856
|
+
className: "schema-fields advanced-fields",
|
|
1857
|
+
children: A.filter((e) => e.advanced).map((n) => /* @__PURE__ */ E(L, {
|
|
1858
|
+
field: n,
|
|
1859
|
+
value: e[n.key],
|
|
1860
|
+
path: `cell.spec.containers.${t}.${n.key}`,
|
|
1861
|
+
errors: l,
|
|
1862
|
+
disabled: p,
|
|
1863
|
+
onChange: (e) => T(t, n.key, e)
|
|
1864
|
+
}, n.key))
|
|
1865
|
+
})
|
|
1866
|
+
]
|
|
1867
|
+
}, t))
|
|
1868
|
+
]
|
|
1869
|
+
}),
|
|
1870
|
+
/* @__PURE__ */ D("div", {
|
|
1871
|
+
className: "schema-section",
|
|
1872
|
+
children: [/* @__PURE__ */ D("button", {
|
|
1873
|
+
type: "button",
|
|
1874
|
+
className: "subtle-button",
|
|
1875
|
+
"aria-expanded": a,
|
|
1876
|
+
onClick: () => o((e) => !e),
|
|
1877
|
+
children: [a ? "Hide" : "Show", " advanced Cell configuration"]
|
|
1878
|
+
}), a && /* @__PURE__ */ D("div", {
|
|
1879
|
+
className: "schema-fields advanced-fields",
|
|
1880
|
+
children: [de.map((e) => /* @__PURE__ */ E(L, {
|
|
1881
|
+
field: e,
|
|
1882
|
+
value: y[e.key],
|
|
1883
|
+
path: `cell.spec.${e.key}`,
|
|
1884
|
+
errors: l,
|
|
1885
|
+
disabled: p,
|
|
1886
|
+
onChange: (t) => C(e.key, t)
|
|
1887
|
+
}, e.key)), ["autoDelete"].map((e) => /* @__PURE__ */ E(L, {
|
|
1888
|
+
field: {
|
|
1889
|
+
key: e,
|
|
1890
|
+
label: "Delete Cell after root exits",
|
|
1891
|
+
kind: "boolean"
|
|
1892
|
+
},
|
|
1893
|
+
value: y[e],
|
|
1894
|
+
path: `cell.spec.${e}`,
|
|
1895
|
+
errors: l,
|
|
1896
|
+
disabled: p,
|
|
1897
|
+
onChange: (t) => C(e, t)
|
|
1898
|
+
}, e))]
|
|
1899
|
+
})]
|
|
1900
|
+
}),
|
|
1901
|
+
e.error && /* @__PURE__ */ D("p", {
|
|
1902
|
+
className: "error",
|
|
1903
|
+
role: "alert",
|
|
1904
|
+
children: ["Scope inventory could not be loaded: ", e.error.message]
|
|
1905
|
+
}),
|
|
1906
|
+
!!e.data?.failures.length && /* @__PURE__ */ E("p", {
|
|
1907
|
+
className: "stale",
|
|
1908
|
+
children: "Scope inventory is incomplete. Verify the selected target resources before creating."
|
|
1909
|
+
}),
|
|
1910
|
+
Object.keys(l).length > 0 && /* @__PURE__ */ E("p", {
|
|
1911
|
+
className: "field-error",
|
|
1912
|
+
role: "alert",
|
|
1913
|
+
children: "Fix the highlighted fields before previewing or creating."
|
|
1914
|
+
})
|
|
1915
|
+
]
|
|
1916
|
+
})]
|
|
1917
|
+
}),
|
|
1918
|
+
ie && /* @__PURE__ */ E("p", {
|
|
1919
|
+
className: "error",
|
|
1920
|
+
role: "alert",
|
|
1921
|
+
children: ie
|
|
1922
|
+
}),
|
|
1923
|
+
p && /* @__PURE__ */ E("p", {
|
|
1924
|
+
role: "status",
|
|
1925
|
+
children: h === "create" ? "Creating Cell…" : "Validating and preparing preview…"
|
|
1926
|
+
}),
|
|
1927
|
+
d && /* @__PURE__ */ D(_e, {
|
|
1928
|
+
review: k,
|
|
1929
|
+
onHide: () => f(void 0),
|
|
1930
|
+
children: [
|
|
1931
|
+
/* @__PURE__ */ E(me, { document: d.document }),
|
|
1932
|
+
/* @__PURE__ */ E("p", {
|
|
1933
|
+
className: "description",
|
|
1934
|
+
children: "kukeon adds its default root container on creation unless one is defined; the created Cell shows the final specification."
|
|
1935
|
+
}),
|
|
1936
|
+
/* @__PURE__ */ E(he, {
|
|
1937
|
+
document: d.document,
|
|
1938
|
+
label: "Complete manual Cell preview"
|
|
1939
|
+
})
|
|
1940
|
+
]
|
|
1941
|
+
}),
|
|
1942
|
+
/* @__PURE__ */ E(ve, {
|
|
1943
|
+
start: te,
|
|
1944
|
+
attach: re,
|
|
1945
|
+
onStart: ne,
|
|
1946
|
+
onAttach: g,
|
|
1947
|
+
pending: p,
|
|
1948
|
+
hasPreview: !!d,
|
|
1949
|
+
previewLabel: "Validate and preview Cell",
|
|
1950
|
+
canPreview: !p,
|
|
1951
|
+
canCreate: !p,
|
|
1952
|
+
onPreview: () => void O(!1),
|
|
1953
|
+
onCreate: () => void O(!0)
|
|
1954
|
+
})
|
|
1955
|
+
]
|
|
1956
|
+
});
|
|
1957
|
+
}
|
|
1958
|
+
function z({ revision: e, inventory: t, configScope: n, onCreated: r }) {
|
|
1959
|
+
let [i, a] = w("config");
|
|
1960
|
+
return /* @__PURE__ */ D(T, { children: [/* @__PURE__ */ D("div", {
|
|
1961
|
+
className: "creation-method-switch",
|
|
1962
|
+
role: "group",
|
|
1963
|
+
"aria-label": "Cell creation method",
|
|
1964
|
+
children: [/* @__PURE__ */ E("button", {
|
|
1965
|
+
type: "button",
|
|
1966
|
+
"aria-pressed": i === "config",
|
|
1967
|
+
onClick: () => a("config"),
|
|
1968
|
+
children: "From Config"
|
|
1969
|
+
}), /* @__PURE__ */ E("button", {
|
|
1970
|
+
type: "button",
|
|
1971
|
+
"aria-pressed": i === "manual",
|
|
1972
|
+
onClick: () => a("manual"),
|
|
1973
|
+
children: "Manual"
|
|
1974
|
+
})]
|
|
1975
|
+
}), i === "config" ? /* @__PURE__ */ E(R, {
|
|
1976
|
+
revision: e,
|
|
1977
|
+
inventory: t,
|
|
1978
|
+
configScope: n,
|
|
1979
|
+
onCreated: r
|
|
1980
|
+
}, JSON.stringify(n ?? [])) : /* @__PURE__ */ E(xe, {
|
|
1981
|
+
inventory: t,
|
|
1982
|
+
onCreated: r
|
|
1983
|
+
})] });
|
|
1984
|
+
}
|
|
1985
|
+
export { z as NewCellPage };
|