easy-devops 0.2.7 → 1.0.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.
Files changed (65) hide show
  1. package/README.md +97 -53
  2. package/install.sh +34 -12
  3. package/package.json +11 -12
  4. package/{cli → src/cli}/index.js +28 -6
  5. package/{cli → src/cli}/managers/domain-manager.js +143 -35
  6. package/{cli → src/cli}/managers/nginx-manager.js +43 -10
  7. package/src/cli/managers/ssl-manager.js +678 -0
  8. package/{cli → src/cli}/menus/dashboard.js +1 -1
  9. package/{cli → src/cli}/menus/settings.js +27 -8
  10. package/{cli → src/cli}/menus/update.js +1 -1
  11. package/{core → src/core}/config.js +5 -2
  12. package/{core → src/core}/db.js +1 -1
  13. package/{core → src/core}/detector.js +50 -87
  14. package/{core → src/core}/nginx-conf-generator.js +101 -64
  15. package/src/core/platform.js +61 -0
  16. package/{core → src/core}/shell.js +38 -2
  17. package/src/core/validators.js +96 -0
  18. package/{dashboard → src/dashboard}/lib/cert-reader.js +5 -5
  19. package/{dashboard → src/dashboard}/lib/nginx-service.js +47 -77
  20. package/src/dashboard/public/img/icon.png +0 -0
  21. package/src/dashboard/public/img/icon_b.png +0 -0
  22. package/{dashboard → src/dashboard}/public/js/app.js +206 -30
  23. package/{dashboard → src/dashboard}/routes/domains.js +96 -72
  24. package/{dashboard → src/dashboard}/routes/settings.js +19 -11
  25. package/src/dashboard/routes/ssl.js +281 -0
  26. package/src/dashboard/views/index.ejs +652 -0
  27. package/src/dashboard/views/partials/domain-form.ejs +356 -0
  28. package/src/dashboard/views/partials/domains-panel.ejs +101 -0
  29. package/src/dashboard/views/partials/login.ejs +167 -0
  30. package/src/dashboard/views/partials/nginx-panel.ejs +153 -0
  31. package/src/dashboard/views/partials/overview.ejs +142 -0
  32. package/src/dashboard/views/partials/settings-panel.ejs +68 -0
  33. package/src/dashboard/views/partials/sidebar.ejs +96 -0
  34. package/src/dashboard/views/partials/ssl-panel.ejs +176 -0
  35. package/{lib → src/lib}/installer/nvm-bootstrap.sh +8 -8
  36. package/{lib → src/lib}/installer/picker.sh +33 -16
  37. package/cli/managers/ssl-manager.js +0 -963
  38. package/dashboard/routes/ssl.js +0 -140
  39. package/dashboard/views/index.ejs +0 -327
  40. package/dashboard/views/partials/domain-form.ejs +0 -257
  41. package/dashboard/views/partials/domains-panel.ejs +0 -66
  42. package/dashboard/views/partials/login.ejs +0 -50
  43. package/dashboard/views/partials/nginx-panel.ejs +0 -90
  44. package/dashboard/views/partials/overview.ejs +0 -67
  45. package/dashboard/views/partials/settings-panel.ejs +0 -37
  46. package/dashboard/views/partials/sidebar.ejs +0 -45
  47. package/dashboard/views/partials/ssl-panel.ejs +0 -95
  48. /package/{cli → src/cli}/managers/node-manager.js +0 -0
  49. /package/{cli → src/cli}/menus/.gitkeep +0 -0
  50. /package/{cli → src/cli}/menus/domains.js +0 -0
  51. /package/{cli → src/cli}/menus/nginx.js +0 -0
  52. /package/{cli → src/cli}/menus/nodejs.js +0 -0
  53. /package/{cli → src/cli}/menus/ssl.js +0 -0
  54. /package/{dashboard → src/dashboard}/lib/.gitkeep +0 -0
  55. /package/{dashboard → src/dashboard}/lib/domains-db.js +0 -0
  56. /package/{dashboard → src/dashboard}/lib/nginx-conf-generator.js +0 -0
  57. /package/{dashboard → src/dashboard}/routes/.gitkeep +0 -0
  58. /package/{dashboard → src/dashboard}/routes/auth.js +0 -0
  59. /package/{dashboard → src/dashboard}/routes/nginx.js +0 -0
  60. /package/{dashboard → src/dashboard}/server.js +0 -0
  61. /package/{lib → src/lib}/installer/.gitkeep +0 -0
  62. /package/{lib → src/lib}/installer/detect.sh +0 -0
  63. /package/{lib → src/lib}/installer/node-versions.sh +0 -0
  64. /package/{lib → src/lib}/installer/progress.sh +0 -0
  65. /package/{lib → src/lib}/installer/winget-install.ps1 +0 -0
@@ -0,0 +1,153 @@
1
+ <!-- Nginx Page -->
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>
15
+
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>
46
+
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>
54
+
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
+ <!-- Custom Config File Dropdown -->
61
+ <div class="cselect" :class="{ 'cselect--open': nginx.configDropdownOpen }"
62
+ v-click-outside="() => nginx.configDropdownOpen = false">
63
+ <button type="button" class="cselect__trigger font-mono text-[12px]"
64
+ @click="nginx.configDropdownOpen = !nginx.configDropdownOpen">
65
+ <span :class="nginx.selectedConfig ? 'text-foreground' : 'text-muted'">
66
+ {{ nginx.selectedConfig || 'Select config file…' }}
67
+ </span>
68
+ <svg class="cselect__arrow" viewBox="0 0 20 20" fill="currentColor">
69
+ <path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd"/>
70
+ </svg>
71
+ </button>
72
+ <div class="cselect__panel" v-show="nginx.configDropdownOpen">
73
+ <div v-if="nginx.configs.length === 0" class="cselect__empty">No config files found</div>
74
+ <button v-for="c in nginx.configs" :key="c" type="button"
75
+ class="cselect__option font-mono text-[12px]"
76
+ :class="{ 'cselect__option--active': nginx.selectedConfig === c }"
77
+ @mousedown.prevent="nginx.selectedConfig = c; selectConfig(c); nginx.configDropdownOpen = false">
78
+ <span class="truncate">{{ c }}</span>
79
+ <svg v-if="nginx.selectedConfig === c" class="w-3.5 h-3.5 shrink-0 ml-auto" fill="currentColor" viewBox="0 0 20 20">
80
+ <path fill-rule="evenodd" d="M16.707 5.293a1 1 0 010 1.414l-8 8a1 1 0 01-1.414 0l-4-4a1 1 0 011.414-1.414L8 12.586l7.293-7.293a1 1 0 011.414 0z" clip-rule="evenodd"/>
81
+ </svg>
82
+ </button>
83
+ </div>
84
+ </div>
85
+ <button @click="saveNginxConfig" :disabled="!nginx.selectedConfig || nginx.configSaving" class="btn btn-primary min-w-[80px]">
86
+ <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>
87
+ {{ nginx.configSaving ? 'Wait...' : 'Save' }}
88
+ </button>
89
+ </div>
90
+ </div>
91
+ <div class="relative w-full p-0 flex flex-col">
92
+ <!-- syntax-like dark block for config -->
93
+ <textarea v-model="nginx.configContent" :disabled="!nginx.selectedConfig" rows="18"
94
+ 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]"
95
+ placeholder="Select a config file to start editing..."></textarea>
96
+
97
+ <!-- Copy Button (hover) -->
98
+ <button v-if="nginx.configContent && nginx.selectedConfig"
99
+ @click="navigator.clipboard.writeText(nginx.configContent)"
100
+ 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"
101
+ title="Copy to clipboard"
102
+ onmouseover="this.style.opacity='1'"
103
+ onmouseout="this.style.opacity=''"
104
+ id="copyConfBtn">
105
+ <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>
106
+ </button>
107
+ <style>
108
+ textarea:hover + #copyConfBtn, #copyConfBtn:hover { opacity: 1; }
109
+ </style>
110
+ </div>
111
+ <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'">
112
+ <span>{{ nginx.configMsg }}</span>
113
+ </div>
114
+ </div>
115
+
116
+ <!-- Error Log -->
117
+ <div class="stat-card overflow-hidden">
118
+ <div class="flex items-center justify-between p-5 border-b border-border bg-black/5 dark:bg-white/5">
119
+ <h3 class="form-label !mb-0 font-bold">Error Log</h3>
120
+ <button @click="loadNginxLogs" class="btn btn-secondary btn-sm">
121
+ <svg class="w-3.5 h-3.5 mr-1" fill="none" viewBox="0 0 24 24" stroke="currentColor">
122
+ <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" />
123
+ </svg>
124
+ Refresh
125
+ </button>
126
+ </div>
127
+ <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">
128
+ <!-- Copy Button for Logs -->
129
+ <button v-if="nginx.logs.length > 0"
130
+ @click="navigator.clipboard.writeText(nginx.logs.join('\n'))"
131
+ 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"
132
+ title="Copy Logs"
133
+ onmouseover="this.style.opacity='1'"
134
+ onmouseout="this.style.opacity=''"
135
+ id="copyLogBtn">
136
+ Copy Lines
137
+ </button>
138
+ <style>
139
+ .bg-\[\#0a0f18\]:hover #copyLogBtn, #copyLogBtn:hover { opacity: 1; }
140
+ </style>
141
+
142
+ <div v-if="nginx.logsLoading" class="text-muted flex items-center gap-2">
143
+ <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>
144
+ Loading...
145
+ </div>
146
+ <div v-else-if="nginx.logs.length === 0" class="text-muted italic">No errors logged currently.</div>
147
+ <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">
148
+ {{ line }}
149
+ </div>
150
+ </div>
151
+ </div>
152
+ </div>
153
+ </div>
@@ -0,0 +1,142 @@
1
+ <!-- Dashboard Overview Page -->
2
+ <div v-show="page === 'overview'" 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">Overview</h2>
6
+ <p class="text-muted font-medium text-sm mt-1">High-level status of your proxy infrastructure</p>
7
+ </div>
8
+ </div>
9
+
10
+ <div class="grid grid-cols-1 md:grid-cols-2 lg:grid-cols-4 gap-6">
11
+ <!-- Nginx Status Card -->
12
+ <div class="stat-card group">
13
+ <div class="flex items-start justify-between">
14
+ <div>
15
+ <p class="form-label">Nginx Process</p>
16
+ <div class="mt-2 flex items-baseline gap-2">
17
+ <h3 class="text-3xl font-bold tracking-tight text-foreground">
18
+ {{ nginx.status?.running ? 'Active' : 'Offline' }}
19
+ </h3>
20
+ </div>
21
+ <div class="mt-3 flex items-center gap-2">
22
+ <div class="status-dot" :class="nginx.status?.running ? 'active' : 'inactive'"></div>
23
+ <span class="text-xs font-mono font-medium text-muted">
24
+ PID: {{ nginx.status?.pid || '---' }}
25
+ </span>
26
+ </div>
27
+ </div>
28
+ <div class="stat-icon">
29
+ <svg class="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
30
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19.428 15.428a2 2 0 00-1.022-.547l-2.387-.477a6 6 0 00-3.86.517l-.318.158a6 6 0 01-3.86.517L6.05 15.21a2 2 0 00-1.806.547M8 4h8l-1 1v5.172a2 2 0 00.586 1.414l5 5c1.26 1.26.367 3.414-1.415 3.414H4.828c-1.782 0-2.674-2.154-1.414-3.414l5-5A2 2 0 009 10.172V5L8 4z" />
31
+ </svg>
32
+ </div>
33
+ </div>
34
+ <!-- Trendline overlay -->
35
+ <div class="absolute bottom-0 left-0 right-0 h-12 opacity-10 pointer-events-none transition-opacity group-hover:opacity-20"
36
+ style="background: linear-gradient(0deg, var(--color-primary) 0%, transparent 100%);"></div>
37
+ </div>
38
+
39
+ <!-- Domains Configured Card -->
40
+ <div class="stat-card group">
41
+ <div class="flex items-start justify-between">
42
+ <div>
43
+ <p class="form-label">Active Domains</p>
44
+ <div class="mt-2 flex items-baseline gap-2">
45
+ <h3 class="text-3xl font-bold tracking-tight text-foreground">
46
+ {{ domains.list.filter(d => d.enabled !== false).length }}
47
+ </h3>
48
+ <span class="text-sm font-medium text-muted uppercase tracking-wider">/ {{ domains.list.length }}</span>
49
+ </div>
50
+ <div class="mt-3 flex items-center gap-1.5 text-xs text-muted font-medium">
51
+ <svg class="w-3.5 h-3.5 text-primary" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 7h8m0 0v8m0-8l-8 8-4-4-6 6"></path></svg>
52
+ <span class="text-primary">+{{ domains.list.filter(d => d.enabled !== false).length > 0 ? '100' : '0' }}%</span>
53
+ <span>managed configs</span>
54
+ </div>
55
+ </div>
56
+ <div class="stat-icon">
57
+ <svg class="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
58
+ <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" />
59
+ </svg>
60
+ </div>
61
+ </div>
62
+ <!-- Trendline overlay -->
63
+ <div class="absolute bottom-0 left-0 right-0 h-12 opacity-10 pointer-events-none transition-opacity group-hover:opacity-20"
64
+ style="background: linear-gradient(0deg, var(--color-primary) 0%, transparent 100%);"></div>
65
+ </div>
66
+
67
+ <!-- SSL Certificates Card -->
68
+ <div class="stat-card group">
69
+ <div class="flex items-start justify-between">
70
+ <div>
71
+ <p class="form-label">SSL Certificates</p>
72
+ <div class="mt-2 flex items-baseline gap-2">
73
+ <h3 class="text-3xl font-bold tracking-tight text-foreground">
74
+ {{ ssl.certs.length }}
75
+ </h3>
76
+ </div>
77
+ <div class="mt-3 flex items-center gap-2 text-xs font-medium">
78
+ <span v-if="expiringCount > 0" class="px-2.5 py-1 rounded-[6px] bg-amber-500/12 text-amber-500 border border-amber-500/25 font-bold">
79
+ {{ expiringCount }} Expiring
80
+ </span>
81
+ <span v-else class="text-green-500 flex items-center gap-1.5 font-bold">
82
+ <svg class="w-3.5 h-3.5" fill="none" viewBox="0 0 24 24" stroke="currentColor"><path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M5 13l4 4L19 7"></path></svg>
83
+ All Healthy
84
+ </span>
85
+ </div>
86
+ </div>
87
+ <div class="stat-icon">
88
+ <svg class="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
89
+ <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" />
90
+ </svg>
91
+ </div>
92
+ </div>
93
+ <!-- Trendline overlay -->
94
+ <div class="absolute bottom-0 left-0 right-0 h-12 opacity-10 pointer-events-none transition-opacity group-hover:opacity-20"
95
+ style="background: linear-gradient(0deg, var(--color-primary) 0%, transparent 100%);"></div>
96
+ </div>
97
+
98
+ <!-- System Uptime Card -->
99
+ <div class="stat-card group">
100
+ <div class="flex items-start justify-between">
101
+ <div>
102
+ <p class="form-label">Service Engine</p>
103
+ <div class="mt-2 flex items-baseline gap-2">
104
+ <h3 class="text-3xl font-bold tracking-tight text-foreground font-mono" style="letter-spacing: -1px;">
105
+ {{ nginx.status?.running ? '100%' : '0%' }}
106
+ </h3>
107
+ </div>
108
+ <div class="mt-3 flex items-center gap-1.5 text-xs text-muted font-medium font-mono">
109
+ Uptime: {{ nginx.status?.running ? 'Active' : 'Offline' }}
110
+ </div>
111
+ </div>
112
+ <div class="stat-icon">
113
+ <svg class="w-6 h-6" fill="none" viewBox="0 0 24 24" stroke="currentColor">
114
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />
115
+ </svg>
116
+ </div>
117
+ </div>
118
+ <!-- Trendline overlay -->
119
+ <div class="absolute bottom-0 left-0 right-0 h-12 opacity-10 pointer-events-none transition-opacity group-hover:opacity-20"
120
+ style="background: linear-gradient(0deg, var(--color-primary) 0%, transparent 100%);"></div>
121
+ </div>
122
+ </div>
123
+
124
+ <!-- Quick Actions -->
125
+ <div class="mt-10">
126
+ <h3 class="text-[10px] uppercase font-bold text-muted tracking-widest mb-4">Quick Actions</h3>
127
+ <div class="flex flex-wrap gap-4">
128
+ <button @click="navigateTo('domains')" class="btn btn-primary">
129
+ <svg 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>
130
+ Add Domain
131
+ </button>
132
+ <button @click="navigateTo('ssl')" class="btn btn-secondary">
133
+ <svg 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 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>
134
+ Issue SSL Let's Encrypt
135
+ </button>
136
+ <button @click="nginxAction('reload')" class="btn btn-secondary" :disabled="!nginx.status?.running">
137
+ <svg 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="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>
138
+ Reload Nginx
139
+ </button>
140
+ </div>
141
+ </div>
142
+ </div>
@@ -0,0 +1,68 @@
1
+ <!-- Settings Page -->
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>
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>
15
+
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">
18
+
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>
24
+
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>
30
+
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>
36
+
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>
42
+
43
+ </div>
44
+
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>
51
+
52
+ </div>
53
+
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>
68
+ </div>
@@ -0,0 +1,96 @@
1
+ <!-- Sidebar Navigation -->
2
+ <aside class="sidebar-wrapper flex-shrink-0 flex flex-col border-r border-border relative z-20 h-screen"
3
+ :class="sidebarCollapsed ? 'w-16' : 'w-60'">
4
+
5
+ <!-- Logo section -->
6
+ <div class="h-16 border-b border-border flex items-center shrink-0 overflow-hidden"
7
+ :class="sidebarCollapsed ? 'justify-center px-0' : 'px-5 gap-3'">
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" />
10
+ </div>
11
+ <div class="whitespace-nowrap transition-opacity duration-300"
12
+ :class="sidebarCollapsed ? 'opacity-0 w-0' : 'opacity-100'">
13
+ <h1 class="font-bold text-foreground text-sm tracking-wide">Easy DevOps</h1>
14
+ </div>
15
+ </div>
16
+
17
+ <!-- Navigation items -->
18
+ <nav class="flex-1 py-4 overflow-y-auto overflow-x-hidden flex flex-col gap-1 px-3">
19
+ <!-- Main Menu Label -->
20
+ <div v-show="!sidebarCollapsed" class="px-2 mb-2 mt-2">
21
+ <span class="text-[10px] uppercase tracking-widest text-muted font-bold">Main Menu</span>
22
+ </div>
23
+
24
+ <button v-for="item in navItems" :key="item.id" @click="navigateTo(item.id)"
25
+ class="group flex items-center rounded-[10px] font-medium transition-all duration-200 relative outline-none border border-transparent"
26
+ :class="[
27
+ page === item.id ? 'sidebar-active-item text-primary' : 'text-muted hover:bg-surface hover:text-foreground',
28
+ sidebarCollapsed ? 'justify-center w-10 h-10 mx-auto' : 'w-full px-3 py-2.5 gap-3'
29
+ ]">
30
+
31
+ <!-- Icons mapped based on id -->
32
+ <div class="shrink-0 w-5 h-5 flex items-center justify-center transition-transform group-hover:scale-110"
33
+ :class="page === item.id ? 'text-primary' : ''">
34
+ <!-- Dashboard -->
35
+ <svg v-if="item.id === 'overview'" 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="M4 6a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2V6zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2V6zM4 16a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2H6a2 2 0 01-2-2v-2zm10 0a2 2 0 012-2h2a2 2 0 012 2v2a2 2 0 01-2 2h-2a2 2 0 01-2-2v-2z"></path></svg>
36
+ <!-- Nginx Config -->
37
+ <svg v-if="item.id === 'nginx'" 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 20l4-16m4 4l4 4-4 4M6 16l-4-4 4-4"></path></svg>
38
+ <!-- SSL Certificates -->
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
+ <!-- Domains -->
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
+ <!-- Settings -->
43
+ <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
+ </div>
45
+
46
+ <span class="whitespace-nowrap transition-opacity duration-200 text-[13px] font-semibold"
47
+ :class="sidebarCollapsed ? 'opacity-0 w-0 hidden' : 'opacity-100'">
48
+ {{ item.label }}
49
+ </span>
50
+
51
+ <!-- Tooltip if collapsed -->
52
+ <div v-if="sidebarCollapsed"
53
+ class="absolute left-14 px-3 py-2 bg-surface border border-border text-foreground text-[11px] uppercase tracking-wider font-bold rounded-[8px] opacity-0 group-hover:opacity-100 pointer-events-none transition-opacity duration-300 z-50 whitespace-nowrap shadow-xl">
54
+ {{ item.label }}
55
+ </div>
56
+ </button>
57
+ </nav>
58
+
59
+ <!-- Bottom actions -->
60
+ <div class="px-3 pb-5 space-y-1">
61
+ <button @click="doLogout"
62
+ class="group flex items-center rounded-[10px] font-medium transition-all text-muted hover:bg-red-500/10 hover:text-red-500 outline-none"
63
+ :class="sidebarCollapsed ? 'justify-center w-10 h-10 mx-auto' : 'w-full px-3 py-2.5 gap-3'">
64
+ <div class="shrink-0 w-5 h-5 flex items-center justify-center">
65
+ <svg 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="M17 16l4-4m0 0l-4-4m4 4H7m6 4v1a3 3 0 01-3 3H6a3 3 0 01-3-3V7a3 3 0 013-3h4a3 3 0 013 3v1"></path></svg>
66
+ </div>
67
+ <span class="whitespace-nowrap transition-opacity duration-200 text-[13px] font-semibold"
68
+ :class="sidebarCollapsed ? 'opacity-0 w-0 hidden' : 'opacity-100'">
69
+ Sign out
70
+ </span>
71
+ <div v-if="sidebarCollapsed"
72
+ class="absolute left-14 px-3 py-2 bg-surface border border-border text-foreground text-[11px] uppercase tracking-wider font-bold rounded-[8px] opacity-0 group-hover:opacity-100 pointer-events-none transition-opacity duration-300 z-50 whitespace-nowrap shadow-xl">
73
+ Sign out
74
+ </div>
75
+ </button>
76
+
77
+ <div class="h-px bg-border my-2 mx-1"></div>
78
+
79
+ <button @click="sidebarCollapsed = !sidebarCollapsed"
80
+ class="group flex items-center rounded-[10px] font-medium transition-all text-muted hover:bg-surface hover:text-foreground outline-none"
81
+ :class="sidebarCollapsed ? 'justify-center w-10 h-10 mx-auto' : 'w-full px-3 py-2.5 gap-3'">
82
+ <div class="shrink-0 w-5 h-5 flex items-center justify-center transition-transform duration-300"
83
+ :class="sidebarCollapsed ? 'rotate-180' : ''">
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="M11 19l-7-7 7-7m8 14l-7-7 7-7"></path></svg>
85
+ </div>
86
+ <span class="whitespace-nowrap transition-opacity duration-200 text-[13px] font-semibold"
87
+ :class="sidebarCollapsed ? 'opacity-0 w-0 hidden' : 'opacity-100'">
88
+ Collapse Sidebar
89
+ </span>
90
+ <div v-if="sidebarCollapsed"
91
+ class="absolute left-14 px-3 py-2 bg-surface border border-border text-foreground text-[11px] uppercase tracking-wider font-bold rounded-[8px] opacity-0 group-hover:opacity-100 pointer-events-none transition-opacity duration-300 z-50 whitespace-nowrap shadow-xl">
92
+ Expand Sidebar
93
+ </div>
94
+ </button>
95
+ </div>
96
+ </aside>