easy-devops 1.1.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.
- package/README.md +2 -2
- package/package.json +6 -3
- package/src/cli/index.js +13 -1
- package/src/cli/menus/dashboard.js +1 -1
- package/src/core/channels/discord.js +77 -0
- package/src/core/channels/telegram.js +120 -0
- package/src/core/db.js +8 -1
- package/src/core/domainNotifier.js +298 -0
- package/src/core/events.js +130 -0
- package/src/core/notifier.js +73 -0
- package/src/core/shell.js +59 -7
- package/src/dashboard/controllers/authController.js +29 -0
- package/src/dashboard/controllers/domainsController.js +416 -0
- package/src/dashboard/controllers/nginxController.js +128 -0
- package/src/dashboard/controllers/settingsController.js +335 -0
- package/src/dashboard/controllers/sslController.js +291 -0
- package/src/dashboard/public/img/icon.png +0 -0
- package/src/dashboard/public/img/icon_b.png +0 -0
- package/src/dashboard/public/js/app.js +234 -2
- package/src/dashboard/routes/auth.js +12 -22
- package/src/dashboard/routes/domains.js +11 -363
- package/src/dashboard/routes/nginx.js +13 -146
- package/src/dashboard/routes/settings.js +16 -189
- package/src/dashboard/routes/ssl.js +9 -276
- package/src/dashboard/server.js +24 -27
- package/src/dashboard/socketManager.js +282 -0
- package/src/dashboard/views/index.ejs +52 -0
- package/src/dashboard/views/partials/domain-form.ejs +64 -1
- package/src/dashboard/views/partials/domains-panel.ejs +4 -0
- package/src/dashboard/views/partials/login.ejs +1 -1
- package/src/dashboard/views/partials/logs-panel.ejs +67 -0
- package/src/dashboard/views/partials/settings-panel.ejs +263 -87
- package/src/dashboard/views/partials/sidebar.ejs +3 -1
- /package/src/{dashboard/routes → core/channels}/.gitkeep +0 -0
|
@@ -1,101 +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
|
-
|
|
11
|
-
<div class="
|
|
12
|
-
<
|
|
13
|
-
|
|
14
|
-
|
|
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
|
-
|
|
17
|
-
<div
|
|
30
|
+
<!-- Tab Content: General Settings -->
|
|
31
|
+
<div v-show="settingsTab === 'general'" class="space-y-6">
|
|
18
32
|
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
</
|
|
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="
|
|
26
|
-
<
|
|
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">
|
|
33
|
-
<input v-model="settings.
|
|
34
|
-
<p class="text-[11px] text-muted mt-2 font-bold tracking-wide uppercase opacity-70">
|
|
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">
|
|
39
|
-
<input v-model="settings.
|
|
40
|
-
<p class="text-[11px] text-muted mt-2 font-bold tracking-wide uppercase opacity-70">
|
|
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
|
-
|
|
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="
|
|
46
|
-
<
|
|
47
|
-
<
|
|
48
|
-
<
|
|
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
|
-
|
|
55
|
-
<div class="
|
|
56
|
-
<
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
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
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
</div>
|
|
76
|
+
</div>
|
|
77
|
+
|
|
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 & 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]"><@&RoleId></code>
|
|
261
|
+
<span class="opacity-70">— Example: <code class="px-1 py-0.5 bg-black/10 dark:bg-white/10 rounded text-[10px]"><@&1280907071813976196></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>
|
|
101
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/
|
|
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'">
|
|
@@ -39,6 +39,8 @@
|
|
|
39
39
|
<svg v-if="item.id === 'ssl'" class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 15v2m-6 4h12a2 2 0 002-2v-6a2 2 0 00-2-2H6a2 2 0 00-2 2v6a2 2 0 002 2zm10-10V7a4 4 0 00-8 0v4h8z"></path></svg>
|
|
40
40
|
<!-- Domains -->
|
|
41
41
|
<svg v-if="item.id === 'domains'" class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 01-9 9m9-9a9 9 0 00-9-9m9 9H3m9 9a9 9 0 01-9-9m9 9c1.657 0 3-4.03 3-9s-1.343-9-3-9m0 18c-1.657 0-3-4.03-3-9s1.343-9 3-9m-9 9a9 9 0 019-9"></path></svg>
|
|
42
|
+
<!-- Logs -->
|
|
43
|
+
<svg v-if="item.id === 'logs'" class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M9 12h6m-6 4h6m2 5H7a2 2 0 01-2-2V5a2 2 0 012-2h5.586a1 1 0 01.707.293l5.414 5.414a1 1 0 01.293.707V19a2 2 0 01-2 2z"></path></svg>
|
|
42
44
|
<!-- Settings -->
|
|
43
45
|
<svg v-if="item.id === 'settings'" class="w-5 h-5" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M15 12a3 3 0 11-6 0 3 3 0 016 0z"></path></svg>
|
|
44
46
|
</div>
|
|
File without changes
|