添加更多的延迟选择

This commit is contained in:
CN-JS-HuiBai
2026-04-05 23:53:22 +08:00
parent 4e953c01fc
commit dddf9dba65
4 changed files with 287 additions and 141 deletions

View File

@@ -14,7 +14,8 @@ const REQUIRED_TABLES = [
'prometheus_sources',
'site_settings',
'traffic_stats',
'server_locations'
'server_locations',
'latency_routes'
];
async function checkAndFixDatabase() {
@@ -145,6 +146,18 @@ async function createTable(tableName) {
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
`);
break;
case 'latency_routes':
await db.query(`
CREATE TABLE IF NOT EXISTS latency_routes (
id INT AUTO_INCREMENT PRIMARY KEY,
source_id INT NOT NULL,
latency_source VARCHAR(100) NOT NULL,
latency_dest VARCHAR(100) NOT NULL,
latency_target VARCHAR(255) NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
`);
break;
case 'server_locations':
await db.query(`
CREATE TABLE IF NOT EXISTS server_locations (