@rcpooley/concord 0.6.2 → 0.6.3
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/cli/main.js +0 -0
- package/dist/daemon.js +0 -0
- package/package.json +1 -1
- package/dist/ui.d.ts +0 -62
- package/dist/ui.d.ts.map +0 -1
- package/dist/ui.js +0 -288
- package/dist/ui.js.map +0 -1
package/dist/cli/main.js
CHANGED
|
File without changes
|
package/dist/daemon.js
CHANGED
|
File without changes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rcpooley/concord",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.3",
|
|
4
4
|
"description": "Declarative config reconciler: edit a typed config repo, push it, and your hosts converge. Also exports the schema library config repos import.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/rcpooley/concord#readme",
|
package/dist/ui.d.ts
DELETED
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import { type IncomingMessage, type Server, type ServerResponse } from 'node:http';
|
|
2
|
-
import { type PlanService } from './plans.js';
|
|
3
|
-
/**
|
|
4
|
-
* The daemon's own UI and API: recent reconciles, plans on request.
|
|
5
|
-
*
|
|
6
|
-
* It listens on a unix socket SEPARATE from the webhook's. Expose it only on a
|
|
7
|
-
* private network (a VPN, a LAN, an ssh tunnel), never publicly. The two
|
|
8
|
-
* sockets are the whole security model: the public listener stays an HMAC
|
|
9
|
-
* check and a poke, and nothing here is reachable from the internet even if a
|
|
10
|
-
* route is misconfigured to point at the wrong one — the wrong one does not
|
|
11
|
-
* serve these paths.
|
|
12
|
-
*
|
|
13
|
-
* There is no auth beyond that private network, deliberately: nothing here
|
|
14
|
-
* changes production. The only write is "plan this branch", which reads.
|
|
15
|
-
*
|
|
16
|
-
* Like the webhook, this is never load-bearing: a dead listener means no UI,
|
|
17
|
-
* never a missed reconcile.
|
|
18
|
-
*/
|
|
19
|
-
/** One real reconcile, as the daemon recorded it. */
|
|
20
|
-
export interface RunRecord {
|
|
21
|
-
id: string;
|
|
22
|
-
/** What asked for it: `interval`, `startup`, `webhook`, `SIGHUP`. */
|
|
23
|
-
trigger: string;
|
|
24
|
-
status: 'running' | 'converged' | 'changed' | 'aborted' | 'error';
|
|
25
|
-
startedAt: string;
|
|
26
|
-
finishedAt?: string;
|
|
27
|
-
/** Config commit that was reconciled. */
|
|
28
|
-
sha?: string;
|
|
29
|
-
totalOps?: number;
|
|
30
|
-
/** The closing line — "converged", "3 change(s) …", "ABORTED at …". */
|
|
31
|
-
summary?: string;
|
|
32
|
-
log: string[];
|
|
33
|
-
}
|
|
34
|
-
export type RunSummary = Omit<RunRecord, 'log'>;
|
|
35
|
-
export interface DaemonStatus {
|
|
36
|
-
startedAt: string;
|
|
37
|
-
intervalSeconds: number;
|
|
38
|
-
/** `sha` for a git checkout, `version` for an npm install. */
|
|
39
|
-
reconciler: {
|
|
40
|
-
sha?: string;
|
|
41
|
-
version?: string;
|
|
42
|
-
behind?: string;
|
|
43
|
-
};
|
|
44
|
-
reconciling: boolean;
|
|
45
|
-
/** When the next interval run is due, if the daemon is sleeping. */
|
|
46
|
-
nextRunAt?: string;
|
|
47
|
-
configRepo?: string;
|
|
48
|
-
}
|
|
49
|
-
export interface UiOptions {
|
|
50
|
-
socketPath: string;
|
|
51
|
-
status: () => DaemonStatus;
|
|
52
|
-
runs: {
|
|
53
|
-
list: (limit: number) => RunSummary[];
|
|
54
|
-
get: (id: string) => RunRecord | undefined;
|
|
55
|
-
};
|
|
56
|
-
plans: PlanService;
|
|
57
|
-
log: (scope: string, message: string) => void;
|
|
58
|
-
}
|
|
59
|
-
export declare function startUi(opts: UiOptions): Server;
|
|
60
|
-
export declare function handle(opts: UiOptions, req: IncomingMessage, res: ServerResponse): Promise<void>;
|
|
61
|
-
export declare function esc(s: unknown): string;
|
|
62
|
-
//# sourceMappingURL=ui.d.ts.map
|
package/dist/ui.d.ts.map
DEL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CAAA;IAC1B,IAAI,EAAE;QACJ,IAAI,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,UAAU,EAAE,CAAA;QACrC,GAAG,EAAE,CAAC,EAAE,EAAE,MAAM,KAAK,SAAS,GAAG,SAAS,CAAA;KAC3C,CAAA;IACD,KAAK,EAAE,WAAW,CAAA;IAClB,GAAG,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,IAAI,CAAA;CAC9C;AAMD,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,GAAG,MAAM,CA4B/C;AAID,wBAAsB,MAAM,CAAC,IAAI,EAAE,SAAS,EAAE,GAAG,EAAE,eAAe,EAAE,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAqEtG;AA2ED,wBAAgB,GAAG,CAAC,CAAC,EAAE,OAAO,GAAG,MAAM,CAKtC"}
|
package/dist/ui.js
DELETED
|
@@ -1,288 +0,0 @@
|
|
|
1
|
-
import { chmodSync, existsSync, unlinkSync } from 'node:fs';
|
|
2
|
-
import { hostname } from 'node:os';
|
|
3
|
-
import { createServer } from 'node:http';
|
|
4
|
-
import { isRecordId } from './records.js';
|
|
5
|
-
import { PlanError } from './plans.js';
|
|
6
|
-
const MAX_BODY = 16 * 1024;
|
|
7
|
-
/** Longest a `?wait=` may hold a request open, in seconds. */
|
|
8
|
-
const MAX_WAIT_S = 600;
|
|
9
|
-
export function startUi(opts) {
|
|
10
|
-
const { socketPath, log } = opts;
|
|
11
|
-
if (existsSync(socketPath)) {
|
|
12
|
-
try {
|
|
13
|
-
unlinkSync(socketPath);
|
|
14
|
-
}
|
|
15
|
-
catch {
|
|
16
|
-
/* listen() will say why */
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
const server = createServer((req, res) => {
|
|
20
|
-
handle(opts, req, res).catch((err) => {
|
|
21
|
-
log('ui', `error on ${req.method} ${req.url}: ${err instanceof Error ? err.message : String(err)}`);
|
|
22
|
-
if (!res.headersSent)
|
|
23
|
-
sendJson(res, 500, { error: 'internal error' });
|
|
24
|
-
else
|
|
25
|
-
res.end();
|
|
26
|
-
});
|
|
27
|
-
});
|
|
28
|
-
server.listen(socketPath, () => {
|
|
29
|
-
// A reverse proxy's workers (often in a container) run as their own uid.
|
|
30
|
-
// The socket is only reachable from this host and whatever mounts it; who
|
|
31
|
-
// can reach the proxy route is the real gate.
|
|
32
|
-
chmodSync(socketPath, 0o666);
|
|
33
|
-
log('ui', `listening on ${socketPath}`);
|
|
34
|
-
});
|
|
35
|
-
server.on('error', (err) => log('ui', `listener error: ${err.message}`));
|
|
36
|
-
return server;
|
|
37
|
-
}
|
|
38
|
-
// ----------------------------------------------------------------- routes ---
|
|
39
|
-
export async function handle(opts, req, res) {
|
|
40
|
-
const url = new URL(req.url ?? '/', 'http://concord.local');
|
|
41
|
-
const path = url.pathname.replace(/\/+$/, '') || '/';
|
|
42
|
-
const method = req.method ?? 'GET';
|
|
43
|
-
const parts = path.split('/').filter(Boolean);
|
|
44
|
-
if (method === 'GET' && path === '/healthz')
|
|
45
|
-
return sendText(res, 200, 'ok');
|
|
46
|
-
// --------------------------------------------------------------- API ---
|
|
47
|
-
if (parts[0] === 'api') {
|
|
48
|
-
if (method === 'GET' && path === '/api/status')
|
|
49
|
-
return sendJson(res, 200, opts.status());
|
|
50
|
-
if (method === 'GET' && path === '/api/runs') {
|
|
51
|
-
return sendJson(res, 200, { runs: opts.runs.list(limitParam(url)) });
|
|
52
|
-
}
|
|
53
|
-
if (method === 'GET' && parts[1] === 'runs' && parts.length === 3) {
|
|
54
|
-
const run = isRecordId(parts[2]) ? opts.runs.get(parts[2]) : undefined;
|
|
55
|
-
return run ? sendJson(res, 200, run) : sendJson(res, 404, { error: 'no such run' });
|
|
56
|
-
}
|
|
57
|
-
if (method === 'GET' && path === '/api/plans') {
|
|
58
|
-
return sendJson(res, 200, { plans: opts.plans.list(limitParam(url)) });
|
|
59
|
-
}
|
|
60
|
-
if (method === 'POST' && path === '/api/plans') {
|
|
61
|
-
const body = await readJson(req);
|
|
62
|
-
if (body === undefined)
|
|
63
|
-
return sendJson(res, 400, { error: 'body must be JSON: {"branch": "…", "sha"?: "…"}' });
|
|
64
|
-
try {
|
|
65
|
-
const plan = opts.plans.request(body.branch, body.sha);
|
|
66
|
-
const waitS = waitParam(url);
|
|
67
|
-
const done = waitS > 0 ? await opts.plans.wait(plan.id, waitS * 1000) : plan;
|
|
68
|
-
return sendJson(res, 202, withLinks(done ?? plan));
|
|
69
|
-
}
|
|
70
|
-
catch (err) {
|
|
71
|
-
if (err instanceof PlanError)
|
|
72
|
-
return sendJson(res, err.status, { error: err.message });
|
|
73
|
-
throw err;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
if (method === 'GET' && parts[1] === 'plans' && parts.length === 3) {
|
|
77
|
-
const id = parts[2];
|
|
78
|
-
if (!isRecordId(id))
|
|
79
|
-
return sendJson(res, 404, { error: 'no such plan' });
|
|
80
|
-
const plan = await opts.plans.wait(id, waitParam(url) * 1000);
|
|
81
|
-
return plan ? sendJson(res, 200, withLinks(plan)) : sendJson(res, 404, { error: 'no such plan' });
|
|
82
|
-
}
|
|
83
|
-
return sendJson(res, 404, { error: 'not found' });
|
|
84
|
-
}
|
|
85
|
-
// ---------------------------------------------------------------- HTML ---
|
|
86
|
-
if (method === 'GET' && path === '/')
|
|
87
|
-
return sendHtml(res, 200, pageHome(opts));
|
|
88
|
-
if (method === 'POST' && path === '/plans') {
|
|
89
|
-
const form = await readForm(req);
|
|
90
|
-
try {
|
|
91
|
-
const plan = opts.plans.request(form.get('branch')?.trim(), form.get('sha')?.trim() || undefined);
|
|
92
|
-
res.writeHead(303, { location: `/plans/${plan.id}` });
|
|
93
|
-
return void res.end();
|
|
94
|
-
}
|
|
95
|
-
catch (err) {
|
|
96
|
-
if (err instanceof PlanError)
|
|
97
|
-
return sendHtml(res, err.status, pageError(err.message));
|
|
98
|
-
throw err;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
if (method === 'GET' && parts[0] === 'plans' && parts.length === 2) {
|
|
102
|
-
const plan = isRecordId(parts[1]) ? opts.plans.get(parts[1]) : undefined;
|
|
103
|
-
return plan ? sendHtml(res, 200, pagePlan(plan)) : sendHtml(res, 404, pageError('No such plan.'));
|
|
104
|
-
}
|
|
105
|
-
if (method === 'GET' && parts[0] === 'runs' && parts.length === 2) {
|
|
106
|
-
const run = isRecordId(parts[1]) ? opts.runs.get(parts[1]) : undefined;
|
|
107
|
-
return run ? sendHtml(res, 200, pageRun(run)) : sendHtml(res, 404, pageError('No such run.'));
|
|
108
|
-
}
|
|
109
|
-
return sendHtml(res, 404, pageError('Not found.'));
|
|
110
|
-
}
|
|
111
|
-
function withLinks(plan) {
|
|
112
|
-
return { ...plan, url: `/plans/${plan.id}` };
|
|
113
|
-
}
|
|
114
|
-
function limitParam(url) {
|
|
115
|
-
const n = Number(url.searchParams.get('limit') ?? 20);
|
|
116
|
-
return Number.isInteger(n) && n > 0 ? Math.min(n, 100) : 20;
|
|
117
|
-
}
|
|
118
|
-
function waitParam(url) {
|
|
119
|
-
const n = Number(url.searchParams.get('wait') ?? 0);
|
|
120
|
-
return Number.isFinite(n) && n > 0 ? Math.min(n, MAX_WAIT_S) : 0;
|
|
121
|
-
}
|
|
122
|
-
// --------------------------------------------------------------- plumbing ---
|
|
123
|
-
function readBody(req) {
|
|
124
|
-
return new Promise((resolve) => {
|
|
125
|
-
const chunks = [];
|
|
126
|
-
let size = 0;
|
|
127
|
-
req.on('data', (c) => {
|
|
128
|
-
size += c.length;
|
|
129
|
-
if (size > MAX_BODY) {
|
|
130
|
-
resolve(undefined);
|
|
131
|
-
req.destroy();
|
|
132
|
-
return;
|
|
133
|
-
}
|
|
134
|
-
chunks.push(c);
|
|
135
|
-
});
|
|
136
|
-
req.on('end', () => resolve(Buffer.concat(chunks).toString('utf8')));
|
|
137
|
-
req.on('error', () => resolve(undefined));
|
|
138
|
-
});
|
|
139
|
-
}
|
|
140
|
-
async function readJson(req) {
|
|
141
|
-
const body = await readBody(req);
|
|
142
|
-
if (body === undefined)
|
|
143
|
-
return undefined;
|
|
144
|
-
try {
|
|
145
|
-
const parsed = JSON.parse(body);
|
|
146
|
-
return parsed && typeof parsed === 'object' && !Array.isArray(parsed)
|
|
147
|
-
? parsed
|
|
148
|
-
: undefined;
|
|
149
|
-
}
|
|
150
|
-
catch {
|
|
151
|
-
return undefined;
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
async function readForm(req) {
|
|
155
|
-
return new URLSearchParams((await readBody(req)) ?? '');
|
|
156
|
-
}
|
|
157
|
-
function sendJson(res, code, body) {
|
|
158
|
-
res.writeHead(code, { 'content-type': 'application/json; charset=utf-8', 'cache-control': 'no-store' });
|
|
159
|
-
res.end(JSON.stringify(body, null, 2) + '\n');
|
|
160
|
-
}
|
|
161
|
-
function sendText(res, code, body) {
|
|
162
|
-
res.writeHead(code, { 'content-type': 'text/plain; charset=utf-8' });
|
|
163
|
-
res.end(body + '\n');
|
|
164
|
-
}
|
|
165
|
-
function sendHtml(res, code, body) {
|
|
166
|
-
res.writeHead(code, {
|
|
167
|
-
'content-type': 'text/html; charset=utf-8',
|
|
168
|
-
'cache-control': 'no-store',
|
|
169
|
-
// Nothing on these pages is meant to run script, load from elsewhere, or be framed.
|
|
170
|
-
'content-security-policy': "default-src 'none'; style-src 'unsafe-inline'; form-action 'self'; frame-ancestors 'none'",
|
|
171
|
-
});
|
|
172
|
-
res.end(body);
|
|
173
|
-
}
|
|
174
|
-
// ------------------------------------------------------------------ pages ---
|
|
175
|
-
export function esc(s) {
|
|
176
|
-
return String(s ?? '').replace(/[&<>"']/g, (c) => ({ '&': '&', '<': '<', '>': '>', '"': '"', "'": ''' })[c]);
|
|
177
|
-
}
|
|
178
|
-
const CSS = `
|
|
179
|
-
:root { color-scheme: light dark; --muted: #888; --ok: #2e9e5b; --warn: #c98a00; --bad: #d0453a; --run: #3a7bd5; }
|
|
180
|
-
body { font: 14px/1.45 system-ui, sans-serif; max-width: 1100px; margin: 24px auto; padding: 0 16px; }
|
|
181
|
-
h1 { font-size: 20px; margin: 0 0 4px } h2 { font-size: 16px; margin: 28px 0 8px }
|
|
182
|
-
a { color: inherit } .muted { color: var(--muted) } code, pre { font: 12px/1.4 ui-monospace, monospace }
|
|
183
|
-
table { border-collapse: collapse; width: 100% } td, th { text-align: left; padding: 4px 10px 4px 0; vertical-align: top; border-bottom: 1px solid #8883 }
|
|
184
|
-
pre { background: #8881; padding: 10px; overflow-x: auto; white-space: pre-wrap; word-break: break-all }
|
|
185
|
-
.pill { display: inline-block; padding: 0 8px; border-radius: 9px; font-size: 12px; color: #fff }
|
|
186
|
-
.s-converged, .s-planned { background: var(--ok) } .s-changed { background: var(--run) }
|
|
187
|
-
.s-running, .s-queued { background: var(--run) } .s-aborted, .s-error, .s-failed { background: var(--bad) }
|
|
188
|
-
.s-refused { background: var(--warn) }
|
|
189
|
-
.box { border: 1px solid #8884; border-radius: 6px; padding: 10px 14px; margin: 10px 0 }
|
|
190
|
-
.err { border-color: var(--bad) } .warn { border-color: var(--warn) }
|
|
191
|
-
form input[type=text] { font: inherit; padding: 4px 6px; width: 320px } form button { font: inherit; padding: 4px 12px }
|
|
192
|
-
ul.ops { margin: 4px 0; padding-left: 18px } .k-delete { color: var(--bad) } .k-create { color: var(--ok) }
|
|
193
|
-
`;
|
|
194
|
-
function layout(title, body, refresh = false) {
|
|
195
|
-
return `<!doctype html><html><head><meta charset="utf-8"><title>${esc(title)} · concord</title>
|
|
196
|
-
${refresh ? '<meta http-equiv="refresh" content="3">' : ''}
|
|
197
|
-
<meta name="viewport" content="width=device-width, initial-scale=1"><style>${CSS}</style></head>
|
|
198
|
-
<body><p class="muted"><a href="/">concord</a> · ${esc(hostname())}</p>${body}</body></html>`;
|
|
199
|
-
}
|
|
200
|
-
const pill = (status) => `<span class="pill s-${esc(status)}">${esc(status)}</span>`;
|
|
201
|
-
const time = (iso) => (iso ? `<span title="${esc(iso)}">${esc(iso.replace('T', ' ').slice(0, 19))}Z</span>` : '');
|
|
202
|
-
const short = (sha) => (sha ? `<code>${esc(sha.slice(0, 10))}</code>` : '');
|
|
203
|
-
function duration(from, to) {
|
|
204
|
-
if (!from || !to)
|
|
205
|
-
return '';
|
|
206
|
-
const s = Math.round((Date.parse(to) - Date.parse(from)) / 1000);
|
|
207
|
-
return s >= 60 ? `${Math.floor(s / 60)}m${s % 60}s` : `${s}s`;
|
|
208
|
-
}
|
|
209
|
-
function pageHome(opts) {
|
|
210
|
-
const st = opts.status();
|
|
211
|
-
const runs = opts.runs.list(20);
|
|
212
|
-
const plans = opts.plans.list(20);
|
|
213
|
-
const busy = st.reconciling || plans.some((p) => p.status === 'queued' || p.status === 'running');
|
|
214
|
-
const statusBox = `<div class="box${st.reconciler.behind ? ' warn' : ''}">
|
|
215
|
-
<b>${st.reconciling ? 'Reconciling now' : 'Idle'}</b>${st.nextRunAt && !st.reconciling ? ` <span class="muted">· next interval run ${time(st.nextRunAt)}</span>` : ''}<br>
|
|
216
|
-
<span class="muted">reconciler</span> ${st.reconciler.version ? `<code>${esc(st.reconciler.version)}</code>` : short(st.reconciler.sha)}${st.reconciler.behind ? ` <b>⚠ ${esc(st.reconciler.behind)}</b> — update the reconciler on this host` : ''}
|
|
217
|
-
· <span class="muted">every</span> ${esc(st.intervalSeconds)}s · <span class="muted">up since</span> ${time(st.startedAt)}</div>`;
|
|
218
|
-
const planForm = `<form method="post" action="/plans" class="box">
|
|
219
|
-
<b>Plan a branch</b> of the config repo against the live fleet (read-only).<br>
|
|
220
|
-
<input type="text" name="branch" placeholder="my-change" required pattern="[A-Za-z0-9._/-]+">
|
|
221
|
-
<input type="text" name="sha" placeholder="expected sha (optional)" style="width:200px">
|
|
222
|
-
<button>Plan</button>
|
|
223
|
-
<div class="muted">The branch must contain the current main — a branch behind main is refused.</div></form>`;
|
|
224
|
-
return layout('concord', `<h1>Concord</h1>${statusBox}
|
|
225
|
-
<h2>Plans</h2>${planForm}${plansTable(plans)}
|
|
226
|
-
<h2>Reconciles</h2>${runsTable(runs)}`, busy);
|
|
227
|
-
}
|
|
228
|
-
function plansTable(plans) {
|
|
229
|
-
if (!plans.length)
|
|
230
|
-
return '<p class="muted">No plans yet.</p>';
|
|
231
|
-
return `<table><tr><th>requested</th><th>branch</th><th>commit</th><th>status</th><th>changes</th><th></th></tr>${plans
|
|
232
|
-
.map((p) => `<tr><td>${time(p.requestedAt)}</td><td><code>${esc(p.branch)}</code></td><td>${short(p.sha)}</td>
|
|
233
|
-
<td>${pill(p.status)}</td><td>${p.totalOps ?? ''}</td>
|
|
234
|
-
<td><a href="/plans/${esc(p.id)}">view</a>${p.error ? ` <span class="muted">${esc(truncate(p.error, 90))}</span>` : ''}</td></tr>`)
|
|
235
|
-
.join('')}</table>`;
|
|
236
|
-
}
|
|
237
|
-
function runsTable(runs) {
|
|
238
|
-
if (!runs.length)
|
|
239
|
-
return '<p class="muted">No reconciles recorded since this version was deployed.</p>';
|
|
240
|
-
return `<table><tr><th>started</th><th>trigger</th><th>config</th><th>status</th><th>took</th><th>summary</th></tr>${runs
|
|
241
|
-
.map((r) => `<tr><td><a href="/runs/${esc(r.id)}">${time(r.startedAt)}</a></td><td>${esc(r.trigger)}</td>
|
|
242
|
-
<td>${short(r.sha)}</td><td>${pill(r.status)}</td><td>${duration(r.startedAt, r.finishedAt)}</td>
|
|
243
|
-
<td class="muted">${esc(truncate(r.summary ?? '', 110))}</td></tr>`)
|
|
244
|
-
.join('')}</table>`;
|
|
245
|
-
}
|
|
246
|
-
function pagePlan(p) {
|
|
247
|
-
const live = p.status === 'queued' || p.status === 'running';
|
|
248
|
-
const r = p.result;
|
|
249
|
-
const changed = r?.modules.filter((m) => m.ops.length || m.error) ?? [];
|
|
250
|
-
const head = `<h1>Plan of <code>${esc(p.branch)}</code> ${pill(p.status)}</h1>
|
|
251
|
-
<p class="muted">${esc(p.id)} · requested ${time(p.requestedAt)}${p.finishedAt ? ` · took ${duration(p.startedAt, p.finishedAt)}` : ''}
|
|
252
|
-
${p.sha ? ` · commit ${short(p.sha)}` : ''}${p.mainSha ? ` · main ${short(p.mainSha)}` : ''}</p>
|
|
253
|
-
${p.error ? `<div class="box ${p.status === 'refused' ? 'warn' : 'err'}">${esc(p.error)}</div>` : ''}
|
|
254
|
-
${p.overlappedRun ? '<div class="box warn">A real reconcile ran during this plan, so some state it read may have been mid-change. Plan again if anything looks odd.</div>' : ''}`;
|
|
255
|
-
const ahead = p.ahead?.length
|
|
256
|
-
? `<h2>On the branch, not on main (${p.ahead.length})</h2><ul>${p.ahead
|
|
257
|
-
.map((c) => `<li>${short(c.sha)} ${esc(c.subject)}</li>`)
|
|
258
|
-
.join('')}</ul>`
|
|
259
|
-
: p.ahead
|
|
260
|
-
? '<h2>On the branch, not on main</h2><p class="muted">Nothing — this is main.</p>'
|
|
261
|
-
: '';
|
|
262
|
-
const changes = r
|
|
263
|
-
? `<h2>${r.totalOps} change(s)${r.failed ? ' before the plan aborted' : ''}</h2>
|
|
264
|
-
${changed.length ? changed.map(moduleBlock).join('') : '<p>Nothing would change.</p>'}
|
|
265
|
-
${r.unreachable.length ? `<div class="box warn">Not checked (host unreachable): ${esc(r.unreachable.join(', '))}</div>` : ''}
|
|
266
|
-
${r.skipped.length ? `<div class="box err">Not evaluated (after the abort): ${esc(r.skipped.join(', '))}</div>` : ''}
|
|
267
|
-
${r.warnings.map((w) => `<div class="box warn">${esc(w.scope)}: ${esc(w.message)}</div>`).join('')}`
|
|
268
|
-
: '';
|
|
269
|
-
return layout(`plan ${p.branch}`, `${head}${changes}${ahead}<h2>Log</h2><pre>${esc(p.log.join('\n'))}</pre>`, live);
|
|
270
|
-
}
|
|
271
|
-
function moduleBlock(m) {
|
|
272
|
-
return `<div class="box${m.error ? ' err' : ''}"><b><code>${esc(m.scope)}</code></b>${m.error ? `<br>ERROR: ${esc(m.error)}` : ''}<ul class="ops">${m.ops
|
|
273
|
-
.map((o) => `<li><span class="k-${esc(o.kind)}">[${esc(o.kind)}]</span> ${esc(o.summary)}</li>`)
|
|
274
|
-
.join('')}</ul></div>`;
|
|
275
|
-
}
|
|
276
|
-
function pageRun(r) {
|
|
277
|
-
return layout(`run ${r.id}`, `<h1>Reconcile ${pill(r.status)}</h1>
|
|
278
|
-
<p class="muted">${esc(r.id)} · ${esc(r.trigger)} · started ${time(r.startedAt)}${r.finishedAt ? ` · took ${duration(r.startedAt, r.finishedAt)}` : ''}${r.sha ? ` · config ${short(r.sha)}` : ''}</p>
|
|
279
|
-
${r.summary ? `<div class="box${r.status === 'aborted' || r.status === 'error' ? ' err' : ''}">${esc(r.summary)}</div>` : ''}
|
|
280
|
-
<h2>Log</h2><pre>${esc(r.log.join('\n'))}</pre>`, r.status === 'running');
|
|
281
|
-
}
|
|
282
|
-
function pageError(message) {
|
|
283
|
-
return layout('error', `<div class="box err">${esc(message)}</div><p><a href="/">back</a></p>`);
|
|
284
|
-
}
|
|
285
|
-
function truncate(s, n) {
|
|
286
|
-
return s.length > n ? `${s.slice(0, n - 1)}…` : s;
|
|
287
|
-
}
|
|
288
|
-
//# sourceMappingURL=ui.js.map
|
package/dist/ui.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ui.js","sourceRoot":"","sources":["../src/ui.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,SAAS,CAAA;AAC3D,OAAO,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAA;AAClC,OAAO,EAAE,YAAY,EAA0D,MAAM,WAAW,CAAA;AAChG,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,OAAO,EAAE,SAAS,EAAwE,MAAM,YAAY,CAAA;AA2D5G,MAAM,QAAQ,GAAG,EAAE,GAAG,IAAI,CAAA;AAC1B,8DAA8D;AAC9D,MAAM,UAAU,GAAG,GAAG,CAAA;AAEtB,MAAM,UAAU,OAAO,CAAC,IAAe;IACrC,MAAM,EAAE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