Save issued B2 application keys as downloadable JSON packages
Device Core qualification / qualify (push) Successful in 6m30s
Device Core qualification / qualify (push) Successful in 6m30s
This commit is contained in:
@@ -47,6 +47,14 @@ export function B2HostSettings({ host, workspace, onClose, onChanged, onError }:
|
||||
const contours = status?.contours || [];
|
||||
const canManage = status?.authority === 'host';
|
||||
const busy = Boolean(pending);
|
||||
function downloadIssuedKey() {
|
||||
const url = URL.createObjectURL(new Blob([issued + '\n'], { type: 'application/json' }));
|
||||
const link = document.createElement('a');
|
||||
link.href = url;
|
||||
link.download = 'arnavi-application-key.json';
|
||||
link.click();
|
||||
window.setTimeout(() => URL.revokeObjectURL(url), 1000);
|
||||
}
|
||||
return <>
|
||||
<FeatureSettingsWindow open title="Настройки VPS" subtitle={project.ownerScope.displayName}
|
||||
identity={{ title: host.displayName, subtitle: status?.endpoint || 'ARNavi VPS', avatarLabel: 'VPS' }}
|
||||
@@ -107,8 +115,9 @@ export function B2HostSettings({ host, workspace, onClose, onChanged, onError }:
|
||||
</SettingsCard> : null}
|
||||
</> : null}
|
||||
{section === 'applications' ? <>
|
||||
{issued ? <SettingsCard title="Новый ключ приложения" description="Скопируйте ключ и передайте в подключаемое приложение. Позже его можно перевыпустить без потери устройств.">
|
||||
{issued ? <SettingsCard title="Новый ключ приложения" description="Сохраните файл ключа для подключаемого приложения. Позже ключ можно перевыпустить без потери устройств.">
|
||||
<div className="b2-settings"><TextAreaField label="Ключ" value={issued} readOnly rows={6} />
|
||||
<Button onClick={downloadIssuedKey}><Icon name="download" />Скачать файл ключа</Button>
|
||||
<Button onClick={() => navigator.clipboard.writeText(issued).catch(onError)}>Скопировать ключ</Button>
|
||||
<Button onClick={() => setIssued('')}>Скрыть</Button></div>
|
||||
</SettingsCard> : null}
|
||||
|
||||
Reference in New Issue
Block a user