v1.3.251212

This commit is contained in:
2025-12-15 07:55:31 +00:00
parent 0cc8f13231
commit c9a95ca5c8
13 changed files with 3621 additions and 30 deletions

View File

@@ -335,18 +335,20 @@ app.post('/admin/users', authenticateToken, async (req, res) => {
if (licenseModel.includes('EST-05E')) {
maxUsers = 10;
} else if (licenseModel.includes('EST-10E')) {
maxUsers = 40;
maxUsers = 60;
} else if (licenseModel.includes('EST-100E')) {
maxUsers = 100;
} else if (licenseModel.includes('EST-05C')) {
maxUsers = 10;
} else if (licenseModel.includes('EST-10C')) {
maxUsers = 40;
maxUsers = 60;
} else if (licenseModel.includes('EST-100C')) {
maxUsers = 100;
} else if (licenseModel.includes('EST-10A')) {
maxUsers = 60;
} else if (licenseModel.includes('EST-100')) {
} else if (licenseModel.includes('EST-100A')) {
maxUsers = 100;
}else if (licenseModel.includes('EST-100D')) {
maxUsers = 100;
}
@@ -975,7 +977,7 @@ app.post('/admin/toggle-scenario', authenticateToken, async (req, res) => {
maxScenarioUsers = 5;
break;
case 'EST-10E':
maxScenarioUsers = 20;
maxScenarioUsers = 30;
break;
case 'EST-100E':
maxScenarioUsers = 50;
@@ -984,15 +986,18 @@ app.post('/admin/toggle-scenario', authenticateToken, async (req, res) => {
maxScenarioUsers = 5;
break;
case 'EST-10C':
maxScenarioUsers = 20;
maxScenarioUsers = 30;
break;
case 'EST-100C':
maxScenarioUsers = 50;
break;
case 'EST-10A':
maxScenarioUsers = 20;
maxScenarioUsers = 30;
break;
case 'EST-100':
case 'EST-100A':
maxScenarioUsers = 50;
break;
case 'EST-100D':
maxScenarioUsers = 50;
break;
default:
@@ -1126,7 +1131,6 @@ app.post('/network-config', authenticateToken, async (req, res) => {
});
}
// 验证必需字段(仅校验 BOOTPROTO
if (!config.BOOTPROTO) {
return res.status(400).json({
success: false,
@@ -1154,7 +1158,6 @@ app.post('/network-config', authenticateToken, async (req, res) => {
}
}
// 仅更新指定字段,其它键保持不变
const existingConfig = await readNetworkConfig();
const allowedUpdateKeys = ['BOOTPROTO', 'IPADDR', 'NETMASK', 'GATEWAY', 'DNS'];
const updatedConfig = { ...existingConfig };
@@ -1212,4 +1215,4 @@ process.on('uncaughtException', (error) => {
// 捕获未处理的 Promise 拒绝并记录日志
process.on('unhandledRejection', (reason, promise) => {
log(`Unhandled Rejection at: ${promise}, reason: ${reason}`);
});
});