Skip to content

Commit 4465e9c

Browse files
authored
Merge pull request #91 from smileoniks-ctrl/main
Fix node activity toggle runtime state
2 parents ac1705b + a85b521 commit 4465e9c

16 files changed

Lines changed: 1093 additions & 42 deletions

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -523,6 +523,7 @@ Required scope: `users:read` (GET) / `users:write` (POST, PUT, DELETE)
523523
| POST | `/api/users` | Create user |
524524
| PUT | `/api/users/:userId` | Update user |
525525
| DELETE | `/api/users/:userId` | Delete user |
526+
| POST | `/api/users/bulk-delete` | Delete selected users (best-effort) |
526527
| POST | `/api/users/:userId/enable` | Enable user |
527528
| POST | `/api/users/:userId/disable` | Disable user |
528529
| POST | `/api/users/:userId/groups` | Add user to groups |
@@ -890,4 +891,4 @@ Pull requests welcome!
890891

891892
## 📄 License
892893

893-
MIT
894+
MIT

docker-compose.local.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ services:
7070
ACME_EMAIL: ${ACME_EMAIL:-dev@example.com}
7171
ENCRYPTION_KEY: ${ENCRYPTION_KEY:-localdevencryptionkey0123456789ab}
7272
SESSION_SECRET: ${SESSION_SECRET:-localdevsessionsecret}
73+
SESSION_COOKIE_SECURE: ${SESSION_COOKIE_SECURE:-false}
7374
LOG_LEVEL: ${LOG_LEVEL:-debug}
7475
networks:
7576
- hysteria-net

docker.env.example

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ MONGO_USER=hysteria
3636
# Для локальной разработки по HTTP без домена см. docker-compose.local.yml.
3737
# USE_CADDY=true
3838

39+
# Secure-cookie для сессии админа. По умолчанию включено.
40+
# docker-compose.local.yml выставляет false для локального HTTP.
41+
# SESSION_COOKIE_SECURE=true
42+
3943
# Порт backend сервиса (по умолчанию: 3000)
4044
# PORT=3000
4145

@@ -62,4 +66,4 @@ LOG_LEVEL=info
6266
# Защита от перегрузки CPU при сетевой нестабильности (issue #70).
6367
# По умолчанию: 3. Увеличивать на свой риск — на 1 vCPU больше 3 хэндшейков
6468
# одновременно гарантированно сажают панель.
65-
# SSH_DIRECT_MAX_CONCURRENT=3
69+
# SSH_DIRECT_MAX_CONCURRENT=3

index.js

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ const panelRoutes = require('./src/routes/panel');
4040
const mcpRoutes = require('./src/routes/mcp');
4141
const marzbanCompat = require('./src/routes/marzbanCompat');
4242
const { subscriptionLimiter, applyRateLimits } = require('./src/utils/rateLimiters');
43+
const { buildSessionCookieOptions } = require('./src/utils/sessionCookie');
4344

4445
const helmet = require('helmet');
4546
const app = express();
@@ -81,11 +82,7 @@ function initSessionMiddleware() {
8182
secret: config.SESSION_SECRET,
8283
resave: false,
8384
saveUninitialized: false,
84-
cookie: {
85-
secure: true,
86-
sameSite: 'strict',
87-
maxAge: 24 * 60 * 60 * 1000
88-
}
85+
cookie: buildSessionCookieOptions()
8986
});
9087
}
9188

@@ -1049,4 +1046,4 @@ process.on('uncaughtException', (err) => {
10491046
shutdown('uncaughtException').catch(() => process.exit(1));
10501047
});
10511048

1052-
startServer();
1049+
startServer();

public/css/style.css

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -992,6 +992,32 @@ html {
992992
transition: all var(--transition);
993993
}
994994

995+
.user-row.is-selected {
996+
background: var(--accent-glow);
997+
}
998+
999+
.user-select-cell {
1000+
width: 42px;
1001+
min-width: 42px;
1002+
text-align: center;
1003+
}
1004+
1005+
.user-select-checkbox {
1006+
width: 16px;
1007+
height: 16px;
1008+
accent-color: var(--accent);
1009+
cursor: pointer;
1010+
}
1011+
1012+
.bulk-delete-btn {
1013+
margin-left: 8px;
1014+
white-space: nowrap;
1015+
}
1016+
1017+
.bulk-delete-btn[hidden] {
1018+
display: none !important;
1019+
}
1020+
9951021
.user-info {
9961022
display: flex;
9971023
flex-direction: column;
@@ -2765,9 +2791,27 @@ html {
27652791
margin-bottom: 12px;
27662792
gap: 12px;
27672793
}
2794+
2795+
.mobile-user-title-wrap {
2796+
display: flex;
2797+
align-items: flex-start;
2798+
gap: 10px;
2799+
min-width: 0;
2800+
}
2801+
2802+
.mobile-user-card.is-selected {
2803+
border-color: var(--accent);
2804+
background: rgba(99, 102, 241, 0.12);
2805+
}
2806+
2807+
.mobile-user-select {
2808+
margin-top: 2px;
2809+
flex: 0 0 auto;
2810+
}
27682811

27692812
.mobile-node-title {
27702813
flex: 1;
2814+
min-width: 0;
27712815
}
27722816

27732817
.mobile-node-title strong {

0 commit comments

Comments
 (0)