@knpkv/alchemy-console 0.3.2 → 0.4.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 +78 -23
- package/dist/api.d.ts +16 -2
- package/dist/api.d.ts.map +1 -1
- package/dist/client/assets/empty-state-creature-CWMFWDpa.svg +60 -0
- package/dist/client/assets/index-C5EGKyzJ.js +58 -0
- package/dist/client/assets/{index-CrA-MUdX.css → index-CHwWf6VU.css} +1 -1
- package/dist/client/index.html +2 -2
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/internal/resource-identity.d.ts +7 -0
- package/dist/internal/resource-identity.d.ts.map +1 -0
- package/dist/internal/resource-identity.js +180 -0
- package/dist/internal/resource-identity.js.map +1 -0
- package/dist/local-state.d.ts.map +1 -1
- package/dist/local-state.js +11 -1
- package/dist/local-state.js.map +1 -1
- package/dist/outputs.d.ts +5 -0
- package/dist/outputs.d.ts.map +1 -0
- package/dist/outputs.js +15 -0
- package/dist/outputs.js.map +1 -0
- package/dist/presentation/ResourceDetailView.d.ts +13 -0
- package/dist/presentation/ResourceDetailView.d.ts.map +1 -0
- package/dist/presentation/ResourceDetailView.js +12 -0
- package/dist/presentation/ResourceDetailView.js.map +1 -0
- package/dist/presentation/ResourceTree.d.ts +18 -0
- package/dist/presentation/ResourceTree.d.ts.map +1 -0
- package/dist/presentation/ResourceTree.js +36 -0
- package/dist/presentation/ResourceTree.js.map +1 -0
- package/dist/presentation/StackDetailView.d.ts +15 -0
- package/dist/presentation/StackDetailView.d.ts.map +1 -0
- package/dist/presentation/StackDetailView.js +36 -0
- package/dist/presentation/StackDetailView.js.map +1 -0
- package/dist/presentation/StackListView.d.ts +4 -2
- package/dist/presentation/StackListView.d.ts.map +1 -1
- package/dist/presentation/StackListView.js +4 -4
- package/dist/presentation/StackListView.js.map +1 -1
- package/dist/presentation/detail-model.d.ts +40 -0
- package/dist/presentation/detail-model.d.ts.map +1 -0
- package/dist/presentation/detail-model.js +2 -0
- package/dist/presentation/detail-model.js.map +1 -0
- package/dist/presentation/detail-parts.d.ts +28 -0
- package/dist/presentation/detail-parts.d.ts.map +1 -0
- package/dist/presentation/detail-parts.js +42 -0
- package/dist/presentation/detail-parts.js.map +1 -0
- package/dist/presentation/resource-graph.d.ts +4 -0
- package/dist/presentation/resource-graph.d.ts.map +1 -0
- package/dist/presentation/resource-graph.js +25 -0
- package/dist/presentation/resource-graph.js.map +1 -0
- package/dist/s3-live.d.ts +1 -0
- package/dist/s3-live.d.ts.map +1 -1
- package/dist/s3-live.js +20 -14
- package/dist/s3-live.js.map +1 -1
- package/dist/s3-reader.d.ts +2 -1
- package/dist/s3-reader.d.ts.map +1 -1
- package/dist/s3-reader.js.map +1 -1
- package/dist/s3-state.d.ts.map +1 -1
- package/dist/s3-state.js +13 -1
- package/dist/s3-state.js.map +1 -1
- package/dist/schema.d.ts +22 -3
- package/dist/schema.d.ts.map +1 -1
- package/dist/schema.js +16 -5
- package/dist/schema.js.map +1 -1
- package/dist/server/Catalog.d.ts.map +1 -1
- package/dist/server/Catalog.js +15 -2
- package/dist/server/Catalog.js.map +1 -1
- package/dist/state.d.ts +2 -0
- package/dist/state.d.ts.map +1 -1
- package/dist/state.js +8 -8
- package/dist/state.js.map +1 -1
- package/dist/views/empty-state-creature.svg +60 -0
- package/dist/views/index.js +705 -105
- package/dist/views/style.css +1 -1
- package/dist/views.d.ts +5 -0
- package/dist/views.d.ts.map +1 -1
- package/dist/views.js +2 -1
- package/dist/views.js.map +1 -1
- package/package.json +3 -3
- package/dist/client/assets/index-CNQi3IQH.js +0 -58
package/dist/views/index.js
CHANGED
|
@@ -1,9 +1,591 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
1
|
+
import { Button as e, Notice as t, Skeleton as n, Tabs as r, Text as i } from "@knpkv/rly/primitives";
|
|
2
|
+
import { useId as a, useMemo as o, useState as s } from "react";
|
|
3
|
+
import { Icon as c } from "@knpkv/rly/foundations";
|
|
4
|
+
import { DateTime as l, Option as u, Schema as d } from "effect";
|
|
5
|
+
import { jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
6
|
+
//#region src/presentation/detail-parts.tsx
|
|
7
|
+
var m = () => /* @__PURE__ */ f("span", {
|
|
8
|
+
className: "ac-detail-muted",
|
|
9
|
+
children: "Not available yet"
|
|
10
|
+
}), h = ({ children: e, title: t, unavailable: n = !1 }) => /* @__PURE__ */ p("div", {
|
|
11
|
+
className: n ? "ac-detail-panel ac-detail-unavailable" : "ac-detail-panel",
|
|
12
|
+
children: [/* @__PURE__ */ f(i, {
|
|
13
|
+
as: "p",
|
|
14
|
+
className: "ac-detail-panel-title",
|
|
15
|
+
children: t
|
|
16
|
+
}), e === void 0 ? null : /* @__PURE__ */ f(i, {
|
|
17
|
+
as: "p",
|
|
18
|
+
tone: "secondary",
|
|
19
|
+
children: e
|
|
20
|
+
})]
|
|
21
|
+
}), g = ({ status: e }) => {
|
|
22
|
+
if (e === null) return /* @__PURE__ */ f("span", {
|
|
23
|
+
className: "ac-detail-muted",
|
|
24
|
+
children: "Unknown"
|
|
25
|
+
});
|
|
26
|
+
let t = e === "created" || e === "updated" || e === "replaced";
|
|
27
|
+
return /* @__PURE__ */ p("span", {
|
|
28
|
+
className: `ac-resource-status ${t ? "ac-resource-success" : e === "failed" ? "ac-resource-failed" : "ac-resource-working"}`,
|
|
29
|
+
children: [
|
|
30
|
+
/* @__PURE__ */ f(c, {
|
|
31
|
+
name: t ? "check" : e === "failed" ? "alert" : "loader",
|
|
32
|
+
decorative: !0,
|
|
33
|
+
size: "small"
|
|
34
|
+
}),
|
|
35
|
+
e.slice(0, 1).toUpperCase(),
|
|
36
|
+
e.slice(1)
|
|
37
|
+
]
|
|
38
|
+
});
|
|
39
|
+
}, _ = ({ value: e }) => {
|
|
40
|
+
let t = u.getOrNull(d.decodeUnknownOption(d.DateTimeUtcFromString)(e));
|
|
41
|
+
return t === null ? /* @__PURE__ */ f(m, {}) : /* @__PURE__ */ f("time", {
|
|
42
|
+
dateTime: l.formatIso(t),
|
|
43
|
+
children: new Intl.DateTimeFormat("en-GB", {
|
|
44
|
+
day: "numeric",
|
|
45
|
+
month: "short",
|
|
46
|
+
hour: "2-digit",
|
|
47
|
+
minute: "2-digit"
|
|
48
|
+
}).format(l.toEpochMillis(t))
|
|
49
|
+
});
|
|
50
|
+
}, v = ({ resource: e }) => e.consoleUrl === null ? null : /* @__PURE__ */ p("a", {
|
|
51
|
+
"data-rly-hit-area": !0,
|
|
52
|
+
className: "ac-detail-link ac-provider-link",
|
|
53
|
+
href: e.consoleUrl,
|
|
54
|
+
target: "_blank",
|
|
55
|
+
rel: "noopener noreferrer",
|
|
56
|
+
children: [
|
|
57
|
+
"Open in ",
|
|
58
|
+
e.resourceType.startsWith("Cloudflare.") ? "Cloudflare" : "AWS",
|
|
59
|
+
" console",
|
|
60
|
+
" ",
|
|
61
|
+
/* @__PURE__ */ f("span", {
|
|
62
|
+
"aria-hidden": "true",
|
|
63
|
+
children: "↗"
|
|
64
|
+
}),
|
|
65
|
+
/* @__PURE__ */ p("span", {
|
|
66
|
+
className: "ac-sr-only",
|
|
67
|
+
children: [
|
|
68
|
+
" for ",
|
|
69
|
+
e.logicalId,
|
|
70
|
+
", opens in a new tab"
|
|
71
|
+
]
|
|
72
|
+
})
|
|
73
|
+
]
|
|
74
|
+
}), y = ({ copy: t, onReadAgain: r, state: a }) => a._tag === "Loading" ? /* @__PURE__ */ p("div", {
|
|
75
|
+
"aria-busy": "true",
|
|
76
|
+
className: "ac-detail-loading",
|
|
77
|
+
children: [
|
|
78
|
+
/* @__PURE__ */ f("span", {
|
|
79
|
+
className: "ac-sr-only",
|
|
80
|
+
role: "status",
|
|
81
|
+
children: "Reading stack state…"
|
|
82
|
+
}),
|
|
83
|
+
/* @__PURE__ */ f(n, { className: "ac-detail-title-skeleton" }),
|
|
84
|
+
/* @__PURE__ */ f(n, {
|
|
85
|
+
variant: "block",
|
|
86
|
+
className: "ac-detail-body-skeleton"
|
|
87
|
+
})
|
|
88
|
+
]
|
|
89
|
+
}) : /* @__PURE__ */ p("section", {
|
|
90
|
+
className: "ac-state-panel",
|
|
91
|
+
role: "status",
|
|
92
|
+
children: [
|
|
93
|
+
/* @__PURE__ */ f(i, {
|
|
94
|
+
as: "h1",
|
|
95
|
+
className: "ac-state-title",
|
|
96
|
+
variant: "section-title",
|
|
97
|
+
children: a._tag === "Unauthorized" ? a.reason === "bootstrap" ? "Sign-in failed or link already used." : `Your ${t.product} session has ended.` : a._tag === "NotFound" ? "This stack is no longer available." : "Stack state is unavailable right now."
|
|
98
|
+
}),
|
|
99
|
+
/* @__PURE__ */ f(i, {
|
|
100
|
+
as: "p",
|
|
101
|
+
tone: "secondary",
|
|
102
|
+
children: a._tag === "Unauthorized" ? "Sign in again to see stacks." : a._tag === "NotFound" ? "Return to Stacks and Read again. Nothing was changed." : "The stack state couldn’t be read, so no resources are shown. Nothing was changed."
|
|
103
|
+
}),
|
|
104
|
+
a._tag === "Unauthorized" ? /* @__PURE__ */ f(i, {
|
|
105
|
+
as: "p",
|
|
106
|
+
variant: "meta",
|
|
107
|
+
tone: "secondary",
|
|
108
|
+
children: t.signInInstruction
|
|
109
|
+
}) : a._tag === "Failed" ? /* @__PURE__ */ f(e, {
|
|
110
|
+
className: "ac-read",
|
|
111
|
+
onClick: r,
|
|
112
|
+
children: "Retry"
|
|
113
|
+
}) : null
|
|
114
|
+
]
|
|
115
|
+
}), b = (e) => {
|
|
116
|
+
if (e.length > 5e4 || new Map(e.map((e) => [e.fqn, e])).size !== e.length) return null;
|
|
117
|
+
let t = new Map(e.map((e) => [e.fqn, []])), n = 0;
|
|
118
|
+
for (let r of e) {
|
|
119
|
+
if (r.downstream === null || (n += r.downstream.length, n > 1e5)) return null;
|
|
120
|
+
for (let e of new Set(r.downstream)) {
|
|
121
|
+
let n = t.get(e);
|
|
122
|
+
if (n === void 0 || e === r.fqn) return null;
|
|
123
|
+
n.push(r);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return t;
|
|
127
|
+
}, x = ({ copy: e, resource: t, resourceHref: n, stack: r, stackHref: a }) => {
|
|
128
|
+
let s = o(() => b(r.resources), [r.resources])?.get(t.fqn) ?? null;
|
|
129
|
+
return /* @__PURE__ */ p("div", {
|
|
130
|
+
className: "ac-detail ac-resource-detail",
|
|
131
|
+
children: [
|
|
132
|
+
/* @__PURE__ */ p("a", {
|
|
133
|
+
"data-rly-hit-area": !0,
|
|
134
|
+
className: "ac-detail-link ac-resource-back",
|
|
135
|
+
href: a,
|
|
136
|
+
children: [
|
|
137
|
+
"← ",
|
|
138
|
+
r.app,
|
|
139
|
+
" ",
|
|
140
|
+
r.stage
|
|
141
|
+
]
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ p("header", {
|
|
144
|
+
className: "ac-detail-header",
|
|
145
|
+
children: [/* @__PURE__ */ f(i, {
|
|
146
|
+
as: "h1",
|
|
147
|
+
variant: "page-title",
|
|
148
|
+
className: "ac-title",
|
|
149
|
+
children: t.logicalId
|
|
150
|
+
}), /* @__PURE__ */ f(i, {
|
|
151
|
+
as: "p",
|
|
152
|
+
tone: "secondary",
|
|
153
|
+
children: t.resourceType
|
|
154
|
+
})]
|
|
155
|
+
}),
|
|
156
|
+
/* @__PURE__ */ p("div", {
|
|
157
|
+
className: "ac-resource-identity",
|
|
158
|
+
children: [
|
|
159
|
+
/* @__PURE__ */ p("dl", {
|
|
160
|
+
className: "ac-identity-table",
|
|
161
|
+
children: [
|
|
162
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("dt", { children: "Logical name" }), /* @__PURE__ */ f("dd", { children: t.logicalId })] }),
|
|
163
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("dt", { children: "Type" }), /* @__PURE__ */ f("dd", {
|
|
164
|
+
className: "ac-resource-id",
|
|
165
|
+
children: t.resourceType
|
|
166
|
+
})] }),
|
|
167
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("dt", { children: "Physical ID" }), /* @__PURE__ */ f("dd", {
|
|
168
|
+
className: "ac-resource-id",
|
|
169
|
+
children: t.providerId ?? /* @__PURE__ */ f(m, {})
|
|
170
|
+
})] }),
|
|
171
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("dt", { children: "Region" }), /* @__PURE__ */ f("dd", { children: t.region ?? /* @__PURE__ */ f(m, {}) })] }),
|
|
172
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("dt", { children: "Account" }), /* @__PURE__ */ f("dd", {
|
|
173
|
+
className: "ac-resource-id",
|
|
174
|
+
children: t.account ?? /* @__PURE__ */ f(m, {})
|
|
175
|
+
})] }),
|
|
176
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("dt", { children: "Status" }), /* @__PURE__ */ f("dd", { children: /* @__PURE__ */ f(g, { status: t.status }) })] }),
|
|
177
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("dt", { children: "Last updated" }), /* @__PURE__ */ f("dd", { children: /* @__PURE__ */ f(_, { value: t.updatedAt }) })] }),
|
|
178
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("dt", { children: "Construct" }), /* @__PURE__ */ f("dd", { children: t.parent ?? /* @__PURE__ */ f(m, {}) })] })
|
|
179
|
+
]
|
|
180
|
+
}),
|
|
181
|
+
/* @__PURE__ */ f(i, {
|
|
182
|
+
as: "p",
|
|
183
|
+
variant: "meta",
|
|
184
|
+
tone: "secondary",
|
|
185
|
+
children: "Identity comes from this resource’s own state and is shown only to the signed-in owner."
|
|
186
|
+
}),
|
|
187
|
+
/* @__PURE__ */ f(v, { resource: t })
|
|
188
|
+
]
|
|
189
|
+
}),
|
|
190
|
+
s !== null && s.length > 0 ? /* @__PURE__ */ p("section", {
|
|
191
|
+
className: "ac-detail-section",
|
|
192
|
+
children: [/* @__PURE__ */ f(i, {
|
|
193
|
+
as: "h2",
|
|
194
|
+
variant: "section-title",
|
|
195
|
+
children: "Dependencies"
|
|
196
|
+
}), /* @__PURE__ */ f("ul", {
|
|
197
|
+
className: "ac-dependencies",
|
|
198
|
+
children: s.map((e) => /* @__PURE__ */ p("li", { children: [/* @__PURE__ */ f("a", {
|
|
199
|
+
"data-rly-hit-area": !0,
|
|
200
|
+
className: "ac-detail-link ac-resource-name",
|
|
201
|
+
href: n(e),
|
|
202
|
+
children: e.logicalId
|
|
203
|
+
}), /* @__PURE__ */ f("span", {
|
|
204
|
+
className: "ac-resource-type",
|
|
205
|
+
children: e.resourceType
|
|
206
|
+
})] }, e.fqn))
|
|
207
|
+
})]
|
|
208
|
+
}) : null,
|
|
209
|
+
/* @__PURE__ */ p("section", {
|
|
210
|
+
className: "ac-detail-section",
|
|
211
|
+
children: [/* @__PURE__ */ f(i, {
|
|
212
|
+
as: "h2",
|
|
213
|
+
variant: "section-title",
|
|
214
|
+
children: "Properties"
|
|
215
|
+
}), /* @__PURE__ */ p(h, {
|
|
216
|
+
title: "Not available yet",
|
|
217
|
+
children: [e.product, " shows resource identity only for now. Properties come later."]
|
|
218
|
+
})]
|
|
219
|
+
})
|
|
220
|
+
]
|
|
221
|
+
});
|
|
222
|
+
}, S = new URL(new URL("empty-state-creature.svg", import.meta.url).href, "" + import.meta.url).href, C = (e) => {
|
|
223
|
+
let t = /* @__PURE__ */ new Map();
|
|
224
|
+
for (let n of e) {
|
|
225
|
+
let e = t.get(n.parent);
|
|
226
|
+
e === void 0 && (e = {
|
|
227
|
+
parent: n.parent,
|
|
228
|
+
resources: [],
|
|
229
|
+
types: /* @__PURE__ */ new Map()
|
|
230
|
+
}, t.set(n.parent, e)), e.resources.push(n);
|
|
231
|
+
let r = e.types.get(n.resourceType);
|
|
232
|
+
r === void 0 ? e.types.set(n.resourceType, [n]) : r.push(n);
|
|
233
|
+
}
|
|
234
|
+
return [...t.values()];
|
|
235
|
+
}, w = ({ app: e, resourceHref: t, resources: n, stage: r }) => {
|
|
236
|
+
let o = a(), s = C(n);
|
|
237
|
+
return /* @__PURE__ */ p("section", {
|
|
238
|
+
className: "ac-detail-section",
|
|
239
|
+
"aria-labelledby": o,
|
|
240
|
+
children: [/* @__PURE__ */ p("div", {
|
|
241
|
+
className: "ac-detail-section-heading",
|
|
242
|
+
children: [/* @__PURE__ */ f(i, {
|
|
243
|
+
as: "h2",
|
|
244
|
+
variant: "section-title",
|
|
245
|
+
id: o,
|
|
246
|
+
children: "Resources"
|
|
247
|
+
}), /* @__PURE__ */ p(i, {
|
|
248
|
+
variant: "meta",
|
|
249
|
+
tone: "secondary",
|
|
250
|
+
children: [
|
|
251
|
+
n.length,
|
|
252
|
+
" ",
|
|
253
|
+
n.length === 1 ? "resource" : "resources",
|
|
254
|
+
s.length === 0 ? "" : ` · ${s.filter((e) => e.parent !== null).length} constructs`
|
|
255
|
+
]
|
|
256
|
+
})]
|
|
257
|
+
}), n.length === 0 ? /* @__PURE__ */ p("div", {
|
|
258
|
+
className: "ac-detail-panel ac-empty-state",
|
|
259
|
+
children: [/* @__PURE__ */ f("img", {
|
|
260
|
+
className: "ac-empty-state-creature",
|
|
261
|
+
src: S,
|
|
262
|
+
alt: "",
|
|
263
|
+
"aria-hidden": "true",
|
|
264
|
+
width: "56",
|
|
265
|
+
height: "56"
|
|
266
|
+
}), /* @__PURE__ */ p("div", {
|
|
267
|
+
className: "ac-empty-state-copy",
|
|
268
|
+
children: [/* @__PURE__ */ f(i, {
|
|
269
|
+
as: "p",
|
|
270
|
+
className: "ac-detail-panel-title",
|
|
271
|
+
children: "No resources in state"
|
|
272
|
+
}), /* @__PURE__ */ p(i, {
|
|
273
|
+
as: "p",
|
|
274
|
+
tone: "secondary",
|
|
275
|
+
children: [
|
|
276
|
+
e,
|
|
277
|
+
" / ",
|
|
278
|
+
r,
|
|
279
|
+
" has state but records no resources. Nothing has been created yet, or everything was removed in an earlier deployment."
|
|
280
|
+
]
|
|
281
|
+
})]
|
|
282
|
+
})]
|
|
283
|
+
}) : /* @__PURE__ */ f("div", {
|
|
284
|
+
className: "ac-resource-tree",
|
|
285
|
+
children: s.map((e, n) => /* @__PURE__ */ f(T, {
|
|
286
|
+
construct: e,
|
|
287
|
+
initiallyOpen: n === 0 || s.length > 2 && n === 1,
|
|
288
|
+
resourceHref: t
|
|
289
|
+
}, e.parent ?? ""))
|
|
290
|
+
})]
|
|
291
|
+
});
|
|
292
|
+
}, T = ({ construct: e, initiallyOpen: t, resourceHref: n }) => {
|
|
293
|
+
let [r, i] = s(t);
|
|
294
|
+
return /* @__PURE__ */ p("details", {
|
|
295
|
+
open: r,
|
|
296
|
+
onToggle: (e) => i(e.currentTarget.open),
|
|
297
|
+
className: "ac-construct",
|
|
298
|
+
children: [/* @__PURE__ */ p("summary", { children: [
|
|
299
|
+
/* @__PURE__ */ f(c, {
|
|
300
|
+
name: r ? "chevron-down" : "chevron-right",
|
|
301
|
+
decorative: !0,
|
|
302
|
+
size: "small"
|
|
303
|
+
}),
|
|
304
|
+
/* @__PURE__ */ f("span", {
|
|
305
|
+
className: "ac-construct-name",
|
|
306
|
+
children: e.parent ?? "No construct"
|
|
307
|
+
}),
|
|
308
|
+
/* @__PURE__ */ p("span", {
|
|
309
|
+
className: "ac-construct-count",
|
|
310
|
+
children: [
|
|
311
|
+
e.resources.length,
|
|
312
|
+
" ",
|
|
313
|
+
e.resources.length === 1 ? "resource" : "resources"
|
|
314
|
+
]
|
|
315
|
+
})
|
|
316
|
+
] }), /* @__PURE__ */ f("div", {
|
|
317
|
+
className: "ac-construct-types",
|
|
318
|
+
children: [...e.types].map(([e, t]) => /* @__PURE__ */ p("section", {
|
|
319
|
+
className: "ac-type-group",
|
|
320
|
+
"aria-label": e,
|
|
321
|
+
children: [/* @__PURE__ */ p("div", {
|
|
322
|
+
className: "ac-tree-type",
|
|
323
|
+
children: [
|
|
324
|
+
e,
|
|
325
|
+
" ",
|
|
326
|
+
/* @__PURE__ */ f("span", { children: t.length })
|
|
327
|
+
]
|
|
328
|
+
}), /* @__PURE__ */ f("ul", { children: t.map((e) => /* @__PURE__ */ f("li", { children: /* @__PURE__ */ p("a", {
|
|
329
|
+
href: n(e),
|
|
330
|
+
className: "ac-tree-resource ac-detail-link",
|
|
331
|
+
children: [/* @__PURE__ */ f("span", { children: e.logicalId }), /* @__PURE__ */ f(c, {
|
|
332
|
+
name: "chevron-right",
|
|
333
|
+
decorative: !0,
|
|
334
|
+
size: "small"
|
|
335
|
+
})]
|
|
336
|
+
}) }, e.fqn)) })]
|
|
337
|
+
}, e))
|
|
338
|
+
})]
|
|
339
|
+
});
|
|
340
|
+
}, E = ({ children: e }) => /* @__PURE__ */ f("span", {
|
|
341
|
+
className: "ac-detail-mobile-label",
|
|
342
|
+
"aria-hidden": "true",
|
|
343
|
+
children: e
|
|
344
|
+
}), D = ({ resourceHref: e, stack: t }) => {
|
|
345
|
+
let n = a(), r = t.resources.filter((e) => e.status === "failed").length, o = t.resources.filter((e) => e.status === null).length;
|
|
346
|
+
return /* @__PURE__ */ p("section", {
|
|
347
|
+
className: "ac-detail-section",
|
|
348
|
+
"aria-labelledby": n,
|
|
349
|
+
children: [/* @__PURE__ */ p("div", {
|
|
350
|
+
className: "ac-detail-section-heading",
|
|
351
|
+
children: [/* @__PURE__ */ f(i, {
|
|
352
|
+
as: "h2",
|
|
353
|
+
variant: "section-title",
|
|
354
|
+
id: n,
|
|
355
|
+
children: "Resources"
|
|
356
|
+
}), t.resources.length > 0 ? /* @__PURE__ */ p(i, {
|
|
357
|
+
variant: "meta",
|
|
358
|
+
tone: "secondary",
|
|
359
|
+
children: [
|
|
360
|
+
t.resources.length,
|
|
361
|
+
" ",
|
|
362
|
+
t.resources.length === 1 ? "resource" : "resources",
|
|
363
|
+
r > 0 ? ` · ${r} failed` : "",
|
|
364
|
+
o > 0 ? ` · ${o} Unknown` : ""
|
|
365
|
+
]
|
|
366
|
+
}) : null]
|
|
367
|
+
}), t.resources.length === 0 ? /* @__PURE__ */ f(h, {
|
|
368
|
+
title: "No resources in this stack’s state.",
|
|
369
|
+
children: "Resources appear here once a deployment records them."
|
|
370
|
+
}) : /* @__PURE__ */ f("div", {
|
|
371
|
+
className: "ac-detail-table-wrap",
|
|
372
|
+
children: /* @__PURE__ */ p("table", {
|
|
373
|
+
className: "ac-detail-table ac-resource-table",
|
|
374
|
+
"aria-labelledby": n,
|
|
375
|
+
children: [/* @__PURE__ */ f("thead", { children: /* @__PURE__ */ p("tr", { children: [
|
|
376
|
+
/* @__PURE__ */ f("th", {
|
|
377
|
+
scope: "col",
|
|
378
|
+
children: "Logical name"
|
|
379
|
+
}),
|
|
380
|
+
/* @__PURE__ */ f("th", {
|
|
381
|
+
scope: "col",
|
|
382
|
+
children: "Type"
|
|
383
|
+
}),
|
|
384
|
+
/* @__PURE__ */ f("th", {
|
|
385
|
+
scope: "col",
|
|
386
|
+
children: "Physical ID"
|
|
387
|
+
}),
|
|
388
|
+
/* @__PURE__ */ f("th", {
|
|
389
|
+
scope: "col",
|
|
390
|
+
children: "Status"
|
|
391
|
+
}),
|
|
392
|
+
/* @__PURE__ */ f("th", {
|
|
393
|
+
scope: "col",
|
|
394
|
+
children: "Last updated"
|
|
395
|
+
}),
|
|
396
|
+
/* @__PURE__ */ f("th", {
|
|
397
|
+
scope: "col",
|
|
398
|
+
children: /* @__PURE__ */ f("span", {
|
|
399
|
+
className: "ac-sr-only",
|
|
400
|
+
children: "Provider console"
|
|
401
|
+
})
|
|
402
|
+
})
|
|
403
|
+
] }) }), /* @__PURE__ */ f("tbody", { children: t.resources.map((t) => /* @__PURE__ */ p("tr", { children: [
|
|
404
|
+
/* @__PURE__ */ p("th", {
|
|
405
|
+
scope: "row",
|
|
406
|
+
children: [/* @__PURE__ */ f(E, { children: "Logical name" }), /* @__PURE__ */ f("a", {
|
|
407
|
+
"data-rly-hit-area": !0,
|
|
408
|
+
className: "ac-detail-link ac-resource-name",
|
|
409
|
+
href: e(t),
|
|
410
|
+
children: t.logicalId
|
|
411
|
+
})]
|
|
412
|
+
}),
|
|
413
|
+
/* @__PURE__ */ p("td", {
|
|
414
|
+
className: "ac-resource-type",
|
|
415
|
+
children: [/* @__PURE__ */ f(E, { children: "Type" }), t.resourceType]
|
|
416
|
+
}),
|
|
417
|
+
/* @__PURE__ */ p("td", {
|
|
418
|
+
className: "ac-resource-id",
|
|
419
|
+
children: [/* @__PURE__ */ f(E, { children: "Physical ID" }), t.providerId ?? /* @__PURE__ */ f(m, {})]
|
|
420
|
+
}),
|
|
421
|
+
/* @__PURE__ */ p("td", {
|
|
422
|
+
className: "ac-resource-status-cell",
|
|
423
|
+
children: [/* @__PURE__ */ f(E, { children: "Status" }), /* @__PURE__ */ f(g, { status: t.status })]
|
|
424
|
+
}),
|
|
425
|
+
/* @__PURE__ */ p("td", {
|
|
426
|
+
className: "ac-resource-time",
|
|
427
|
+
children: [/* @__PURE__ */ f(E, { children: "Last updated" }), /* @__PURE__ */ f(_, { value: t.updatedAt })]
|
|
428
|
+
}),
|
|
429
|
+
/* @__PURE__ */ f("td", {
|
|
430
|
+
className: "ac-resource-console",
|
|
431
|
+
children: /* @__PURE__ */ f(v, { resource: t })
|
|
432
|
+
})
|
|
433
|
+
] }, t.fqn)) })]
|
|
434
|
+
})
|
|
435
|
+
})]
|
|
436
|
+
});
|
|
437
|
+
}, O = ({ outputs: e }) => {
|
|
438
|
+
let t = a(), n = e?.filter((e) => e.value._tag === "Hidden").length ?? 0;
|
|
439
|
+
return /* @__PURE__ */ p("section", {
|
|
440
|
+
className: "ac-detail-section",
|
|
441
|
+
"aria-labelledby": t,
|
|
442
|
+
children: [/* @__PURE__ */ p("div", {
|
|
443
|
+
className: "ac-detail-section-heading",
|
|
444
|
+
children: [/* @__PURE__ */ f(i, {
|
|
445
|
+
as: "h2",
|
|
446
|
+
variant: "section-title",
|
|
447
|
+
id: t,
|
|
448
|
+
children: "Outputs"
|
|
449
|
+
}), e !== null && e.length > 0 ? /* @__PURE__ */ p(i, {
|
|
450
|
+
variant: "meta",
|
|
451
|
+
tone: "secondary",
|
|
452
|
+
children: [
|
|
453
|
+
e.length,
|
|
454
|
+
" ",
|
|
455
|
+
e.length === 1 ? "output" : "outputs",
|
|
456
|
+
" · ",
|
|
457
|
+
n,
|
|
458
|
+
" hidden"
|
|
459
|
+
]
|
|
460
|
+
}) : null]
|
|
461
|
+
}), e === null ? /* @__PURE__ */ f(h, {
|
|
462
|
+
title: "Not available yet",
|
|
463
|
+
unavailable: !0,
|
|
464
|
+
children: "The outputs in this stack’s state can’t be read yet."
|
|
465
|
+
}) : e.length === 0 ? /* @__PURE__ */ f(h, { title: "This stack has no outputs." }) : /* @__PURE__ */ f("div", {
|
|
466
|
+
className: "ac-detail-table-wrap",
|
|
467
|
+
children: /* @__PURE__ */ p("table", {
|
|
468
|
+
className: "ac-detail-table ac-output-table",
|
|
469
|
+
"aria-labelledby": t,
|
|
470
|
+
children: [/* @__PURE__ */ f("thead", { children: /* @__PURE__ */ p("tr", { children: [
|
|
471
|
+
/* @__PURE__ */ f("th", {
|
|
472
|
+
scope: "col",
|
|
473
|
+
children: "Key"
|
|
474
|
+
}),
|
|
475
|
+
/* @__PURE__ */ f("th", {
|
|
476
|
+
scope: "col",
|
|
477
|
+
children: "Value"
|
|
478
|
+
}),
|
|
479
|
+
/* @__PURE__ */ f("th", {
|
|
480
|
+
scope: "col",
|
|
481
|
+
children: "Description"
|
|
482
|
+
})
|
|
483
|
+
] }) }), /* @__PURE__ */ f("tbody", { children: e.map((e) => /* @__PURE__ */ p("tr", { children: [
|
|
484
|
+
/* @__PURE__ */ p("th", {
|
|
485
|
+
scope: "row",
|
|
486
|
+
children: [/* @__PURE__ */ f(E, { children: "Key" }), /* @__PURE__ */ f("span", {
|
|
487
|
+
className: "ac-output-key",
|
|
488
|
+
children: e.key
|
|
489
|
+
})]
|
|
490
|
+
}),
|
|
491
|
+
/* @__PURE__ */ p("td", { children: [/* @__PURE__ */ f(E, { children: "Value" }), e.value._tag === "Hidden" ? /* @__PURE__ */ f("span", {
|
|
492
|
+
className: "ac-detail-muted",
|
|
493
|
+
children: "Hidden"
|
|
494
|
+
}) : /* @__PURE__ */ f("span", {
|
|
495
|
+
className: "ac-output-value",
|
|
496
|
+
children: e.value.text
|
|
497
|
+
})] }),
|
|
498
|
+
/* @__PURE__ */ p("td", {
|
|
499
|
+
className: "ac-detail-muted",
|
|
500
|
+
children: [/* @__PURE__ */ f(E, { children: "Description" }), e.description ?? /* @__PURE__ */ f(m, {})]
|
|
501
|
+
})
|
|
502
|
+
] }, e.key)) })]
|
|
503
|
+
})
|
|
504
|
+
})]
|
|
505
|
+
});
|
|
506
|
+
}, k = ({ copy: e, onReadAgain: t, onTabChange: n, resourceHref: a, state: o, tab: s }) => {
|
|
507
|
+
if (o._tag !== "Ready") return /* @__PURE__ */ f("div", {
|
|
508
|
+
className: "ac-detail",
|
|
509
|
+
children: /* @__PURE__ */ f(y, {
|
|
510
|
+
state: o,
|
|
511
|
+
copy: e,
|
|
512
|
+
onReadAgain: t
|
|
513
|
+
})
|
|
514
|
+
});
|
|
515
|
+
let c = o.stack;
|
|
516
|
+
return /* @__PURE__ */ p("div", {
|
|
517
|
+
className: "ac-detail",
|
|
518
|
+
children: [
|
|
519
|
+
/* @__PURE__ */ p("header", {
|
|
520
|
+
className: "ac-detail-header",
|
|
521
|
+
children: [/* @__PURE__ */ p("div", {
|
|
522
|
+
className: "ac-detail-title-row",
|
|
523
|
+
children: [/* @__PURE__ */ f(i, {
|
|
524
|
+
as: "h1",
|
|
525
|
+
variant: "page-title",
|
|
526
|
+
className: "ac-title",
|
|
527
|
+
children: c.app
|
|
528
|
+
}), /* @__PURE__ */ f("span", {
|
|
529
|
+
className: "ac-stage-badge",
|
|
530
|
+
children: c.stage
|
|
531
|
+
})]
|
|
532
|
+
}), /* @__PURE__ */ f(i, {
|
|
533
|
+
as: "p",
|
|
534
|
+
tone: "secondary",
|
|
535
|
+
className: "ac-description",
|
|
536
|
+
children: "Infrastructure state. Read-only."
|
|
537
|
+
})]
|
|
538
|
+
}),
|
|
539
|
+
/* @__PURE__ */ p("dl", {
|
|
540
|
+
className: "ac-stack-metadata",
|
|
541
|
+
children: [
|
|
542
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("dt", { children: "Region" }), /* @__PURE__ */ f("dd", { children: "Unknown" })] }),
|
|
543
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("dt", { children: "Backend" }), /* @__PURE__ */ f("dd", { children: c.backend === "s3" ? "State bucket" : "Local" })] }),
|
|
544
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("dt", { children: "Alchemy version" }), /* @__PURE__ */ f("dd", {
|
|
545
|
+
className: "ac-resource-id",
|
|
546
|
+
children: c.alchemyVersion ?? "Unknown"
|
|
547
|
+
})] }),
|
|
548
|
+
/* @__PURE__ */ p("div", { children: [/* @__PURE__ */ f("dt", { children: "Last deploy" }), /* @__PURE__ */ f("dd", { children: c.lastDeploy === null ? "Unknown" : /* @__PURE__ */ f(_, { value: c.lastDeploy }) })] })
|
|
549
|
+
]
|
|
550
|
+
}),
|
|
551
|
+
/* @__PURE__ */ f(r, {
|
|
552
|
+
className: "ac-detail-tabs",
|
|
553
|
+
"aria-label": "Stack state",
|
|
554
|
+
size: "large",
|
|
555
|
+
value: s,
|
|
556
|
+
"data-mobile-layout": "single-row",
|
|
557
|
+
onValueChange: (e) => {
|
|
558
|
+
(e === "resources" || e === "outputs" || e === "state") && n(e);
|
|
559
|
+
},
|
|
560
|
+
items: [
|
|
561
|
+
{
|
|
562
|
+
value: "resources",
|
|
563
|
+
label: "Resources",
|
|
564
|
+
content: /* @__PURE__ */ f(D, {
|
|
565
|
+
stack: c,
|
|
566
|
+
resourceHref: a
|
|
567
|
+
})
|
|
568
|
+
},
|
|
569
|
+
{
|
|
570
|
+
value: "outputs",
|
|
571
|
+
label: "Outputs",
|
|
572
|
+
content: /* @__PURE__ */ f(O, { outputs: c.outputs })
|
|
573
|
+
},
|
|
574
|
+
{
|
|
575
|
+
value: "state",
|
|
576
|
+
label: "State",
|
|
577
|
+
content: /* @__PURE__ */ f(w, {
|
|
578
|
+
app: c.app,
|
|
579
|
+
stage: c.stage,
|
|
580
|
+
resources: c.resources,
|
|
581
|
+
resourceHref: a
|
|
582
|
+
})
|
|
583
|
+
}
|
|
584
|
+
]
|
|
585
|
+
})
|
|
586
|
+
]
|
|
587
|
+
});
|
|
588
|
+
}, A = new URL(new URL("empty-creature.svg", import.meta.url).href, "" + import.meta.url).href, j = (e) => e.source === "s3" ? e.reason === "denied" ? {
|
|
7
589
|
tone: "critical",
|
|
8
590
|
title: "State bucket access denied.",
|
|
9
591
|
body: "Discovery is incomplete — stacks that could be read are listed.",
|
|
@@ -23,268 +605,286 @@ var c = new URL(new URL("empty-creature.svg", import.meta.url).href, "" + import
|
|
|
23
605
|
title: "Local discovery is incomplete.",
|
|
24
606
|
body: "A local state file couldn’t be read, so some local stacks may be missing. The stacks below were read normally.",
|
|
25
607
|
hint: "Discovery only reads state; it doesn’t repair it. Check local state, then Read again."
|
|
26
|
-
},
|
|
27
|
-
let
|
|
28
|
-
return /* @__PURE__ */
|
|
608
|
+
}, M = ({ issue: e }) => {
|
|
609
|
+
let n = j(e);
|
|
610
|
+
return /* @__PURE__ */ p(t, {
|
|
29
611
|
className: "ac-notice",
|
|
30
|
-
tone:
|
|
31
|
-
children: [/* @__PURE__ */
|
|
32
|
-
/* @__PURE__ */
|
|
612
|
+
tone: n.tone,
|
|
613
|
+
children: [/* @__PURE__ */ p("p", { children: [
|
|
614
|
+
/* @__PURE__ */ f("strong", { children: n.title }),
|
|
33
615
|
" ",
|
|
34
|
-
|
|
35
|
-
] }), /* @__PURE__ */
|
|
616
|
+
n.body
|
|
617
|
+
] }), /* @__PURE__ */ f("p", {
|
|
36
618
|
className: "ac-notice-hint",
|
|
37
|
-
children:
|
|
619
|
+
children: n.hint
|
|
38
620
|
})]
|
|
39
621
|
});
|
|
40
|
-
},
|
|
41
|
-
let
|
|
42
|
-
return /* @__PURE__ */
|
|
622
|
+
}, N = ({ app: e, stackHref: t, stacks: n }) => {
|
|
623
|
+
let r = a();
|
|
624
|
+
return /* @__PURE__ */ p("section", {
|
|
43
625
|
className: "ac-group",
|
|
44
|
-
children: [/* @__PURE__ */
|
|
626
|
+
children: [/* @__PURE__ */ p("div", {
|
|
45
627
|
className: "ac-group-heading",
|
|
46
|
-
children: [/* @__PURE__ */
|
|
628
|
+
children: [/* @__PURE__ */ f(i, {
|
|
47
629
|
as: "h2",
|
|
48
|
-
id:
|
|
630
|
+
id: r,
|
|
49
631
|
variant: "section-title",
|
|
50
632
|
children: e
|
|
51
|
-
}), /* @__PURE__ */
|
|
633
|
+
}), /* @__PURE__ */ p(i, {
|
|
52
634
|
variant: "meta",
|
|
53
635
|
tone: "secondary",
|
|
54
636
|
children: [
|
|
55
|
-
|
|
637
|
+
n.length,
|
|
56
638
|
" ",
|
|
57
|
-
|
|
639
|
+
n.length === 1 ? "stage" : "stages"
|
|
58
640
|
]
|
|
59
641
|
})]
|
|
60
|
-
}), /* @__PURE__ */
|
|
642
|
+
}), /* @__PURE__ */ f("div", {
|
|
61
643
|
className: "ac-table-wrap",
|
|
62
|
-
children: /* @__PURE__ */
|
|
644
|
+
children: /* @__PURE__ */ p("table", {
|
|
63
645
|
className: "ac-table",
|
|
64
|
-
"aria-labelledby":
|
|
65
|
-
children: [/* @__PURE__ */
|
|
66
|
-
/* @__PURE__ */
|
|
646
|
+
"aria-labelledby": r,
|
|
647
|
+
children: [/* @__PURE__ */ f("thead", { children: /* @__PURE__ */ p("tr", { children: [
|
|
648
|
+
/* @__PURE__ */ f("th", {
|
|
67
649
|
scope: "col",
|
|
68
650
|
children: "Stage"
|
|
69
651
|
}),
|
|
70
|
-
/* @__PURE__ */
|
|
652
|
+
/* @__PURE__ */ f("th", {
|
|
71
653
|
scope: "col",
|
|
72
654
|
children: "Backend"
|
|
73
655
|
}),
|
|
74
|
-
/* @__PURE__ */
|
|
656
|
+
/* @__PURE__ */ f("th", {
|
|
75
657
|
scope: "col",
|
|
76
658
|
children: "Alchemy"
|
|
77
659
|
}),
|
|
78
|
-
/* @__PURE__ */
|
|
660
|
+
/* @__PURE__ */ f("th", {
|
|
79
661
|
scope: "col",
|
|
80
662
|
children: "Last deploy"
|
|
81
663
|
}),
|
|
82
|
-
/* @__PURE__ */
|
|
664
|
+
/* @__PURE__ */ f("th", {
|
|
83
665
|
scope: "col",
|
|
84
666
|
children: "Resources"
|
|
85
667
|
})
|
|
86
|
-
] }) }), /* @__PURE__ */
|
|
87
|
-
/* @__PURE__ */
|
|
668
|
+
] }) }), /* @__PURE__ */ f("tbody", { children: n.map((n) => /* @__PURE__ */ p("tr", { children: [
|
|
669
|
+
/* @__PURE__ */ f("th", {
|
|
88
670
|
scope: "row",
|
|
89
|
-
children: /* @__PURE__ */
|
|
671
|
+
children: t === void 0 ? /* @__PURE__ */ p("span", {
|
|
90
672
|
className: "ac-stage",
|
|
91
|
-
children: [/* @__PURE__ */
|
|
673
|
+
children: [/* @__PURE__ */ p("span", {
|
|
674
|
+
className: "ac-sr-only",
|
|
675
|
+
children: [e, " "]
|
|
676
|
+
}), n.stage]
|
|
677
|
+
}) : /* @__PURE__ */ p("a", {
|
|
678
|
+
className: "ac-stage ac-list-link",
|
|
679
|
+
"data-rly-hit-area": !0,
|
|
680
|
+
href: t(n),
|
|
681
|
+
children: [/* @__PURE__ */ p("span", {
|
|
92
682
|
className: "ac-sr-only",
|
|
93
683
|
children: [e, " "]
|
|
94
|
-
}),
|
|
684
|
+
}), n.stage]
|
|
95
685
|
})
|
|
96
686
|
}),
|
|
97
|
-
/* @__PURE__ */
|
|
687
|
+
/* @__PURE__ */ p("td", { children: [/* @__PURE__ */ f("span", {
|
|
98
688
|
className: "ac-sr-only",
|
|
99
689
|
children: "Backend: "
|
|
100
|
-
}),
|
|
101
|
-
/* @__PURE__ */
|
|
690
|
+
}), n.backend === "s3" ? "State bucket" : "Local"] }),
|
|
691
|
+
/* @__PURE__ */ p("td", {
|
|
102
692
|
className: "ac-version",
|
|
103
|
-
children: [/* @__PURE__ */
|
|
693
|
+
children: [/* @__PURE__ */ f("span", {
|
|
104
694
|
className: "ac-mobile-label",
|
|
105
695
|
children: "Alchemy "
|
|
106
|
-
}),
|
|
696
|
+
}), n.alchemyVersion ?? "Unknown"]
|
|
107
697
|
}),
|
|
108
|
-
/* @__PURE__ */
|
|
698
|
+
/* @__PURE__ */ p("td", { children: [/* @__PURE__ */ f("span", {
|
|
109
699
|
className: "ac-mobile-label",
|
|
110
700
|
children: "Last deploy "
|
|
111
|
-
}),
|
|
112
|
-
/* @__PURE__ */
|
|
113
|
-
className: "ac-
|
|
114
|
-
children: "
|
|
115
|
-
|
|
116
|
-
|
|
701
|
+
}), n.lastDeploy ?? "Unknown"] }),
|
|
702
|
+
/* @__PURE__ */ p("td", {
|
|
703
|
+
className: t === void 0 ? void 0 : "ac-list-count",
|
|
704
|
+
children: [/* @__PURE__ */ f("span", {
|
|
705
|
+
className: "ac-mobile-label",
|
|
706
|
+
children: "Resources "
|
|
707
|
+
}), n.resourceCount === null ? "Unknown" : t === void 0 ? n.resourceCount : /* @__PURE__ */ f("a", {
|
|
708
|
+
className: "ac-list-link",
|
|
709
|
+
"data-rly-hit-area": !0,
|
|
710
|
+
href: t(n),
|
|
711
|
+
"aria-label": `${e} ${n.stage}: ${n.resourceCount} resources`,
|
|
712
|
+
children: n.resourceCount
|
|
713
|
+
})]
|
|
714
|
+
})
|
|
715
|
+
] }, n.id)) })]
|
|
117
716
|
})
|
|
118
717
|
})]
|
|
119
718
|
});
|
|
120
|
-
},
|
|
719
|
+
}, P = () => /* @__PURE__ */ f("div", {
|
|
121
720
|
className: "ac-skeletons",
|
|
122
721
|
"aria-hidden": "true",
|
|
123
722
|
children: [
|
|
124
723
|
"first",
|
|
125
724
|
"second",
|
|
126
725
|
"third"
|
|
127
|
-
].map((e) => /* @__PURE__ */
|
|
726
|
+
].map((e) => /* @__PURE__ */ p("div", {
|
|
128
727
|
className: `ac-skeleton-group ac-skeleton-${e}`,
|
|
129
|
-
children: [/* @__PURE__ */
|
|
728
|
+
children: [/* @__PURE__ */ f(n, { className: "ac-skeleton-heading" }), /* @__PURE__ */ f(n, {
|
|
130
729
|
className: "ac-skeleton-body",
|
|
131
730
|
variant: "block"
|
|
132
731
|
})]
|
|
133
732
|
}, e))
|
|
134
|
-
}),
|
|
135
|
-
let
|
|
136
|
-
return /* @__PURE__ */
|
|
733
|
+
}), F = ({ copy: t, onReadAgain: n, stackHref: r, state: o }) => {
|
|
734
|
+
let s = a(), l = o._tag === "Ready" && o.list.stacks.length === 0 && o.list.issues.length === 0, u = o._tag === "Ready" ? o.list.issues.filter((e, t, n) => n.findIndex((t) => t.source === e.source && t.reason === e.reason) === t) : [], d = o._tag === "Ready" ? [...new Set(o.list.stacks.map((e) => e.app))].sort() : [], m = o._tag === "Loading" ? "Looking in local state and the state bucket…" : o._tag === "Ready" ? u.length > 0 ? `${o.list.stacks.length} stacks found · discovery incomplete` : `${o.list.stacks.length} ${o.list.stacks.length === 1 ? "stack" : "stacks"} · ${d.length} ${d.length === 1 ? "app" : "apps"}` : o._tag === "Unauthorized" ? o.reason === "bootstrap" ? "Sign-in failed or link already used." : `Your ${t.product} session has ended.` : "Stacks are unavailable right now.";
|
|
735
|
+
return /* @__PURE__ */ p("div", {
|
|
137
736
|
className: "ac-stacks",
|
|
138
737
|
children: [
|
|
139
|
-
/* @__PURE__ */
|
|
738
|
+
/* @__PURE__ */ p("header", {
|
|
140
739
|
className: "ac-list-header",
|
|
141
|
-
children: [/* @__PURE__ */
|
|
740
|
+
children: [/* @__PURE__ */ f(i, {
|
|
142
741
|
as: "h1",
|
|
143
742
|
className: "ac-title",
|
|
144
743
|
variant: "page-title",
|
|
145
744
|
children: "Stacks"
|
|
146
|
-
}), /* @__PURE__ */
|
|
745
|
+
}), /* @__PURE__ */ p("div", {
|
|
147
746
|
className: "ac-list-lead",
|
|
148
|
-
children: [/* @__PURE__ */
|
|
747
|
+
children: [/* @__PURE__ */ f(i, {
|
|
149
748
|
as: "p",
|
|
150
749
|
className: "ac-description",
|
|
151
750
|
tone: "secondary",
|
|
152
751
|
children: "Infrastructure state from local discovery and the state bucket. Read-only."
|
|
153
|
-
}),
|
|
752
|
+
}), l || o._tag === "Unauthorized" || o._tag === "Failed" ? null : /* @__PURE__ */ f(e, {
|
|
154
753
|
className: "ac-read",
|
|
155
|
-
disabled:
|
|
156
|
-
onClick:
|
|
157
|
-
children:
|
|
754
|
+
disabled: o._tag === "Loading",
|
|
755
|
+
onClick: n,
|
|
756
|
+
children: o._tag === "Loading" ? "Reading…" : "Read again"
|
|
158
757
|
})]
|
|
159
758
|
})]
|
|
160
759
|
}),
|
|
161
|
-
/* @__PURE__ */
|
|
760
|
+
/* @__PURE__ */ f("div", {
|
|
162
761
|
className: "ac-sr-only",
|
|
163
762
|
role: "status",
|
|
164
763
|
"aria-live": "polite",
|
|
165
764
|
"aria-atomic": "true",
|
|
166
|
-
children:
|
|
765
|
+
children: m
|
|
167
766
|
}),
|
|
168
|
-
|
|
169
|
-
|
|
767
|
+
u.map((e) => /* @__PURE__ */ f(M, { issue: e }, `${e.source}-${e.reason}`)),
|
|
768
|
+
o._tag === "Unauthorized" ? /* @__PURE__ */ p("section", {
|
|
170
769
|
className: "ac-state-panel",
|
|
171
|
-
"aria-labelledby":
|
|
770
|
+
"aria-labelledby": s,
|
|
172
771
|
children: [
|
|
173
|
-
/* @__PURE__ */
|
|
772
|
+
/* @__PURE__ */ p("div", {
|
|
174
773
|
className: "ac-state-label ac-state-caution",
|
|
175
|
-
children: [/* @__PURE__ */
|
|
774
|
+
children: [/* @__PURE__ */ f(c, {
|
|
176
775
|
name: "alert",
|
|
177
776
|
size: "small",
|
|
178
777
|
decorative: !0
|
|
179
|
-
}), /* @__PURE__ */
|
|
778
|
+
}), /* @__PURE__ */ f("span", { children: o.reason === "bootstrap" ? "Sign-in failed" : "Signed out" })]
|
|
180
779
|
}),
|
|
181
|
-
/* @__PURE__ */
|
|
780
|
+
/* @__PURE__ */ f(i, {
|
|
182
781
|
as: "h2",
|
|
183
|
-
id:
|
|
782
|
+
id: s,
|
|
184
783
|
className: "ac-state-title",
|
|
185
784
|
variant: "section-title",
|
|
186
|
-
children:
|
|
785
|
+
children: o.reason === "bootstrap" ? "Sign-in failed or link already used." : `Your ${t.product} session has ended.`
|
|
187
786
|
}),
|
|
188
|
-
/* @__PURE__ */
|
|
787
|
+
/* @__PURE__ */ f(i, {
|
|
189
788
|
as: "p",
|
|
190
789
|
className: "ac-state-body",
|
|
191
790
|
tone: "secondary",
|
|
192
791
|
children: "Sign in again to see stacks."
|
|
193
792
|
}),
|
|
194
|
-
/* @__PURE__ */
|
|
793
|
+
/* @__PURE__ */ f(i, {
|
|
195
794
|
as: "p",
|
|
196
795
|
className: "ac-state-instruction",
|
|
197
796
|
variant: "meta",
|
|
198
797
|
tone: "secondary",
|
|
199
|
-
children:
|
|
798
|
+
children: t.signInInstruction
|
|
200
799
|
})
|
|
201
800
|
]
|
|
202
|
-
}) :
|
|
801
|
+
}) : o._tag === "Failed" ? /* @__PURE__ */ p("section", {
|
|
203
802
|
className: "ac-state-panel",
|
|
204
|
-
"aria-labelledby":
|
|
803
|
+
"aria-labelledby": s,
|
|
205
804
|
children: [
|
|
206
|
-
/* @__PURE__ */
|
|
805
|
+
/* @__PURE__ */ p("div", {
|
|
207
806
|
className: "ac-state-label ac-state-critical",
|
|
208
|
-
children: [/* @__PURE__ */
|
|
807
|
+
children: [/* @__PURE__ */ f(c, {
|
|
209
808
|
name: "alert",
|
|
210
809
|
size: "small",
|
|
211
810
|
decorative: !0
|
|
212
|
-
}), /* @__PURE__ */
|
|
811
|
+
}), /* @__PURE__ */ f("span", { children: "Unavailable" })]
|
|
213
812
|
}),
|
|
214
|
-
/* @__PURE__ */
|
|
813
|
+
/* @__PURE__ */ f(i, {
|
|
215
814
|
as: "h2",
|
|
216
|
-
id:
|
|
815
|
+
id: s,
|
|
217
816
|
className: "ac-state-title",
|
|
218
817
|
variant: "section-title",
|
|
219
818
|
children: "Stacks are unavailable right now."
|
|
220
819
|
}),
|
|
221
|
-
/* @__PURE__ */
|
|
820
|
+
/* @__PURE__ */ f(i, {
|
|
222
821
|
as: "p",
|
|
223
822
|
className: "ac-state-body",
|
|
224
823
|
tone: "secondary",
|
|
225
824
|
children: "The stack list couldn’t be read, so no stacks are shown. Nothing was changed."
|
|
226
825
|
}),
|
|
227
|
-
/* @__PURE__ */
|
|
826
|
+
/* @__PURE__ */ f(e, {
|
|
228
827
|
className: "ac-read",
|
|
229
|
-
onClick:
|
|
828
|
+
onClick: n,
|
|
230
829
|
children: "Retry"
|
|
231
830
|
})
|
|
232
831
|
]
|
|
233
|
-
}) :
|
|
832
|
+
}) : l ? /* @__PURE__ */ p("div", {
|
|
234
833
|
className: "ac-empty",
|
|
235
834
|
children: [
|
|
236
|
-
/* @__PURE__ */
|
|
835
|
+
/* @__PURE__ */ f("img", {
|
|
237
836
|
className: "ac-empty-creature",
|
|
238
|
-
src:
|
|
837
|
+
src: A,
|
|
239
838
|
alt: "",
|
|
240
839
|
width: "88",
|
|
241
840
|
height: "88"
|
|
242
841
|
}),
|
|
243
|
-
/* @__PURE__ */
|
|
842
|
+
/* @__PURE__ */ f(i, {
|
|
244
843
|
as: "h2",
|
|
245
844
|
className: "ac-empty-title",
|
|
246
845
|
variant: "section-title",
|
|
247
846
|
children: "No stacks found in local state or the state bucket."
|
|
248
847
|
}),
|
|
249
|
-
/* @__PURE__ */
|
|
848
|
+
/* @__PURE__ */ f(i, {
|
|
250
849
|
as: "p",
|
|
251
850
|
className: "ac-empty-description",
|
|
252
851
|
tone: "secondary",
|
|
253
852
|
children: "Local discovery and the state bucket returned no stack state."
|
|
254
853
|
}),
|
|
255
|
-
/* @__PURE__ */
|
|
854
|
+
/* @__PURE__ */ f(e, {
|
|
256
855
|
className: "ac-read",
|
|
257
|
-
onClick:
|
|
856
|
+
onClick: n,
|
|
258
857
|
children: "Read again"
|
|
259
858
|
}),
|
|
260
|
-
/* @__PURE__ */
|
|
859
|
+
/* @__PURE__ */ p(i, {
|
|
261
860
|
as: "p",
|
|
262
861
|
className: "ac-empty-foot",
|
|
263
862
|
variant: "meta",
|
|
264
863
|
tone: "secondary",
|
|
265
864
|
children: [
|
|
266
865
|
"Checked ",
|
|
267
|
-
|
|
866
|
+
o.checkedAt,
|
|
268
867
|
" · stacks appear here after their first deployment from the CLI."
|
|
269
868
|
]
|
|
270
869
|
})
|
|
271
870
|
]
|
|
272
|
-
}) : /* @__PURE__ */
|
|
871
|
+
}) : /* @__PURE__ */ p("div", {
|
|
273
872
|
className: "ac-results",
|
|
274
|
-
"aria-busy":
|
|
873
|
+
"aria-busy": o._tag === "Loading",
|
|
275
874
|
children: [
|
|
276
|
-
/* @__PURE__ */
|
|
875
|
+
/* @__PURE__ */ f(i, {
|
|
277
876
|
as: "p",
|
|
278
877
|
className: "ac-summary",
|
|
279
878
|
variant: "meta",
|
|
280
879
|
tone: "secondary",
|
|
281
|
-
children:
|
|
880
|
+
children: m
|
|
282
881
|
}),
|
|
283
|
-
|
|
882
|
+
o._tag === "Loading" ? /* @__PURE__ */ f(P, {}) : o._tag === "Ready" ? d.map((e) => /* @__PURE__ */ f(N, {
|
|
284
883
|
app: e,
|
|
285
|
-
stacks:
|
|
884
|
+
stacks: o.list.stacks.filter((t) => t.app === e),
|
|
885
|
+
stackHref: r
|
|
286
886
|
}, e)) : null,
|
|
287
|
-
|
|
887
|
+
o._tag === "Ready" && o.list.stacks.length === 0 ? /* @__PURE__ */ f(i, {
|
|
288
888
|
as: "p",
|
|
289
889
|
tone: "secondary",
|
|
290
890
|
children: "No stacks could be read. Discovery is incomplete."
|
|
@@ -295,4 +895,4 @@ var c = new URL(new URL("empty-creature.svg", import.meta.url).href, "" + import
|
|
|
295
895
|
});
|
|
296
896
|
};
|
|
297
897
|
//#endregion
|
|
298
|
-
export {
|
|
898
|
+
export { x as ResourceDetailView, k as StackDetailView, F as StackListView };
|