easy-devops 0.2.6 → 1.0.0

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,66 +1,104 @@
1
1
  <!-- Domains List Page -->
2
- <div v-show="page === 'domains'" class="max-w-6xl mx-auto">
3
- <div class="flex items-center justify-between mb-2">
4
- <h2 class="text-2xl font-bold">Domains</h2>
5
- <button @click="toggleDomainForm()" class="btn btn-primary">
6
- <svg v-if="!domains.showForm" class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
7
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4" />
8
- </svg>
9
- {{ domains.showForm ? 'Cancel' : 'Add Domain' }}
10
- </button>
11
- </div>
12
- <p class="text-slate-400 mb-8">Nginx reverse proxy configurations</p>
2
+ <div v-show="page === 'domains'" class="w-full">
3
+ <div class="flex items-center justify-between mb-8">
4
+ <div>
5
+ <h2 class="text-2xl font-bold tracking-tight text-foreground">Domains</h2>
6
+ <p class="text-muted font-medium text-sm mt-1">Nginx reverse proxy configurations</p>
7
+ </div>
8
+ <button @click="toggleDomainForm()" class="btn btn-primary">
9
+ <svg v-if="!domains.showForm" class="w-4 h-4 mr-1" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 4v16m8-8H4"></path></svg>
10
+ {{ domains.showForm ? 'Cancel' : 'Add Domain' }}
11
+ </button>
12
+ </div>
13
+
14
+ <!-- Domain Form Modal / Drawer Equivalent -->
15
+ <%- include('domain-form.ejs') %>
16
+
17
+ <!-- Data Display -->
18
+ <div v-if="domains.loading" class="text-muted text-sm flex items-center gap-2">
19
+ <!-- Skeleton loader instead of spinner -->
20
+ <div class="w-full flex flex-col gap-2">
21
+ <div class="h-16 w-full animate-pulse-fx stat-card"></div>
22
+ <div class="h-16 w-full animate-pulse-fx stat-card"></div>
23
+ <div class="h-16 w-full animate-pulse-fx stat-card"></div>
24
+ </div>
25
+ </div>
26
+
27
+ <div v-else-if="domains.list.length === 0" class="stat-card p-16 text-center relative overflow-hidden">
28
+ <div class="absolute top-0 left-0 w-full h-1 bg-primary/40"></div>
29
+ <div class="flex justify-center mb-4">
30
+ <div class="w-16 h-16 rounded-full flex items-center justify-center text-white shadow-lg" style="background: rgba(var(--color-primary-rgb), 0.1); color: var(--color-primary);">
31
+ <svg class="w-8 h-8" 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>
32
+ </div>
33
+ </div>
34
+ <h3 class="text-lg font-semibold text-foreground">No Domains Yet</h3>
35
+ <p class="text-muted text-sm mt-2 max-w-sm mx-auto">Get started by adding your first domain structure to the proxy.</p>
36
+ <button @click="toggleDomainForm()" class="btn btn-primary mt-6">Add Domain</button>
37
+ </div>
38
+
39
+ <div v-else class="stat-card overflow-hidden flex flex-col">
40
+ <!-- Headers pseudo-row -->
41
+ <div class="flex items-center px-6 py-3 border-b border-border bg-black/5 dark:bg-white/5">
42
+ <div class="w-8 shrink-0"></div> <!-- for status dot -->
43
+ <div class="flex-1 form-label !mb-0 text-left">Domain / Target</div>
44
+ <div class="w-48 form-label !mb-0 text-left">Tags</div>
45
+ <div class="w-32 form-label !mb-0 text-right pr-2">Actions</div>
46
+ </div>
13
47
 
14
- <!-- Domain Form (included from domain-form.ejs) -->
15
- <%- include('domain-form.ejs') %>
48
+ <!-- Domain List Rows -->
49
+ <div v-for="d in domains.list" :key="d.name" class="domain-row group" :class="d.enabled === false ? 'opacity-50 grayscale' : ''">
50
+ <!-- Status Dot -->
51
+ <div class="w-8 shrink-0 flex items-center justify-center -ml-1">
52
+ <div class="status-dot" :class="d.enabled === false ? 'inactive' : 'active'"></div>
53
+ </div>
54
+
55
+ <!-- Domain & Backend -->
56
+ <div class="flex-1 min-w-0 pr-4">
57
+ <div class="font-mono text-[14px] font-semibold text-foreground truncate flex items-center gap-2">
58
+ {{ d.name }}
59
+ <span v-if="d.www" class="badge badge-neutral">www</span>
60
+ </div>
61
+ <div class="font-mono text-[11px] text-muted mt-1 truncate">
62
+ <svg class="inline-block w-3 h-3 mr-1 opacity-70" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z"></path></svg>
63
+ <span v-if="/^https?:\/\//i.test(d.backendHost || '')">{{ d.backendHost }}</span>
64
+ <span v-else>{{ d.upstreamType || 'http' }}://{{ d.backendHost || '127.0.0.1' }}:{{ d.port }}</span>
65
+ </div>
66
+ </div>
67
+
68
+ <!-- Badges Stack -->
69
+ <div class="w-48 flex items-center flex-wrap gap-1.5 shrink-0">
70
+ <!-- Wildcard Badge -->
71
+ <span v-if="d.wildcard" class="badge badge-purple">Wildcard</span>
16
72
 
17
- <!-- Domain List -->
18
- <div v-if="domains.loading" class="text-slate-500">Loading...</div>
19
- <div v-else-if="domains.list.length === 0" class="card p-12 text-center">
20
- <p class="text-slate-500">No domains configured. Click "Add Domain" to get started.</p>
21
- </div>
22
- <div v-else class="card overflow-hidden">
23
- <table class="data-table">
24
- <thead>
25
- <tr>
26
- <th>Domain</th>
27
- <th>Port</th>
28
- <th>Type</th>
29
- <th>SSL</th>
30
- <th>Cert</th>
31
- <th class="text-right">Actions</th>
32
- </tr>
33
- </thead>
34
- <tbody>
35
- <tr v-for="d in domains.list" :key="d.name">
36
- <td class="font-mono font-medium">{{ d.name }}</td>
37
- <td class="font-mono text-slate-400">:{{ d.port }}</td>
38
- <td><span class="badge badge-neutral">{{ (d.upstreamType || 'http').toUpperCase() }}</span></td>
39
- <td>
40
- <span :class="d.ssl?.enabled ? 'badge badge-success' : 'badge badge-neutral'">
41
- {{ d.ssl?.enabled ? 'HTTPS' : 'HTTP' }}
42
- </span>
43
- </td>
44
- <td class="font-mono text-slate-400">
45
- {{ d.daysLeft != null ? d.daysLeft + 'd' : '—' }}
46
- </td>
47
- <td class="text-right">
48
- <div class="flex justify-end gap-2">
49
- <button @click="editDomain(d.name)" class="btn btn-secondary btn-sm">Edit</button>
50
- <button @click="reloadDomain(d.name)" class="btn btn-secondary btn-sm btn-icon" title="Reload">
51
- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
52
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
53
- </svg>
54
- </button>
55
- <button @click="deleteDomain(d.name)" class="btn btn-danger btn-sm btn-icon" title="Delete">
56
- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
57
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
58
- </svg>
59
- </button>
60
- </div>
61
- </td>
62
- </tr>
63
- </tbody>
64
- </table>
65
- </div>
73
+ <!-- SSL Badge -->
74
+ <span v-if="d.ssl?.enabled" class="badge"
75
+ :class="d.daysLeft > 30 ? 'badge-success' : (d.daysLeft >= 10 ? 'badge-warning' : 'badge-danger')">
76
+ SSL: {{ d.daysLeft != null ? d.daysLeft + 'd' : 'Wait' }}
77
+ </span>
78
+ <span v-else class="badge badge-neutral">HTTP Only</span>
79
+ </div>
80
+
81
+ <!-- Actions (appear on hover via .domain-actions in CSS) -->
82
+ <div class="w-32 flex justify-end gap-1.5 shrink-0 domain-actions">
83
+ <!-- Toggle button -->
84
+ <button @click="toggleDomain(d.name)" class="btn btn-secondary btn-icon text-muted hover:text-foreground" :title="d.enabled === false ? 'Enable' : 'Disable'">
85
+ <svg v-if="d.enabled === false" 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="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z"></path><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
86
+ <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="M10 9v6m4-6v6m7-3a9 9 0 11-18 0 9 9 0 0118 0z"></path></svg>
87
+ </button>
88
+ <!-- Reload button -->
89
+ <button @click="reloadDomain(d.name)" class="btn btn-secondary btn-icon text-muted hover:text-foreground" title="Reload Nginx config for this domain">
90
+ <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 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"></path></svg>
91
+ </button>
92
+ <!-- Edit button -->
93
+ <button @click="editDomain(d.name)" class="btn btn-secondary btn-icon text-muted hover:text-primary" title="Edit Domain">
94
+ <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="M11 5H6a2 2 0 00-2 2v11a2 2 0 002 2h11a2 2 0 002-2v-5m-1.414-9.414a2 2 0 112.828 2.828L11.828 15H9v-2.828l8.586-8.586z"></path></svg>
95
+ </button>
96
+ <!-- Delete button -->
97
+ <button @click="deleteDomain(d.name)" class="btn btn-danger btn-icon text-muted" title="Delete Domain">
98
+ <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="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16"></path></svg>
99
+ </button>
100
+ </div>
101
+
102
+ </div>
103
+ </div>
66
104
  </div>
@@ -1,50 +1,167 @@
1
+
1
2
  <!-- Login Page -->
2
- <div v-if="!authenticated" class="min-h-screen flex items-center justify-center p-4">
3
- <div class="w-full max-w-md">
4
- <div class="text-center mb-10">
5
- <div class="inline-flex items-center justify-center w-16 h-16 rounded-2xl bg-gradient-to-br from-brand-400 to-brand-600 mb-4">
6
- <svg class="w-8 h-8 text-white" fill="none" viewBox="0 0 24 24" stroke="currentColor">
7
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />
8
- </svg>
3
+ <div
4
+ v-if="!authenticated"
5
+ style="
6
+ width: 100%;
7
+ flex: 1;
8
+ min-height: 100vh;
9
+ display: flex;
10
+ align-items: center;
11
+ justify-content: center;
12
+ padding: 24px;
13
+ position: relative;
14
+ overflow: hidden;
15
+ background: var(--color-bg);
16
+ "
17
+ >
18
+ <!-- Background Layers -->
19
+ <!-- Layer 1: Large slow orb -->
20
+ <div style="
21
+ position: absolute; width: 600px; height: 600px;
22
+ background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
23
+ opacity: 0.12;
24
+ filter: blur(80px);
25
+ animation: float-orb1 12s ease-in-out infinite alternate;
26
+ top: -100px; left: -100px;
27
+ pointer-events: none;
28
+ "></div>
29
+
30
+ <!-- Layer 2: Second orb -->
31
+ <div style="
32
+ position: absolute; width: 400px; height: 400px;
33
+ background: radial-gradient(circle, var(--color-primary) 0%, transparent 70%);
34
+ opacity: 0.08;
35
+ filter: blur(60px);
36
+ animation: float-orb2 16s ease-in-out infinite alternate;
37
+ bottom: -80px; right: -80px;
38
+ pointer-events: none;
39
+ "></div>
40
+
41
+ <!-- Layer 3: Subtle grid/dot pattern overlay -->
42
+ <div style="
43
+ position: absolute; inset: 0;
44
+ opacity: 0.03;
45
+ background-image: radial-gradient(circle, white 1px, transparent 1px);
46
+ background-size: 32px 32px;
47
+ pointer-events: none;
48
+ "></div>
49
+
50
+ <!-- Content Wrapper -->
51
+ <div style="
52
+ width: 100%;
53
+ max-width: 420px;
54
+ display: flex;
55
+ flex-direction: column;
56
+ align-items: center;
57
+ position: relative;
58
+ z-index: 10;
59
+ ">
60
+
61
+ <!-- Logo & Title Section -->
62
+ <div style="text-align: center; margin-bottom: 40px; animation: logo-enter 600ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;">
63
+ <div style="
64
+ display: inline-flex; align-items: center; justify-content: center;
65
+ width: 72px; height: 72px;
66
+ border-radius: 18px;
67
+ border: 1px solid rgba(255,255,255,0.10);
68
+ box-shadow:
69
+ 0 0 0 1px rgba(var(--color-primary-rgb), 0.2),
70
+ 0 0 30px rgba(var(--color-primary-rgb), 0.25),
71
+ 0 0 60px rgba(var(--color-primary-rgb), 0.10);
72
+ transition: transform 300ms ease;
73
+ overflow: hidden;
74
+ "
75
+ onmouseover="this.style.transform='scale(1.05)'"
76
+ onmouseout="this.style.transform='scale(1)'">
77
+ <img src="/img/icon.png" alt="Easy DevOps" style="width: 72px; height: 72px; object-fit: contain;" />
9
78
  </div>
10
- <h1 class="text-2xl font-bold text-white">Easy DevOps</h1>
11
- <p class="text-slate-400 mt-2">Sign in to access your dashboard</p>
79
+ <h1 style="
80
+ font-size: 26px;
81
+ font-weight: 700;
82
+ letter-spacing: -0.02em;
83
+ color: var(--color-text);
84
+ margin-top: 16px;
85
+ margin-bottom: 0;
86
+ ">Easy DevOps</h1>
87
+ <p style="
88
+ font-size: 13px;
89
+ color: var(--color-muted);
90
+ margin-top: 6px;
91
+ letter-spacing: 0.01em;
92
+ margin-bottom: 0;
93
+ ">Sign in to access your dashboard</p>
12
94
  </div>
13
95
 
14
- <div class="card p-8">
15
- <div class="space-y-5">
16
- <div class="input-group">
17
- <input v-model="login.password" type="password" placeholder=" " @keyup.enter="doLogin" />
18
- <label>Password</label>
19
- </div>
20
-
21
- <p v-if="login.error" class="text-red-400 text-sm flex items-center gap-2">
22
- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
23
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
24
- </svg>
25
- {{ login.error }}
26
- </p>
27
-
28
- <button @click="doLogin" :disabled="login.loading" class="btn btn-primary w-full">
29
- <svg v-if="login.loading" class="w-4 h-4 animate-spin" fill="none" viewBox="0 0 24 24">
30
- <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
31
- <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path>
32
- </svg>
33
- {{ login.loading ? 'Signing in...' : 'Sign In' }}
34
- </button>
96
+ <!-- Login Card -->
97
+ <div class="login-card w-full text-left" style="animation: card-enter 500ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;">
98
+ <div class="mb-6">
99
+ <label class="login-label">Password</label>
100
+ <input v-model="login.password" type="password" class="login-input" placeholder="Enter dashboard password" @keyup.enter="doLogin" />
101
+ </div>
102
+
103
+ <div v-if="login.error" style="
104
+ padding: 12px; margin-bottom: 24px;
105
+ background: rgba(239, 68, 68, 0.1);
106
+ border-left: 3px solid #ef4444;
107
+ color: #ef4444;
108
+ font-size: 13px; font-weight: 600;
109
+ display: flex; align-items: center; gap: 8px;
110
+ border-radius: 10px;
111
+ ">
112
+ <svg style="width: 16px; height: 16px; flex-shrink: 0;" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
113
+ {{ login.error }}
35
114
  </div>
36
115
 
37
- <p class="text-center text-xs text-slate-500 mt-6">No password set? Leave blank and press Sign In.</p>
116
+ <button @click="doLogin" :disabled="login.loading" class="login-btn gap-2">
117
+ <svg v-if="login.loading" class="w-4 h-4 animate-spin inline-block -ml-1" fill="none" viewBox="0 0 24 24">
118
+ <circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
119
+ <path class="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z"></path>
120
+ </svg>
121
+ {{ login.loading ? 'Signing in...' : 'Sign In' }}
122
+ </button>
123
+
124
+ <p style="
125
+ text-align: center; font-size: 12px; color: var(--color-muted);
126
+ margin-top: 24px; margin-bottom: 0; font-weight: 500;
127
+ ">No password set? Leave blank and press Sign In.</p>
38
128
  </div>
39
129
 
40
- <button @click="toggleTheme" class="mx-auto mt-6 flex items-center gap-2 text-sm text-slate-500 hover:text-slate-300 transition">
41
- <svg v-if="isDark" class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
42
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z" />
43
- </svg>
44
- <svg v-else class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
45
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" />
46
- </svg>
47
- {{ isDark ? 'Light mode' : 'Dark mode' }}
48
- </button>
130
+ <!-- Bottom Theme Controls (Pill) -->
131
+ <div style="
132
+ display: inline-flex;
133
+ align-items: center;
134
+ gap: 12px;
135
+ padding: 8px 16px;
136
+ background: rgba(255,255,255,0.04);
137
+ border: 1px solid rgba(255,255,255,0.06);
138
+ border-radius: 999px;
139
+ backdrop-filter: blur(12px);
140
+ -webkit-backdrop-filter: blur(12px);
141
+ margin-top: 32px;
142
+ animation: card-enter 700ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
143
+ opacity: 0;
144
+ ">
145
+ <button @click="toggleTheme" class="theme-toggle-btn">
146
+ <svg v-if="isDark" style="width: 14px; height: 14px;" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z" /></svg>
147
+ <svg v-else style="width: 14px; height: 14px;" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" /></svg>
148
+ <!-- {{ isDark ? 'Light mode' : 'Dark mode' }} -->
149
+ </button>
150
+
151
+ <div style="width: 1px; height: 14px; background: rgba(255,255,255,0.15);"></div>
152
+
153
+ <div style="display: flex; align-items: center; gap: 8px;">
154
+ <button v-for="color in ['teal', 'violet', 'amber', 'rose', 'cyan']" :key="color"
155
+ @click="setAccent(color)"
156
+ class="theme-accent-circle"
157
+ :class="{ 'active': accent === color }"
158
+ :style="{
159
+ 'background-color': color === 'teal' ? '#d64a29' : color === 'violet' ? '#7C3AED' : color === 'amber' ? '#D97706' : color === 'rose' ? '#E11D48' : '#0891B2',
160
+ 'color': color === 'teal' ? '#0D9488' : color === 'violet' ? '#7C3AED' : color === 'amber' ? '#D97706' : color === 'rose' ? '#E11D48' : '#0891B2'
161
+ }"
162
+ title="Change accent">
163
+ </button>
164
+ </div>
165
+ </div>
49
166
  </div>
50
167
  </div>
@@ -1,90 +1,132 @@
1
1
  <!-- Nginx Page -->
2
- <div v-show="page === 'nginx'" class="max-w-6xl mx-auto">
3
- <div class="flex items-center justify-between mb-2">
4
- <h2 class="text-2xl font-bold">Nginx</h2>
5
- <button @click="loadNginxStatus" class="btn btn-secondary btn-sm">
6
- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
7
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
8
- </svg>
9
- Refresh
10
- </button>
11
- </div>
12
- <p class="text-slate-400 mb-8">Control, configure and monitor nginx</p>
2
+ <div v-show="page === 'nginx'" class="w-full">
3
+ <div class="flex items-center justify-between mb-8">
4
+ <div>
5
+ <h2 class="text-2xl font-bold tracking-tight text-foreground">Nginx</h2>
6
+ <p class="text-muted font-medium text-sm mt-1">Control, configure and monitor nginx</p>
7
+ </div>
8
+ <button @click="loadNginxStatus" class="btn btn-secondary">
9
+ <svg class="w-4 h-4 mr-1.5" fill="none" viewBox="0 0 24 24" stroke="currentColor">
10
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
11
+ </svg>
12
+ Refresh
13
+ </button>
14
+ </div>
13
15
 
14
- <!-- Status Bar -->
15
- <div class="card p-6 mb-6">
16
- <div class="flex items-center justify-between flex-wrap gap-4">
17
- <div class="flex items-center gap-4">
18
- <span :class="nginx.status?.running ? 'status-dot online' : 'status-dot offline'" class="w-4 h-4"></span>
19
- <div>
20
- <span class="text-xl font-semibold">{{ nginx.status?.running ? 'Running' : 'Stopped' }}</span>
21
- <span v-if="nginx.status?.version" class="text-slate-400 ml-2 font-mono text-sm">{{ nginx.status.version }}</span>
22
- </div>
23
- </div>
24
- <div class="flex gap-2">
25
- <button v-if="!nginx.status?.running" @click="nginxAction('start')" class="btn btn-primary">
26
- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
27
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z" />
28
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" />
29
- </svg>
30
- Start
31
- </button>
32
- <template v-else>
33
- <button @click="nginxAction('reload')" class="btn btn-primary btn-sm">Reload</button>
34
- <button @click="nginxAction('restart')" class="btn btn-secondary btn-sm">Restart</button>
35
- <button @click="nginxAction('stop')" class="btn btn-danger btn-sm">Stop</button>
36
- </template>
37
- <button @click="nginxAction('test')" class="btn btn-secondary btn-sm">Test Config</button>
38
- </div>
39
- </div>
16
+ <div class="flex flex-col gap-6 pb-12">
17
+ <!-- Status Bar -->
18
+ <div class="stat-card p-6 relative overflow-hidden">
19
+ <div class="absolute top-0 left-0 w-full h-1 bg-primary/40"></div>
20
+ <div class="flex flex-col sm:flex-row sm:items-center justify-between gap-6">
21
+ <div class="flex items-center gap-4">
22
+ <div class="w-14 h-14 rounded-[16px] bg-background flex items-center justify-center shrink-0 border border-border relative shadow-sm">
23
+ <svg class="w-7 h-7 text-foreground" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 12h14M5 12a2 2 0 01-2-2V6a2 2 0 012-2h14a2 2 0 012 2v4a2 2 0 01-2 2M5 12a2 2 0 00-2 2v4a2 2 0 002 2h14a2 2 0 002-2v-4a2 2 0 00-2-2m-2-4h.01M17 16h.01" /></svg>
24
+ <div class="absolute -top-1.5 -right-1.5 w-4 h-4 rounded-full border-2 border-surface shadow-md" :class="nginx.status?.running ? 'bg-green-500' : 'bg-red-500'"></div>
25
+ </div>
26
+ <div>
27
+ <div class="text-lg font-bold text-foreground tracking-tight">{{ nginx.status?.running ? 'Running' : 'Stopped' }}</div>
28
+ <div class="text-[11px] font-mono text-muted font-bold mt-0.5">{{ nginx.status?.version || 'Unknown Version' }}</div>
29
+ </div>
30
+ </div>
31
+ <div class="flex flex-wrap gap-2">
32
+ <button v-if="!nginx.status?.running" @click="nginxAction('start')" class="btn btn-primary min-w-[90px]">
33
+ <svg class="w-4 h-4 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M14.752 11.168l-3.197-2.132A1 1 0 0010 9.87v4.263a1 1 0 001.555.832l3.197-2.132a1 1 0 000-1.664z" /><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg>
34
+ Start
35
+ </button>
36
+ <template v-else>
37
+ <button @click="nginxAction('reload')" class="btn btn-secondary">Reload</button>
38
+ <button @click="nginxAction('restart')" class="btn btn-secondary opacity-50 cursor-not-allowed" disabled>Restart</button>
39
+ <button @click="nginxAction('stop')" class="btn btn-danger">Stop</button>
40
+ </template>
41
+ <!-- Separator -->
42
+ <div class="w-px h-8 border-l border-border mx-1 self-center hidden sm:block"></div>
43
+ <button @click="nginxAction('test')" class="btn btn-secondary">Test Config</button>
44
+ </div>
45
+ </div>
40
46
 
41
- <div v-if="nginx.actionMsg" class="mt-4 p-4 rounded-xl bg-brand-500/10 border border-brand-500/20 text-brand-400 text-sm font-mono">
42
- {{ nginx.actionMsg }}
43
- </div>
44
- <div v-if="nginx.actionError" class="mt-4 p-4 rounded-xl bg-red-500/10 border border-red-500/20 text-red-400 text-sm font-mono">
45
- {{ nginx.actionError }}
46
- </div>
47
- </div>
47
+ <div v-if="nginx.actionMsg" class="mt-4 p-4 rounded-[12px] bg-primary/10 border border-primary/20 text-primary text-[13px] font-mono inline-block w-full">
48
+ {{ nginx.actionMsg }}
49
+ </div>
50
+ <div v-if="nginx.actionError" class="mt-4 p-4 rounded-[12px] bg-red-500/10 border border-red-500/20 text-red-500 text-[13px] font-mono break-all inline-block w-full">
51
+ {{ nginx.actionError }}
52
+ </div>
53
+ </div>
48
54
 
49
- <!-- Config Editor -->
50
- <div class="card mb-6">
51
- <div class="flex items-center justify-between p-4 border-b border-slate-800">
52
- <h3 class="font-semibold">Config Editor</h3>
53
- <div class="flex gap-2">
54
- <select v-model="nginx.selectedConfig" @change="selectConfig(nginx.selectedConfig)" class="input-group bg-slate-800 border border-slate-700 rounded-lg px-3 py-2 text-sm font-mono focus:outline-none focus:ring-2 focus:ring-brand-500">
55
- <option value="" disabled>Select file...</option>
56
- <option v-for="c in nginx.configs" :key="c" :value="c">{{ c }}</option>
57
- </select>
58
- <button @click="saveNginxConfig" :disabled="!nginx.selectedConfig || nginx.configSaving" class="btn btn-primary btn-sm">
59
- {{ nginx.configSaving ? 'Saving...' : 'Save' }}
60
- </button>
61
- </div>
62
- </div>
63
- <div class="p-4">
64
- <textarea v-model="nginx.configContent" :disabled="!nginx.selectedConfig" rows="16"
65
- class="w-full bg-slate-900 border border-slate-800 rounded-xl p-4 font-mono text-sm text-slate-300 focus:outline-none focus:ring-2 focus:ring-brand-500 disabled:opacity-40 resize-y"
66
- placeholder="Select a config file to start editing..."></textarea>
67
- <p v-if="nginx.configMsg" class="mt-2 text-sm font-mono" :class="nginx.configMsg.includes('pass') ? 'text-brand-400' : 'text-red-400'">
68
- {{ nginx.configMsg }}
69
- </p>
70
- </div>
71
- </div>
55
+ <!-- Config Editor -->
56
+ <div class="stat-card flex flex-col overflow-hidden">
57
+ <div class="flex flex-col sm:flex-row sm:items-center justify-between p-5 border-b border-border bg-black/5 dark:bg-white/5 gap-4">
58
+ <h3 class="form-label !mb-0 font-bold">Config Editor</h3>
59
+ <div class="flex gap-3">
60
+ <select v-model="nginx.selectedConfig" @change="selectConfig(nginx.selectedConfig)" class="form-input !py-1.5 !px-3 font-mono text-[12px] min-w-[200px]">
61
+ <option value="" disabled>Select Conf File...</option>
62
+ <option v-for="c in nginx.configs" :key="c" :value="c">{{ c }}</option>
63
+ </select>
64
+ <button @click="saveNginxConfig" :disabled="!nginx.selectedConfig || nginx.configSaving" class="btn btn-primary min-w-[80px]">
65
+ <svg v-if="nginx.configSaving" class="w-3 h-3 animate-spin mr-1.5 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>
66
+ {{ nginx.configSaving ? 'Wait...' : 'Save' }}
67
+ </button>
68
+ </div>
69
+ </div>
70
+ <div class="relative w-full p-0 flex flex-col">
71
+ <!-- syntax-like dark block for config -->
72
+ <textarea v-model="nginx.configContent" :disabled="!nginx.selectedConfig" rows="18"
73
+ class="w-full bg-[#0a0f18] text-[#a5d6ff] font-mono text-[13px] leading-relaxed p-6 focus:outline-none focus:bg-[#0d1421] transition-colors disabled:opacity-50 disabled:bg-[#0a0f18] resize-y rounded-b-[20px]"
74
+ placeholder="Select a config file to start editing..."></textarea>
72
75
 
73
- <!-- Error Log -->
74
- <div class="card">
75
- <div class="flex items-center justify-between p-4 border-b border-slate-800">
76
- <h3 class="font-semibold">Error Log</h3>
77
- <button @click="loadNginxLogs" class="btn btn-secondary btn-sm">
78
- <svg class="w-4 h-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
79
- <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
80
- </svg>
81
- Refresh
82
- </button>
83
- </div>
84
- <div class="p-4 max-h-64 overflow-y-auto">
85
- <div v-if="nginx.logsLoading" class="text-slate-500 text-sm">Loading...</div>
86
- <div v-else-if="nginx.logs.length === 0" class="text-slate-500 text-sm">No errors logged.</div>
87
- <pre v-else class="text-xs text-slate-400 font-mono leading-relaxed">{{ nginx.logs.join('\n') }}</pre>
88
- </div>
89
- </div>
76
+ <!-- Copy Button (hover) -->
77
+ <button v-if="nginx.configContent && nginx.selectedConfig"
78
+ @click="navigator.clipboard.writeText(nginx.configContent)"
79
+ class="absolute top-4 right-6 btn btn-secondary btn-icon text-muted border-white/10 hover:text-white hover:bg-white/10 opacity-0 hover:opacity-100 transition-opacity"
80
+ title="Copy to clipboard"
81
+ onmouseover="this.style.opacity='1'"
82
+ onmouseout="this.style.opacity=''"
83
+ id="copyConfBtn">
84
+ <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="M8 16H6a2 2 0 01-2-2V6a2 2 0 012-2h8a2 2 0 012 2v2m-6 12h8a2 2 0 002-2v-8a2 2 0 00-2-2h-8a2 2 0 00-2 2v8a2 2 0 002 2z"></path></svg>
85
+ </button>
86
+ <style>
87
+ textarea:hover + #copyConfBtn, #copyConfBtn:hover { opacity: 1; }
88
+ </style>
89
+ </div>
90
+ <div v-if="nginx.configMsg" class="p-3 border-t border-border font-mono text-[11px] flex items-center justify-between font-bold" :class="nginx.configMsg.includes('pass') ? 'bg-primary/5 text-primary' : 'bg-red-500/5 text-red-500'">
91
+ <span>{{ nginx.configMsg }}</span>
92
+ </div>
93
+ </div>
94
+
95
+ <!-- Error Log -->
96
+ <div class="stat-card overflow-hidden">
97
+ <div class="flex items-center justify-between p-5 border-b border-border bg-black/5 dark:bg-white/5">
98
+ <h3 class="form-label !mb-0 font-bold">Error Log</h3>
99
+ <button @click="loadNginxLogs" class="btn btn-secondary btn-sm">
100
+ <svg class="w-3.5 h-3.5 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
101
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15" />
102
+ </svg>
103
+ Refresh
104
+ </button>
105
+ </div>
106
+ <div class="w-full bg-[#0a0f18] text-[#e2e8f0] font-mono text-[12px] leading-relaxed p-5 h-64 overflow-y-auto whitespace-pre-wrap rounded-b-[20px] relative">
107
+ <!-- Copy Button for Logs -->
108
+ <button v-if="nginx.logs.length > 0"
109
+ @click="navigator.clipboard.writeText(nginx.logs.join('\n'))"
110
+ class="absolute top-3 right-4 btn btn-secondary btn-sm text-white bg-white/10 hover:bg-white/20 border-transparent opacity-0 transition-opacity"
111
+ title="Copy Logs"
112
+ onmouseover="this.style.opacity='1'"
113
+ onmouseout="this.style.opacity=''"
114
+ id="copyLogBtn">
115
+ Copy Lines
116
+ </button>
117
+ <style>
118
+ .bg-\[\#0a0f18\]:hover #copyLogBtn, #copyLogBtn:hover { opacity: 1; }
119
+ </style>
120
+
121
+ <div v-if="nginx.logsLoading" class="text-muted flex items-center gap-2">
122
+ <svg class="animate-spin w-4 h-4" 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 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"></path></svg>
123
+ Loading...
124
+ </div>
125
+ <div v-else-if="nginx.logs.length === 0" class="text-muted italic">No errors logged currently.</div>
126
+ <div v-else v-for="(line, idx) in nginx.logs" :key="idx" class="border-b border-white/5 py-1.5 last:border-0 hover:bg-white/5 px-2 -mx-2 rounded transition-colors break-words">
127
+ {{ line }}
128
+ </div>
129
+ </div>
130
+ </div>
131
+ </div>
90
132
  </div>