@dshn/agent 0.1.5 → 0.1.6
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/client.js +14 -6
- package/package.json +1 -1
package/client.js
CHANGED
|
@@ -338,6 +338,9 @@ window.__ModuleLoader__.load({
|
|
|
338
338
|
.dshn-modebtn.dshn-on { background: var(--dsw-alias-bg-layer-1, #fff); color: var(--dsw-alias-label-primary, #1c1e21);
|
|
339
339
|
box-shadow: 0 1px 2px rgba(0,0,0,.08); }
|
|
340
340
|
.dshn-ca { min-height: 54px; resize: vertical; font-family: ui-monospace, Menlo, monospace; font-size: 11px; line-height: 1.4; }
|
|
341
|
+
.dshn-catoggle { border: 0; background: transparent; cursor: pointer; padding: 2px 0; font-size: 11px; font-family: inherit;
|
|
342
|
+
color: var(--dsw-alias-label-tertiary, #8b9099); }
|
|
343
|
+
.dshn-catoggle:hover { color: var(--dsw-alias-label-primary, #1c1e21); }
|
|
341
344
|
.dshn-e2e-box { margin: 4px 0 12px; padding: 11px 12px; border-radius: 10px;
|
|
342
345
|
border: 1px solid var(--dsw-alias-border-l2, rgba(128,134,142,.25)); background: var(--dsw-alias-bg-layer-2, #f4f5f7); }
|
|
343
346
|
.dshn-e2e-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px;
|
|
@@ -500,6 +503,9 @@ window.__ModuleLoader__.load({
|
|
|
500
503
|
const [mode, setMode] = react.useState(rs0.relayHost ? 'selfhost' : 'official')
|
|
501
504
|
const [relayHost, setRelayHost] = react.useState(rs0.relayHost || '')
|
|
502
505
|
const [originCa, setOriginCa] = react.useState(rs0.originCa || '')
|
|
506
|
+
// The self-signed CA is rarely needed (valid cert / Cloudflare cover most);
|
|
507
|
+
// hidden behind a toggle, auto-shown only if one is already saved.
|
|
508
|
+
const [showCa, setShowCa] = react.useState(!!rs0.originCa)
|
|
503
509
|
|
|
504
510
|
// When the saved passwords arrive from a later status poll, fill them once.
|
|
505
511
|
react.useEffect(() => {
|
|
@@ -514,7 +520,7 @@ window.__ModuleLoader__.load({
|
|
|
514
520
|
const rs = s.relaySettings
|
|
515
521
|
if (!rs) return
|
|
516
522
|
if (rs.relayHost && relayHost === '') { setRelayHost(rs.relayHost); setMode('selfhost') }
|
|
517
|
-
if (rs.originCa && originCa === '') setOriginCa(rs.originCa)
|
|
523
|
+
if (rs.originCa && originCa === '') { setOriginCa(rs.originCa); setShowCa(true) }
|
|
518
524
|
}, [s.relaySettings && s.relaySettings.relayHost])
|
|
519
525
|
|
|
520
526
|
// The domain suffix reflects the self-hosted relay AS YOU TYPE it (a
|
|
@@ -636,11 +642,13 @@ window.__ModuleLoader__.load({
|
|
|
636
642
|
h('input', { className: 'dshn-input', value: relayHost, placeholder: 'wss://tunnel.example.com',
|
|
637
643
|
autoComplete: 'off', spellCheck: false, autoFocus: !configured, onChange: (ev) => setRelayHost(ev.target.value) }),
|
|
638
644
|
h('div', { className: 'dshn-hint' }, T.relayHostHint)) : null,
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
h('
|
|
645
|
+
// Self-signed CA — hidden behind a toggle; only the rare self-signed relay
|
|
646
|
+
// needs it (valid cert / behind Cloudflare needs nothing).
|
|
647
|
+
mode === 'selfhost' ? h('div', { className: 'dshn-field' },
|
|
648
|
+
h('button', { type: 'button', className: 'dshn-catoggle', onClick: () => setShowCa(!showCa) }, (showCa ? '▾ ' : '▸ ') + T.relayCa),
|
|
649
|
+
showCa ? h('textarea', { className: 'dshn-input dshn-ca', value: originCa, rows: 3, spellCheck: false, style: { marginTop: '6px' },
|
|
650
|
+
placeholder: '-----BEGIN CERTIFICATE-----', onChange: (ev) => setOriginCa(ev.target.value) }) : null,
|
|
651
|
+
showCa ? h('div', { className: 'dshn-hint' }, T.relayCaHint) : null) : null,
|
|
644
652
|
|
|
645
653
|
h('label', { className: 'dshn-field' },
|
|
646
654
|
h('span', null, T.prefix),
|