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 <dev@florianhotze.com>
  • Loading branch information
florian-h05 committed Jan 13, 2025
1 parent 7ef5b6f commit 876a56c
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 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,10 +227,17 @@
td.sticky
position sticky
left 0
width 105px
color black
background #f1f1f1
z-index 1
td.level
width 50px
td.logger
width 280px
tr.table-rows
height 31px
Expand Down Expand Up @@ -335,6 +342,7 @@ export default {
batchLogs: [],
nextId: 0,
maxEntries: 2000,
maxLoggerNameLength: 40,
logStart: '--:--:--',
logEnd: '--:--:--',
currentHighlightColorItemIndex: null,
Expand Down Expand Up @@ -449,9 +457,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 876a56c

Please sign in to comment.