chore(widgets): 🔧 Update widget-related utility file HealthMonitor.ts with latest configuration/bug fixes
This commit is contained in:
parent
54ae93c4da
commit
0d204112a5
1 changed files with 12 additions and 1 deletions
|
|
@ -433,13 +433,24 @@ export class HealthMonitor {
|
|||
// Build output lines
|
||||
const outputLines: string[] = Array(this.MAX_LINES).fill('')
|
||||
|
||||
// Calculate max width per column for proper spacing
|
||||
const columnWidths: number[] = []
|
||||
for (const column of visibleColumns) {
|
||||
const maxWidth = Math.max(...column.map(item => this.stripTags(item.text).length))
|
||||
columnWidths.push(maxWidth)
|
||||
}
|
||||
|
||||
for (let colIdx = 0; colIdx < visibleColumns.length; colIdx++) {
|
||||
const column = visibleColumns[colIdx]
|
||||
const columnWidth = columnWidths[colIdx]
|
||||
|
||||
for (let lineIdx = 0; lineIdx < column.length && lineIdx < this.MAX_LINES; lineIdx++) {
|
||||
const item = column[lineIdx]
|
||||
if (item) {
|
||||
// Pad previous content on this line and append this item
|
||||
const currentLength = this.stripTags(outputLines[lineIdx]).length
|
||||
const padding = lineIdx === 0 || currentLength === 0 ? '' : ' '
|
||||
// Use larger spacing between columns (6 spaces instead of 2)
|
||||
const padding = currentLength === 0 ? '' : ' '.repeat(6)
|
||||
outputLines[lineIdx] += padding + item.text
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue