ConnLogs: return object with _diag for troubleshooting + frontend compat
API now returns:
{
"logs": [...], // ConnectionLog array (same fields as before)
"_diag": [...] // status.log paths/existence/parse status per instance
}
Frontend updated to handle both array (legacy) and object format.
This makes it easy to diagnose:
- Which status.log paths the backend looked at
- Whether files exist and their sizes
- How many entries were parsed
- Any parse errors
User just needs to: git pull && rebuild && restart on production.
This commit is contained in:
@@ -33,7 +33,11 @@ const list = ref([])
|
||||
const instances = ref([])
|
||||
const instanceId = ref('')
|
||||
|
||||
async function load() { list.value = await Logs.conns(instanceId.value) }
|
||||
async function load() {
|
||||
const r = await Logs.conns(instanceId.value)
|
||||
// 后端可能返回数组(旧)或 {logs:[...], _diag:[...]}(新)
|
||||
list.value = Array.isArray(r) ? r : (r.logs || [])
|
||||
}
|
||||
function fmt(n) {
|
||||
if (!n) return '0'
|
||||
const u = ['B','KB','MB','GB','TB']; let i=0,v=n
|
||||
|
||||
Reference in New Issue
Block a user