@imenam/self-register-proxy 1.0.42 → 1.0.45
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 +74 -8
- package/config.js +40 -2
- package/package.json +1 -1
- package/proxy.js +39 -2
- package/routes/dashboard.js +1 -1
- package/routes/metaConfig.js +2 -2
- package/services/auth.js +20 -2
- package/services/portManager.js +59 -4
- package/views/dashboard.js +309 -803
- package/views/login.js +61 -130
- package/views/metaConfigs.js +403 -643
- package/views/terminal.html +272 -691
- package/views/terminal.js +34 -30
- package/views/theme.js +431 -0
package/views/login.js
CHANGED
|
@@ -1,130 +1,61 @@
|
|
|
1
|
-
const { escapeHtml } = require('../services/proxyRouter');
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
*
|
|
6
|
-
* @param {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
<
|
|
12
|
-
|
|
13
|
-
<meta
|
|
14
|
-
<
|
|
15
|
-
<
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
margin-bottom: 0.25rem;
|
|
63
|
-
display: block;
|
|
64
|
-
}
|
|
65
|
-
.form-group input {
|
|
66
|
-
background: rgba(0, 0, 0, 0.3);
|
|
67
|
-
border: 1px solid rgba(255, 255, 255, 0.1);
|
|
68
|
-
padding: 0.6rem 0.75rem;
|
|
69
|
-
border-radius: 6px;
|
|
70
|
-
color: white;
|
|
71
|
-
font-family: inherit;
|
|
72
|
-
font-size: 0.9rem;
|
|
73
|
-
width: 100%;
|
|
74
|
-
}
|
|
75
|
-
.form-group input:focus {
|
|
76
|
-
outline: none;
|
|
77
|
-
border-color: #8b5cf6;
|
|
78
|
-
background: rgba(0, 0, 0, 0.4);
|
|
79
|
-
}
|
|
80
|
-
.submit-btn {
|
|
81
|
-
background: linear-gradient(90deg, #6366f1, #8b5cf6);
|
|
82
|
-
color: white;
|
|
83
|
-
border: none;
|
|
84
|
-
padding: 0.6rem 1.25rem;
|
|
85
|
-
border-radius: 6px;
|
|
86
|
-
font-weight: 600;
|
|
87
|
-
font-size: 0.85rem;
|
|
88
|
-
cursor: pointer;
|
|
89
|
-
transition: opacity 0.2s;
|
|
90
|
-
width: 100%;
|
|
91
|
-
}
|
|
92
|
-
.submit-btn:hover {
|
|
93
|
-
opacity: 0.9;
|
|
94
|
-
}
|
|
95
|
-
.error-msg {
|
|
96
|
-
background: rgba(239, 68, 68, 0.15);
|
|
97
|
-
border: 1px solid rgba(239, 68, 68, 0.3);
|
|
98
|
-
color: #fca5a5;
|
|
99
|
-
padding: 0.5rem 0.75rem;
|
|
100
|
-
border-radius: 6px;
|
|
101
|
-
font-size: 0.8rem;
|
|
102
|
-
margin-bottom: 1rem;
|
|
103
|
-
}
|
|
104
|
-
@media (max-width: 600px) {
|
|
105
|
-
.login-container {
|
|
106
|
-
max-width: none;
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
</style>
|
|
110
|
-
</head>
|
|
111
|
-
<body>
|
|
112
|
-
<div class="login-container">
|
|
113
|
-
<h1>${escapeHtml(proxyName)}</h1>
|
|
114
|
-
<p class="subtitle">Connexion administrateur</p>
|
|
115
|
-
<div class="login-box">
|
|
116
|
-
<form method="POST" action="/proxy/login">
|
|
117
|
-
${error ? '<div class="error-msg">Mot de passe incorrect</div>' : ''}
|
|
118
|
-
<div class="form-group">
|
|
119
|
-
<label for="password">Mot de passe</label>
|
|
120
|
-
<input type="password" id="password" name="password" required autofocus>
|
|
121
|
-
</div>
|
|
122
|
-
<button type="submit" class="submit-btn">Connexion</button>
|
|
123
|
-
</form>
|
|
124
|
-
</div>
|
|
125
|
-
</div>
|
|
126
|
-
</body>
|
|
127
|
-
</html>`;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
module.exports = { renderLogin };
|
|
1
|
+
const { escapeHtml } = require('../services/proxyRouter');
|
|
2
|
+
const { BASE_CSS, icon } = require('./theme');
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Page de connexion administrateur
|
|
6
|
+
* @param {string} proxyName
|
|
7
|
+
* @param {boolean} error
|
|
8
|
+
*/
|
|
9
|
+
function renderLogin(proxyName, error) {
|
|
10
|
+
return `<!DOCTYPE html>
|
|
11
|
+
<html lang="fr">
|
|
12
|
+
<head>
|
|
13
|
+
<meta charset="UTF-8">
|
|
14
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
15
|
+
<title>${escapeHtml(proxyName)} — Connexion</title>
|
|
16
|
+
<style>
|
|
17
|
+
${BASE_CSS}
|
|
18
|
+
body { display: flex; align-items: center; justify-content: center; padding: 24px; }
|
|
19
|
+
.login { width: 100%; max-width: 320px; text-align: center; }
|
|
20
|
+
.login-logo {
|
|
21
|
+
width: 44px; height: 44px; border-radius: 12px; background: var(--accent);
|
|
22
|
+
display: grid; place-items: center; color: #fff; margin: 0 auto 16px;
|
|
23
|
+
}
|
|
24
|
+
.login h1 { font-size: 20px; font-weight: 600; }
|
|
25
|
+
.login-sub { font-size: 14px; color: var(--text-3); margin-top: 4px; }
|
|
26
|
+
.login form { margin-top: 40px; }
|
|
27
|
+
.login-field { position: relative; }
|
|
28
|
+
.login-field svg { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); color: var(--text-3); }
|
|
29
|
+
.login-field input {
|
|
30
|
+
width: 100%; height: 44px; padding: 0 16px 0 42px;
|
|
31
|
+
background: var(--surface); border: 1px solid var(--border); border-radius: 10px;
|
|
32
|
+
color: var(--text); font-family: inherit; font-size: 15px;
|
|
33
|
+
}
|
|
34
|
+
.login-field input:focus { outline: none; border-color: var(--accent); }
|
|
35
|
+
.login .btn-primary { width: 100%; height: 44px; margin-top: 12px; border-radius: 10px; font-size: 14px; }
|
|
36
|
+
.login-error {
|
|
37
|
+
display: flex; align-items: center; justify-content: center; gap: 8px;
|
|
38
|
+
margin-top: 18px; font-size: 13px; color: var(--red);
|
|
39
|
+
}
|
|
40
|
+
</style>
|
|
41
|
+
</head>
|
|
42
|
+
<body>
|
|
43
|
+
<main class="login">
|
|
44
|
+
<div class="login-logo">${icon('network', 24)}</div>
|
|
45
|
+
<h1>${escapeHtml(proxyName)}</h1>
|
|
46
|
+
<p class="login-sub">Connexion administrateur</p>
|
|
47
|
+
|
|
48
|
+
<form method="POST" action="/proxy/login">
|
|
49
|
+
<div class="login-field">
|
|
50
|
+
${icon('lock')}
|
|
51
|
+
<input type="password" id="password" name="password" placeholder="Mot de passe" required autofocus>
|
|
52
|
+
</div>
|
|
53
|
+
<button type="submit" class="btn btn-primary">Se connecter</button>
|
|
54
|
+
${error ? `<p class="login-error">${icon('circleAlert', 14)}<span>Mot de passe incorrect</span></p>` : ''}
|
|
55
|
+
</form>
|
|
56
|
+
</main>
|
|
57
|
+
</body>
|
|
58
|
+
</html>`;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
module.exports = { renderLogin };
|