fix: SHOW TABLE STATUS 列名小写化修复前端 key 警告 + table-detail 400 错误
根因: Go 后端 DetailListTables 返回 SHOW TABLE STATUS 原始列名(如 Name, Engine, Rows) 前端 TableMeta 使用小写 key(name, engine, rows), 导致 t.name = undefined 结果: key 警告 + handleExpandTable(dbName, undefined) 触发 table-detail 400 修复: instance_detail.go 中 DetailListTables 将列名统一 strings.ToLower()
This commit is contained in:
1 parent
14e394fb09
commit
8469df359f
1 file changed
+3
-2
@@ -105,14 +105,15 @@ func DetailListTables(c *gin.Context) {
|
||||
ptrValues[i] = &values[i]
|
||||
}
|
||||
rows.Scan(ptrValues...)
|
||||
// Normalize to lowercase keys for frontend compatibility
|
||||
rowMap := make(map[string]interface{})
|
||||
for i, col := range cols {
|
||||
val := values[i]
|
||||
b, ok := val.([]byte)
|
||||
if ok {
|
||||
rowMap[col] = string(b)
|
||||
rowMap[strings.ToLower(col)] = string(b)
|
||||
} else {
|
||||
rowMap[col] = val
|
||||
rowMap[strings.ToLower(col)] = val
|
||||
}
|
||||
}
|
||||
tables = append(tables, rowMap)
|
||||
|
||||
Reference in new issue
Block a user