Various fixes to the ngax UI

This commit is contained in:
Kenneth Skovhede
2015-12-03 22:04:20 +01:00
parent 70d5ed7031
commit 116aed59fc
3 changed files with 16 additions and 3 deletions
@@ -64,4 +64,9 @@ backupApp.service('AppService', function($http, $cookies) {
return rurl;
};
this.get_bugreport_url = function(reportid) {
return this.apiurl + '/bugreport/' + reportid + '?x-xsrf-token=' + encodeURIComponent($cookies.get('xsrf-token'));
};
});
@@ -5,7 +5,7 @@ backupApp.service('AppUtils', function() {
this.formatSizes = ['TB', 'GB', 'MB', 'KB'];
this.formatSizeString = function(val) {
val = parseInt(val || 0);
var max = formatSizes.length;
var max = this.formatSizes.length;
for(var i = 0; i < this.formatSizes.length; i++) {
var m = Math.pow(1024, max - i);
if (val > m)
@@ -16,7 +16,11 @@ backupApp.service('ServerStatus', function($rootScope, $timeout, AppService, App
xsfrerror: false,
connectionAttemptTimer: 0,
failedConnectionAttempts: 0,
lastPgEvent: null
lastPgEvent: null,
updaterState: 'Waiting',
updatedVersion: null,
updateReady: false,
updateDownloadProgress: 0
};
this.state = state;
@@ -196,7 +200,11 @@ backupApp.service('ServerStatus', function($rootScope, $timeout, AppService, App
notifyIfChanged(response.data, 'LastNotificationUpdateID', 'lastNotificationUpdateId') |
notifyIfChanged(response.data, 'ActiveTask', 'activeTask') |
notifyIfChanged(response.data, 'ProgramState', 'programState') |
notifyIfChanged(response.data, 'EstimatedPauseEnd', 'estimatedPauseEnd');
notifyIfChanged(response.data, 'EstimatedPauseEnd', 'estimatedPauseEnd')
notifyIfChanged(response.data, 'UpdaterState', 'updaterState') |
notifyIfChanged(response.data, 'UpdateReady', 'updateReady') |
notifyIfChanged(response.data, 'UpdatedVersion', 'updatedVersion')|
notifyIfChanged(response.data, 'UpdateDownloadProgress', 'updateDownloadProgress');
// Clear error indicators
state.failedConnectionAttempts = 0;