@coffre/ui 0.2.0 → 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/dist/chunks/audit-sentence-BhHmvQX_.js +660 -0
- package/dist/chunks/audit-sentence-BhHmvQX_.js.map +1 -0
- package/dist/chunks/delete-place-CRX7ntE8.js +206 -0
- package/dist/chunks/delete-place-CRX7ntE8.js.map +1 -0
- package/dist/chunks/{directory-CSjWWUQ1.js → directory-zr3ek7Mc.js} +175 -60
- package/dist/chunks/directory-zr3ek7Mc.js.map +1 -0
- package/dist/chunks/folders-DoBmCwOi.js +207 -0
- package/dist/chunks/folders-DoBmCwOi.js.map +1 -0
- package/dist/chunks/grants-Cw1FyGID.js +669 -0
- package/dist/chunks/grants-Cw1FyGID.js.map +1 -0
- package/dist/chunks/offboarding-CE6d7um1.js +305 -0
- package/dist/chunks/offboarding-CE6d7um1.js.map +1 -0
- package/dist/chunks/one-time-DXEl9hbg.js +35 -0
- package/dist/chunks/one-time-DXEl9hbg.js.map +1 -0
- package/dist/chunks/page-DvsgZ2Hd.js +391 -0
- package/dist/chunks/page-DvsgZ2Hd.js.map +1 -0
- package/dist/chunks/principal-BIN-xwZw.js +42 -0
- package/dist/chunks/principal-BIN-xwZw.js.map +1 -0
- package/dist/chunks/{principal-page-D_91OA0l.js → principal-page-DhjO76GH.js} +245 -251
- package/dist/chunks/principal-page-DhjO76GH.js.map +1 -0
- package/dist/chunks/project-page-SRCtRe2g.js +17 -0
- package/dist/chunks/project-page-SRCtRe2g.js.map +1 -0
- package/dist/chunks/{queries-CQ81o4so.js → queries-DVR_i3rA.js} +132 -30
- package/dist/chunks/queries-DVR_i3rA.js.map +1 -0
- package/dist/chunks/references-B6pLT1uQ.js +343 -0
- package/dist/chunks/references-B6pLT1uQ.js.map +1 -0
- package/dist/chunks/{row-state-0PsrEzOL.js → row-state-DOPUsjQK.js} +3 -3
- package/dist/chunks/{row-state-0PsrEzOL.js.map → row-state-DOPUsjQK.js.map} +1 -1
- package/dist/chunks/signin-errors--ykMFuqN.js +57 -0
- package/dist/chunks/signin-errors--ykMFuqN.js.map +1 -0
- package/dist/chunks/tabs-BmwKfUeK.js +22 -0
- package/dist/chunks/tabs-BmwKfUeK.js.map +1 -0
- package/dist/chunks/{theme-B2vQolVR.js → theme-DJuz-xLM.js} +3 -3
- package/dist/chunks/{theme-B2vQolVR.js.map → theme-DJuz-xLM.js.map} +1 -1
- package/dist/chunks/{ui-DixXLQvQ.js → ui-DJje3gST.js} +6 -3
- package/dist/chunks/ui-DJje3gST.js.map +1 -0
- package/dist/chunks/{use-change-c6CeLRin.js → use-change-DUiGO19U.js} +52 -21
- package/dist/chunks/use-change-DUiGO19U.js.map +1 -0
- package/dist/chunks/{use-shell-jxd7Tzd-.js → use-shell-rNKfGjdj.js} +3 -3
- package/dist/chunks/{use-shell-jxd7Tzd-.js.map → use-shell-rNKfGjdj.js.map} +1 -1
- package/dist/chunks/validation-D312_NLf.js +87 -0
- package/dist/chunks/validation-D312_NLf.js.map +1 -0
- package/dist/index.d.ts +361 -27
- package/dist/index.js +188 -98
- package/dist/index.js.map +1 -1
- package/dist/pages/account.d.ts +2 -2
- package/dist/pages/account.js +297 -135
- package/dist/pages/account.js.map +1 -1
- package/dist/pages/approval.d.ts +9 -0
- package/dist/pages/approval.js +207 -0
- package/dist/pages/approval.js.map +1 -0
- package/dist/pages/audit.js +17 -542
- package/dist/pages/audit.js.map +1 -1
- package/dist/pages/device-login.js +2 -3
- package/dist/pages/device-login.js.map +1 -1
- package/dist/pages/environment.js +647 -257
- package/dist/pages/environment.js.map +1 -1
- package/dist/pages/login.js +18 -7
- package/dist/pages/login.js.map +1 -1
- package/dist/pages/oauth-authorize.d.ts +10 -0
- package/dist/pages/oauth-authorize.js +249 -0
- package/dist/pages/oauth-authorize.js.map +1 -0
- package/dist/pages/project-access.d.ts +6 -0
- package/dist/pages/project-access.js +370 -0
- package/dist/pages/project-access.js.map +1 -0
- package/dist/pages/project-environments.d.ts +4 -0
- package/dist/pages/project-environments.js +593 -0
- package/dist/pages/project-environments.js.map +1 -0
- package/dist/pages/project-settings.d.ts +4 -0
- package/dist/pages/project-settings.js +242 -0
- package/dist/pages/project-settings.js.map +1 -0
- package/dist/pages/project.d.ts +10 -2
- package/dist/pages/project.js +57 -934
- package/dist/pages/project.js.map +1 -1
- package/dist/pages/projects.js +53 -21
- package/dist/pages/projects.js.map +1 -1
- package/dist/pages/service-account.d.ts +10 -0
- package/dist/pages/{token.js → service-account.js} +115 -56
- package/dist/pages/service-account.js.map +1 -0
- package/dist/pages/service-accounts.d.ts +3 -0
- package/dist/pages/service-accounts.js +38 -0
- package/dist/pages/service-accounts.js.map +1 -0
- package/dist/pages/settings.d.ts +1 -0
- package/dist/pages/settings.js +104 -42
- package/dist/pages/settings.js.map +1 -1
- package/dist/pages/unregistered.js +2 -3
- package/dist/pages/unregistered.js.map +1 -1
- package/dist/pages/user.d.ts +6 -1
- package/dist/pages/user.js +18 -6
- package/dist/pages/user.js.map +1 -1
- package/dist/pages/users.js +6 -10
- package/dist/pages/users.js.map +1 -1
- package/package.json +3 -3
- package/src/components/actions-log.tsx +117 -0
- package/src/components/audit-sentence.tsx +55 -0
- package/src/components/command-palette.tsx +4 -4
- package/src/components/delete-place.tsx +180 -0
- package/src/components/directory.tsx +259 -110
- package/src/components/every-project.tsx +287 -0
- package/src/components/expiry-field.tsx +42 -0
- package/src/components/folders.tsx +219 -0
- package/src/components/grants.tsx +11 -4
- package/src/components/icons.tsx +2 -0
- package/src/components/missing.tsx +110 -0
- package/src/components/offboarding.tsx +61 -33
- package/src/components/page.tsx +4 -1
- package/src/components/principal-page.tsx +136 -106
- package/src/components/principal-picker.tsx +5 -5
- package/src/components/principal.tsx +4 -4
- package/src/components/references.tsx +323 -0
- package/src/components/service-tokens.tsx +115 -95
- package/src/components/shell.tsx +11 -32
- package/src/components/tabs.tsx +18 -0
- package/src/components/trusted-workloads.tsx +97 -79
- package/src/components/ui.tsx +8 -1
- package/src/index.ts +13 -2
- package/src/layout.tsx +2 -2
- package/src/lib/access-plan.ts +2 -2
- package/src/lib/audit-sentences.ts +161 -77
- package/src/lib/changes.ts +56 -5
- package/src/lib/coffre.ts +3 -2
- package/src/lib/one-time.ts +32 -0
- package/src/lib/project-access.ts +11 -23
- package/src/lib/project-page.ts +14 -0
- package/src/lib/queries.ts +126 -32
- package/src/lib/search.ts +25 -0
- package/src/lib/signin-errors.ts +45 -1
- package/src/lib/validation.ts +14 -0
- package/src/options.ts +187 -35
- package/src/pages/account.tsx +274 -129
- package/src/pages/approval.tsx +197 -0
- package/src/pages/audit.tsx +9 -61
- package/src/pages/environment.tsx +585 -286
- package/src/pages/login.tsx +8 -2
- package/src/pages/oauth-authorize.tsx +233 -0
- package/src/pages/project-access.tsx +219 -0
- package/src/pages/project-environments.tsx +582 -0
- package/src/pages/project-settings.tsx +259 -0
- package/src/pages/project.tsx +52 -879
- package/src/pages/projects.tsx +55 -18
- package/src/pages/service-account.tsx +50 -0
- package/src/pages/{tokens.tsx → service-accounts.tsx} +9 -6
- package/src/pages/settings.tsx +62 -8
- package/src/pages/user.tsx +16 -4
- package/src/pages/users.tsx +2 -2
- package/src/parity.ts +160 -0
- package/src/register.ts +58 -9
- package/src/router.tsx +4 -0
- package/src/shared/models.ts +6 -2
- package/src/styles/globals.css +536 -31
- package/dist/chunks/directory-CSjWWUQ1.js.map +0 -1
- package/dist/chunks/grants-saMQagmG.js +0 -160
- package/dist/chunks/grants-saMQagmG.js.map +0 -1
- package/dist/chunks/icons-D-PfAfnH.js +0 -203
- package/dist/chunks/icons-D-PfAfnH.js.map +0 -1
- package/dist/chunks/offboarding-C6l30DZR.js +0 -263
- package/dist/chunks/offboarding-C6l30DZR.js.map +0 -1
- package/dist/chunks/page-C5HcNqf2.js +0 -190
- package/dist/chunks/page-C5HcNqf2.js.map +0 -1
- package/dist/chunks/principal-page-D_91OA0l.js.map +0 -1
- package/dist/chunks/queries-CQ81o4so.js.map +0 -1
- package/dist/chunks/signin-errors-BEFlVDbQ.js +0 -30
- package/dist/chunks/signin-errors-BEFlVDbQ.js.map +0 -1
- package/dist/chunks/ui-DixXLQvQ.js.map +0 -1
- package/dist/chunks/use-action-CWsg_YWU.js +0 -49
- package/dist/chunks/use-action-CWsg_YWU.js.map +0 -1
- package/dist/chunks/use-change-c6CeLRin.js.map +0 -1
- package/dist/chunks/validation-BQtqPe2V.js +0 -29
- package/dist/chunks/validation-BQtqPe2V.js.map +0 -1
- package/dist/pages/token.d.ts +0 -3
- package/dist/pages/token.js.map +0 -1
- package/dist/pages/tokens.d.ts +0 -3
- package/dist/pages/tokens.js +0 -39
- package/dist/pages/tokens.js.map +0 -1
- package/dist/project-BqIy8gYR.d.ts +0 -5
- package/src/lib/instance.ts +0 -13
- package/src/pages/token.tsx +0 -34
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
import { useState } from 'react';
|
|
2
|
+
import type { ApprovalView, Decision } from '@coffre/client';
|
|
3
|
+
|
|
4
|
+
import { failureMessage, statusOf, useCoffre } from '../lib/coffre';
|
|
5
|
+
import { ClosedDoor } from '../components/page';
|
|
6
|
+
import { CopyButton, ErrorLine, Notice, Spinner, Timestamp } from '../components/ui';
|
|
7
|
+
import { CheckCircle, Link as LinkIcon, SlashCircle } from '../components/icons';
|
|
8
|
+
import { pageRoute } from '../lib/page-route';
|
|
9
|
+
import type { approval } from '../options';
|
|
10
|
+
|
|
11
|
+
const Route = pageRoute<typeof approval>();
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Where an MCP client sends you to confirm a change it asked for: what it
|
|
15
|
+
* would do, read afresh, and Approve, which makes it here and now, as you.
|
|
16
|
+
* The app only hears what became of it. Nothing changes until you press
|
|
17
|
+
* Approve, and a value you type goes to coffre and nowhere else.
|
|
18
|
+
*/
|
|
19
|
+
export function ApprovalPage() {
|
|
20
|
+
const loaded = Route.useLoaderData();
|
|
21
|
+
const [decided, setDecided] = useState<Decision | null>(null);
|
|
22
|
+
|
|
23
|
+
if (decided !== null) return <Decided decision={decided} reveal={loaded.ok && loaded.approval.kind === 'reveal'} />;
|
|
24
|
+
if (!loaded.ok) {
|
|
25
|
+
return (
|
|
26
|
+
<ClosedDoor icon={<SlashCircle size={18} />} label="Approve a change" title="This approval can't be shown">
|
|
27
|
+
<p>{loaded.error}</p>
|
|
28
|
+
</ClosedDoor>
|
|
29
|
+
);
|
|
30
|
+
}
|
|
31
|
+
const view = loaded.approval;
|
|
32
|
+
if (view.status !== 'pending') return <Settled view={view} />;
|
|
33
|
+
return <Approve view={view} onDecided={setDecided} />;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const SETTLED: Record<Exclude<ApprovalView['status'], 'pending'>, string> = {
|
|
37
|
+
approved: 'You approved this',
|
|
38
|
+
denied: 'You denied this',
|
|
39
|
+
cancelled: 'The app cancelled this',
|
|
40
|
+
failed: 'This change failed',
|
|
41
|
+
expired: 'This approval expired',
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
function Settled({ view }: { view: ApprovalView }) {
|
|
45
|
+
const status = view.status as keyof typeof SETTLED;
|
|
46
|
+
return (
|
|
47
|
+
<ClosedDoor
|
|
48
|
+
icon={status === 'approved' ? <CheckCircle size={18} /> : <SlashCircle size={18} />}
|
|
49
|
+
label="Approve a change"
|
|
50
|
+
title={SETTLED[status]}
|
|
51
|
+
>
|
|
52
|
+
<p>
|
|
53
|
+
{view.client.name} asked to {view.summary}.{' '}
|
|
54
|
+
{view.outcome?.text ?? (status === 'expired' ? 'Nothing changed. The app can ask again.' : 'Nothing changed.')}
|
|
55
|
+
</p>
|
|
56
|
+
</ClosedDoor>
|
|
57
|
+
);
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
function Decided({ decision, reveal }: { decision: Decision; reveal: boolean }) {
|
|
61
|
+
const done = decision.status === 'approved';
|
|
62
|
+
return (
|
|
63
|
+
<ClosedDoor
|
|
64
|
+
icon={done ? <CheckCircle size={18} /> : <SlashCircle size={18} />}
|
|
65
|
+
label={reveal ? 'Show a value' : 'Approve a change'}
|
|
66
|
+
title={done ? (reveal ? 'The value' : 'Done') : decision.status === 'denied' ? 'Denied' : reveal ? 'It could not be shown' : 'The change failed'}
|
|
67
|
+
>
|
|
68
|
+
{!(reveal && done) && <p>{decision.outcome.text}</p>}
|
|
69
|
+
{decision.shown.length > 0 && (
|
|
70
|
+
<>
|
|
71
|
+
<Notice tone="warn">{reveal ? 'Shown here only, and logged as your reveal: the app does not get it.' : 'Shown once, here only: copy it now. The app does not get it.'}</Notice>
|
|
72
|
+
<dl className="facts device-facts">
|
|
73
|
+
{decision.shown.map((line) => (
|
|
74
|
+
<div className="fact" key={line.label}>
|
|
75
|
+
<dt>{line.label}</dt>
|
|
76
|
+
<dd className="cell-account">
|
|
77
|
+
<span className="mono approval-shown">{line.value}</span>
|
|
78
|
+
<CopyButton value={line.value} label={`Copy ${line.label.toLowerCase()}`} />
|
|
79
|
+
</dd>
|
|
80
|
+
</div>
|
|
81
|
+
))}
|
|
82
|
+
</dl>
|
|
83
|
+
</>
|
|
84
|
+
)}
|
|
85
|
+
<p>You can close this tab: the app hears the outcome when it asks.</p>
|
|
86
|
+
</ClosedDoor>
|
|
87
|
+
);
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
function Approve({ view, onDecided }: { view: ApprovalView; onDecided: (decision: Decision) => void }) {
|
|
91
|
+
const coffre = useCoffre();
|
|
92
|
+
const [value, setValue] = useState('');
|
|
93
|
+
const [pending, setPending] = useState<'approve' | 'deny' | null>(null);
|
|
94
|
+
const [error, setError] = useState<string | null>(null);
|
|
95
|
+
const { client } = view;
|
|
96
|
+
const asksValue = view.asks?.value ?? null;
|
|
97
|
+
const reveal = view.kind === 'reveal';
|
|
98
|
+
|
|
99
|
+
async function decide(approve: boolean) {
|
|
100
|
+
setPending(approve ? 'approve' : 'deny');
|
|
101
|
+
try {
|
|
102
|
+
onDecided(
|
|
103
|
+
await coffre.approvals.decide(view.id, {
|
|
104
|
+
approve,
|
|
105
|
+
digest: view.digest,
|
|
106
|
+
...(approve && asksValue !== null ? { value } : {}),
|
|
107
|
+
}),
|
|
108
|
+
);
|
|
109
|
+
} catch (error) {
|
|
110
|
+
setError(statusOf(error) === undefined ? 'The answer could not be sent. Nothing changed.' : failureMessage(error));
|
|
111
|
+
setPending(null);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return (
|
|
116
|
+
<section className="card signin" aria-labelledby="approval-title">
|
|
117
|
+
<div className="signin-head">
|
|
118
|
+
<h1 className="signin-title" id="approval-title">
|
|
119
|
+
{reveal ? 'Show this value?' : 'Approve this change?'}
|
|
120
|
+
</h1>
|
|
121
|
+
<p className="signin-lede">
|
|
122
|
+
{client.name} asks to <strong>{view.summary}</strong>.{' '}
|
|
123
|
+
{reveal
|
|
124
|
+
? 'Reveal shows it here, to you, logged as your reveal; it is never sent to the app.'
|
|
125
|
+
: 'Read what it does: nothing changes until you approve, and then coffre makes it, as you.'}
|
|
126
|
+
</p>
|
|
127
|
+
</div>
|
|
128
|
+
|
|
129
|
+
<div className="consent-client">
|
|
130
|
+
<LinkIcon size={16} />
|
|
131
|
+
<span className="cell-stack">
|
|
132
|
+
{client.host !== null ? <span className="consent-host mono">{client.host}</span> : <span className="consent-host">{client.name}</span>}
|
|
133
|
+
<span>
|
|
134
|
+
{client.host !== null && <>{client.name} </>}
|
|
135
|
+
{client.registration === 'dcr' && <span className="tag tag-amber">Unverified</span>}
|
|
136
|
+
</span>
|
|
137
|
+
</span>
|
|
138
|
+
</div>
|
|
139
|
+
|
|
140
|
+
<dl className="facts device-facts">
|
|
141
|
+
{view.details.map((line) => (
|
|
142
|
+
<div className="fact" key={line.label}>
|
|
143
|
+
<dt>{line.label}</dt>
|
|
144
|
+
<dd className={line.kind === 'mono' ? 'mono' : undefined}>
|
|
145
|
+
{line.kind === 'time' ? <Timestamp iso={line.value} /> : line.value}
|
|
146
|
+
</dd>
|
|
147
|
+
</div>
|
|
148
|
+
))}
|
|
149
|
+
<div className="fact">
|
|
150
|
+
<dt>Expires (UTC)</dt>
|
|
151
|
+
<dd>
|
|
152
|
+
<Timestamp iso={view.expiresAt} />
|
|
153
|
+
</dd>
|
|
154
|
+
</div>
|
|
155
|
+
</dl>
|
|
156
|
+
|
|
157
|
+
{asksValue !== null && (
|
|
158
|
+
<label className="field approval-field">
|
|
159
|
+
<span className="label">{asksValue.label}</span>
|
|
160
|
+
<textarea
|
|
161
|
+
className="input mono approval-value"
|
|
162
|
+
name="value"
|
|
163
|
+
rows={3}
|
|
164
|
+
autoComplete="off"
|
|
165
|
+
spellCheck={false}
|
|
166
|
+
value={value}
|
|
167
|
+
disabled={pending !== null}
|
|
168
|
+
onChange={(event) => setValue(event.target.value)}
|
|
169
|
+
/>
|
|
170
|
+
<small>{asksValue.note}</small>
|
|
171
|
+
</label>
|
|
172
|
+
)}
|
|
173
|
+
|
|
174
|
+
<div className="consent-notices">
|
|
175
|
+
{client.registration === 'dcr' && (
|
|
176
|
+
<Notice tone="warn">This app registered itself: its name is its own claim. Approve only what you asked it to do.</Notice>
|
|
177
|
+
)}
|
|
178
|
+
<ErrorLine error={error} />
|
|
179
|
+
</div>
|
|
180
|
+
|
|
181
|
+
<div className="device-actions">
|
|
182
|
+
<button className="btn" disabled={pending !== null} onClick={() => void decide(false)}>
|
|
183
|
+
{pending === 'deny' && <Spinner />}
|
|
184
|
+
Deny
|
|
185
|
+
</button>
|
|
186
|
+
<button
|
|
187
|
+
className="btn btn-primary"
|
|
188
|
+
disabled={pending !== null || (asksValue !== null && value === '')}
|
|
189
|
+
onClick={() => void decide(true)}
|
|
190
|
+
>
|
|
191
|
+
{pending === 'approve' && <Spinner />}
|
|
192
|
+
{reveal ? 'Reveal' : 'Approve'}
|
|
193
|
+
</button>
|
|
194
|
+
</div>
|
|
195
|
+
</section>
|
|
196
|
+
);
|
|
197
|
+
}
|
package/src/pages/audit.tsx
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import type
|
|
2
|
-
import {
|
|
1
|
+
import { type AuditEntryView } from '@coffre/client';
|
|
2
|
+
import { useState, type ReactNode } from 'react';
|
|
3
3
|
import { useQuery, useSuspenseQuery } from '@tanstack/react-query';
|
|
4
4
|
import { Link } from '@tanstack/react-router';
|
|
5
5
|
import { useCoffre } from '../lib/coffre';
|
|
@@ -12,7 +12,8 @@ import {
|
|
|
12
12
|
who,
|
|
13
13
|
type Part,
|
|
14
14
|
} from '../lib/audit-sentences';
|
|
15
|
-
import {
|
|
15
|
+
import { EmptyState, Notice, Spinner, Timestamp, Toggletip } from '../components/ui';
|
|
16
|
+
import { memberName, Sentence } from '../components/audit-sentence';
|
|
16
17
|
import { ClosedDoor, PageHeader } from '../components/page';
|
|
17
18
|
import {
|
|
18
19
|
Activity,
|
|
@@ -99,10 +100,10 @@ export function AuditPage() {
|
|
|
99
100
|
{/* `exact` compares the whole search, not a subset of it: otherwise
|
|
100
101
|
"All events" for one actor also counts as active while that
|
|
101
102
|
actor's denials are showing, and both halves light up. */}
|
|
102
|
-
<Link to="/audit" search={{ ...filters, decision: undefined, detail: search.detail }} activeOptions={{ exact: true }}>
|
|
103
|
+
<Link to="/audit" search={{ ...filters, decision: undefined, detail: search.detail }} activeOptions={{ exact: true, includeSearch: false }}>
|
|
103
104
|
All events
|
|
104
105
|
</Link>
|
|
105
|
-
<Link to="/audit" search={{ ...filters, decision: 'deny', detail: search.detail }} activeOptions={{ exact: true }}>
|
|
106
|
+
<Link to="/audit" search={{ ...filters, decision: 'deny', detail: search.detail }} activeOptions={{ exact: true, includeSearch: false }}>
|
|
106
107
|
<SlashCircle size={13} />
|
|
107
108
|
Denials only
|
|
108
109
|
</Link>
|
|
@@ -131,7 +132,7 @@ export function AuditPage() {
|
|
|
131
132
|
</Link>
|
|
132
133
|
</div>
|
|
133
134
|
|
|
134
|
-
<section className="card" aria-label="Audit entries">
|
|
135
|
+
<section className="card card-wide" aria-label="Audit entries">
|
|
135
136
|
{shown.length === 0 ? (
|
|
136
137
|
<EmptyState title={deniedOnly ? 'No denials recorded' : 'Nothing recorded yet'}>
|
|
137
138
|
{deniedOnly
|
|
@@ -220,7 +221,6 @@ function Line({
|
|
|
220
221
|
detail={detail}
|
|
221
222
|
breaks={breaksInside && !grouped}
|
|
222
223
|
marked={breaksInside}
|
|
223
|
-
batch={batch}
|
|
224
224
|
toggle={
|
|
225
225
|
grouped ? (
|
|
226
226
|
<button
|
|
@@ -271,7 +271,6 @@ function Row({
|
|
|
271
271
|
marked,
|
|
272
272
|
toggle,
|
|
273
273
|
child = false,
|
|
274
|
-
batch,
|
|
275
274
|
}: {
|
|
276
275
|
entry: Entry;
|
|
277
276
|
seq: string;
|
|
@@ -286,10 +285,8 @@ function Row({
|
|
|
286
285
|
marked: boolean;
|
|
287
286
|
toggle?: ReactNode;
|
|
288
287
|
child?: boolean;
|
|
289
|
-
/** The batch a line stands for, to name a sync by any of its entries. */
|
|
290
|
-
batch?: Entry[];
|
|
291
288
|
}) {
|
|
292
|
-
const actor = who(
|
|
289
|
+
const actor = who(entry);
|
|
293
290
|
const classes = [
|
|
294
291
|
refused && 'is-denied',
|
|
295
292
|
(breaks || marked) && 'is-break',
|
|
@@ -345,55 +342,6 @@ function Row({
|
|
|
345
342
|
);
|
|
346
343
|
}
|
|
347
344
|
|
|
348
|
-
/** A sentence, its people and places links to their pages. */
|
|
349
|
-
function Sentence({ parts }: { parts: Part[] }) {
|
|
350
|
-
return (
|
|
351
|
-
<>
|
|
352
|
-
{parts.map((part, index) => (
|
|
353
|
-
<Fragment key={index}>
|
|
354
|
-
{typeof part === 'string' ? (
|
|
355
|
-
part
|
|
356
|
-
) : 'place' in part ? (
|
|
357
|
-
<PlaceLink path={part.place} />
|
|
358
|
-
) : (
|
|
359
|
-
<MemberLink member={part.member} />
|
|
360
|
-
)}
|
|
361
|
-
</Fragment>
|
|
362
|
-
))}
|
|
363
|
-
</>
|
|
364
|
-
);
|
|
365
|
-
}
|
|
366
|
-
|
|
367
|
-
function PlaceLink({ path }: { path: string }) {
|
|
368
|
-
const [project, environment] = path.split('/') as [string, string | undefined];
|
|
369
|
-
const text = <span className="mono">{breakAfterUnderscores(path)}</span>;
|
|
370
|
-
return environment === undefined ? (
|
|
371
|
-
<Link to="/projects/$project" params={{ project }}>
|
|
372
|
-
{text}
|
|
373
|
-
</Link>
|
|
374
|
-
) : (
|
|
375
|
-
<Link to="/projects/$project/$environment" params={{ project, environment }}>
|
|
376
|
-
{text}
|
|
377
|
-
</Link>
|
|
378
|
-
);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
function MemberLink({ member }: { member: string }) {
|
|
382
|
-
return member.startsWith('token:') ? (
|
|
383
|
-
<Link to="/tokens/$token" params={{ token: member.slice('token:'.length) }}>
|
|
384
|
-
{member}
|
|
385
|
-
</Link>
|
|
386
|
-
) : (
|
|
387
|
-
<Link to="/users/$user" params={{ user: memberName(member) }}>
|
|
388
|
-
{memberName(member)}
|
|
389
|
-
</Link>
|
|
390
|
-
);
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
function memberName(member: string): string {
|
|
394
|
-
return member.startsWith('user:') ? member.slice('user:'.length) : member;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
345
|
/** The entry the log breaks at, said in words as well as in red. */
|
|
398
346
|
function BreakMark() {
|
|
399
347
|
return (
|
|
@@ -485,7 +433,7 @@ function ChainStatus({ chain, onRetry }: { chain: ChainResult | undefined; onRet
|
|
|
485
433
|
label={
|
|
486
434
|
`Every entry through ${chain.through ?? 0} holds, under the app's key and the vault's.` +
|
|
487
435
|
(chain.checkpoint === null
|
|
488
|
-
? '
|
|
436
|
+
? ' Not checkpointed yet: the vault signs the log every few minutes.'
|
|
489
437
|
: ` The vault last signed it through entry ${chain.checkpoint.seq}, at ${chain.checkpoint.signedAt}.`)
|
|
490
438
|
}
|
|
491
439
|
>
|