Apply critical OIDC and notification system fixes while preserving i18n

- Merge OIDC authentication fixes from 3877e90:
  * Enhanced JWKS discovery mechanism with multiple backup URLs
  * Better support for non-standard OIDC providers (Authentik, etc.)
  * Improved error handling for "Failed to get user information"
- Migrate to unified Sonner toast notification system:
  * Replace custom success/error state management
  * Remove redundant alert state variables
  * Consistent user feedback across all components
- Improve code quality and function naming conventions
- PRESERVE all existing i18n functionality and Chinese translations

🤖 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
ZacharyZcR
2025-09-03 15:38:06 +08:00
parent 853d282d2f
commit b67a82c19e
4 changed files with 49 additions and 55 deletions

View File

@@ -21,6 +21,7 @@ import React, {useEffect, useRef, useState} from "react";
import {Switch} from "@/components/ui/switch.tsx";
import {Alert, AlertDescription} from "@/components/ui/alert.tsx";
import {createSSHHost, updateSSHHost, getSSHHosts} from '@/ui/main-axios.ts';
import {toast} from "sonner";
interface SSHHost {
id: number;
@@ -255,8 +256,9 @@ export function HostManagerHostEditor({editingHost, onFormSubmit}: SSHManagerHos
}
window.dispatchEvent(new CustomEvent('ssh-hosts:changed'));
toast.success(editingHost ? t('hosts.hostUpdated') : t('hosts.hostAdded'));
} catch (error) {
alert(t('errors.saveError'));
toast.error(t('errors.saveError'));
}
};