+
+ ${severityLabel}
+ ID: #${obs.id}
+ Occurrences: ${obs.occurrence_count}
+ ${dismissedBadge}
+
+
+
+
Error Signature:
+
${obs.error_signature}
+
+
+
+
Raw Message:
+
${obs.raw_message || 'N/A'}
+
+
+
+
+ Device:
+ ${obs.device_name || disk.name}
+
+
+ Serial:
+ ${obs.serial || disk.serial || 'N/A'}
+
+
+ Model:
+ ${obs.model || disk.model || 'N/A'}
+
+
+ First Seen:
+ ${firstDate}
+
+
+ Last Seen:
+ ${lastDate}
+
+
+
+ `
+ })
+
+ groupsHtml += `
+
+
6. Observations & Events (${observations.length} recorded, ${totalOccurrences} total occurrences)
+
The following events have been detected and logged for this disk. These observations may indicate potential issues that require attention.
+ ${groupsHtml}
+
+ `
+ }
+
const html = `
@@ -2032,94 +2127,7 @@ ${isNvmeDisk ? `
`}
-${observations.length > 0 ? `
-
-
-
6. Observations & Events (${observations.length} recorded, ${observations.reduce((sum, o) => sum + o.occurrence_count, 0)} total occurrences)
-
The following events have been detected and logged for this disk. These observations may indicate potential issues that require attention.
-
-
- ${(() => {
- const groupedObs: Record
= {}
- observations.forEach(obs => {
- const type = obs.error_type || 'unknown'
- if (!groupedObs[type]) groupedObs[type] = []
- groupedObs[type].push(obs)
- })
-
- return Object.entries(groupedObs).map(([type, obsList]) => {
- const typeLabel = type === 'io_error' ? 'I/O Errors' : type === 'smart_error' ? 'SMART Errors' : type === 'filesystem_error' ? 'Filesystem Errors' : type.replace(/_/g, ' ').replace(/\b\w/g, l => l.toUpperCase())
- const totalOccurrences = obsList.reduce((sum, o) => sum + o.occurrence_count, 0)
-
- return \`
-
-
- \${typeLabel}
- \${obsList.length} unique, \${totalOccurrences} total
-
-
- \${obsList.map(obs => {
- const severityColor = obs.severity === 'critical' ? '#dc2626' : obs.severity === 'warning' ? '#ca8a04' : '#3b82f6'
- const severityBg = obs.severity === 'critical' ? '#dc262615' : obs.severity === 'warning' ? '#ca8a0415' : '#3b82f615'
- const severityLabel = obs.severity ? obs.severity.charAt(0).toUpperCase() + obs.severity.slice(1) : 'Info'
- const firstDate = obs.first_occurrence ? new Date(obs.first_occurrence).toLocaleString() : 'N/A'
- const lastDate = obs.last_occurrence ? new Date(obs.last_occurrence).toLocaleString() : 'N/A'
- const dismissed = obs.dismissed ? '
Dismissed' : ''
-
- return \\\`
-
-
- \${severityLabel}
- ID: #\${obs.id}
- Occurrences: \${obs.occurrence_count}
- \${dismissed}
-
-
-
-
-
Error Signature:
-
\${obs.error_signature}
-
-
-
-
-
Raw Message:
-
\${obs.raw_message || 'N/A'}
-
-
-
-
-
- Device:
- \${obs.device_name || disk.name}
-
-
- Serial:
- \${obs.serial || disk.serial || 'N/A'}
-
-
- Model:
- \${obs.model || disk.model || 'N/A'}
-
-
- First Seen:
- \${firstDate}
-
-
- Last Seen:
- \${lastDate}
-
-
-
- \\\`
- }).join('')}
-
-
- \`
- }).join('')
- })()}
-
-` : ''}
+${observationsHtml}