mirror of
https://github.com/henrygd/beszel.git
synced 2026-08-19 16:57:47 +02:00
feat(hub): show public key in universal token settings (#2028)
This commit is contained in:
@@ -139,6 +139,7 @@ const SectionUniversalToken = memo(() => {
|
|||||||
const [isLoading, setIsLoading] = useState(true)
|
const [isLoading, setIsLoading] = useState(true)
|
||||||
const [checked, setChecked] = useState(false)
|
const [checked, setChecked] = useState(false)
|
||||||
const [isPermanent, setIsPermanent] = useState(false)
|
const [isPermanent, setIsPermanent] = useState(false)
|
||||||
|
const publicKey = $publicKey.get()
|
||||||
|
|
||||||
async function updateToken(enable: number = -1, permanent: number = -1) {
|
async function updateToken(enable: number = -1, permanent: number = -1) {
|
||||||
// enable: 0 for disable, 1 for enable, -1 (unset) for get current state
|
// enable: 0 for disable, 1 for enable, -1 (unset) for get current state
|
||||||
@@ -191,6 +192,25 @@ const SectionUniversalToken = memo(() => {
|
|||||||
<ActionsButtonUniversalToken token={token} checked={checked} />
|
<ActionsButtonUniversalToken token={token} checked={checked} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{checked && (
|
||||||
|
<div className="flex items-center gap-4 min-w-0 border-t pt-3">
|
||||||
|
<span className="text-sm text-muted-foreground whitespace-nowrap">
|
||||||
|
<Trans>Public key</Trans>
|
||||||
|
</span>
|
||||||
|
<div className="min-w-0 flex-1 overflow-auto">
|
||||||
|
<span className="text-sm text-primary font-mono">{publicKey}</span>
|
||||||
|
</div>
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
size="icon"
|
||||||
|
onClick={() => copyToClipboard(publicKey)}
|
||||||
|
title={t`Copy public key`}
|
||||||
|
>
|
||||||
|
<CopyIcon className="w-4" />
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
|
)}
|
||||||
|
|
||||||
{checked && (
|
{checked && (
|
||||||
<div className="border-t pt-3">
|
<div className="border-t pt-3">
|
||||||
<div className="text-sm font-medium">
|
<div className="text-sm font-medium">
|
||||||
|
|||||||
Reference in New Issue
Block a user