easy-devops 1.2.0 → 1.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,133 +1,277 @@
1
1
  <!-- Settings Page -->
2
2
  <div v-show="page === 'settings'" class="w-full max-w-4xl pb-12">
3
- <div class="flex items-center justify-between mb-8">
4
- <div>
5
- <h2 class="text-2xl font-bold tracking-tight text-foreground">Settings</h2>
6
- <p class="text-muted font-medium text-sm mt-1">Dashboard configuration and service paths</p>
7
- </div>
8
- </div>
3
+ <div class="flex items-center justify-between mb-8">
4
+ <div>
5
+ <h2 class="text-2xl font-bold tracking-tight text-foreground">Settings</h2>
6
+ <p class="text-muted font-medium text-sm mt-1">Dashboard configuration and service paths</p>
7
+ </div>
8
+ </div>
9
9
 
10
- <div class="stat-card overflow-hidden relative">
11
- <div class="absolute top-0 left-0 w-full h-1 bg-primary/40"></div>
12
- <div class="p-6 border-b border-border/50 bg-black/5 dark:bg-white/5">
13
- <h3 class="form-label !mb-0 font-bold">Application configuration</h3>
14
- </div>
10
+ <!-- Tab Navigation -->
11
+ <div class="flex gap-1 mb-6 p-1 bg-black/5 dark:bg-white/5 rounded-[10px] border border-border/50">
12
+ <button
13
+ @click="settingsTab = 'general'"
14
+ class="flex-1 px-4 py-2.5 text-sm font-semibold rounded-[8px] transition-all"
15
+ :class="settingsTab === 'general'
16
+ ? 'bg-primary text-white shadow-sm'
17
+ : 'text-muted hover:text-foreground hover:bg-black/5 dark:hover:bg-white/5'">
18
+ ⚙️ General Settings
19
+ </button>
20
+ <button
21
+ @click="settingsTab = 'notifications'"
22
+ class="flex-1 px-4 py-2.5 text-sm font-semibold rounded-[8px] transition-all"
23
+ :class="settingsTab === 'notifications'
24
+ ? 'bg-primary text-white shadow-sm'
25
+ : 'text-muted hover:text-foreground hover:bg-black/5 dark:hover:bg-white/5'">
26
+ 🔔 Notifications
27
+ </button>
28
+ </div>
15
29
 
16
- <div class="p-8 space-y-10 bg-background">
17
- <div class="grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-10">
30
+ <!-- Tab Content: General Settings -->
31
+ <div v-show="settingsTab === 'general'" class="space-y-6">
18
32
 
19
- <div class="w-full">
20
- <label class="form-label">Dashboard Port</label>
21
- <input v-model.number="settings.dashboardPort" type="number" class="form-input" placeholder="6443" />
22
- <p class="text-[11px] text-muted mt-2 font-bold tracking-wide uppercase opacity-70">Restart dashboard after changing</p>
23
- </div>
33
+ <!-- Application Configuration Card -->
34
+ <div class="stat-card overflow-hidden relative">
35
+ <div class="absolute top-0 left-0 w-full h-1 bg-primary/40"></div>
36
+ <div class="p-6 border-b border-border/50 bg-black/5 dark:bg-white/5">
37
+ <h3 class="form-label !mb-0 font-bold">Application configuration</h3>
38
+ </div>
24
39
 
25
- <div class="w-full">
26
- <label class="form-label">ACME Email (Let's Encrypt)</label>
27
- <input v-model="settings.acmeEmail" type="email" class="form-input" placeholder="admin@example.com" />
28
- <p class="text-[11px] text-muted mt-2 font-bold tracking-wide uppercase opacity-70">Required for certificate issuance</p>
29
- </div>
40
+ <div class="p-8 space-y-10 bg-background">
41
+ <div class="grid grid-cols-1 md:grid-cols-2 gap-x-8 gap-y-10">
30
42
 
31
- <div class="w-full">
32
- <label class="form-label">Nginx Directory</label>
33
- <input v-model="settings.nginxDir" class="form-input font-mono text-[13px]" placeholder="/etc/nginx" />
34
- <p class="text-[11px] text-muted mt-2 font-bold tracking-wide uppercase opacity-70">Where nginx.conf is located</p>
35
- </div>
43
+ <div class="w-full">
44
+ <label class="form-label">Dashboard Port</label>
45
+ <input v-model.number="settings.dashboardPort" type="number" class="form-input" placeholder="6443" />
46
+ <p class="text-[11px] text-muted mt-2 font-bold tracking-wide uppercase opacity-70">Restart dashboard after changing</p>
47
+ </div>
36
48
 
37
- <div class="w-full">
38
- <label class="form-label">SSL Settings Directory</label>
39
- <input v-model="settings.sslDir" class="form-input font-mono text-[13px]" placeholder="/etc/nginx/ssl" />
40
- <p class="text-[11px] text-muted mt-2 font-bold tracking-wide uppercase opacity-70">Directory for default SSL certs</p>
41
- </div>
49
+ <div class="w-full">
50
+ <label class="form-label">ACME Email (Let's Encrypt)</label>
51
+ <input v-model="settings.acmeEmail" type="email" class="form-input" placeholder="admin@example.com" />
52
+ <p class="text-[11px] text-muted mt-2 font-bold tracking-wide uppercase opacity-70">Required for certificate issuance</p>
53
+ </div>
42
54
 
43
- </div>
55
+ <div class="w-full">
56
+ <label class="form-label">Nginx Directory</label>
57
+ <input v-model="settings.nginxDir" class="form-input font-mono text-[13px]" placeholder="/etc/nginx" />
58
+ <p class="text-[11px] text-muted mt-2 font-bold tracking-wide uppercase opacity-70">Where nginx.conf is located</p>
59
+ </div>
44
60
 
45
- <div class="border-t border-border/50 pt-10">
46
- <div class="w-full max-w-md">
47
- <label class="form-label">New Password</label>
48
- <input v-model="settings.password" type="password" class="form-input" placeholder="Leave blank to keep current" />
49
- </div>
50
- </div>
61
+ <div class="w-full">
62
+ <label class="form-label">SSL Settings Directory</label>
63
+ <input v-model="settings.sslDir" class="form-input font-mono text-[13px]" placeholder="/etc/nginx/ssl" />
64
+ <p class="text-[11px] text-muted mt-2 font-bold tracking-wide uppercase opacity-70">Directory for default SSL certs</p>
65
+ </div>
51
66
 
52
- </div>
67
+ </div>
53
68
 
54
- <!-- Actions area -->
55
- <div class="p-5 border-t border-border bg-black/5 dark:bg-white/5 flex flex-col sm:flex-row sm:items-center justify-between gap-4">
56
- <div class="flex items-center gap-3">
57
- <button @click="saveSettings" :disabled="settings.loading" class="btn btn-primary min-w-[140px] shadow-sm">
58
- <svg v-if="settings.loading" class="w-4 h-4 animate-spin -ml-1 mr-2 inline-block" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>
59
- {{ settings.loading ? 'Saving...' : 'Save Settings' }}
60
- </button>
61
- </div>
62
- <div>
63
- <span v-if="settings.msg" class="text-green-500 text-[13px] font-bold px-3 py-1.5 rounded-[10px] bg-green-500/10 border border-green-500/20">{{ settings.msg }}</span>
64
- <span v-if="settings.error" class="text-red-500 text-[13px] font-bold px-3 py-1.5 rounded-[10px] bg-red-500/10 border border-red-500/20">{{ settings.error }}</span>
65
- </div>
66
- </div>
67
- </div>
69
+ <div class="border-t border-border/50 pt-10">
70
+ <div class="w-full max-w-md">
71
+ <label class="form-label">New Password</label>
72
+ <input v-model="settings.password" type="password" class="form-input" placeholder="Leave blank to keep current" />
73
+ </div>
74
+ </div>
68
75
 
69
- <!-- Backup & Restore card -->
70
- <div class="stat-card overflow-hidden relative mt-6">
71
- <div class="absolute top-0 left-0 w-full h-1 bg-primary/40"></div>
72
- <div class="p-6 border-b border-border/50 bg-black/5 dark:bg-white/5">
73
- <h3 class="form-label !mb-0 font-bold">Backup &amp; Restore</h3>
74
- <p class="text-[11px] text-muted mt-1 font-bold tracking-wide uppercase opacity-70">Export or restore configuration and domains</p>
75
- </div>
76
- <div class="p-8 bg-background flex flex-col sm:flex-row gap-6">
77
- <div class="flex-1">
78
- <p class="text-sm text-muted mb-4">Export all settings and domains as a JSON file. Passwords are excluded from the export.</p>
79
- <button @click="exportBackup" class="btn btn-secondary">
80
- <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"></path></svg>
81
- Export Backup
82
- </button>
83
- </div>
84
- <div class="w-px bg-border hidden sm:block"></div>
85
- <div class="flex-1">
86
- <p class="text-sm text-muted mb-4">Restore configuration from a previously exported backup file.</p>
87
- <label class="btn btn-secondary cursor-pointer" :class="backup.restoring ? 'opacity-50 pointer-events-none' : ''">
88
- <svg v-if="backup.restoring" class="w-4 h-4 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>
89
- <svg v-else class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l4-4m0 0l4 4m-4-4v12"></path></svg>
90
- {{ backup.restoring ? 'Restoring...' : 'Import Backup' }}
91
- <input type="file" accept=".json" class="hidden" @change="importBackup" :disabled="backup.restoring" />
92
- </label>
93
- </div>
94
- </div>
95
- <div v-if="backup.msg || backup.error" class="px-8 pb-6">
96
- <span v-if="backup.msg" class="text-green-500 text-[13px] font-bold px-3 py-1.5 rounded-[10px] bg-green-500/10 border border-green-500/20">{{ backup.msg }}</span>
97
- <span v-if="backup.error" class="text-red-500 text-[13px] font-bold px-3 py-1.5 rounded-[10px] bg-red-500/10 border border-red-500/20">{{ backup.error }}</span>
98
- </div>
99
- </div>
76
+ </div>
100
77
 
101
- <!-- Linux Permissions card (hidden on Windows) -->
102
- <div v-if="settings.platform !== 'win32'" class="stat-card overflow-hidden relative mt-6">
103
- <div class="absolute top-0 left-0 w-full h-1" :class="permissions.configured ? 'bg-green-500/40' : 'bg-yellow-500/40'"></div>
104
- <div class="p-6 border-b border-border/50 bg-black/5 dark:bg-white/5 flex items-center justify-between">
105
- <div>
106
- <h3 class="form-label !mb-0 font-bold">Linux Permissions</h3>
107
- <p class="text-[11px] text-muted mt-1 font-bold tracking-wide uppercase opacity-70">Passwordless sudo for nginx and systemctl</p>
108
- </div>
109
- <span v-if="permissions.configured" class="text-green-500 text-xs font-bold px-2.5 py-1 rounded-lg bg-green-500/10 border border-green-500/20">✓ Configured</span>
110
- <span v-else class="text-yellow-500 text-xs font-bold px-2.5 py-1 rounded-lg bg-yellow-500/10 border border-yellow-500/20">⚠ Required</span>
111
- </div>
112
- <div class="p-8 bg-background">
113
- <p v-if="permissions.configured" class="text-sm text-muted">Passwordless sudo is configured. The dashboard can manage nginx and systemctl without prompting for a password.</p>
114
- <div v-else>
115
- <p class="text-sm text-muted mb-6">The dashboard needs passwordless sudo to control nginx and systemctl. Enter your sudo password once to configure it.</p>
116
- <div class="w-full max-w-md">
117
- <label class="form-label">Sudo Password</label>
118
- <input v-model="permissions.password" type="password" class="form-input" placeholder="Enter your sudo password" @keyup.enter="setupPermissions" />
119
- </div>
120
- </div>
121
- </div>
122
- <div v-if="!permissions.configured" class="p-5 border-t border-border bg-black/5 dark:bg-white/5 flex flex-col sm:flex-row sm:items-center justify-between gap-4">
123
- <button @click="setupPermissions" :disabled="permissions.loading || !permissions.password" class="btn btn-primary min-w-[180px] shadow-sm">
124
- <svg v-if="permissions.loading" class="w-4 h-4 animate-spin -ml-1 mr-2 inline-block" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>
125
- {{ permissions.loading ? 'Setting up...' : 'Setup Permissions' }}
126
- </button>
127
- <div>
128
- <span v-if="permissions.msg" class="text-green-500 text-[13px] font-bold px-3 py-1.5 rounded-[10px] bg-green-500/10 border border-green-500/20">{{ permissions.msg }}</span>
129
- <span v-if="permissions.error" class="text-red-500 text-[13px] font-bold px-3 py-1.5 rounded-[10px] bg-red-500/10 border border-red-500/20">{{ permissions.error }}</span>
130
- </div>
131
- </div>
132
- </div>
78
+ <!-- Actions area -->
79
+ <div class="p-5 border-t border-border bg-black/5 dark:bg-white/5 flex flex-col sm:flex-row sm:items-center justify-between gap-4">
80
+ <div class="flex items-center gap-3">
81
+ <button @click="saveSettings" :disabled="settings.loading" class="btn btn-primary min-w-[140px] shadow-sm">
82
+ <svg v-if="settings.loading" class="w-4 h-4 animate-spin -ml-1 mr-2 inline-block" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>
83
+ {{ settings.loading ? 'Saving...' : 'Save Settings' }}
84
+ </button>
85
+ </div>
86
+ <div>
87
+ <span v-if="settings.msg" class="text-green-500 text-[13px] font-bold px-3 py-1.5 rounded-[10px] bg-green-500/10 border border-green-500/20">{{ settings.msg }}</span>
88
+ <span v-if="settings.error" class="text-red-500 text-[13px] font-bold px-3 py-1.5 rounded-[10px] bg-red-500/10 border border-red-500/20">{{ settings.error }}</span>
89
+ </div>
90
+ </div>
91
+ </div>
92
+
93
+ <!-- Backup & Restore card -->
94
+ <div class="stat-card overflow-hidden relative">
95
+ <div class="absolute top-0 left-0 w-full h-1 bg-primary/40"></div>
96
+ <div class="p-6 border-b border-border/50 bg-black/5 dark:bg-white/5">
97
+ <h3 class="form-label !mb-0 font-bold">Backup &amp; Restore</h3>
98
+ <p class="text-[11px] text-muted mt-1 font-bold tracking-wide uppercase opacity-70">Export or restore configuration and domains</p>
99
+ </div>
100
+ <div class="p-8 bg-background flex flex-col sm:flex-row gap-6">
101
+ <div class="flex-1">
102
+ <p class="text-sm text-muted mb-4">Export all settings and domains as a JSON file. Passwords are excluded from the export.</p>
103
+ <button @click="exportBackup" class="btn btn-secondary">
104
+ <svg class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-4l-4 4m0 0l-4-4m4 4V4"></path></svg>
105
+ Export Backup
106
+ </button>
107
+ </div>
108
+ <div class="w-px bg-border hidden sm:block"></div>
109
+ <div class="flex-1">
110
+ <p class="text-sm text-muted mb-4">Restore configuration from a previously exported backup file.</p>
111
+ <label class="btn btn-secondary cursor-pointer" :class="backup.restoring ? 'opacity-50 pointer-events-none' : ''">
112
+ <svg v-if="backup.restoring" class="w-4 h-4 animate-spin" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>
113
+ <svg v-else class="w-4 h-4" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 16v1a3 3 0 003 3h10a3 3 0 003-3v-1m-4-8l4-4m0 0l4 4m-4-4v12"></path></svg>
114
+ {{ backup.restoring ? 'Restoring...' : 'Import Backup' }}
115
+ <input type="file" accept=".json" class="hidden" @change="importBackup" :disabled="backup.restoring" />
116
+ </label>
117
+ </div>
118
+ </div>
119
+ <div v-if="backup.msg || backup.error" class="px-8 pb-6">
120
+ <span v-if="backup.msg" class="text-green-500 text-[13px] font-bold px-3 py-1.5 rounded-[10px] bg-green-500/10 border border-green-500/20">{{ backup.msg }}</span>
121
+ <span v-if="backup.error" class="text-red-500 text-[13px] font-bold px-3 py-1.5 rounded-[10px] bg-red-500/10 border border-red-500/20">{{ backup.error }}</span>
122
+ </div>
123
+ </div>
124
+
125
+ <!-- Linux Permissions card (hidden on Windows) -->
126
+ <div v-if="settings.platform !== 'win32'" class="stat-card overflow-hidden relative">
127
+ <div class="absolute top-0 left-0 w-full h-1" :class="permissions.configured ? 'bg-green-500/40' : 'bg-yellow-500/40'"></div>
128
+ <div class="p-6 border-b border-border/50 bg-black/5 dark:bg-white/5 flex items-center justify-between">
129
+ <div>
130
+ <h3 class="form-label !mb-0 font-bold">Linux Permissions</h3>
131
+ <p class="text-[11px] text-muted mt-1 font-bold tracking-wide uppercase opacity-70">Passwordless sudo for nginx and systemctl</p>
132
+ </div>
133
+ <span v-if="permissions.configured" class="text-green-500 text-xs font-bold px-2.5 py-1 rounded-lg bg-green-500/10 border border-green-500/20">✓ Configured</span>
134
+ <span v-else class="text-yellow-500 text-xs font-bold px-2.5 py-1 rounded-lg bg-yellow-500/10 border border-yellow-500/20">⚠ Required</span>
135
+ </div>
136
+ <div class="p-8 bg-background">
137
+ <p v-if="permissions.configured" class="text-sm text-muted">Passwordless sudo is configured. The dashboard can manage nginx and systemctl without prompting for a password.</p>
138
+ <div v-else>
139
+ <p class="text-sm text-muted mb-6">The dashboard needs passwordless sudo to control nginx and systemctl. Enter your sudo password once to configure it.</p>
140
+ <div class="w-full max-w-md">
141
+ <label class="form-label">Sudo Password</label>
142
+ <input v-model="permissions.password" type="password" class="form-input" placeholder="Enter your sudo password" @keyup.enter="setupPermissions" />
143
+ </div>
144
+ </div>
145
+ </div>
146
+ <div v-if="!permissions.configured" class="p-5 border-t border-border bg-black/5 dark:bg-white/5 flex flex-col sm:flex-row sm:items-center justify-between gap-4">
147
+ <button @click="setupPermissions" :disabled="permissions.loading || !permissions.password" class="btn btn-primary min-w-[180px] shadow-sm">
148
+ <svg v-if="permissions.loading" class="w-4 h-4 animate-spin -ml-1 mr-2 inline-block" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>
149
+ {{ permissions.loading ? 'Setting up...' : 'Setup Permissions' }}
150
+ </button>
151
+ <div>
152
+ <span v-if="permissions.msg" class="text-green-500 text-[13px] font-bold px-3 py-1.5 rounded-[10px] bg-green-500/10 border border-green-500/20">{{ permissions.msg }}</span>
153
+ <span v-if="permissions.error" class="text-red-500 text-[13px] font-bold px-3 py-1.5 rounded-[10px] bg-red-500/10 border border-red-500/20">{{ permissions.error }}</span>
154
+ </div>
155
+ </div>
156
+ </div>
157
+ </div>
158
+
159
+ <!-- Tab Content: Notifications -->
160
+ <div v-show="settingsTab === 'notifications'" class="space-y-6">
161
+
162
+ <!-- Notification Channels card -->
163
+ <div class="stat-card overflow-hidden relative">
164
+ <div class="absolute top-0 left-0 w-full h-1 bg-primary/40"></div>
165
+ <div class="p-6 border-b border-border/50 bg-black/5 dark:bg-white/5 flex items-center justify-between">
166
+ <div>
167
+ <h3 class="form-label !mb-0 font-bold">Notification Channels</h3>
168
+ <p class="text-[11px] text-muted mt-1 font-bold tracking-wide uppercase opacity-70">Named Discord and Telegram channels — assign to domains per event</p>
169
+ </div>
170
+ <button @click="openAddChannel()" class="btn btn-primary btn-sm shrink-0">+ Add Channel</button>
171
+ </div>
172
+
173
+ <div class="p-6 bg-background">
174
+ <div v-if="channels.loading" class="text-muted text-sm py-4 text-center">Loading...</div>
175
+
176
+ <div v-else-if="channels.list.length === 0" class="text-center py-10">
177
+ <p class="text-muted text-sm">No channels configured yet.</p>
178
+ <p class="text-muted text-xs mt-1 opacity-70">Add a Discord webhook or Telegram bot to start receiving notifications.</p>
179
+ </div>
180
+
181
+ <div v-else class="space-y-3">
182
+ <div v-for="ch in channels.list" :key="ch.id"
183
+ class="flex items-center justify-between p-4 border border-border/60 rounded-[12px] bg-black/5 dark:bg-white/5">
184
+ <div class="flex items-center gap-3 min-w-0">
185
+ <span class="text-[11px] font-bold px-2 py-0.5 rounded-md shrink-0"
186
+ :class="ch.type === 'discord' ? 'bg-indigo-500/20 text-indigo-400' : 'bg-sky-500/20 text-sky-400'">
187
+ {{ ch.type === 'discord' ? 'Discord' : 'Telegram' }}
188
+ </span>
189
+ <span class="text-sm font-semibold text-foreground truncate">{{ ch.name }}</span>
190
+ <span v-if="ch.message" class="text-[10px] text-muted opacity-60 truncate">{{ ch.message.substring(0, 30) }}{{ ch.message.length > 30 ? '...' : '' }}</span>
191
+ </div>
192
+ <div class="flex items-center gap-2 shrink-0 ml-3">
193
+ <span v-if="channels.testResults[ch.id]?.msg" class="text-green-500 text-xs font-medium">{{ channels.testResults[ch.id].msg }}</span>
194
+ <span v-if="channels.testResults[ch.id]?.error" class="text-red-500 text-xs font-medium">{{ channels.testResults[ch.id].error }}</span>
195
+ <button @click="testChannelById(ch.id)" :disabled="channels.testingId === ch.id" class="btn btn-secondary btn-sm">
196
+ <svg v-if="channels.testingId === ch.id" class="w-3 h-3 animate-spin inline-block mr-1" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>
197
+ Test
198
+ </button>
199
+ <button @click="openEditChannel(ch)" class="btn btn-secondary btn-sm">Edit</button>
200
+ <button @click="deleteChannel(ch.id)" class="btn btn-danger btn-sm">Delete</button>
201
+ </div>
202
+ </div>
203
+ </div>
204
+ </div>
205
+ </div>
206
+ </div>
207
+
208
+ <!-- Channel Add/Edit Modal -->
209
+ <div v-if="channelModal.open" class="fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6 modal-overlay">
210
+ <div class="relative w-full max-w-lg flex flex-col modal-card">
211
+ <div class="flex items-center justify-between p-5 border-b border-border shrink-0" style="background: rgba(0,0,0,0.1)">
212
+ <h3 class="font-bold text-[15px] text-foreground tracking-tight">
213
+ {{ channelModal.editing ? 'Edit Channel' : 'Add Channel' }}
214
+ </h3>
215
+ <button @click="channelModal.open = false" class="btn btn-secondary btn-sm">Cancel</button>
216
+ </div>
217
+ <div class="p-6 space-y-5 bg-background">
218
+
219
+ <div>
220
+ <label class="form-label">Name</label>
221
+ <input v-model="channelModal.form.name" type="text" class="form-input" placeholder="e.g. Production Discord" />
222
+ </div>
223
+
224
+ <div v-if="!channelModal.editing">
225
+ <label class="form-label">Type</label>
226
+ <div class="flex gap-6">
227
+ <label class="flex items-center gap-2 cursor-pointer">
228
+ <input type="radio" v-model="channelModal.form.type" value="discord" class="text-primary" />
229
+ <span class="text-sm font-bold">Discord</span>
230
+ </label>
231
+ <label class="flex items-center gap-2 cursor-pointer">
232
+ <input type="radio" v-model="channelModal.form.type" value="telegram" class="text-primary" />
233
+ <span class="text-sm font-bold">Telegram</span>
234
+ </label>
235
+ </div>
236
+ </div>
237
+
238
+ <div v-if="channelModal.form.type === 'discord'">
239
+ <label class="form-label">Webhook URL</label>
240
+ <input v-model="channelModal.form.webhookUrl" type="text" class="form-input font-mono text-sm" placeholder="https://discord.com/api/webhooks/..." />
241
+ </div>
242
+
243
+ <template v-if="channelModal.form.type === 'telegram'">
244
+ <div>
245
+ <label class="form-label">Bot Token</label>
246
+ <input v-model="channelModal.form.botToken" type="text" class="form-input font-mono text-sm" placeholder="123456:ABCdef..." />
247
+ </div>
248
+ <div>
249
+ <label class="form-label">Chat ID</label>
250
+ <input v-model="channelModal.form.chatId" type="text" class="form-input font-mono text-sm" placeholder="100123456789" />
251
+ </div>
252
+ </template>
253
+
254
+ <!-- Message Prefix Field (Discord only) -->
255
+ <div v-if="channelModal.form.type === 'discord'">
256
+ <label class="form-label">Message Prefix <span class="text-muted font-normal">(optional)</span></label>
257
+ <input v-model="channelModal.form.message" type="text" class="form-input" placeholder="e.g. <@&1280907071813976196> or @team" />
258
+ <div class="mt-2 p-3 bg-primary/5 border border-primary/20 rounded-[8px]">
259
+ <p class="text-[11px] text-muted">
260
+ 💡 <span class="font-semibold text-foreground">Tip:</span> To mention a Discord role, use <code class="px-1 py-0.5 bg-black/10 dark:bg-white/10 rounded text-[10px]">&lt;@&amp;RoleId&gt;</code>
261
+ <span class="opacity-70">— Example: <code class="px-1 py-0.5 bg-black/10 dark:bg-white/10 rounded text-[10px]">&lt;@&amp;1280907071813976196&gt;</code> will ping that role on every alert.</span>
262
+ </p>
263
+ </div>
264
+ </div>
265
+
266
+ <p v-if="channelModal.error" class="text-red-500 text-[13px] font-semibold">{{ channelModal.error }}</p>
267
+ </div>
268
+ <div class="p-5 border-t border-border bg-black/5 dark:bg-white/5 flex justify-end gap-3">
269
+ <button @click="channelModal.open = false" class="btn btn-secondary">Cancel</button>
270
+ <button @click="saveChannel()" :disabled="channelModal.saving" class="btn btn-primary min-w-[100px]">
271
+ <svg v-if="channelModal.saving" class="w-4 h-4 animate-spin -ml-1 mr-2 inline-block" fill="none" viewBox="0 0 24 24"><circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle><path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path></svg>
272
+ {{ channelModal.saving ? 'Saving...' : 'Save' }}
273
+ </button>
274
+ </div>
275
+ </div>
276
+ </div>
133
277
  </div>
@@ -6,7 +6,7 @@
6
6
  <div class="h-16 border-b border-border flex items-center shrink-0 overflow-hidden"
7
7
  :class="sidebarCollapsed ? 'justify-center px-0' : 'px-5 gap-3'">
8
8
  <div class="w-8 h-8 rounded-[10px] shrink-0 flex items-center justify-center overflow-hidden">
9
- <img src="/img/icon.png" alt="Easy DevOps" class="w-8 h-8 object-contain" />
9
+ <img src="/img/icon_b.png" alt="Easy DevOps" class="w-8 h-8 object-contain" />
10
10
  </div>
11
11
  <div class="whitespace-nowrap transition-opacity duration-300"
12
12
  :class="sidebarCollapsed ? 'opacity-0 w-0' : 'opacity-100'">