mirror of
https://github.com/ansible/awx.git
synced 2026-05-11 19:37:38 -02:30
AC-502 start of new dashboard.
This commit is contained in:
@@ -16,6 +16,9 @@ function Authenticate($cookieStore, $window, $scope, $rootScope, $location, Auth
|
||||
$('#login-username').focus();
|
||||
};
|
||||
|
||||
// Just in case, make sure the wait widget is not active
|
||||
Wait('stop');
|
||||
|
||||
// Display the login dialog
|
||||
$('#login-modal').modal({ show: true, keyboard: false, backdrop: 'static' });
|
||||
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
'use strict';
|
||||
|
||||
function Home ($routeParams, $scope, $rootScope, $location, Wait, ObjectCount, ClearScope)
|
||||
function Home ($routeParams, $scope, $rootScope, $location, Wait, JobStatus, ClearScope)
|
||||
{
|
||||
ClearScope('home'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
|
||||
//scope.
|
||||
@@ -23,10 +23,10 @@ function Home ($routeParams, $scope, $rootScope, $location, Wait, ObjectCount, C
|
||||
Wait('start');
|
||||
}
|
||||
|
||||
ObjectCount({ target: 'container1' });
|
||||
JobStatus({ target: 'container1' });
|
||||
|
||||
$rootScope.$on('WidgetLoaded', function() {
|
||||
// Once all the widget report back 'loaded', turn off Wait widget
|
||||
// Once all the widgets report back 'loaded', turn off Wait widget
|
||||
loadedCount++;
|
||||
if ( loadedCount == waitCount ) {
|
||||
Wait('stop');
|
||||
@@ -34,4 +34,4 @@ function Home ($routeParams, $scope, $rootScope, $location, Wait, ObjectCount, C
|
||||
});
|
||||
}
|
||||
|
||||
Home.$inject=[ '$routeParams', '$scope', '$rootScope', '$location', 'Wait', 'ObjectCount', 'ClearScope'];
|
||||
Home.$inject=[ '$routeParams', '$scope', '$rootScope', '$location', 'Wait', 'JobStatus', 'ClearScope'];
|
||||
@@ -74,32 +74,28 @@ function JobHostSummaryList ($scope, $rootScope, $location, $log, $routeParams,
|
||||
Rest.setUrl(GetBasePath('jobs') + scope.job_id);
|
||||
Rest.get()
|
||||
.success( function(data, status, headers, config) {
|
||||
LoadBreadCrumbs({ path: '/jobs/' + data.id, title: data.id + ' - ' +
|
||||
data.summary_fields.job_template.name });
|
||||
scope.job_status = data.status;
|
||||
scope.$emit('setHostLink', data.inventory);
|
||||
if (!(data.status == 'pending' || data.status == 'waiting' || data.status == 'running')) {
|
||||
if ($rootScope.timer) {
|
||||
clearInterval($rootScope.timer);
|
||||
}
|
||||
}
|
||||
scope.$emit('setHostLink', data.inventory);
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
ProcessErrors(scope, data, status, null,
|
||||
{ hdr: 'Error!', msg: 'Failed to get job status for job: ' + scope.job_id + '. GET status: ' + status });
|
||||
});
|
||||
}
|
||||
else {
|
||||
else {
|
||||
// Make the host name appear in breadcrumbs
|
||||
LoadBreadCrumbs({ path: '/hosts/' + scope['host_id'], title: $routeParams['host_name'] });
|
||||
if ($routeParams['inventory']) {
|
||||
scope.$emit('setHostLink', $routeParams['inventory']);
|
||||
}
|
||||
}
|
||||
if (base == 'hosts' && $routeParams['host_name']) {
|
||||
// Make the host name appear in breadcrumbs
|
||||
LoadBreadCrumbs({ path: '/hosts/' + scope['host_id'], title: $routeParams['host_name'] });
|
||||
}
|
||||
else {
|
||||
LoadBreadCrumbs({ path: '/jobs/' + scope.job_id, title: scope.job_id + ' - ' +
|
||||
scope.jobhosts[0].summary_fields.job.job_template_name });
|
||||
}
|
||||
});
|
||||
|
||||
SearchInit({ scope: scope, set: 'jobhosts', list: list, url: defaultUrl });
|
||||
|
||||
@@ -42,10 +42,12 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
||||
scope.projects[i].status = 'n/a';
|
||||
}
|
||||
switch(scope.projects[i].status) {
|
||||
case 'n/a':
|
||||
scope.projects[i].badge = 'none';
|
||||
break;
|
||||
case 'updating':
|
||||
case 'successful':
|
||||
case 'ok':
|
||||
case 'n/a':
|
||||
scope.projects[i].badge = 'false';
|
||||
break;
|
||||
case 'never updated':
|
||||
|
||||
Reference in New Issue
Block a user