Skip to content

Commit 876a56c

Browse files
committed
Log viewer: Limit column width
Signed-off-by: Florian Hotze <[email protected]>
1 parent 7ef5b6f commit 876a56c

File tree

1 file changed

+12
-2
lines changed

1 file changed

+12
-2
lines changed

bundles/org.openhab.ui/web/src/pages/developer/log-viewer.vue

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -227,10 +227,17 @@
227227
td.sticky
228228
position sticky
229229
left 0
230+
width 105px
230231
color black
231232
background #f1f1f1
232233
z-index 1
233234
235+
td.level
236+
width 50px
237+
238+
td.logger
239+
width 280px
240+
234241
tr.table-rows
235242
height 31px
236243
@@ -335,6 +342,7 @@ export default {
335342
batchLogs: [],
336343
nextId: 0,
337344
maxEntries: 2000,
345+
maxLoggerNameLength: 40,
338346
logStart: '--:--:--',
339347
logEnd: '--:--:--',
340348
currentHighlightColorItemIndex: null,
@@ -449,9 +457,11 @@ export default {
449457
renderEntry (entity) {
450458
let tr = document.createElement('tr')
451459
tr.className = 'table-rows ' + entity.level.toLowerCase()
460+
let loggerName = entity.loggerName
461+
if (loggerName.length > this.maxLoggerNameLength) loggerName = loggerName.substring(loggerName.length - this.maxLoggerNameLength)
452462
tr.innerHTML = `<td class="sticky">${entity.time}<span class="milliseconds">${entity.milliseconds}</span></td>` +
453-
`<td>${entity.level}</td>` +
454-
`<td>${entity.loggerName}</td>` +
463+
`<td class="level">${entity.level}</td>` +
464+
`<td class="logger">${loggerName}</td>` +
455465
`<td class="nowrap">${this.highlightText(entity.message)}</td>`
456466
return tr
457467
},

0 commit comments

Comments
 (0)