Skip to content

Commit

Permalink
Log viewer: Limit column width
Browse files Browse the repository at this point in the history
Signed-off-by: Florian Hotze <[email protected]>
  • Loading branch information
florian-h05 committed Jan 13, 2025
1 parent 7ef5b6f commit 6c0597d
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions bundles/org.openhab.ui/web/src/pages/developer/log-viewer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -227,9 +227,18 @@
td.sticky
position sticky
left 0
width 105px
color black
background #f1f1f1
z-index 1
white-space nowrap
overflow hidden
td.level
width 50px
td.logger
width 280px
tr.table-rows
height 31px
Expand Down Expand Up @@ -335,6 +344,7 @@ export default {
batchLogs: [],
nextId: 0,
maxEntries: 2000,
maxLoggerNameLength: 40,
logStart: '--:--:--',
logEnd: '--:--:--',
currentHighlightColorItemIndex: null,
Expand Down Expand Up @@ -425,11 +435,11 @@ export default {
this.addLogEntry(event)
}
const heartbeatCallback = () => {
const keepaliveCallback = () => {
this.socket.send('[]')
}
this.socket = this.$oh.ws.connect('/ws/logs', messageCallback, heartbeatCallback, readyCallback, null, 9)
this.socket = this.$oh.ws.connect('/ws/logs', messageCallback, readyCallback, null, keepaliveCallback, 9)
// TEMP
// for (let i = 0; i < 1980; i++) {
Expand All @@ -449,9 +459,11 @@ export default {
renderEntry (entity) {
let tr = document.createElement('tr')
tr.className = 'table-rows ' + entity.level.toLowerCase()
let loggerName = entity.loggerName
if (loggerName.length > this.maxLoggerNameLength) loggerName = loggerName.substring(loggerName.length - this.maxLoggerNameLength)
tr.innerHTML = `<td class="sticky">${entity.time}<span class="milliseconds">${entity.milliseconds}</span></td>` +
`<td>${entity.level}</td>` +
`<td>${entity.loggerName}</td>` +
`<td class="level">${entity.level}</td>` +
`<td class="logger">${loggerName}</td>` +
`<td class="nowrap">${this.highlightText(entity.message)}</td>`
return tr
},
Expand Down

0 comments on commit 6c0597d

Please sign in to comment.