Use the new notification onClick api in places
This commit is contained in:
@@ -73,38 +73,26 @@ angular.module('Application').controller('MainController', ['$scope', '$route',
|
||||
|
||||
function runConfigurationChecks() {
|
||||
if ($scope.config.update && $scope.config.update.box) {
|
||||
var updateActionScope = $scope.$new(true);
|
||||
updateActionScope.action = '/#/settings';
|
||||
Client.notify('Update Available', 'Update now to version ' + $scope.config.update.box.version + '.', true, 'success', updateActionScope);
|
||||
Client.notify('Update Available', 'Update now to version ' + $scope.config.update.box.version + '.', true, 'success', '/#/settings');
|
||||
}
|
||||
|
||||
Client.getBackupConfig(function (error, backupConfig) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
if (backupConfig.provider === 'noop') {
|
||||
var actionScope = $scope.$new(true);
|
||||
actionScope.action = '/#/backups';
|
||||
|
||||
Client.notify('Backup Configuration', 'Cloudron backups are disabled. Please ensure this server is backed up using alternate means.', false, 'info', actionScope);
|
||||
Client.notify('Backup Configuration', 'Cloudron backups are disabled. Please ensure this server is backed up using alternate means.', false, 'info', '/#/backups');
|
||||
} else if (backupConfig.provider === 'filesystem' && !backupConfig.externalDisk) {
|
||||
var actionScope = $scope.$new(true);
|
||||
actionScope.action = '/#/backups';
|
||||
|
||||
Client.notify('Backup Configuration',
|
||||
'Cloudron backups are currently on the same disk as the Cloudron server instance. This is dangerous and can lead to complete data loss if the disk fails.',
|
||||
false /* persistent */, 'info', actionScope);
|
||||
false /* persistent */, 'info', '/#/backups');
|
||||
}
|
||||
});
|
||||
|
||||
Client.isRebootRequired(function (error, isRequired) {
|
||||
if (error) return console.error(error);
|
||||
|
||||
if (!isRequired) return;
|
||||
|
||||
var actionScope = $scope.$new(true);
|
||||
actionScope.action = '/#/system';
|
||||
|
||||
Client.notify('Reboot Required', 'To finish security updates, a reboot is necessary.', true /* persistent */, 'warning', actionScope);
|
||||
Client.notify('Reboot Required', 'To finish security updates, a reboot is necessary.', true /* persistent */, 'warning', '/#/system');
|
||||
});
|
||||
|
||||
Client.getNotifications(false, 1, 100, function (error, results) {
|
||||
|
||||
Reference in New Issue
Block a user