PATH:
usr
/
local
/
jetapps
/
frontend
/
jetbackup
/
app
/
controllers
define([ "app" ], function(app) { app.controller("queues", ["$rootScope", "$scope", "$interval", "$timeout", "jetapi", "lang", "meta", "consts", function($rootScope, $scope, $interval, $timeout, jetapi, lang, meta, consts) { $scope.queues = []; $scope.loadingQueue = false; $scope.sortedList = {}; $scope.statusBar = null; $scope.actionStatus = null; $scope.refreshIntervalRate = 3000; var metaQueue = meta.new('queues'); $scope.meta = metaQueue; $scope.metaData = metaQueue.getData(); metaQueue.setSortReverse(false); if(!metaQueue.getSortBy()) metaQueue.setSortBy("status"); if(!metaQueue.getSortDirection()) metaQueue.setSortDirection("asc"); metaQueue.setSortFields(["status", "created", "type_name", "item_name"]); metaQueue.setTotalItems($scope.queues.length); $scope.minimizeAll = function () { $scope.actionModule = ''; for(var i=0; i< $scope.queues.length; i++) $scope.queues[i].isExpanded = false; }; $scope.cleatStatus = function() { for(var i=0; i< $scope.queues.length; i++) $scope.queues[i].status = null; }; $scope.downloadBackup = function (backup) { if(backup.download_id) { jetapi.getDownload({ _id: backup.download_id }, function(response) { if(!response.status) { backup.status = { message: response.errors[0], type: "danger", closeable: true, ttl: 10000 }; return; } var parts = response.data.path.split('/'); window.location = '../../../download?file=.jbm/downloads/' + parts[parts.length-1]; }); } }; $scope.deleteDownload = function(backup) { backup.isExpanded = true; $scope.actionModule = 'deletedownload'; $scope.pushAutoRefresh = true; }; $scope.onClickDeleteDownloadConfirm = function(backup) { jetapi.deleteDownload({ _id: backup.download_id }, function(response) { $scope.statusBar = { message: response.status ? response.messages[0] : response.errors[0], type: response.status ? "success" : "danger", closeable: true, ttl: 10000 }; $scope.actionModule = null; }); $scope.fetchData(); }; $scope.checkStatus = function () { $interval(function() { if($scope.actionModule) return; $scope.fetchData(); }, $scope.refreshIntervalRate); }; $scope.hasPermissionToDownload = function(type){ switch (type) { case consts.BACKUP_TYPE_FILES: return $scope.PERMS.canDownloadFileBackups; case consts.BACKUP_TYPE_DATABASES: return $scope.PERMS.canDownloadDatabaseBackups; case consts.BACKUP_TYPE_EMAILS: return $scope.PERMS.canDownloadEmailBackups; case consts.BACKUP_TYPE_CRON_JOBS: return $scope.PERMS.canDownloadCronBackups; case consts.BACKUP_TYPE_DNS_ZONES: return $scope.PERMS.canDownloadDNSBackups; case consts.BACKUP_TYPE_SSL_CERTIFICATES: return $scope.PERMS.canDownloadSSLBackups; case consts.BACKUP_TYPE_FULL: return $scope.PERMS.canDownloadFullBackups; default: return false; } }; $scope.clearStatus = function() { $scope.statusBar = null; }; $scope.fetchData = function() { $scope.loadingQueue = true; var apiParams = { skip: $scope.meta.getSkip(), limit: $scope.meta.getPageSize(), sort: {}, filter: $scope.meta.filterValue, }; apiParams.sort[$scope.meta.getSortBy()] = $scope.meta.getSortDirectionInt(); jetapi.listQueueItems(apiParams, function (response) { $scope.queues = []; metaQueue.setTotalItems(response.data.total); metaQueue.calculate(response.data.queues); $scope.queues = response.data.queue; $scope.loadingQueue = false; }); }; $timeout(function () { $scope.fetchData(); $scope.checkStatus(); }()); }] ); } );
[-] gdpr.js
[edit]
[+]
..
[-] emailBackups.js
[edit]
[-] cronBackups.js
[edit]
[-] dnsBackups.js
[edit]
[-] settings.js
[edit]
[-] queues.js
[edit]
[-] sslBackups.js
[edit]
[-] backups.js
[edit]
[-] fileBackups.js
[edit]
[-] dbBackups.js
[edit]
[-] fileManager.js
[edit]
[-] fullBackups.js
[edit]
[-] snapshots.js
[edit]