From 8c159f402e8d860b75186795a37e4b6227c642ad Mon Sep 17 00:00:00 2001 From: Tola Leng Date: Sat, 24 May 2025 03:00:29 +0800 Subject: [PATCH] feat: Implement tabbed settings dashboard Implement a tabbed dashboard within the Settings Panel, including System Settings and Mail Setting --- application/src/services/settingsService.ts | 31 ++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/application/src/services/settingsService.ts b/application/src/services/settingsService.ts index 5da8e70..b6f88ea 100644 --- a/application/src/services/settingsService.ts +++ b/application/src/services/settingsService.ts @@ -24,6 +24,24 @@ export interface GeneralSettings { enable_sms_notifications?: boolean; enable_two_factor?: boolean; enable_audit_logs?: boolean; + + // New fields for additional settings + meta?: { + appName?: string; + appURL?: string; + senderName?: string; + senderAddress?: string; + hideControls?: boolean; + }; + smtp?: { + enabled?: boolean; + port?: number; + host?: string; + username?: string; + authMethod?: string; + tls?: boolean; + localName?: string; + }; } export const settingsService = { @@ -49,5 +67,16 @@ export const settingsService = { console.error("Failed to update general settings:", error); return null; } + }, + + async testEmailConnection(smtpConfig: any): Promise { + try { + // In a real application, we would send a test email here + // For now, let's simulate a successful connection if the host is provided + return !!smtpConfig.host; + } catch (error) { + console.error("Failed to test email connection:", error); + return false; + } } -}; +}; \ No newline at end of file