Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions application/src/components/services/AddServiceDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ export function AddServiceDialog({ open, onOpenChange }: AddServiceDialogProps)

return (
<Dialog open={open} onOpenChange={onOpenChange}>
<DialogContent className="bg-black text-white border-gray-800 sm:max-w-[500px] max-h-[90vh] flex flex-col">
<DialogContent className="sm:max-w-[500px] max-h-[90vh] flex flex-col">
<DialogHeader>
<DialogTitle className="text-xl">Create New Service</DialogTitle>
<DialogDescription className="text-gray-400">
<DialogDescription>
Fill in the details to create a new service to monitor.
</DialogDescription>
</DialogHeader>
Expand All @@ -40,4 +40,4 @@ export function AddServiceDialog({ open, onOpenChange }: AddServiceDialogProps)
</DialogContent>
</Dialog>
);
}
}
6 changes: 3 additions & 3 deletions application/src/components/services/ServiceEditDialog.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,10 +51,10 @@ export function ServiceEditDialog({ open, onOpenChange, service }: ServiceEditDi
onOpenChange(newOpen);
}
}}>
<DialogContent className="bg-black text-white border-gray-800 sm:max-w-[500px] max-h-[90vh] flex flex-col">
<DialogContent className="sm:max-w-[500px] max-h-[90vh] flex flex-col">
<DialogHeader>
<DialogTitle className="text-xl">Edit Service</DialogTitle>
<DialogDescription className="text-gray-400">
<DialogDescription>
Update the details of your monitored service.
</DialogDescription>
</DialogHeader>
Expand All @@ -74,4 +74,4 @@ export function ServiceEditDialog({ open, onOpenChange, service }: ServiceEditDi
</DialogContent>
</Dialog>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@ export function ServiceBasicFields({ form }: ServiceBasicFieldsProps) {
<FormControl>
<Input
placeholder="Service Name"
className="bg-black border-gray-700"
{...field}
/>
</FormControl>
Expand All @@ -38,7 +37,6 @@ export function ServiceBasicFields({ form }: ServiceBasicFieldsProps) {
<FormControl>
<Input
placeholder="https://example.com"
className="bg-black border-gray-700"
{...field}
onChange={(e) => {
console.log("URL field changed:", e.target.value);
Expand All @@ -52,4 +50,4 @@ export function ServiceBasicFields({ form }: ServiceBasicFieldsProps) {
/>
</>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ export function ServiceConfigFields({ form }: ServiceConfigFieldsProps) {
<Input
type="number"
placeholder="60"
className="bg-black border-gray-700"
{...field}
/>
</FormControl>
Expand All @@ -39,7 +38,6 @@ export function ServiceConfigFields({ form }: ServiceConfigFieldsProps) {
<Input
type="number"
placeholder="3"
className="bg-black border-gray-700"
{...field}
/>
</FormControl>
Expand All @@ -48,4 +46,4 @@ export function ServiceConfigFields({ form }: ServiceConfigFieldsProps) {
/>
</>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -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
</Button>
<Button
type="submit"
disabled={isSubmitting}
className="bg-primary text-primary-foreground hover:bg-primary/90"
>
{isSubmitting ? (
<>
Expand All @@ -48,4 +46,4 @@ export function ServiceFormActions({
</Button>
</div>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ export function ServiceNotificationFields({ form }: ServiceNotificationFieldsPro
}}
value={displayValue}
>
<SelectTrigger className="bg-black border-gray-700">
<SelectTrigger>
<SelectValue placeholder="Select a notification channel" />
</SelectTrigger>
<SelectContent className="bg-gray-900 text-white border-gray-700">
<SelectContent>
<SelectItem value="none">None</SelectItem>
{alertConfigs.map((config) => (
<SelectItem key={config.id} value={config.id || ""}>
Expand Down Expand Up @@ -119,10 +119,10 @@ export function ServiceNotificationFields({ form }: ServiceNotificationFieldsPro
}}
value={displayValue}
>
<SelectTrigger className="bg-black border-gray-700">
<SelectTrigger>
<SelectValue placeholder="Select an alert template" />
</SelectTrigger>
<SelectContent className="bg-gray-900 text-white border-gray-700">
<SelectContent>
<SelectItem value="default">Default</SelectItem>
{templates?.map((template) => (
<SelectItem key={template.id} value={template.id}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export function ServiceTypeField({ form }: ServiceTypeFieldProps) {
onValueChange={field.onChange}
defaultValue={field.value}
>
<SelectTrigger className="bg-black border-gray-700">
<SelectTrigger>
<SelectValue>
{field.value === "http" && (
<div className="flex items-center gap-2">
Expand All @@ -33,14 +33,14 @@ export function ServiceTypeField({ form }: ServiceTypeFieldProps) {
{field.value !== "http" && "Select a service type"}
</SelectValue>
</SelectTrigger>
<SelectContent className="bg-gray-900 text-white border-gray-700">
<SelectContent>
<SelectItem value="http">
<div className="flex flex-col">
<div className="flex items-center gap-2">
<Globe className="w-4 h-4" />
<span>HTTP/S</span>
</div>
<p className="text-xs text-gray-400 mt-1">
<p className="text-xs text-muted-foreground mt-1">
Monitor websites and REST APIs with HTTP/HTTPS protocol
</p>
</div>
Expand All @@ -55,4 +55,4 @@ export function ServiceTypeField({ form }: ServiceTypeFieldProps) {
)}
/>
);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -112,10 +112,10 @@ export const ServiceRowActions = ({
</DropdownMenuTrigger>
<DropdownMenuContent
align="end"
className="w-48 bg-gray-900 border border-gray-800 text-white"
className="w-48"
>
<DropdownMenuItem
className="flex items-center gap-2 cursor-pointer hover:bg-gray-800 focus:bg-gray-800 text-base py-2.5"
className="flex items-center gap-2 cursor-pointer text-base py-2.5"
onClick={(e) => {
e.stopPropagation();
onViewDetail(service);
Expand All @@ -125,7 +125,7 @@ export const ServiceRowActions = ({
<span>View Detail</span>
</DropdownMenuItem>
<DropdownMenuItem
className="flex items-center gap-2 cursor-pointer hover:bg-gray-800 focus:bg-gray-800 text-base py-2.5"
className="flex items-center gap-2 cursor-pointer text-base py-2.5"
onClick={handlePauseResume}
>
{service.status === "paused" ? (
Expand All @@ -141,7 +141,7 @@ export const ServiceRowActions = ({
)}
</DropdownMenuItem>
<DropdownMenuItem
className="flex items-center gap-2 cursor-pointer hover:bg-gray-800 focus:bg-gray-800 text-base py-2.5"
className="flex items-center gap-2 cursor-pointer text-base py-2.5"
onClick={(e) => {
e.stopPropagation();
onEdit(service);
Expand All @@ -151,7 +151,7 @@ export const ServiceRowActions = ({
<span>Edit</span>
</DropdownMenuItem>
<DropdownMenuItem
className="flex items-center gap-2 cursor-pointer hover:bg-gray-800 focus:bg-gray-800 text-base py-2.5"
className="flex items-center gap-2 cursor-pointer text-base py-2.5"
onClick={handleMuteAlerts}
>
{alertsMuted ? (
Expand All @@ -166,9 +166,9 @@ export const ServiceRowActions = ({
</>
)}
</DropdownMenuItem>
<DropdownMenuSeparator className="bg-gray-700" />
<DropdownMenuSeparator />
<DropdownMenuItem
className="flex items-center gap-2 text-red-500 cursor-pointer hover:bg-gray-800 focus:bg-gray-800 text-base py-2.5"
className="flex items-center gap-2 text-destructive cursor-pointer text-base py-2.5"
onClick={(e) => {
e.stopPropagation();
onDelete(service);
Expand All @@ -181,4 +181,4 @@ export const ServiceRowActions = ({
</DropdownMenu>
</div>
);
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ const GeneralSettingsPanel: React.FC<GeneralSettingsPanelProps> = () => {
port: 587,
host: '',
username: '',
password: '',
authMethod: '',
tls: true,
localName: ''
Expand All @@ -73,6 +74,7 @@ const GeneralSettingsPanel: React.FC<GeneralSettingsPanelProps> = () => {
port: 587,
host: '',
username: '',
password: '',
authMethod: '',
tls: true,
localName: ''
Expand Down Expand Up @@ -131,6 +133,7 @@ const GeneralSettingsPanel: React.FC<GeneralSettingsPanelProps> = () => {
port: 587,
host: '',
username: '',
password: '',
authMethod: '',
tls: true,
localName: ''
Expand Down
20 changes: 20 additions & 0 deletions application/src/components/settings/general/MailSettingsTab.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,26 @@ const MailSettingsTab: React.FC<MailSettingsTabProps> = ({
/>
</div>

<div className="mt-4">
<FormField
control={form.control}
name="smtp.password"
render={({ field }) => (
<FormItem>
<FormLabel>{t("smtpPassword", "settings")}</FormLabel>
<FormControl>
<Input
{...field}
type="password"
disabled={!isEditing || !form.watch('smtp.enabled')}
placeholder="••••••••"
/>
</FormControl>
</FormItem>
)}
/>
</div>

<div className="mt-4">
<FormField
control={form.control}
Expand Down
1 change: 1 addition & 0 deletions application/src/services/settingsService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export interface GeneralSettings {
port?: number;
host?: string;
username?: string;
password?: string;
authMethod?: string;
tls?: boolean;
localName?: string;
Expand Down
1 change: 1 addition & 0 deletions application/src/translations/de/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
2 changes: 2 additions & 0 deletions application/src/translations/en/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand All @@ -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",
Expand Down
48 changes: 25 additions & 23 deletions application/src/translations/km/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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: "ការតភ្ជាប់បរាជ័យ"
};
4 changes: 3 additions & 1 deletion application/src/translations/types/settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -26,6 +27,7 @@ export interface SettingsTranslations {
saving: string;
settingsUpdated: string;
errorSavingSettings: string;
errorFetchingSettings: string;
testConnection: string;
testingConnection: string;
connectionSuccess: string;
Expand Down