public JsonNetResult Restore(Backup backup) { if (BackupRoutine.Restore(backup)) { return(JsonNet.JsonOK()); } return(JsonNet.JsonError(Resources.Global.Backup_RestoreFailed)); }
public JsonNetResult BackupNow() { if (BackupRoutine.SingleBackup()) { return(JsonNet.JsonOK()); } return(JsonNet.JsonError(Resources.Global.Backup_Failed)); }
public JsonNetResult GetAppHealth() { if (db.AppLogs.Any(l => l.Seen == false && l.Type == AppLogType.Error || l.Type == AppLogType.Warning)) { return(JsonNet.JsonError(string.Empty)); } return(JsonNet.JsonOK()); }
public JsonNetResult TestNetworkSettings(BackupSettings settings) { if (DirectoryUtility.IsPathAvailable(settings.NetworkShare, settings.NetworkUsername, settings.NetworkPassword)) { return(JsonNet.JsonOK()); } else { return(JsonNet.JsonError(Resources.Global.Backup_TestFailed)); } }
public JsonNetResult GetBackupStatus() { var log = db.AppLogs.AsNoTracking().Where(l => l.Module == Module.Backup).OrderByDescending(l => l.ID).FirstOrDefault(); return((log != null && log.Type != AppLogType.Success) ? JsonNet.JsonError(string.Empty) : JsonNet.JsonOK()); }