[web] Design review: last row's menu not clipped, Hostname focused after loading, popover closes on Esc and outside click, phone engine chip in the top bar, paused and needs-attention copy with Restore in the panel, change bar offers and countdown, focus after share and kept, fingerprint check when signing by hand, draft kept through sign-in
This commit is contained in:
@@ -16,6 +16,20 @@
|
||||
let pending = $state(false);
|
||||
let starting = $state(false);
|
||||
const base = $derived(r?.file_base ?? `domi-intermediate-${new Date().toISOString().slice(0, 10)}`);
|
||||
const signCmd = $derived(r?.approve_command ?? `openssl x509 -req -in ${base}.csr -CA domi-root.crt -CAkey domi-root.key -days 365 -sha256 -extfile ${base}.ext -out ${base}.crt`);
|
||||
const checkCmd = $derived(`openssl req -in ${base}.csr -outform DER | openssl dgst -sha256`);
|
||||
let copied = $state(false);
|
||||
// Groups of 8, easier to compare by eye; openssl prints it without spaces.
|
||||
const group = (h: string) => h.match(/.{1,8}/g)?.join(" ") ?? h;
|
||||
async function copy(text: string) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(text);
|
||||
copied = true;
|
||||
setTimeout(() => (copied = false), 3000);
|
||||
} catch {
|
||||
err = "Your browser did not allow copying. Select the command and copy it.";
|
||||
}
|
||||
}
|
||||
|
||||
function save(text: string, name: string, type: string) {
|
||||
const url = URL.createObjectURL(new Blob([text], { type }));
|
||||
@@ -88,15 +102,19 @@
|
||||
<p class="ia-label">Step 1</p>
|
||||
<h2 class="ia-h3">Download the request</h2>
|
||||
<p class="ia-text2">This file asks the Domi root to sign a new intermediate certificate. It holds no secret.</p>
|
||||
<p>Check that the offline computer shows the same code: <span class="ia-code small" aria-label="Match code {r.match_code}">{r.match_code}</span></p>
|
||||
<div class="row"><Button icon="copy" onclick={download}>Download the request (.csr)</Button><Button icon="copy" onclick={downloadExt}>Download the signing settings (.ext)</Button></div>
|
||||
<div class="row"><Button icon="download" onclick={download}>Download the request (.csr)</Button><Button icon="download" onclick={downloadExt}>Download the signing settings (.ext)</Button></div>
|
||||
</section>
|
||||
<section class="step">
|
||||
<p class="ia-label">Step 2</p>
|
||||
<h2 class="ia-h3">Sign it on the offline computer</h2>
|
||||
<p class="ia-text2">Copy both files to the offline computer that holds the Domi root, then run:</p>
|
||||
<pre class="ia-secret ia-cmd">{r.approve_command ?? `openssl x509 -req -in ${base}.csr -CA domi-root.crt -CAkey domi-root.key -days 365 -sha256 -extfile ${base}.ext -out ${base}.crt`}</pre>
|
||||
<p class="ia-muted">Before signing, check that the request is the one this page shows: <code>openssl req -in {base}.csr -noout -subject</code>. (On a computer with Ianitor installed, <code>ianitor-control ca sign</code> does the same and shows the match code.)</p>
|
||||
<p class="ia-text2">First check that the request is the one this server made. This prints its fingerprint:</p>
|
||||
<pre class="ia-secret ia-cmd">{checkCmd}</pre>
|
||||
{#if r.csr_sha256}<p>openssl must print the same fingerprint as this page: <span class="ia-cmd fp" aria-label="Fingerprint {r.csr_sha256}">{group(r.csr_sha256)}</span></p>{/if}
|
||||
<p class="ia-text2">Then sign it:</p>
|
||||
<pre class="ia-secret ia-cmd">{signCmd}</pre>
|
||||
<div class="row"><Button icon="copy" onclick={() => copy(signCmd)}>Copy command</Button>{#if copied}<span class="ia-status" data-s="kept" role="status"><Icon name="check" />Copied</span>{/if}</div>
|
||||
<p class="ia-muted">On a computer with Ianitor installed, <code>ianitor-control ca sign</code> signs it instead and shows the match code {r.match_code}.</p>
|
||||
</section>
|
||||
<section class="step">
|
||||
<p class="ia-label">Step 3</p>
|
||||
@@ -121,5 +139,5 @@
|
||||
<style>
|
||||
.row { display: flex; gap: 8px; flex-wrap: wrap; }
|
||||
.step { border: 1px solid var(--hairline); border-radius: var(--radius-lg); padding: 20px; display: flex; flex-direction: column; gap: 10px; }
|
||||
.small { font-size: 1.4rem; }
|
||||
.fp { word-break: break-all; color: var(--accent-strong); }
|
||||
</style>
|
||||
|
||||
Reference in New Issue
Block a user