fix(storage): qualify SMART status and report explanations

This commit is contained in:
martino
2026-09-21 21:54:04 +02:00
parent 5dffb5cb88
commit 402278ecfd
6 changed files with 171 additions and 6 deletions
+5 -5
View File
@@ -2065,7 +2065,7 @@ export function StorageOverview() {
<h4 className="font-semibold mb-3 flex items-center gap-2">
{t("storage.wearLifetime")}
{smartJsonData?.has_data && !wi && (
<Badge className="bg-green-500/10 text-green-400 border-green-500/20 text-[10px] px-1.5">{t("storage.realTest")}</Badge>
<Badge className="bg-green-500/10 text-green-400 border-green-500/20 text-[10px] px-1.5">{t("storage.savedSmartData")}</Badge>
)}
</h4>
<div className="flex gap-5 items-start">
@@ -2777,7 +2777,7 @@ function openSmartReport(disk: DiskInfo, testStatus: SmartTestStatus, smartAttri
// Build recommendations
const recommendations: string[] = []
if (isHealthy) {
recommendations.push(`<div class="rec-item rec-ok"><div class="rec-icon">&#10003;</div><div><strong>${t("storage.smartReport.recommendations.healthyTitle")}</strong><p>${t("storage.smartReport.recommendations.healthyText")}</p></div></div>`)
recommendations.push(`<div class="rec-item rec-ok"><div class="rec-icon">&#10003;</div><div><strong>${t("storage.smartReport.recommendations.passedTitle")}</strong><p>${t("storage.smartReport.recommendations.passedText")}</p></div></div>`)
} else {
recommendations.push(`<div class="rec-item rec-critical"><div class="rec-icon">&#10007;</div><div><strong>${t("storage.smartReport.recommendations.criticalTitle")}</strong><p>${t("storage.smartReport.recommendations.criticalText")}</p></div></div>`)
}
@@ -3284,7 +3284,7 @@ function pmxPrint(){
<h3>${t("storage.smartReport.healthAssessment")}</h3>
<p>
${isHealthy
? t("storage.smartReport.healthyAssessment", { uptime: powerOnFormatted, temperature: disk.temperature > 0 ? disk.temperature + '°C' : na, sectors: (disk.reallocated_sectors ?? 0) === 0 ? t("storage.smartReport.noBadSectors") : t("storage.smartReport.reallocatedSectors", { count: disk.reallocated_sectors ?? 0 }) })
? t("storage.smartReport.passedAssessment", { uptime: powerOnFormatted, temperature: disk.temperature > 0 ? disk.temperature + '°C' : na, sectors: (disk.reallocated_sectors ?? 0) === 0 ? t("storage.smartReport.noReallocatedSectorsReported") : t("storage.smartReport.reallocatedSectors", { count: disk.reallocated_sectors ?? 0 }) })
: t("storage.smartReport.failedAssessment")
}
</p>
@@ -3294,11 +3294,11 @@ function pmxPrint(){
<!-- Simple Explanation for Non-Technical Users -->
<div style="background:${isHealthy ? '#dcfce7' : (hasCritical ? '#fee2e2' : '#fef3c7')};border:1px solid ${isHealthy ? '#86efac' : (hasCritical ? '#fca5a5' : '#fcd34d')};border-radius:8px;padding:16px;margin-top:12px;">
<div style="font-weight:700;font-size:14px;color:${isHealthy ? '#166534' : (hasCritical ? '#991b1b' : '#92400e')};margin-bottom:8px;">
${isHealthy ? t("storage.smartReport.healthyMeaningTitle") : (hasCritical ? t("storage.smartReport.attentionTitle") : t("storage.smartReport.monitorTitle"))}
${isHealthy ? t("storage.smartReport.passedMeaningTitle") : (hasCritical ? t("storage.smartReport.attentionTitle") : t("storage.smartReport.monitorTitle"))}
</div>
<p style="color:${isHealthy ? '#166534' : (hasCritical ? '#991b1b' : '#92400e')};font-size:12px;margin:0 0 8px 0;">
${isHealthy
? t("storage.smartReport.healthyMeaning")
? t("storage.smartReport.passedMeaning")
: (hasCritical
? t("storage.smartReport.criticalMeaning")
: t("storage.smartReport.warningMeaning")
+7
View File
@@ -233,6 +233,7 @@
"life": "life",
"lifeRemaining": "Life Remaining",
"realTest": "Real Test",
"savedSmartData": "Saved SMART data",
"wear": {
"label": "Wear",
"percentageUsed": "Percentage Used",
@@ -362,6 +363,10 @@
"healthAssessment": "Disk Health Assessment",
"passedUpper": "PASSED",
"testAgeWarning": "This report is based on a SMART test performed {days} days ago ({date}). Disk health may have changed since then. We recommend running a new SMART test for up-to-date results.",
"passedAssessment": "The supplied SMART status is PASSED. This status alone does not establish that every attribute is within range or that the disk is free of faults. Power-on time shown: {uptime}. Temperature shown: {temperature}. {sectors}",
"noReallocatedSectorsReported": "The supplied reallocated-sector value is zero or unavailable; this does not establish that there are no bad sectors.",
"passedMeaningTitle": "What does a PASSED status mean?",
"passedMeaning": "PASSED is the overall status supplied to this report, not proof of a completed self-test or a guarantee against failure. Review the attributes, error logs and self-test results, and keep current backups.",
"healthyAssessment": "This disk is operating within normal parameters. All SMART attributes are within acceptable thresholds. The disk has been powered on for approximately {uptime} and is currently operating at {temperature}. {sectors}",
"failedAssessment": "This disk has reported a SMART health failure. Immediate action is required. Back up all critical data and plan for disk replacement.",
"noBadSectors": "No bad sectors have been detected.",
@@ -718,6 +723,8 @@
"backgroundScanStatus": "Status of the SCSI background media scan. Runs continuously to detect surface defects."
},
"recommendations": {
"passedTitle": "Review the reported results",
"passedText": "A PASSED status can coexist with warnings or recorded errors. Review the report details, continue regular monitoring and keep current backups.",
"healthyTitle": "Disk is Healthy",
"healthyText": "All SMART attributes are within normal ranges. Continue regular monitoring.",
"criticalTitle": "Critical: Disk Health Issue Detected",