admin: tell people they can get a better certificate at letsencrypt

Massimo Melina committed Mar 1, 2023 at 11:49 UTC 670f2a990406fbb2e8da9f0f15c23da871fe7f10
1 file changed +6 -2
admin/src/ConfigPage.ts
+6 -2
@@ -4,7 +4,7 @@ import { Box, Button, FormHelperText, Link } from '@mui/material';
4 import { createElement as h, useEffect, useRef } from 'react';
5 import { apiCall, useApi, useApiEx } from './api'
6 import { state, useSnapState } from './state'
7 -import { Info, Refresh } from '@mui/icons-material'
7 +import { Info, Refresh, Warning } from '@mui/icons-material'
8 import { Dict, modifiedSx, with_ } from './misc'
9 import { subscribeKey } from 'valtio/utils'
10 import {
@@ -286,11 +286,15 @@ export async function makeCertAndSave() {
286 if (!window.crypto.subtle)
287 return alertDialog("Retry this procedure on localhost", 'warning')
288 const res = await formDialog<{ commonName: string }>({
289 + title: "We'll generate a basic certificate for you",
290 fields: [
290 - h(Box, { display: 'flex', gap: 1 }, h(Info), "We'll generate a basic certificate for you"),
291 + h(Box, { display: 'flex', gap: 1, alignItems: 'center' }, h(Warning), "This certificate is just one click away, but will issue a warning on the browser"),
292 { k: 'commonName', label: "Enter a domain, or leave empty" }
293 ],
294 save: { children: "Continue" },
295 + barSx: { gap: 1 },
296 + addToBar: [ h(Link, { target: 'cert', href: 'https://letsencrypt.org/' }, h(Button, {}, "Get better certificate")) ],
297 +
298 })
299 if (!res) return
300 const close = waitDialog()