Closing schedule related tickets.

This commit is contained in:
Chris Houseknecht
2014-04-03 16:14:09 -04:00
parent 2587fe9f18
commit c76bb88de7
4 changed files with 15 additions and 6 deletions

View File

@@ -49,7 +49,8 @@ GetBasePath, Wait, Breadcrumbs, Find, LoadDialogPartial, LoadSchedulesScope, Get
scope: $scope, scope: $scope,
list: SchedulesList, list: SchedulesList,
id: 'schedule-list-target', id: 'schedule-list-target',
url: url url: url,
pageSize: 20
}); });
}); });

View File

@@ -419,7 +419,7 @@ angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelpe
}); });
}; };
scope.refreshSchedule = function() { scope.refreshSchedules = function() {
if (base === 'jobs') { if (base === 'jobs') {
parent_scope.refreshJobs(); parent_scope.refreshJobs();
} }
@@ -432,7 +432,7 @@ angular.module('SchedulesHelper', [ 'Utilities', 'RestServices', 'SchedulesHelpe
scope.removeSchedulesRefresh(); scope.removeSchedulesRefresh();
} }
scope.$on('SchedulesRefresh', function() { scope.$on('SchedulesRefresh', function() {
scope.refreshJobs(); scope.search(iterator);
}); });
}; };
}]) }])

View File

@@ -65,7 +65,7 @@ angular.module('ScheduledJobsDefinition', [])
refresh: { refresh: {
mode: 'all', mode: 'all',
awToolTip: "Refresh the page", awToolTip: "Refresh the page",
ngClick: "refreshSchedule()" ngClick: "refreshSchedules()"
} }
}, },

View File

@@ -107,7 +107,6 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
scope.alertHeader = hdr; scope.alertHeader = hdr;
scope.alertBody = msg; scope.alertBody = msg;
scope.alertClass = (cls) ? cls : 'alert-danger'; //default alert class is alert-danger scope.alertClass = (cls) ? cls : 'alert-danger'; //default alert class is alert-danger
//console.log('msg: ' + msg + ' cls: ' + cls);
e = angular.element(document.getElementById('alert-modal')); e = angular.element(document.getElementById('alert-modal'));
$compile(e)(scope); $compile(e)(scope);
$('#alert-modal').modal({ $('#alert-modal').modal({
@@ -137,7 +136,7 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
.factory('ProcessErrors', ['$rootScope', '$cookieStore', '$log', '$location', 'Alert', 'Wait', .factory('ProcessErrors', ['$rootScope', '$cookieStore', '$log', '$location', 'Alert', 'Wait',
function ($rootScope, $cookieStore, $log, $location, Alert, Wait) { function ($rootScope, $cookieStore, $log, $location, Alert, Wait) {
return function (scope, data, status, form, defaultMsg) { return function (scope, data, status, form, defaultMsg) {
var field, fieldErrors, msg; var field, fieldErrors, msg, keys;
Wait('stop'); Wait('stop');
if ($AnsibleConfig.debug_mode) { if ($AnsibleConfig.debug_mode) {
$log.debug('Debug status: ' + status); $log.debug('Debug status: ' + status);
@@ -200,6 +199,15 @@ angular.module('Utilities', ['RestServices', 'Utilities'])
if ((!fieldErrors) && defaultMsg) { if ((!fieldErrors) && defaultMsg) {
Alert(defaultMsg.hdr, defaultMsg.msg); Alert(defaultMsg.hdr, defaultMsg.msg);
} }
} else if (Object.keys(data).length > 0) {
keys = Object.keys(data);
if (Array.isArray(data[keys[0]])) {
msg = data[keys[0]][0];
}
else {
msg = data[keys[0]];
}
Alert(defaultMsg.hdr, msg);
} else { } else {
Alert(defaultMsg.hdr, defaultMsg.msg); Alert(defaultMsg.hdr, defaultMsg.msg);
} }