better tree draw Log items in log page

node-20
Moe 2023-09-20 11:32:54 -07:00
parent 38f5522627
commit a70a4b00bf
2 changed files with 11 additions and 4 deletions

View File

@ -431,3 +431,8 @@ ul.squeeze {
flex-direction: column;
height: 100vh;
}
.log-item .msg-tree > ul {
list-style: none;
padding-left: 0;
}

View File

@ -327,11 +327,13 @@ function compileConnectUrl(options){
function jsonToHtmlBlock(target){
var html = ''
if(target instanceof Object){
var html = '<ul>'
$.each(target,function(key,value){
html += `<div>
<b>${key}</b> : ${jsonToHtmlBlock(value)}
</div>`
html += `
<li><b>${key}</b> : ${jsonToHtmlBlock(value)}</li>
`
})
html += '</ul>'
}else{
html += `<span>${target}</span>`
}
@ -836,7 +838,7 @@ function buildLogRow(v){
<small class="${definitions.Theme.isDark ? 'text-white' : ''}">${humanMonitorName}${v.info && v.info.type ? v.info.type : v.mid}</small>
</div>
<div class="card-body">
<div>${jsonToHtmlBlock(v.info.msg)}</div>
<div class="msg-tree">${jsonToHtmlBlock(v.info.msg)}</div>
</div>
<div class="card-footer">
<small class="text-muted">${formattedTime(v.time)}</small>