优化ui 添加诊断功能

This commit is contained in:
qaq
2025-06-26 14:12:31 +08:00
parent 325b1da3da
commit 8972f6d9fc
20 changed files with 1910 additions and 1658 deletions
+23
View File
@@ -498,6 +498,29 @@ SET @sql = (
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
-- traffic_ratio (流量倍率)
SET @sql = (
SELECT IF(
NOT EXISTS (
SELECT 1
FROM information_schema.COLUMNS
WHERE table_schema = DATABASE()
AND table_name = 'tunnel'
AND column_name = 'traffic_ratio'
),
'ALTER TABLE \`tunnel\` ADD COLUMN \`traffic_ratio\` DECIMAL(5,1) DEFAULT 1.0 COMMENT "流量倍率";',
'SELECT "Column \`traffic_ratio\` already exists in \`tunnel\`";'
)
);
PREPARE stmt FROM @sql;
EXECUTE stmt;
DEALLOCATE PREPARE stmt;
-- 为现有数据设置默认流量倍率
UPDATE \`tunnel\`
SET \`traffic_ratio\` = 1.0
WHERE \`traffic_ratio\` IS NULL;
EOF
# 检查数据库容器