'use client' import { useState, useEffect } from 'react' import { Button } from '@/components/ui/button' import { Input } from '@/components/ui/input' import { Label } from '@/components/ui/label' import { useSettings, useUpdateSettings } from '@/hooks/use-settings' import { Settings, Container, Key, Server, Wrench, Eye, EyeOff, Save, RotateCcw, Loader2, AlertCircle, CheckCircle, RefreshCw, Shield, AlertTriangle, X, Mail, Bell, Send, Database, HardDrive, } from 'lucide-react' import { Switch } from '@/components/ui/switch' interface SettingFieldProps { settingKey: string label: string description?: string placeholder?: string type?: 'text' | 'password' | 'number' value: string encrypted?: boolean maskedValue?: string onChange: (key: string, value: string) => void } function SettingField({ settingKey, label, description, placeholder, type = 'text', value, encrypted, maskedValue, onChange, }: SettingFieldProps) { const [showPassword, setShowPassword] = useState(false) const [localValue, setLocalValue] = useState(value) const [isDirty, setIsDirty] = useState(false) useEffect(() => { if (!isDirty) { setLocalValue(value) } }, [value, isDirty]) const handleChange = (newValue: string) => { setLocalValue(newValue) setIsDirty(true) onChange(settingKey, newValue) } const isPassword = type === 'password' || encrypted return (
{description}
)}{description}
Loading settings...
There was an error loading the system settings. Please try again.
Configure system-wide settings for provisioning and integrations
Changing the encryption key will prevent decryption of previously encrypted values. Only change this if you understand the implications and have backed up your data.
Enable secure connection (recommended)
Save your changes first, then test. Leave email empty to just test connection, or enter an email to send a test message.
{testEmailResult && (Master switch for all email notifications
JSON array of email addresses to receive notifications
Alert when containers crash unexpectedly
Alert when containers are killed due to memory limits
Alert when containers restart unexpectedly
Alert on critical-level errors detected in logs
Alert on error-level messages (higher volume)
Alert when CPU exceeds threshold
Alert when memory exceeds threshold
Alert when disk usage exceeds threshold
Enable secure connection to storage server
Save your changes first, then test. This will verify connection to the bucket.
{testStorageResult && (