easy-devops 1.0.0 → 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.
- package/README.md +24 -23
- package/install.sh +26 -3
- package/package.json +10 -13
- package/{cli → src/cli}/index.js +1 -1
- package/{cli → src/cli}/managers/nginx-manager.js +10 -1
- package/{cli → src/cli}/menus/dashboard.js +1 -1
- package/{cli → src/cli}/menus/update.js +1 -1
- package/{core → src/core}/db.js +1 -1
- package/{core → src/core}/shell.js +36 -0
- package/{dashboard → src/dashboard}/public/js/app.js +13 -1
- package/{dashboard → src/dashboard}/views/index.ejs +111 -7
- package/{dashboard → src/dashboard}/views/partials/domain-form.ejs +30 -7
- package/{dashboard → src/dashboard}/views/partials/domains-panel.ejs +0 -3
- package/{dashboard → src/dashboard}/views/partials/nginx-panel.ejs +25 -4
- package/{dashboard → src/dashboard}/views/partials/settings-panel.ejs +1 -1
- package/{lib → src/lib}/installer/picker.sh +4 -4
- /package/{cli → src/cli}/managers/domain-manager.js +0 -0
- /package/{cli → src/cli}/managers/node-manager.js +0 -0
- /package/{cli → src/cli}/managers/ssl-manager.js +0 -0
- /package/{cli → src/cli}/menus/.gitkeep +0 -0
- /package/{cli → src/cli}/menus/domains.js +0 -0
- /package/{cli → src/cli}/menus/nginx.js +0 -0
- /package/{cli → src/cli}/menus/nodejs.js +0 -0
- /package/{cli → src/cli}/menus/settings.js +0 -0
- /package/{cli → src/cli}/menus/ssl.js +0 -0
- /package/{core → src/core}/config.js +0 -0
- /package/{core → src/core}/detector.js +0 -0
- /package/{core → src/core}/nginx-conf-generator.js +0 -0
- /package/{core → src/core}/platform.js +0 -0
- /package/{core → src/core}/validators.js +0 -0
- /package/{dashboard → src/dashboard}/lib/.gitkeep +0 -0
- /package/{dashboard → src/dashboard}/lib/cert-reader.js +0 -0
- /package/{dashboard → src/dashboard}/lib/domains-db.js +0 -0
- /package/{dashboard → src/dashboard}/lib/nginx-conf-generator.js +0 -0
- /package/{dashboard → src/dashboard}/lib/nginx-service.js +0 -0
- /package/{dashboard → src/dashboard}/public/img/icon.png +0 -0
- /package/{dashboard → src/dashboard}/public/img/icon_b.png +0 -0
- /package/{dashboard → src/dashboard}/routes/.gitkeep +0 -0
- /package/{dashboard → src/dashboard}/routes/auth.js +0 -0
- /package/{dashboard → src/dashboard}/routes/domains.js +0 -0
- /package/{dashboard → src/dashboard}/routes/nginx.js +0 -0
- /package/{dashboard → src/dashboard}/routes/settings.js +0 -0
- /package/{dashboard → src/dashboard}/routes/ssl.js +0 -0
- /package/{dashboard → src/dashboard}/server.js +0 -0
- /package/{dashboard → src/dashboard}/views/partials/login.ejs +0 -0
- /package/{dashboard → src/dashboard}/views/partials/overview.ejs +0 -0
- /package/{dashboard → src/dashboard}/views/partials/sidebar.ejs +0 -0
- /package/{dashboard → src/dashboard}/views/partials/ssl-panel.ejs +0 -0
- /package/{lib → src/lib}/installer/.gitkeep +0 -0
- /package/{lib → src/lib}/installer/detect.sh +0 -0
- /package/{lib → src/lib}/installer/node-versions.sh +0 -0
- /package/{lib → src/lib}/installer/nvm-bootstrap.sh +0 -0
- /package/{lib → src/lib}/installer/progress.sh +0 -0
- /package/{lib → src/lib}/installer/winget-install.ps1 +0 -0
package/README.md
CHANGED
|
@@ -45,13 +45,13 @@ If you **don't have Node.js** yet, use the bootstrap installer:
|
|
|
45
45
|
#### Linux / macOS
|
|
46
46
|
|
|
47
47
|
```bash
|
|
48
|
-
curl -fsSL https://raw.githubusercontent.com/omar00050/Easy-DevOps/main/install.sh
|
|
48
|
+
curl -fsSL https://raw.githubusercontent.com/omar00050/Easy-DevOps/main/install.sh -o install.sh && bash install.sh
|
|
49
49
|
```
|
|
50
50
|
|
|
51
51
|
Or with wget:
|
|
52
52
|
|
|
53
53
|
```bash
|
|
54
|
-
wget -qO
|
|
54
|
+
wget -qO install.sh https://raw.githubusercontent.com/omar00050/Easy-DevOps/main/install.sh && bash install.sh
|
|
55
55
|
```
|
|
56
56
|
|
|
57
57
|
#### Windows (PowerShell)
|
|
@@ -284,7 +284,7 @@ All configuration is stored in `data/easy-devops.sqlite`:
|
|
|
284
284
|
|
|
285
285
|
| Field | Default (Linux) | Default (Windows) | Description |
|
|
286
286
|
|-------|-----------------|-------------------|-------------|
|
|
287
|
-
| `dashboardPort` | `
|
|
287
|
+
| `dashboardPort` | `6443` | `6443` | Dashboard HTTP port |
|
|
288
288
|
| `dashboardPassword` | `admin` | `admin` | Dashboard login password |
|
|
289
289
|
| `nginxDir` | `/etc/nginx` | `C:\nginx` | Nginx installation directory |
|
|
290
290
|
| `sslDir` | `/etc/easy-devops/ssl` | `C:\easy-devops\ssl` | SSL certificate storage root |
|
|
@@ -296,28 +296,29 @@ All configuration is stored in `data/easy-devops.sqlite`:
|
|
|
296
296
|
|
|
297
297
|
```
|
|
298
298
|
easy-devops/
|
|
299
|
-
├──
|
|
300
|
-
│ ├──
|
|
301
|
-
│ ├──
|
|
302
|
-
│
|
|
303
|
-
|
|
304
|
-
│ ├──
|
|
305
|
-
│ ├──
|
|
306
|
-
│ ├──
|
|
307
|
-
│ ├──
|
|
308
|
-
│ ├──
|
|
309
|
-
│ ├──
|
|
310
|
-
│
|
|
311
|
-
|
|
312
|
-
│ ├──
|
|
313
|
-
│ ├──
|
|
314
|
-
│ ├──
|
|
315
|
-
│ ├──
|
|
316
|
-
│
|
|
299
|
+
├── src/
|
|
300
|
+
│ ├── cli/
|
|
301
|
+
│ │ ├── index.js # CLI entry point
|
|
302
|
+
│ │ ├── managers/ # Domain, Nginx, SSL, Node.js logic
|
|
303
|
+
│ │ └── menus/ # Thin menu dispatcher wrappers
|
|
304
|
+
│ ├── core/
|
|
305
|
+
│ │ ├── config.js # Configuration load/save
|
|
306
|
+
│ │ ├── db.js # SQLite helpers (good.db)
|
|
307
|
+
│ │ ├── detector.js # System environment detection
|
|
308
|
+
│ │ ├── nginx-conf-generator.js # Nginx conf builder (shared)
|
|
309
|
+
│ │ ├── platform.js # isWindows, nginx cmd helpers, combineOutput
|
|
310
|
+
│ │ ├── shell.js # Cross-platform shell executor
|
|
311
|
+
│ │ └── validators.js # Shared input validation helpers
|
|
312
|
+
│ ├── dashboard/
|
|
313
|
+
│ │ ├── server.js # Express + Socket.io server
|
|
314
|
+
│ │ ├── routes/ # auth, domains, nginx, settings, ssl
|
|
315
|
+
│ │ ├── lib/ # cert-reader, domains-db, nginx-service
|
|
316
|
+
│ │ ├── views/ # EJS templates + partials
|
|
317
|
+
│ │ └── public/ # Static assets (Vue 3 app)
|
|
318
|
+
│ └── lib/
|
|
319
|
+
│ └── installer/ # Bash helper modules for install.sh
|
|
317
320
|
├── data/
|
|
318
321
|
│ └── easy-devops.sqlite
|
|
319
|
-
├── lib/
|
|
320
|
-
│ └── installer/ # Bash helper modules for install.sh
|
|
321
322
|
├── install.sh # Linux/macOS bootstrap installer
|
|
322
323
|
└── install.ps1 # Windows PowerShell installer
|
|
323
324
|
```
|
package/install.sh
CHANGED
|
@@ -19,7 +19,7 @@ set -euo pipefail
|
|
|
19
19
|
# ---------------------------------------------------------------------------
|
|
20
20
|
# Resolve script and project directory
|
|
21
21
|
# ---------------------------------------------------------------------------
|
|
22
|
-
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
22
|
+
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]:-$0}")" && pwd)"
|
|
23
23
|
EASYDEVOPS_DIR="${EASYDEVOPS_DIR:-$SCRIPT_DIR}"
|
|
24
24
|
|
|
25
25
|
# ---------------------------------------------------------------------------
|
|
@@ -303,7 +303,7 @@ else
|
|
|
303
303
|
local_choice=""
|
|
304
304
|
while true; do
|
|
305
305
|
printf 'Enter 1, 2, or 3 (q to quit): '
|
|
306
|
-
IFS= read -r local_choice
|
|
306
|
+
IFS= read -r local_choice < /dev/tty
|
|
307
307
|
case "$local_choice" in
|
|
308
308
|
1)
|
|
309
309
|
NODE_ACTION="keep"
|
|
@@ -487,7 +487,9 @@ printf '\n'
|
|
|
487
487
|
|
|
488
488
|
if [ "$_allOK" = "true" ]; then
|
|
489
489
|
printf ' All steps completed successfully!\n\n'
|
|
490
|
-
printf '
|
|
490
|
+
printf ' To use immediately in this terminal, run:\n'
|
|
491
|
+
printf ' source ~/.bashrc\n\n'
|
|
492
|
+
printf ' Or open a new terminal, then run:\n'
|
|
491
493
|
printf ' easy-devops\n'
|
|
492
494
|
else
|
|
493
495
|
printf ' Some steps need attention -- see warnings above.\n\n'
|
|
@@ -495,4 +497,25 @@ else
|
|
|
495
497
|
printf ' node cli/index.js\n'
|
|
496
498
|
fi
|
|
497
499
|
printf '\n'
|
|
500
|
+
|
|
501
|
+
# ---------------------------------------------------------------------------
|
|
502
|
+
# Source nvm into the current session so node/npm/easy-devops work immediately
|
|
503
|
+
# (only when nvm was actually used, i.e. NODE_ACTION != "keep")
|
|
504
|
+
# ---------------------------------------------------------------------------
|
|
505
|
+
if [ "$NODE_ACTION" != "keep" ]; then
|
|
506
|
+
export NVM_DIR="$HOME/.nvm"
|
|
507
|
+
if [ -s "$NVM_DIR/nvm.sh" ]; then
|
|
508
|
+
. "$NVM_DIR/nvm.sh"
|
|
509
|
+
fi
|
|
510
|
+
|
|
511
|
+
# Also source shell config to pick up PATH changes
|
|
512
|
+
if [ -f "$HOME/.bashrc" ]; then
|
|
513
|
+
. "$HOME/.bashrc" 2>/dev/null || true
|
|
514
|
+
elif [ -f "$HOME/.bash_profile" ]; then
|
|
515
|
+
. "$HOME/.bash_profile" 2>/dev/null || true
|
|
516
|
+
elif [ -f "$HOME/.zshrc" ]; then
|
|
517
|
+
. "$HOME/.zshrc" 2>/dev/null || true
|
|
518
|
+
fi
|
|
519
|
+
fi
|
|
520
|
+
|
|
498
521
|
exit 0
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "easy-devops",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "A unified DevOps management tool with CLI and web dashboard for managing Nginx, SSL certificates, and Node.js on Linux and Windows servers.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"devops",
|
|
7
7
|
"nginx",
|
|
8
8
|
"ssl",
|
|
9
|
-
"
|
|
9
|
+
"acme",
|
|
10
10
|
"letsencrypt",
|
|
11
11
|
"nodejs",
|
|
12
12
|
"dashboard",
|
|
@@ -30,26 +30,23 @@
|
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://github.com/omar00050/Easy-DevOps#readme",
|
|
32
32
|
"type": "module",
|
|
33
|
-
"main": "cli/index.js",
|
|
33
|
+
"main": "src/cli/index.js",
|
|
34
34
|
"bin": {
|
|
35
|
-
"easy-devops": "cli/index.js",
|
|
36
|
-
"ezz": "cli/index.js"
|
|
35
|
+
"easy-devops": "src/cli/index.js",
|
|
36
|
+
"ezz": "src/cli/index.js"
|
|
37
37
|
},
|
|
38
38
|
"files": [
|
|
39
|
-
"
|
|
40
|
-
"core/",
|
|
41
|
-
"dashboard/",
|
|
42
|
-
"lib/",
|
|
39
|
+
"src/",
|
|
43
40
|
"data/.gitkeep",
|
|
44
41
|
"install.bat",
|
|
45
42
|
"install.ps1",
|
|
46
43
|
"install.sh"
|
|
47
44
|
],
|
|
48
45
|
"scripts": {
|
|
49
|
-
"start": "node cli/index.js",
|
|
46
|
+
"start": "node src/cli/index.js",
|
|
50
47
|
"test": "echo \" no test specified\"",
|
|
51
|
-
"dashboard": "node dashboard/server.js",
|
|
52
|
-
"system-info": "node cli/index.js system-info"
|
|
48
|
+
"dashboard": "node src/dashboard/server.js",
|
|
49
|
+
"system-info": "node src/cli/index.js system-info"
|
|
53
50
|
},
|
|
54
51
|
"engines": {
|
|
55
52
|
"node": ">=18.0.0"
|
|
@@ -66,4 +63,4 @@
|
|
|
66
63
|
"ora": "^7.0.1",
|
|
67
64
|
"socket.io": "^4.8.3"
|
|
68
65
|
}
|
|
69
|
-
}
|
|
66
|
+
}
|
package/{cli → src/cli}/index.js
RENAMED
|
@@ -14,7 +14,7 @@ import settingsMenu from './menus/settings.js';
|
|
|
14
14
|
import updateMenu from './menus/update.js';
|
|
15
15
|
|
|
16
16
|
const require = createRequire(import.meta.url);
|
|
17
|
-
const { version } = require('
|
|
17
|
+
const { version } = require('../../package.json');
|
|
18
18
|
|
|
19
19
|
process.on('SIGINT', () => process.exit(0));
|
|
20
20
|
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
import chalk from 'chalk';
|
|
14
14
|
import inquirer from 'inquirer';
|
|
15
15
|
import ora from 'ora';
|
|
16
|
-
import { run, runLive } from '../../core/shell.js';
|
|
16
|
+
import { run, runLive, runInteractive } from '../../core/shell.js';
|
|
17
17
|
import { loadConfig } from '../../core/config.js';
|
|
18
18
|
import { ensureNginxInclude } from '../../core/nginx-conf-generator.js';
|
|
19
19
|
import { isWindows } from '../../core/platform.js';
|
|
@@ -251,6 +251,15 @@ async function stopNginx(nginxDir) {
|
|
|
251
251
|
|
|
252
252
|
async function installNginx() {
|
|
253
253
|
if (!isWindows) {
|
|
254
|
+
console.log(chalk.yellow('\n sudo password required to install nginx.\n'));
|
|
255
|
+
|
|
256
|
+
const auth = await runInteractive('sudo -v');
|
|
257
|
+
|
|
258
|
+
if (!auth.success) {
|
|
259
|
+
console.log(chalk.red(' sudo authentication failed.'));
|
|
260
|
+
return { success: false, message: 'sudo authentication failed', output: auth.stderr };
|
|
261
|
+
}
|
|
262
|
+
|
|
254
263
|
const spinner = ora('Installing nginx…').start();
|
|
255
264
|
const result = await run('sudo apt-get install -y nginx', { timeout: 120000 });
|
|
256
265
|
if (result.success) {
|
|
@@ -14,7 +14,7 @@ import { run } from '../../core/shell.js';
|
|
|
14
14
|
|
|
15
15
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
16
16
|
const isWindows = process.platform === 'win32';
|
|
17
|
-
const LOG_PATH = path.resolve(__dirname, '
|
|
17
|
+
const LOG_PATH = path.resolve(__dirname, '../../../data/dashboard.log');
|
|
18
18
|
const SERVER_PATH = path.resolve(__dirname, '../../dashboard/server.js');
|
|
19
19
|
|
|
20
20
|
// ─── Port helpers ─────────────────────────────────────────────────────────────
|
|
@@ -27,7 +27,7 @@ import { getDashboardStatus, startDashboard, stopDashboard } from './dashboard.j
|
|
|
27
27
|
|
|
28
28
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
29
29
|
const require = createRequire(import.meta.url);
|
|
30
|
-
const { version: currentVersion } = require('
|
|
30
|
+
const { version: currentVersion } = require('../../../package.json');
|
|
31
31
|
|
|
32
32
|
// ─── Version helpers ──────────────────────────────────────────────────────────
|
|
33
33
|
|
package/{core → src/core}/db.js
RENAMED
|
@@ -4,7 +4,7 @@ import path from 'path';
|
|
|
4
4
|
import { fileURLToPath } from 'url';
|
|
5
5
|
|
|
6
6
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
-
const DATA_DIR = path.join(__dirname, '..', 'data');
|
|
7
|
+
const DATA_DIR = path.join(__dirname, '..', '..', 'data');
|
|
8
8
|
const DB_PATH = path.join(DATA_DIR, 'easy-devops.sqlite');
|
|
9
9
|
|
|
10
10
|
try {
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* - getShell() — Returns OS-resolved shell descriptor { shell, flag }
|
|
10
10
|
* - run(cmd, options) — Executes a command and captures output; never throws
|
|
11
11
|
* - runLive(cmd, options) — Executes a command, streaming output to the terminal; never throws
|
|
12
|
+
* - runInteractive(cmd, options) — Executes a command with full stdio inheritance (Linux only); never throws
|
|
12
13
|
*
|
|
13
14
|
* CommandResult shape (returned by run()):
|
|
14
15
|
* { success: boolean, stdout: string, stderr: string, exitCode: number|null, command: string }
|
|
@@ -149,3 +150,38 @@ export function runLive(cmd, options = {}) {
|
|
|
149
150
|
});
|
|
150
151
|
});
|
|
151
152
|
}
|
|
153
|
+
|
|
154
|
+
// ─── runInteractive ───────────────────────────────────────────────────────────
|
|
155
|
+
|
|
156
|
+
/**
|
|
157
|
+
* Executes a shell command with full stdio inheritance (stdin/stdout/stderr all
|
|
158
|
+
* pass through to the terminal). Intended for Linux-only interactive commands
|
|
159
|
+
* such as `sudo -v` that need to read a password from the user.
|
|
160
|
+
*
|
|
161
|
+
* Never throws.
|
|
162
|
+
*
|
|
163
|
+
* @param {string} cmd - The command string to execute.
|
|
164
|
+
* @param {{ cwd?: string }} [options]
|
|
165
|
+
* @param {string} [options.cwd=process.cwd()] - Working directory for the child process.
|
|
166
|
+
* @returns {Promise<{ success: boolean, exitCode: number|null }>}
|
|
167
|
+
*/
|
|
168
|
+
export function runInteractive(cmd, options = {}) {
|
|
169
|
+
const { cwd = process.cwd() } = options;
|
|
170
|
+
const { shell, flag } = getShell();
|
|
171
|
+
|
|
172
|
+
return new Promise((resolve) => {
|
|
173
|
+
const child = spawn(shell, [flag, cmd], {
|
|
174
|
+
cwd,
|
|
175
|
+
stdio: 'inherit',
|
|
176
|
+
windowsHide: true,
|
|
177
|
+
});
|
|
178
|
+
|
|
179
|
+
child.on('close', (exitCode) => {
|
|
180
|
+
resolve({ success: exitCode === 0, exitCode });
|
|
181
|
+
});
|
|
182
|
+
|
|
183
|
+
child.on('error', (err) => {
|
|
184
|
+
resolve({ success: false, exitCode: null });
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
}
|
|
@@ -64,6 +64,7 @@ createApp({
|
|
|
64
64
|
configs: [], selectedConfig: '',
|
|
65
65
|
configContent: '', configSaving: false, configMsg: '',
|
|
66
66
|
logs: [], logsLoading: false,
|
|
67
|
+
configDropdownOpen: false,
|
|
67
68
|
},
|
|
68
69
|
|
|
69
70
|
ssl: {
|
|
@@ -80,6 +81,7 @@ createApp({
|
|
|
80
81
|
domains: {
|
|
81
82
|
list: [], loading: false, error: '',
|
|
82
83
|
showForm: false,
|
|
84
|
+
upstreamTypeOpen: false,
|
|
83
85
|
editingName: null, // T017: null = adding, string = editing
|
|
84
86
|
saving: false,
|
|
85
87
|
dirty: false, // T019: Track unsaved changes
|
|
@@ -720,4 +722,14 @@ createApp({
|
|
|
720
722
|
else { this.settings.error = r.data.error || 'Save failed'; }
|
|
721
723
|
},
|
|
722
724
|
},
|
|
723
|
-
})
|
|
725
|
+
})
|
|
726
|
+
.directive('click-outside', {
|
|
727
|
+
mounted(el, binding) {
|
|
728
|
+
el._clickOutside = (e) => { if (!el.contains(e.target)) binding.value(e); };
|
|
729
|
+
document.addEventListener('mousedown', el._clickOutside);
|
|
730
|
+
},
|
|
731
|
+
unmounted(el) {
|
|
732
|
+
document.removeEventListener('mousedown', el._clickOutside);
|
|
733
|
+
},
|
|
734
|
+
})
|
|
735
|
+
.mount('#app');
|
|
@@ -119,18 +119,119 @@ border-radius: 10px;
|
|
|
119
119
|
transition: border-color 200ms, box-shadow 200ms, background 200ms;
|
|
120
120
|
outline: none;
|
|
121
121
|
}
|
|
122
|
+
.form-input::placeholder {
|
|
123
|
+
color: var(--color-muted);
|
|
124
|
+
opacity: 0.55;
|
|
125
|
+
}
|
|
126
|
+
.form-input:hover:not(:focus):not(:disabled) {
|
|
127
|
+
border-color: rgba(var(--color-primary-rgb), 0.35);
|
|
128
|
+
}
|
|
122
129
|
.form-input:focus {
|
|
123
130
|
background: rgba(var(--color-primary-rgb), 0.05);
|
|
124
131
|
border-color: var(--color-primary);
|
|
125
132
|
box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
|
|
126
133
|
}
|
|
134
|
+
.form-input:disabled {
|
|
135
|
+
opacity: 0.45;
|
|
136
|
+
cursor: not-allowed;
|
|
137
|
+
}
|
|
127
138
|
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
139
|
+
/* ── Custom Select (cselect) ── */
|
|
140
|
+
.cselect {
|
|
141
|
+
position: relative;
|
|
142
|
+
min-width: 200px;
|
|
143
|
+
user-select: none;
|
|
144
|
+
}
|
|
145
|
+
.cselect__trigger {
|
|
146
|
+
width: 100%;
|
|
147
|
+
display: flex;
|
|
148
|
+
align-items: center;
|
|
149
|
+
justify-content: space-between;
|
|
150
|
+
gap: 10px;
|
|
151
|
+
padding: 9px 12px;
|
|
152
|
+
background: var(--color-input);
|
|
153
|
+
border: 1px solid var(--color-border);
|
|
154
|
+
border-radius: 10px;
|
|
155
|
+
color: var(--color-text);
|
|
156
|
+
font-size: 13px;
|
|
157
|
+
cursor: pointer;
|
|
158
|
+
text-align: left;
|
|
159
|
+
transition: border-color 150ms, box-shadow 150ms, background 150ms;
|
|
160
|
+
outline: none;
|
|
161
|
+
}
|
|
162
|
+
.cselect__trigger:hover {
|
|
163
|
+
border-color: rgba(var(--color-primary-rgb), 0.45);
|
|
164
|
+
}
|
|
165
|
+
.cselect--open .cselect__trigger {
|
|
166
|
+
border-color: var(--color-primary);
|
|
167
|
+
background: rgba(var(--color-primary-rgb), 0.04);
|
|
168
|
+
box-shadow: 0 0 0 3px rgba(var(--color-primary-rgb), 0.15);
|
|
169
|
+
}
|
|
170
|
+
.cselect__arrow {
|
|
171
|
+
width: 15px;
|
|
172
|
+
height: 15px;
|
|
173
|
+
flex-shrink: 0;
|
|
174
|
+
color: var(--color-muted);
|
|
175
|
+
transition: transform 200ms ease, color 200ms ease;
|
|
176
|
+
}
|
|
177
|
+
.cselect--open .cselect__arrow {
|
|
178
|
+
transform: rotate(180deg);
|
|
179
|
+
color: var(--color-primary);
|
|
180
|
+
}
|
|
181
|
+
.cselect__panel {
|
|
182
|
+
position: absolute;
|
|
183
|
+
top: calc(100% + 6px);
|
|
184
|
+
left: 0;
|
|
185
|
+
right: 0;
|
|
186
|
+
background: var(--color-surface);
|
|
187
|
+
border: 1px solid var(--color-border);
|
|
188
|
+
border-radius: 12px;
|
|
189
|
+
box-shadow: 0 12px 32px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.15);
|
|
190
|
+
z-index: 200;
|
|
191
|
+
overflow: hidden;
|
|
192
|
+
padding: 5px;
|
|
193
|
+
max-height: 240px;
|
|
194
|
+
overflow-y: auto;
|
|
195
|
+
}
|
|
196
|
+
.cselect__panel::-webkit-scrollbar { width: 4px; }
|
|
197
|
+
.cselect__panel::-webkit-scrollbar-track { background: transparent; }
|
|
198
|
+
.cselect__panel::-webkit-scrollbar-thumb { background: rgba(var(--color-primary-rgb), 0.3); border-radius: 9999px; }
|
|
199
|
+
.cselect__option {
|
|
200
|
+
width: 100%;
|
|
201
|
+
display: flex;
|
|
202
|
+
align-items: center;
|
|
203
|
+
gap: 8px;
|
|
204
|
+
padding: 8px 10px;
|
|
205
|
+
border-radius: 8px;
|
|
206
|
+
color: var(--color-muted);
|
|
207
|
+
font-size: 13px;
|
|
208
|
+
cursor: pointer;
|
|
209
|
+
background: none;
|
|
210
|
+
border: none;
|
|
211
|
+
text-align: left;
|
|
212
|
+
transition: background 100ms, color 100ms;
|
|
213
|
+
}
|
|
214
|
+
.cselect__option:hover {
|
|
215
|
+
background: rgba(var(--color-primary-rgb), 0.08);
|
|
216
|
+
color: var(--color-text);
|
|
217
|
+
}
|
|
218
|
+
.cselect__option--active {
|
|
219
|
+
color: var(--color-primary);
|
|
220
|
+
background: rgba(var(--color-primary-rgb), 0.07);
|
|
221
|
+
font-weight: 600;
|
|
222
|
+
}
|
|
223
|
+
.cselect__empty {
|
|
224
|
+
padding: 12px 10px;
|
|
225
|
+
font-size: 12px;
|
|
226
|
+
color: var(--color-muted);
|
|
227
|
+
text-align: center;
|
|
228
|
+
font-style: italic;
|
|
229
|
+
}
|
|
230
|
+
.cselect__dot {
|
|
231
|
+
width: 7px;
|
|
232
|
+
height: 7px;
|
|
233
|
+
border-radius: 50%;
|
|
234
|
+
flex-shrink: 0;
|
|
134
235
|
}
|
|
135
236
|
|
|
136
237
|
/* Buttons */
|
|
@@ -210,7 +311,7 @@ border-radius: 20px;
|
|
|
210
311
|
overflow: hidden;
|
|
211
312
|
border: 1px solid var(--color-border);
|
|
212
313
|
box-shadow: 0 40px 100px rgba(0,0,0,0.5), 0 16px 40px rgba(0,0,0,0.3);
|
|
213
|
-
max-height: 90vh;
|
|
314
|
+
max-height: min(90vh, calc(100dvh - 3rem));
|
|
214
315
|
position: relative;
|
|
215
316
|
background: var(--color-surface);
|
|
216
317
|
}
|
|
@@ -482,6 +583,9 @@ box-shadow: 0 0 0 2px var(--color-bg), 0 0 0 4px currentColor;
|
|
|
482
583
|
<body class="font-sans antialiased text-[14px]">
|
|
483
584
|
|
|
484
585
|
<div id="app" v-cloak class="min-h-screen flex text-foreground bg-background relative z-0">
|
|
586
|
+
<!-- Domain Form Modal — mounted at app root to avoid stacking context / overflow clipping issues -->
|
|
587
|
+
<%- include('partials/domain-form.ejs') %>
|
|
588
|
+
|
|
485
589
|
<!-- Login partial -->
|
|
486
590
|
<%- include('partials/login.ejs') %>
|
|
487
591
|
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
<div v-if="domains.showForm" class="fixed inset-0 z-50 flex items-center justify-center p-4 sm:p-6 modal-overlay">
|
|
4
4
|
|
|
5
5
|
<!-- Modal Card -->
|
|
6
|
-
<div class="relative w-full max-w-4xl
|
|
6
|
+
<div class="relative w-full max-w-4xl flex flex-col modal-card">
|
|
7
7
|
|
|
8
8
|
<!-- Modal Header -->
|
|
9
9
|
<div class="flex items-center justify-between p-5 border-b border-border shrink-0" style="background: rgba(0,0,0,0.1)">
|
|
@@ -83,7 +83,7 @@
|
|
|
83
83
|
</div>
|
|
84
84
|
|
|
85
85
|
<!-- Modal Body (Scrollable) -->
|
|
86
|
-
<div class="flex-1 overflow-y-auto w-full flex flex-col pb-6 rounded-b-[20px] bg-transparent">
|
|
86
|
+
<div class="flex-1 min-h-0 overflow-y-auto w-full flex flex-col pb-6 rounded-b-[20px] bg-transparent">
|
|
87
87
|
|
|
88
88
|
<!-- Accordion Section: Basic -->
|
|
89
89
|
<div class="border-b border-border">
|
|
@@ -111,11 +111,34 @@
|
|
|
111
111
|
|
|
112
112
|
<div class="w-full">
|
|
113
113
|
<label class="form-label">Upstream Type</label>
|
|
114
|
-
<
|
|
115
|
-
|
|
116
|
-
<
|
|
117
|
-
|
|
118
|
-
|
|
114
|
+
<div class="cselect" :class="{ 'cselect--open': domains.upstreamTypeOpen }"
|
|
115
|
+
v-click-outside="() => domains.upstreamTypeOpen = false">
|
|
116
|
+
<button type="button" class="cselect__trigger"
|
|
117
|
+
@click="domains.upstreamTypeOpen = !domains.upstreamTypeOpen">
|
|
118
|
+
<span class="flex items-center gap-2">
|
|
119
|
+
<span class="cselect__dot"
|
|
120
|
+
:style="{ background: domains.form.upstreamType === 'http' ? '#3b82f6' : domains.form.upstreamType === 'https' ? '#22c55e' : '#a855f7' }">
|
|
121
|
+
</span>
|
|
122
|
+
{{ domains.form.upstreamType === 'http' ? 'HTTP' : domains.form.upstreamType === 'https' ? 'HTTPS' : 'WebSocket' }}
|
|
123
|
+
</span>
|
|
124
|
+
<svg class="cselect__arrow" viewBox="0 0 20 20" fill="currentColor">
|
|
125
|
+
<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"/>
|
|
126
|
+
</svg>
|
|
127
|
+
</button>
|
|
128
|
+
<div class="cselect__panel" v-show="domains.upstreamTypeOpen">
|
|
129
|
+
<button v-for="opt in [{v:'http',l:'HTTP',c:'#3b82f6'},{v:'https',l:'HTTPS',c:'#22c55e'},{v:'ws',l:'WebSocket',c:'#a855f7'}]"
|
|
130
|
+
:key="opt.v" type="button"
|
|
131
|
+
class="cselect__option"
|
|
132
|
+
:class="{ 'cselect__option--active': domains.form.upstreamType === opt.v }"
|
|
133
|
+
@mousedown.prevent="domains.form.upstreamType = opt.v; domains.upstreamTypeOpen = false">
|
|
134
|
+
<span class="cselect__dot" :style="{ background: opt.c }"></span>
|
|
135
|
+
<span>{{ opt.l }}</span>
|
|
136
|
+
<svg v-if="domains.form.upstreamType === opt.v" class="w-3.5 h-3.5 shrink-0 ml-auto" fill="currentColor" viewBox="0 0 20 20">
|
|
137
|
+
<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"/>
|
|
138
|
+
</svg>
|
|
139
|
+
</button>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
119
142
|
</div>
|
|
120
143
|
|
|
121
144
|
<div class="flex items-center justify-between p-4 bg-black/10 dark:bg-black/20 border border-border w-full md:col-span-2 rounded-[12px]">
|
|
@@ -11,9 +11,6 @@
|
|
|
11
11
|
</button>
|
|
12
12
|
</div>
|
|
13
13
|
|
|
14
|
-
<!-- Domain Form Modal / Drawer Equivalent -->
|
|
15
|
-
<%- include('domain-form.ejs') %>
|
|
16
|
-
|
|
17
14
|
<!-- Data Display -->
|
|
18
15
|
<div v-if="domains.loading" class="text-muted text-sm flex items-center gap-2">
|
|
19
16
|
<!-- Skeleton loader instead of spinner -->
|
|
@@ -57,10 +57,31 @@ Start
|
|
|
57
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
58
|
<h3 class="form-label !mb-0 font-bold">Config Editor</h3>
|
|
59
59
|
<div class="flex gap-3">
|
|
60
|
-
|
|
61
|
-
<
|
|
62
|
-
|
|
63
|
-
|
|
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>
|
|
64
85
|
<button @click="saveNginxConfig" :disabled="!nginx.selectedConfig || nginx.configSaving" class="btn btn-primary min-w-[80px]">
|
|
65
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>
|
|
66
87
|
{{ nginx.configSaving ? 'Wait...' : 'Save' }}
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
<div class="w-full">
|
|
20
20
|
<label class="form-label">Dashboard Port</label>
|
|
21
|
-
<input v-model.number="settings.dashboardPort" type="number" class="form-input" placeholder="
|
|
21
|
+
<input v-model.number="settings.dashboardPort" type="number" class="form-input" placeholder="6443" />
|
|
22
22
|
<p class="text-[11px] text-muted mt-2 font-bold tracking-wide uppercase opacity-70">Restart dashboard after changing</p>
|
|
23
23
|
</div>
|
|
24
24
|
|
|
@@ -101,7 +101,7 @@ _pick_tty() {
|
|
|
101
101
|
fi
|
|
102
102
|
|
|
103
103
|
local ch seq1 seq2
|
|
104
|
-
IFS= read -r -n1 ch 2>/dev/null || ch=""
|
|
104
|
+
IFS= read -r -n1 ch < /dev/tty 2>/dev/null || ch=""
|
|
105
105
|
|
|
106
106
|
# Check flag again after read (signal may have arrived during read)
|
|
107
107
|
if [ "$_cancelled" = "true" ]; then
|
|
@@ -109,8 +109,8 @@ _pick_tty() {
|
|
|
109
109
|
fi
|
|
110
110
|
|
|
111
111
|
if [ "$ch" = $'\x1b' ]; then
|
|
112
|
-
IFS= read -r -n1 -t 0.1 seq1 2>/dev/null || seq1=""
|
|
113
|
-
IFS= read -r -n1 -t 0.1 seq2 2>/dev/null || seq2=""
|
|
112
|
+
IFS= read -r -n1 -t 0.1 seq1 < /dev/tty 2>/dev/null || seq1=""
|
|
113
|
+
IFS= read -r -n1 -t 0.1 seq2 < /dev/tty 2>/dev/null || seq2=""
|
|
114
114
|
if [ "$seq1" = "[" ]; then
|
|
115
115
|
case "$seq2" in
|
|
116
116
|
A) [ "$selected" -gt 0 ] && selected=$(( selected - 1 )) ;;
|
|
@@ -164,7 +164,7 @@ _pick_numbered() {
|
|
|
164
164
|
local choice
|
|
165
165
|
while true; do
|
|
166
166
|
printf 'Enter number (1-%d), or q to quit: ' "$count"
|
|
167
|
-
IFS= read -r choice
|
|
167
|
+
IFS= read -r choice < /dev/tty
|
|
168
168
|
if [ "$choice" = "q" ] || [ "$choice" = "Q" ]; then
|
|
169
169
|
return 2
|
|
170
170
|
fi
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|