Ejemplo n.º 1
0
        public JsonNetResult Restore(Backup backup)
        {
            if (BackupRoutine.Restore(backup))
            {
                return(JsonNet.JsonOK());
            }

            return(JsonNet.JsonError(Resources.Global.Backup_RestoreFailed));
        }
Ejemplo n.º 2
0
        public JsonNetResult BackupNow()
        {
            if (BackupRoutine.SingleBackup())
            {
                return(JsonNet.JsonOK());
            }

            return(JsonNet.JsonError(Resources.Global.Backup_Failed));
        }
Ejemplo n.º 3
0
        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());
        }
Ejemplo n.º 4
0
 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));
     }
 }
Ejemplo n.º 5
0
        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());
        }