Эх сурвалжийг харах

Added error message display on setting UI

TC pushbot 5 4 жил өмнө
parent
commit
dc3602b281

+ 6 - 2
backup.go

@@ -78,6 +78,7 @@ func backup_listAllBackupDisk(w http.ResponseWriter, r *http.Request) {
 		LastBackupCycleTime int64  //Last backup timestamp
 		BackupCycleCount    int64  //How many backup cycle has proceeded since the system startup
 		Error               bool   //If there are error occured in the last cycle
+		ErrorMessage        string //If there are any error msg
 	}
 
 	backupDrives := []*backupDrive{}
@@ -91,7 +92,7 @@ func backup_listAllBackupDisk(w http.ResponseWriter, r *http.Request) {
 			return
 		}
 
-		backupDrives = append(backupDrives, &backupDrive{
+		thisBackupDrive := backupDrive{
 			DiskUID:             diskFsh.UUID,
 			DiskName:            diskFsh.Name,
 			ParentUID:           parentFsh.UUID,
@@ -100,7 +101,10 @@ func backup_listAllBackupDisk(w http.ResponseWriter, r *http.Request) {
 			LastBackupCycleTime: task.LastCycleTime,
 			BackupCycleCount:    task.CycleCounter,
 			Error:               task.PanicStopped,
-		})
+			ErrorMessage:        task.ErrorMessage,
+		}
+
+		backupDrives = append(backupDrives, &thisBackupDrive)
 	}
 
 	js, _ := json.Marshal(backupDrives)

+ 1 - 1
web/SystemAO/disk/backup/backups.html

@@ -113,7 +113,7 @@
 
                         if (disk.Error == true){
                             //Task execution error. 
-                            statusText = `<i class="exclamation triangle icon"></i> Stopped`;
+                            statusText = `<i class="exclamation triangle icon"></i> Stopped <br> ` + disk.ErrorMessage;
                             statusColor = "red";
                         }