ankka-console 0.10.0 → 0.11.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 +25 -1
- package/dist/client/control-plane.js +60 -1
- package/dist/client/schemas.d.ts +525 -0
- package/dist/client/schemas.js +174 -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 +7 -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.js +12 -6
- package/dist/routes/logs.d.ts +35 -0
- package/dist/routes/logs.js +15 -14
- package/dist/routes/members.js +11 -8
- package/dist/routes/organization-new.js +7 -4
- package/dist/routes/organization.js +13 -6
- package/dist/routes/project-new.js +8 -4
- package/dist/routes/project.d.ts +73 -2
- package/dist/routes/project.js +81 -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 +30 -0
- package/dist/routes/service-history.js +79 -0
- package/dist/routes/service-topology.d.ts +153 -0
- package/dist/routes/service-topology.js +54 -0
- package/dist/routes/service.d.ts +34 -10
- package/dist/routes/service.js +27 -22
- package/dist/routes/stream.service.js +18 -1
- package/dist/routes/tokens.js +8 -6
- package/dist/routes.js +2 -0
- package/dist/styles.css +2 -481
- package/dist/testing/fake-control-plane.d.ts +155 -0
- package/dist/testing/fake-control-plane.js +379 -12
- 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/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 +107 -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 +137 -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,40 @@ 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
|
+
topicChecks: {
|
|
31
|
+
topic: string | undefined;
|
|
32
|
+
service: string;
|
|
33
|
+
component: string;
|
|
34
|
+
direction: string;
|
|
35
|
+
stated: string | undefined;
|
|
36
|
+
state: string;
|
|
37
|
+
}[] | undefined;
|
|
38
|
+
topicSources: {
|
|
39
|
+
kind: string;
|
|
40
|
+
component: string;
|
|
41
|
+
topic: string;
|
|
42
|
+
group: string;
|
|
43
|
+
start: string;
|
|
44
|
+
version: number;
|
|
45
|
+
recordedVersion: number | undefined;
|
|
46
|
+
behind: boolean;
|
|
47
|
+
broker: string | undefined;
|
|
48
|
+
contract: string | undefined;
|
|
49
|
+
lag: number | undefined;
|
|
50
|
+
failing: string | undefined;
|
|
51
|
+
}[] | undefined;
|
|
52
|
+
objectStorage: string | undefined;
|
|
53
|
+
bucket: string | undefined;
|
|
54
|
+
bucketAddress: string | undefined;
|
|
21
55
|
}[];
|
|
22
56
|
state: StreamState;
|
|
23
57
|
};
|
|
@@ -50,6 +84,40 @@ export declare function useServiceStream(projectId: string, name: string, initia
|
|
|
50
84
|
paused: boolean;
|
|
51
85
|
hosting: string;
|
|
52
86
|
protocol: string | undefined;
|
|
87
|
+
mounts: {
|
|
88
|
+
path: string;
|
|
89
|
+
service: string;
|
|
90
|
+
state: string;
|
|
91
|
+
}[];
|
|
92
|
+
callers: string[];
|
|
93
|
+
processPort: number | undefined;
|
|
94
|
+
broker: string | undefined;
|
|
95
|
+
undeclaredTopics: string[] | undefined;
|
|
96
|
+
topicChecks: {
|
|
97
|
+
topic: string | undefined;
|
|
98
|
+
service: string;
|
|
99
|
+
component: string;
|
|
100
|
+
direction: string;
|
|
101
|
+
stated: string | undefined;
|
|
102
|
+
state: string;
|
|
103
|
+
}[] | undefined;
|
|
104
|
+
topicSources: {
|
|
105
|
+
kind: string;
|
|
106
|
+
component: string;
|
|
107
|
+
topic: string;
|
|
108
|
+
group: string;
|
|
109
|
+
start: string;
|
|
110
|
+
version: number;
|
|
111
|
+
recordedVersion: number | undefined;
|
|
112
|
+
behind: boolean;
|
|
113
|
+
broker: string | undefined;
|
|
114
|
+
contract: string | undefined;
|
|
115
|
+
lag: number | undefined;
|
|
116
|
+
failing: string | undefined;
|
|
117
|
+
}[] | undefined;
|
|
118
|
+
objectStorage: string | undefined;
|
|
119
|
+
bucket: string | undefined;
|
|
120
|
+
bucketAddress: string | undefined;
|
|
53
121
|
};
|
|
54
122
|
byInstance: Record<string, {
|
|
55
123
|
lines: string[];
|
|
@@ -57,3 +125,71 @@ export declare function useServiceStream(projectId: string, name: string, initia
|
|
|
57
125
|
}>;
|
|
58
126
|
state: StreamState;
|
|
59
127
|
};
|
|
128
|
+
/** A deployed service's merged topology, sent again whenever it changes. */
|
|
129
|
+
export declare function useTopologyStream(projectId: string, name: string, initial: ServiceTopology | null): {
|
|
130
|
+
topology: {
|
|
131
|
+
service: string;
|
|
132
|
+
running: number;
|
|
133
|
+
contributing: number;
|
|
134
|
+
partial: boolean;
|
|
135
|
+
instances: {
|
|
136
|
+
pod: string;
|
|
137
|
+
status: "failed" | "ok" | "unreachable" | "unsupported";
|
|
138
|
+
problem: string | undefined;
|
|
139
|
+
runtime: string | undefined;
|
|
140
|
+
readAt: string | undefined;
|
|
141
|
+
}[];
|
|
142
|
+
window: {
|
|
143
|
+
seconds: number;
|
|
144
|
+
since: string;
|
|
145
|
+
calls: number;
|
|
146
|
+
unanswered: number;
|
|
147
|
+
};
|
|
148
|
+
nodes: {
|
|
149
|
+
id: string;
|
|
150
|
+
kind: string;
|
|
151
|
+
layer: number;
|
|
152
|
+
platform: boolean;
|
|
153
|
+
handlers: {
|
|
154
|
+
name: string;
|
|
155
|
+
type: string;
|
|
156
|
+
streaming: boolean | undefined;
|
|
157
|
+
}[];
|
|
158
|
+
}[];
|
|
159
|
+
declared: {
|
|
160
|
+
from: string;
|
|
161
|
+
to: string;
|
|
162
|
+
kind: string;
|
|
163
|
+
}[];
|
|
164
|
+
calls: {
|
|
165
|
+
from: string;
|
|
166
|
+
to: string;
|
|
167
|
+
pairs: {
|
|
168
|
+
caller: string;
|
|
169
|
+
callee: string;
|
|
170
|
+
handled: {
|
|
171
|
+
ok: number;
|
|
172
|
+
refused: number;
|
|
173
|
+
failed: number;
|
|
174
|
+
};
|
|
175
|
+
unanswered: {
|
|
176
|
+
timedOut: number;
|
|
177
|
+
undelivered: number;
|
|
178
|
+
};
|
|
179
|
+
durationMillis: {
|
|
180
|
+
p50: number;
|
|
181
|
+
p99: number;
|
|
182
|
+
max: number;
|
|
183
|
+
bucketed: boolean;
|
|
184
|
+
};
|
|
185
|
+
streaming: boolean;
|
|
186
|
+
histogram: number[];
|
|
187
|
+
}[];
|
|
188
|
+
}[];
|
|
189
|
+
differences: {
|
|
190
|
+
node: string;
|
|
191
|
+
presentOn: string[];
|
|
192
|
+
}[];
|
|
193
|
+
} | null;
|
|
194
|
+
state: StreamState;
|
|
195
|
+
};
|
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.11.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
|
}
|