feat: add permanent trust functionality for devices with corresponding API and UI updates

This commit is contained in:
shuaiplus
2026-05-12 18:01:04 +08:00
parent 83a1fc2376
commit 2685741386
15 changed files with 140 additions and 2 deletions
+8
View File
@@ -667,6 +667,14 @@ export async function revokeAuthorizedDeviceTrust(
if (!resp.ok) throw new Error(t('txt_revoke_device_trust_failed'));
}
export async function trustAuthorizedDevicePermanently(
authedFetch: AuthedFetch,
deviceIdentifier: string
): Promise<void> {
const resp = await authedFetch(`/api/devices/authorized/${encodeURIComponent(deviceIdentifier)}/permanent`, { method: 'POST' });
if (!resp.ok) throw new Error(t('txt_trust_device_permanently_failed'));
}
export async function revokeAllAuthorizedDeviceTrust(authedFetch: AuthedFetch): Promise<void> {
const resp = await authedFetch('/api/devices/authorized', { method: 'DELETE' });
if (!resp.ok) throw new Error(t('txt_revoke_all_device_trust_failed'));