From 6652ac5e7667c065d7a7f468cd0df8ba43379b1f Mon Sep 17 00:00:00 2001 From: Tola Leng Date: Wed, 4 Jun 2025 21:34:52 +0800 Subject: [PATCH 1/5] Fix: Improve service dialog theme support --- .../services/add-service/ServiceBasicFields.tsx | 4 +--- .../services/add-service/ServiceConfigFields.tsx | 4 +--- .../services/add-service/ServiceFormActions.tsx | 4 +--- .../services/add-service/ServiceNotificationFields.tsx | 8 ++++---- .../components/services/add-service/ServiceTypeField.tsx | 8 ++++---- 5 files changed, 11 insertions(+), 17 deletions(-) diff --git a/application/src/components/services/add-service/ServiceBasicFields.tsx b/application/src/components/services/add-service/ServiceBasicFields.tsx index 884818c..9039d71 100644 --- a/application/src/components/services/add-service/ServiceBasicFields.tsx +++ b/application/src/components/services/add-service/ServiceBasicFields.tsx @@ -20,7 +20,6 @@ export function ServiceBasicFields({ form }: ServiceBasicFieldsProps) { @@ -38,7 +37,6 @@ export function ServiceBasicFields({ form }: ServiceBasicFieldsProps) { { console.log("URL field changed:", e.target.value); @@ -52,4 +50,4 @@ export function ServiceBasicFields({ form }: ServiceBasicFieldsProps) { /> ); -} +} \ No newline at end of file diff --git a/application/src/components/services/add-service/ServiceConfigFields.tsx b/application/src/components/services/add-service/ServiceConfigFields.tsx index 6635833..d172f5e 100644 --- a/application/src/components/services/add-service/ServiceConfigFields.tsx +++ b/application/src/components/services/add-service/ServiceConfigFields.tsx @@ -21,7 +21,6 @@ export function ServiceConfigFields({ form }: ServiceConfigFieldsProps) { @@ -39,7 +38,6 @@ export function ServiceConfigFields({ form }: ServiceConfigFieldsProps) { @@ -48,4 +46,4 @@ export function ServiceConfigFields({ form }: ServiceConfigFieldsProps) { /> ); -} +} \ No newline at end of file diff --git a/application/src/components/services/add-service/ServiceFormActions.tsx b/application/src/components/services/add-service/ServiceFormActions.tsx index a012012..4f6ad59 100644 --- a/application/src/components/services/add-service/ServiceFormActions.tsx +++ b/application/src/components/services/add-service/ServiceFormActions.tsx @@ -28,14 +28,12 @@ export function ServiceFormActions({ onClick={handleCancel} variant="outline" disabled={isSubmitting} - className="border-gray-700 text-gray-300 hover:bg-gray-800 hover:text-white" > Cancel ); -} +} \ No newline at end of file diff --git a/application/src/components/services/add-service/ServiceNotificationFields.tsx b/application/src/components/services/add-service/ServiceNotificationFields.tsx index 0972b3a..aae20d0 100644 --- a/application/src/components/services/add-service/ServiceNotificationFields.tsx +++ b/application/src/components/services/add-service/ServiceNotificationFields.tsx @@ -82,10 +82,10 @@ export function ServiceNotificationFields({ form }: ServiceNotificationFieldsPro }} value={displayValue} > - + - + None {alertConfigs.map((config) => ( @@ -119,10 +119,10 @@ export function ServiceNotificationFields({ form }: ServiceNotificationFieldsPro }} value={displayValue} > - + - + Default {templates?.map((template) => ( diff --git a/application/src/components/services/add-service/ServiceTypeField.tsx b/application/src/components/services/add-service/ServiceTypeField.tsx index 7182411..b0c8933 100644 --- a/application/src/components/services/add-service/ServiceTypeField.tsx +++ b/application/src/components/services/add-service/ServiceTypeField.tsx @@ -22,7 +22,7 @@ export function ServiceTypeField({ form }: ServiceTypeFieldProps) { onValueChange={field.onChange} defaultValue={field.value} > - + {field.value === "http" && (
@@ -33,14 +33,14 @@ export function ServiceTypeField({ form }: ServiceTypeFieldProps) { {field.value !== "http" && "Select a service type"} - +
HTTP/S
-

+

Monitor websites and REST APIs with HTTP/HTTPS protocol

@@ -55,4 +55,4 @@ export function ServiceTypeField({ form }: ServiceTypeFieldProps) { )} /> ); -} +} \ No newline at end of file From 518b469c04ad5b219791d24ecd6d74ef98f03c21 Mon Sep 17 00:00:00 2001 From: Tola Leng Date: Wed, 4 Jun 2025 21:36:14 +0800 Subject: [PATCH 2/5] Fix: Ensure Add Service dialog respects theme --- application/src/components/services/AddServiceDialog.tsx | 6 +++--- application/src/components/services/ServiceEditDialog.tsx | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/application/src/components/services/AddServiceDialog.tsx b/application/src/components/services/AddServiceDialog.tsx index 6442666..19bdd8b 100644 --- a/application/src/components/services/AddServiceDialog.tsx +++ b/application/src/components/services/AddServiceDialog.tsx @@ -25,10 +25,10 @@ export function AddServiceDialog({ open, onOpenChange }: AddServiceDialogProps) return ( - + Create New Service - + Fill in the details to create a new service to monitor. @@ -40,4 +40,4 @@ export function AddServiceDialog({ open, onOpenChange }: AddServiceDialogProps) ); -} +} \ No newline at end of file diff --git a/application/src/components/services/ServiceEditDialog.tsx b/application/src/components/services/ServiceEditDialog.tsx index d1098af..a00ef2b 100644 --- a/application/src/components/services/ServiceEditDialog.tsx +++ b/application/src/components/services/ServiceEditDialog.tsx @@ -51,10 +51,10 @@ export function ServiceEditDialog({ open, onOpenChange, service }: ServiceEditDi onOpenChange(newOpen); } }}> - + Edit Service - + Update the details of your monitored service. @@ -74,4 +74,4 @@ export function ServiceEditDialog({ open, onOpenChange, service }: ServiceEditDi ); -} +} \ No newline at end of file From bd17ef71402ba87ad2d023c868cbc826af187bee Mon Sep 17 00:00:00 2001 From: Tola Leng Date: Wed, 4 Jun 2025 22:09:08 +0800 Subject: [PATCH 3/5] Fix: Apply theme to service action dialog. Ensured the service action dialog (three-dot menu) in uptime monitoring respects the current theme (dark/light mode) by using theme-aware styling. --- .../services/service-row/ServiceRowActions.tsx | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/application/src/components/services/service-row/ServiceRowActions.tsx b/application/src/components/services/service-row/ServiceRowActions.tsx index 3c8d385..d2cd039 100644 --- a/application/src/components/services/service-row/ServiceRowActions.tsx +++ b/application/src/components/services/service-row/ServiceRowActions.tsx @@ -112,10 +112,10 @@ export const ServiceRowActions = ({ { e.stopPropagation(); onViewDetail(service); @@ -125,7 +125,7 @@ export const ServiceRowActions = ({ View Detail {service.status === "paused" ? ( @@ -141,7 +141,7 @@ export const ServiceRowActions = ({ )} { e.stopPropagation(); onEdit(service); @@ -151,7 +151,7 @@ export const ServiceRowActions = ({ Edit {alertsMuted ? ( @@ -166,9 +166,9 @@ export const ServiceRowActions = ({ )} - + { e.stopPropagation(); onDelete(service); @@ -181,4 +181,4 @@ export const ServiceRowActions = ({
); -}; +}; \ No newline at end of file From 0739d6b0ce9f812ddc499a1946442c72ecfdb2b5 Mon Sep 17 00:00:00 2001 From: Tola Leng Date: Thu, 5 Jun 2025 18:33:13 +0800 Subject: [PATCH 4/5] Updated translation for SMTP password field in Mail Settings --- application/src/translations/de/settings.ts | 1 + application/src/translations/en/settings.ts | 2 + application/src/translations/km/settings.ts | 48 ++++++++++--------- .../src/translations/types/settings.ts | 4 +- 4 files changed, 31 insertions(+), 24 deletions(-) diff --git a/application/src/translations/de/settings.ts b/application/src/translations/de/settings.ts index 0940c78..70c07d1 100644 --- a/application/src/translations/de/settings.ts +++ b/application/src/translations/de/settings.ts @@ -18,6 +18,7 @@ export const settingsTranslations: SettingsTranslations = { smtpHost: "SMTP-Host", smtpPort: "SMTP-Port", smtpUsername: "SMTP-Benutzername", + smtpPassword: "SMTP Password", smtpAuthMethod: "Authentifizierungsmethode", enableTLS: "TLS aktivieren", localName: "Lokaler Name", diff --git a/application/src/translations/en/settings.ts b/application/src/translations/en/settings.ts index a25746e..6378b42 100644 --- a/application/src/translations/en/settings.ts +++ b/application/src/translations/en/settings.ts @@ -19,6 +19,7 @@ export const settingsTranslations: SettingsTranslations = { smtpHost: "SMTP Host", smtpPort: "SMTP Port", smtpUsername: "SMTP Username", + smtpPassword: "SMTP Password", smtpAuthMethod: "Authentication Method", enableTLS: "Enable TLS", localName: "Local Name", @@ -28,6 +29,7 @@ export const settingsTranslations: SettingsTranslations = { saving: "Saving...", settingsUpdated: "Settings updated successfully", errorSavingSettings: "Error saving settings", + errorFetchingSettings: "Error loading settings", testConnection: "Test Connection", testingConnection: "Testing Connection...", connectionSuccess: "Connection successful", diff --git a/application/src/translations/km/settings.ts b/application/src/translations/km/settings.ts index a25746e..429059b 100644 --- a/application/src/translations/km/settings.ts +++ b/application/src/translations/km/settings.ts @@ -3,33 +3,35 @@ import { SettingsTranslations } from '../types/settings'; export const settingsTranslations: SettingsTranslations = { // Tabs - systemSettings: "System Settings", - mailSettings: "Mail Settings", + systemSettings: "ការកំណត់ប្រព័ន្ធ", + mailSettings: "ការកំណត់សំបុត្រ", // System Settings - appName: "Application Name", - appURL: "Application URL", - senderName: "Sender Name", - senderEmail: "Sender Email Address", - hideControls: "Hide Controls", + appName: "ឈ្មោះកម្មវិធី", + appURL: "URL កម្មវិធី", + senderName: "ឈ្មោះអ្នកផ្ញើ", + senderEmail: "អាសយដ្ឋានអ៊ីមែលអ្នកផ្ញើ", + hideControls: "លាក់ការគ្រប់គ្រង", // Mail Settings - smtpSettings: "SMTP Configuration", - smtpEnabled: "Enable SMTP", - smtpHost: "SMTP Host", - smtpPort: "SMTP Port", - smtpUsername: "SMTP Username", - smtpAuthMethod: "Authentication Method", - enableTLS: "Enable TLS", - localName: "Local Name", + smtpSettings: "ការកំណត់រចនាសម្ព័ន្ធ SMTP", + smtpEnabled: "បើក SMTP", + smtpHost: "ម៉ាស៊ីន SMTP", + smtpPort: "ច្រក SMTP", + smtpUsername: "ឈ្មោះអ្នកប្រើ SMTP", + smtpPassword: "ពាក្យសម្ងាត់ SMTP", + smtpAuthMethod: "វិធីសាស្ត្រផ្ទៀងផ្ទាត់", + enableTLS: "បើក TLS", + localName: "ឈ្មោះមូលដ្ឋាន", // Actions and status - save: "Save Changes", - saving: "Saving...", - settingsUpdated: "Settings updated successfully", - errorSavingSettings: "Error saving settings", - testConnection: "Test Connection", - testingConnection: "Testing Connection...", - connectionSuccess: "Connection successful", - connectionFailed: "Connection failed" + save: "រក្សាទុកការផ្លាស់ប្ដូរ", + saving: "កំពុងរក្សាទុក...", + settingsUpdated: "បានធ្វើបច្ចុប្បន្នភាពការកំណត់ដោយជោគជ័យ", + errorSavingSettings: "មានបញ្ហាក្នុងការរក្សាទុកការកំណត់", + errorFetchingSettings: "មានបញ្ហាក្នុងការទាញយកការកំណត់", + testConnection: "សាកល្បងការតភ្ជាប់", + testingConnection: "កំពុងសាកល្បងការតភ្ជាប់...", + connectionSuccess: "ការតភ្ជាប់ជោគជ័យ", + connectionFailed: "ការតភ្ជាប់បរាជ័យ" }; \ No newline at end of file diff --git a/application/src/translations/types/settings.ts b/application/src/translations/types/settings.ts index 7ad60d6..aabc506 100644 --- a/application/src/translations/types/settings.ts +++ b/application/src/translations/types/settings.ts @@ -12,11 +12,12 @@ export interface SettingsTranslations { hideControls: string; // Mail Settings - smtpSettings: string; + smtpSettings?: string; smtpEnabled: string; smtpHost: string; smtpPort: string; smtpUsername: string; + smtpPassword: string; smtpAuthMethod: string; enableTLS: string; localName: string; @@ -26,6 +27,7 @@ export interface SettingsTranslations { saving: string; settingsUpdated: string; errorSavingSettings: string; + errorFetchingSettings: string; testConnection: string; testingConnection: string; connectionSuccess: string; From 4ef84b5469484db4eb8263bb8e62b8b8f3765e10 Mon Sep 17 00:00:00 2001 From: Tola Leng Date: Thu, 5 Jun 2025 18:33:58 +0800 Subject: [PATCH 5/5] Add SMTP password field. Added a password field to the Mail Settings tab in the General Settings panel, ensuring it is saved and retrieved via the `/api/settings` endpoint. --- .../settings/general/GeneralSettingsPanel.tsx | 3 +++ .../settings/general/MailSettingsTab.tsx | 20 +++++++++++++++++++ application/src/services/settingsService.ts | 1 + 3 files changed, 24 insertions(+) diff --git a/application/src/components/settings/general/GeneralSettingsPanel.tsx b/application/src/components/settings/general/GeneralSettingsPanel.tsx index 7480d0c..b43cf48 100644 --- a/application/src/components/settings/general/GeneralSettingsPanel.tsx +++ b/application/src/components/settings/general/GeneralSettingsPanel.tsx @@ -47,6 +47,7 @@ const GeneralSettingsPanel: React.FC = () => { port: 587, host: '', username: '', + password: '', authMethod: '', tls: true, localName: '' @@ -73,6 +74,7 @@ const GeneralSettingsPanel: React.FC = () => { port: 587, host: '', username: '', + password: '', authMethod: '', tls: true, localName: '' @@ -131,6 +133,7 @@ const GeneralSettingsPanel: React.FC = () => { port: 587, host: '', username: '', + password: '', authMethod: '', tls: true, localName: '' diff --git a/application/src/components/settings/general/MailSettingsTab.tsx b/application/src/components/settings/general/MailSettingsTab.tsx index fe6349c..34140cd 100644 --- a/application/src/components/settings/general/MailSettingsTab.tsx +++ b/application/src/components/settings/general/MailSettingsTab.tsx @@ -140,6 +140,26 @@ const MailSettingsTab: React.FC = ({ /> +
+ ( + + {t("smtpPassword", "settings")} + + + + + )} + /> +
+