ankka-console 0.10.0 → 0.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client/control-plane.d.ts +87 -1
- package/dist/client/control-plane.js +201 -1
- package/dist/client/schemas.d.ts +1835 -0
- package/dist/client/schemas.js +595 -0
- package/dist/context.d.ts +98 -0
- package/dist/context.js +73 -0
- package/dist/extensions/render.d.ts +2 -0
- package/dist/extensions/render.js +5 -0
- package/dist/extensions/types.d.ts +1 -1
- package/dist/extensions/types.js +29 -0
- package/dist/fonts/inter-latin-ext-wght-normal.woff2 +0 -0
- package/dist/fonts/inter-latin-wght-normal.woff2 +0 -0
- package/dist/index.d.ts +9 -2
- package/dist/index.js +7 -1
- package/dist/routes/auth.sign-out.js +8 -3
- package/dist/routes/front.d.ts +62 -2
- package/dist/routes/front.js +45 -10
- package/dist/routes/logs.d.ts +92 -0
- package/dist/routes/logs.js +15 -14
- package/dist/routes/machines.d.ts +78 -0
- package/dist/routes/machines.js +78 -0
- package/dist/routes/members.js +11 -8
- package/dist/routes/organization-new.js +7 -4
- package/dist/routes/organization.d.ts +29 -1
- package/dist/routes/organization.js +38 -9
- package/dist/routes/project-new.js +8 -4
- package/dist/routes/project.d.ts +347 -2
- package/dist/routes/project.js +182 -9
- package/dist/routes/service-apply.d.ts +5 -2
- package/dist/routes/service-apply.js +17 -14
- package/dist/routes/service-history.d.ts +32 -0
- package/dist/routes/service-history.js +82 -0
- package/dist/routes/service-topology.d.ts +210 -0
- package/dist/routes/service-topology.js +54 -0
- package/dist/routes/service.d.ts +91 -10
- package/dist/routes/service.js +87 -23
- package/dist/routes/stream.service.js +18 -1
- package/dist/routes/tokens.js +8 -6
- package/dist/routes.js +3 -0
- package/dist/runtime.d.ts +3 -1
- package/dist/runtime.js +1 -0
- package/dist/styles.css +2 -481
- package/dist/testing/fake-control-plane.d.ts +334 -1
- package/dist/testing/fake-control-plane.js +1194 -15
- package/dist/testing/index.d.ts +1 -1
- package/dist/testing/scenarios.js +6 -0
- package/dist/theme.css +66 -0
- package/dist/ui/console.d.ts +19 -6
- package/dist/ui/console.js +9 -2
- package/dist/ui/errors.js +7 -5
- package/dist/ui/grants.d.ts +3 -0
- package/dist/ui/grants.js +13 -0
- package/dist/ui/hosting.d.ts +11 -0
- package/dist/ui/hosting.js +20 -0
- package/dist/ui/primitives/button.d.ts +11 -0
- package/dist/ui/primitives/button.js +21 -0
- package/dist/ui/primitives/select.d.ts +10 -0
- package/dist/ui/primitives/select.js +4 -0
- package/dist/ui/primitives/switch.d.ts +9 -0
- package/dist/ui/primitives/switch.js +4 -0
- package/dist/ui/shape.d.ts +4 -0
- package/dist/ui/shape.js +36 -0
- package/dist/ui/shell.d.ts +76 -0
- package/dist/ui/shell.js +114 -0
- package/dist/ui/tokens.d.ts +82 -0
- package/dist/ui/tokens.js +172 -0
- package/dist/ui/topology/Graph.d.ts +13 -0
- package/dist/ui/topology/Graph.js +56 -0
- package/dist/ui/topology/Table.d.ts +10 -0
- package/dist/ui/topology/Table.js +14 -0
- package/dist/ui/topology/layout.d.ts +113 -0
- package/dist/ui/topology/layout.js +177 -0
- package/dist/ui/use-stream.d.ts +251 -1
- package/dist/ui/use-stream.js +11 -1
- package/package.json +11 -3
package/dist/ui/use-stream.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ServiceStatus } from "../client/schemas.ts";
|
|
1
|
+
import type { ServiceStatus, ServiceTopology } from "../client/schemas.ts";
|
|
2
2
|
export type StreamState = "connecting" | "live" | "gone" | "off";
|
|
3
3
|
export declare function useProjectStream(projectId: string, initial: ServiceStatus[]): {
|
|
4
4
|
services: {
|
|
@@ -18,6 +18,97 @@ export declare function useProjectStream(projectId: string, initial: ServiceStat
|
|
|
18
18
|
paused: boolean;
|
|
19
19
|
hosting: string;
|
|
20
20
|
protocol: string | undefined;
|
|
21
|
+
mounts: {
|
|
22
|
+
path: string;
|
|
23
|
+
service: string;
|
|
24
|
+
state: string;
|
|
25
|
+
}[];
|
|
26
|
+
callers: string[];
|
|
27
|
+
processPort: number | undefined;
|
|
28
|
+
broker: string | undefined;
|
|
29
|
+
undeclaredTopics: string[] | undefined;
|
|
30
|
+
secretStore: {
|
|
31
|
+
backend: string;
|
|
32
|
+
keyRead: boolean;
|
|
33
|
+
move: {
|
|
34
|
+
phase: string;
|
|
35
|
+
outcome: string;
|
|
36
|
+
names: {
|
|
37
|
+
name: string;
|
|
38
|
+
state: string;
|
|
39
|
+
}[];
|
|
40
|
+
detail: string | undefined;
|
|
41
|
+
} | undefined;
|
|
42
|
+
} | undefined;
|
|
43
|
+
topicChecks: {
|
|
44
|
+
topic: string | undefined;
|
|
45
|
+
service: string;
|
|
46
|
+
component: string;
|
|
47
|
+
direction: string;
|
|
48
|
+
stated: string | undefined;
|
|
49
|
+
state: string;
|
|
50
|
+
}[] | undefined;
|
|
51
|
+
topicSources: {
|
|
52
|
+
kind: string;
|
|
53
|
+
component: string;
|
|
54
|
+
topic: string;
|
|
55
|
+
group: string;
|
|
56
|
+
start: string;
|
|
57
|
+
version: number;
|
|
58
|
+
recordedVersion: number | undefined;
|
|
59
|
+
behind: boolean;
|
|
60
|
+
broker: string | undefined;
|
|
61
|
+
contract: string | undefined;
|
|
62
|
+
lag: number | undefined;
|
|
63
|
+
failing: string | undefined;
|
|
64
|
+
gap: {
|
|
65
|
+
partitions: {
|
|
66
|
+
partition: number;
|
|
67
|
+
beginning: number;
|
|
68
|
+
earliestRetained: string | undefined;
|
|
69
|
+
}[];
|
|
70
|
+
compacted: boolean;
|
|
71
|
+
gone: boolean;
|
|
72
|
+
readAt: string | undefined;
|
|
73
|
+
} | undefined;
|
|
74
|
+
}[] | undefined;
|
|
75
|
+
warnings: {
|
|
76
|
+
kind: string;
|
|
77
|
+
component: string;
|
|
78
|
+
topic: string;
|
|
79
|
+
message: string;
|
|
80
|
+
}[] | undefined;
|
|
81
|
+
objectStorage: string | undefined;
|
|
82
|
+
bucket: string | undefined;
|
|
83
|
+
bucketAddress: string | undefined;
|
|
84
|
+
objectStore: string | undefined;
|
|
85
|
+
bucketLocation: string | undefined;
|
|
86
|
+
softDeleteDays: number | undefined;
|
|
87
|
+
storageMove: string | undefined;
|
|
88
|
+
databaseCluster: string | undefined;
|
|
89
|
+
grants: string | undefined;
|
|
90
|
+
crossProjectTopics: {
|
|
91
|
+
project: string;
|
|
92
|
+
topic: string;
|
|
93
|
+
right: string;
|
|
94
|
+
status: string;
|
|
95
|
+
}[] | undefined;
|
|
96
|
+
customHostnames: {
|
|
97
|
+
hostname: string;
|
|
98
|
+
state: string;
|
|
99
|
+
reason: string | undefined;
|
|
100
|
+
record: {
|
|
101
|
+
name: string;
|
|
102
|
+
kind: string;
|
|
103
|
+
value: string;
|
|
104
|
+
} | undefined;
|
|
105
|
+
note: string | undefined;
|
|
106
|
+
}[];
|
|
107
|
+
proofRecord: {
|
|
108
|
+
name: string;
|
|
109
|
+
kind: string;
|
|
110
|
+
value: string;
|
|
111
|
+
} | undefined;
|
|
21
112
|
}[];
|
|
22
113
|
state: StreamState;
|
|
23
114
|
};
|
|
@@ -50,6 +141,97 @@ export declare function useServiceStream(projectId: string, name: string, initia
|
|
|
50
141
|
paused: boolean;
|
|
51
142
|
hosting: string;
|
|
52
143
|
protocol: string | undefined;
|
|
144
|
+
mounts: {
|
|
145
|
+
path: string;
|
|
146
|
+
service: string;
|
|
147
|
+
state: string;
|
|
148
|
+
}[];
|
|
149
|
+
callers: string[];
|
|
150
|
+
processPort: number | undefined;
|
|
151
|
+
broker: string | undefined;
|
|
152
|
+
undeclaredTopics: string[] | undefined;
|
|
153
|
+
secretStore: {
|
|
154
|
+
backend: string;
|
|
155
|
+
keyRead: boolean;
|
|
156
|
+
move: {
|
|
157
|
+
phase: string;
|
|
158
|
+
outcome: string;
|
|
159
|
+
names: {
|
|
160
|
+
name: string;
|
|
161
|
+
state: string;
|
|
162
|
+
}[];
|
|
163
|
+
detail: string | undefined;
|
|
164
|
+
} | undefined;
|
|
165
|
+
} | undefined;
|
|
166
|
+
topicChecks: {
|
|
167
|
+
topic: string | undefined;
|
|
168
|
+
service: string;
|
|
169
|
+
component: string;
|
|
170
|
+
direction: string;
|
|
171
|
+
stated: string | undefined;
|
|
172
|
+
state: string;
|
|
173
|
+
}[] | undefined;
|
|
174
|
+
topicSources: {
|
|
175
|
+
kind: string;
|
|
176
|
+
component: string;
|
|
177
|
+
topic: string;
|
|
178
|
+
group: string;
|
|
179
|
+
start: string;
|
|
180
|
+
version: number;
|
|
181
|
+
recordedVersion: number | undefined;
|
|
182
|
+
behind: boolean;
|
|
183
|
+
broker: string | undefined;
|
|
184
|
+
contract: string | undefined;
|
|
185
|
+
lag: number | undefined;
|
|
186
|
+
failing: string | undefined;
|
|
187
|
+
gap: {
|
|
188
|
+
partitions: {
|
|
189
|
+
partition: number;
|
|
190
|
+
beginning: number;
|
|
191
|
+
earliestRetained: string | undefined;
|
|
192
|
+
}[];
|
|
193
|
+
compacted: boolean;
|
|
194
|
+
gone: boolean;
|
|
195
|
+
readAt: string | undefined;
|
|
196
|
+
} | undefined;
|
|
197
|
+
}[] | undefined;
|
|
198
|
+
warnings: {
|
|
199
|
+
kind: string;
|
|
200
|
+
component: string;
|
|
201
|
+
topic: string;
|
|
202
|
+
message: string;
|
|
203
|
+
}[] | undefined;
|
|
204
|
+
objectStorage: string | undefined;
|
|
205
|
+
bucket: string | undefined;
|
|
206
|
+
bucketAddress: string | undefined;
|
|
207
|
+
objectStore: string | undefined;
|
|
208
|
+
bucketLocation: string | undefined;
|
|
209
|
+
softDeleteDays: number | undefined;
|
|
210
|
+
storageMove: string | undefined;
|
|
211
|
+
databaseCluster: string | undefined;
|
|
212
|
+
grants: string | undefined;
|
|
213
|
+
crossProjectTopics: {
|
|
214
|
+
project: string;
|
|
215
|
+
topic: string;
|
|
216
|
+
right: string;
|
|
217
|
+
status: string;
|
|
218
|
+
}[] | undefined;
|
|
219
|
+
customHostnames: {
|
|
220
|
+
hostname: string;
|
|
221
|
+
state: string;
|
|
222
|
+
reason: string | undefined;
|
|
223
|
+
record: {
|
|
224
|
+
name: string;
|
|
225
|
+
kind: string;
|
|
226
|
+
value: string;
|
|
227
|
+
} | undefined;
|
|
228
|
+
note: string | undefined;
|
|
229
|
+
}[];
|
|
230
|
+
proofRecord: {
|
|
231
|
+
name: string;
|
|
232
|
+
kind: string;
|
|
233
|
+
value: string;
|
|
234
|
+
} | undefined;
|
|
53
235
|
};
|
|
54
236
|
byInstance: Record<string, {
|
|
55
237
|
lines: string[];
|
|
@@ -57,3 +239,71 @@ export declare function useServiceStream(projectId: string, name: string, initia
|
|
|
57
239
|
}>;
|
|
58
240
|
state: StreamState;
|
|
59
241
|
};
|
|
242
|
+
/** A deployed service's merged topology, sent again whenever it changes. */
|
|
243
|
+
export declare function useTopologyStream(projectId: string, name: string, initial: ServiceTopology | null): {
|
|
244
|
+
topology: {
|
|
245
|
+
service: string;
|
|
246
|
+
running: number;
|
|
247
|
+
contributing: number;
|
|
248
|
+
partial: boolean;
|
|
249
|
+
instances: {
|
|
250
|
+
pod: string;
|
|
251
|
+
status: "failed" | "ok" | "unreachable" | "unsupported";
|
|
252
|
+
problem: string | undefined;
|
|
253
|
+
runtime: string | undefined;
|
|
254
|
+
readAt: string | undefined;
|
|
255
|
+
}[];
|
|
256
|
+
window: {
|
|
257
|
+
seconds: number;
|
|
258
|
+
since: string;
|
|
259
|
+
calls: number;
|
|
260
|
+
unanswered: number;
|
|
261
|
+
};
|
|
262
|
+
nodes: {
|
|
263
|
+
id: string;
|
|
264
|
+
kind: string;
|
|
265
|
+
layer: number;
|
|
266
|
+
platform: boolean;
|
|
267
|
+
handlers: {
|
|
268
|
+
name: string;
|
|
269
|
+
type: string;
|
|
270
|
+
streaming: boolean | undefined;
|
|
271
|
+
}[];
|
|
272
|
+
}[];
|
|
273
|
+
declared: {
|
|
274
|
+
from: string;
|
|
275
|
+
to: string;
|
|
276
|
+
kind: string;
|
|
277
|
+
}[];
|
|
278
|
+
calls: {
|
|
279
|
+
from: string;
|
|
280
|
+
to: string;
|
|
281
|
+
pairs: {
|
|
282
|
+
caller: string;
|
|
283
|
+
callee: string;
|
|
284
|
+
handled: {
|
|
285
|
+
ok: number;
|
|
286
|
+
refused: number;
|
|
287
|
+
failed: number;
|
|
288
|
+
};
|
|
289
|
+
unanswered: {
|
|
290
|
+
timedOut: number;
|
|
291
|
+
undelivered: number;
|
|
292
|
+
};
|
|
293
|
+
durationMillis: {
|
|
294
|
+
p50: number;
|
|
295
|
+
p99: number;
|
|
296
|
+
max: number;
|
|
297
|
+
bucketed: boolean;
|
|
298
|
+
};
|
|
299
|
+
streaming: boolean;
|
|
300
|
+
histogram: number[];
|
|
301
|
+
}[];
|
|
302
|
+
}[];
|
|
303
|
+
differences: {
|
|
304
|
+
node: string;
|
|
305
|
+
presentOn: string[];
|
|
306
|
+
}[];
|
|
307
|
+
} | null;
|
|
308
|
+
state: StreamState;
|
|
309
|
+
};
|
package/dist/ui/use-stream.js
CHANGED
|
@@ -21,7 +21,7 @@ function useEvents(path, handlers) {
|
|
|
21
21
|
setState("connecting");
|
|
22
22
|
source.onopen = () => setState("live");
|
|
23
23
|
const on = (name, f) => source.addEventListener(name, (e) => f(JSON.parse(e.data)));
|
|
24
|
-
for (const name of ["status", "services", "logs"])
|
|
24
|
+
for (const name of ["status", "services", "logs", "topology"])
|
|
25
25
|
on(name, (d) => ref.current[name]?.(d));
|
|
26
26
|
on("session-ended", () => {
|
|
27
27
|
source.close();
|
|
@@ -65,3 +65,13 @@ export function useServiceStream(projectId, name, initial, logs) {
|
|
|
65
65
|
});
|
|
66
66
|
return { status, byInstance, state };
|
|
67
67
|
}
|
|
68
|
+
/** A deployed service's merged topology, sent again whenever it changes. */
|
|
69
|
+
export function useTopologyStream(projectId, name, initial) {
|
|
70
|
+
const [topology, setTopology] = useState(initial);
|
|
71
|
+
useEffect(() => setTopology(initial), [initial]);
|
|
72
|
+
const path = initial ? `stream/services/${encodeURIComponent(projectId)}/${encodeURIComponent(name)}?topology` : null;
|
|
73
|
+
const state = useEvents(path, {
|
|
74
|
+
topology: (d) => setTopology(d),
|
|
75
|
+
});
|
|
76
|
+
return { topology, state };
|
|
77
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ankka-console",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.0",
|
|
4
4
|
"description": "The ankka console as a package: the control plane client, sign-in and sessions, and the pages as routes a React Router host mounts.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"type": "module",
|
|
@@ -34,7 +34,8 @@
|
|
|
34
34
|
"types": "./dist/testing/index.d.ts",
|
|
35
35
|
"default": "./dist/testing/index.js"
|
|
36
36
|
},
|
|
37
|
-
"./styles.css": "./dist/styles.css"
|
|
37
|
+
"./styles.css": "./dist/styles.css",
|
|
38
|
+
"./theme.css": "./dist/theme.css"
|
|
38
39
|
},
|
|
39
40
|
"repository": {
|
|
40
41
|
"type": "git",
|
|
@@ -45,10 +46,14 @@
|
|
|
45
46
|
"scripts": {
|
|
46
47
|
"build": "node scripts/build.ts",
|
|
47
48
|
"typecheck": "tsc --noEmit -p tsconfig.json",
|
|
48
|
-
"test": "node --conditions=ankka-source --test 'test/**/*.test.ts'"
|
|
49
|
+
"test": "node --conditions=ankka-source --test 'test/**/*.test.ts'",
|
|
50
|
+
"watch": "node scripts/watch.ts"
|
|
49
51
|
},
|
|
50
52
|
"dependencies": {
|
|
53
|
+
"class-variance-authority": "^0.7.1",
|
|
54
|
+
"clsx": "^2.1.1",
|
|
51
55
|
"jose": "^6.2.12",
|
|
56
|
+
"lucide-react": "^1.52.0",
|
|
52
57
|
"openid-client": "^6.8.8",
|
|
53
58
|
"zod": "^4.6.5"
|
|
54
59
|
},
|
|
@@ -65,14 +70,17 @@
|
|
|
65
70
|
}
|
|
66
71
|
},
|
|
67
72
|
"devDependencies": {
|
|
73
|
+
"@fontsource-variable/inter": "^5.3.0",
|
|
68
74
|
"@react-router/dev": "^8.4.0",
|
|
69
75
|
"@react-router/node": "^8.4.0",
|
|
76
|
+
"@tailwindcss/cli": "^4.3.3",
|
|
70
77
|
"@types/node": "^26.6.3",
|
|
71
78
|
"@types/react": "^19.3.0",
|
|
72
79
|
"@types/react-dom": "^19.3.0",
|
|
73
80
|
"react": "^19.3.0",
|
|
74
81
|
"react-dom": "^19.3.0",
|
|
75
82
|
"react-router": "^8.4.0",
|
|
83
|
+
"tailwindcss": "^4.3.3",
|
|
76
84
|
"typescript": "^7.0.2",
|
|
77
85
|
"vite": "^8.3.1"
|
|
78
86
|
}
|