mirror of
https://github.com/ansible/awx.git
synced 2026-04-06 18:49:21 -02:30
First pass at Job Hosts Summary page. Added link to host detail page. Need to add link to job->host->events.
This commit is contained in:
@@ -179,7 +179,7 @@ function InventoriesAdd ($scope, $rootScope, $compile, $location, $log, $routePa
|
||||
}
|
||||
Rest.post(data)
|
||||
.success( function(data, status, headers, config) {
|
||||
ReturnToCaller();
|
||||
$location.path('/inventories/' + data.id);
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
ProcessErrors(scope, data, status, form,
|
||||
|
||||
59
ansibleworks/ui/static/js/controllers/JobHosts.js
Normal file
59
ansibleworks/ui/static/js/controllers/JobHosts.js
Normal file
@@ -0,0 +1,59 @@
|
||||
/************************************
|
||||
* Copyright (c) 2013 AnsibleWorks, Inc.
|
||||
*
|
||||
*
|
||||
* JobHosts.js
|
||||
*
|
||||
* Controller functions for the Job Hosts Summary model.
|
||||
*
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
function JobHostSummaryList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, JobHostList,
|
||||
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
|
||||
ClearScope, ProcessErrors, GetBasePath)
|
||||
{
|
||||
ClearScope('htmlTemplate');
|
||||
var list = JobHostList;
|
||||
var defaultUrl = GetBasePath('jobs') + $routeParams.id + '/job_host_summaries/';
|
||||
var view = GenerateList;
|
||||
var base = $location.path().replace(/^\//,'').split('/')[0];
|
||||
var scope = view.inject(list, { mode: 'edit' });
|
||||
scope.selected = [];
|
||||
|
||||
// After a refresh, populate any needed summary field values on each row
|
||||
if (scope.PostRefreshRemove) {
|
||||
scope.PostRefreshRemove();
|
||||
}
|
||||
scope.PostRefershRemove = scope.$on('PostRefresh', function() {
|
||||
for( var i=0; i < scope.jobhosts.length; i++) {
|
||||
scope.jobhosts[i].host_name = scope.jobhosts[i].summary_fields.host.name;
|
||||
}
|
||||
});
|
||||
|
||||
SearchInit({ scope: scope, set: 'jobhosts', list: list, url: defaultUrl });
|
||||
PaginateInit({ scope: scope, list: list, url: defaultUrl });
|
||||
scope.search(list.iterator);
|
||||
|
||||
LoadBreadCrumbs();
|
||||
|
||||
scope.viewHost = function(id) {
|
||||
Rest.setUrl(GetBasePath('jobs') + $routeParams.id + '/');
|
||||
Rest.get()
|
||||
.success( function(data, status, headers, config) {
|
||||
LoadBreadCrumbs({ path: '/inventories/' + data.inventory, title: data.summary_fields.inventory.name });
|
||||
$location.path('/inventories/' + data.inventory + /hosts/ + id);
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
ProcessErrors(scope, data, status, null,
|
||||
{ hdr: 'Error!', msg: 'Failed to lookup job record for job ' + $routeParams.id + ' GET returned status: ' + status });
|
||||
});
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
JobHostSummaryList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobHostList',
|
||||
'GenerateList', 'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope',
|
||||
'ProcessErrors','GetBasePath'
|
||||
];
|
||||
@@ -185,6 +185,7 @@ function JobTemplatesList ($scope, $rootScope, $location, $log, $routeParams, Re
|
||||
Rest.get()
|
||||
.success( function(data, status, headers, config) {
|
||||
// Create a job record
|
||||
scope.credential = '';
|
||||
if (data.credential == '' || data.credential == null) {
|
||||
// Template does not have credential, prompt for one
|
||||
if (scope.credentialWatchRemove) {
|
||||
|
||||
@@ -41,6 +41,11 @@ function JobsListCtrl ($scope, $rootScope, $location, $log, $routeParams, Rest,
|
||||
$location.path($location.path() + '/' + id + '/job_events');
|
||||
}
|
||||
|
||||
scope.viewSummary = function(id, name) {
|
||||
LoadBreadCrumbs({ path: '/jobs/' + id, title: name });
|
||||
$location.path($location.path() + '/' + id + '/job_host_summaries');
|
||||
}
|
||||
|
||||
scope.deleteJob = function(id, name) {
|
||||
Rest.setUrl(defaultUrl + id + '/');
|
||||
Rest.get()
|
||||
|
||||
@@ -207,7 +207,7 @@ function ProjectsEdit ($scope, $rootScope, $compile, $location, $log, $routePara
|
||||
var id = $routeParams.id;
|
||||
var relatedSets = {};
|
||||
|
||||
// After the Organization is loaded, retrieve each related set
|
||||
// After the project is loaded, retrieve each related set
|
||||
if (scope.projectLoadedRemove) {
|
||||
scope.projectLoadedRemove();
|
||||
}
|
||||
@@ -257,8 +257,8 @@ function ProjectsEdit ($scope, $rootScope, $compile, $location, $log, $routePara
|
||||
ReturnToCaller();
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
ProcessErrors(scope, data, status, OrganizationForm,
|
||||
{ hdr: 'Error!', msg: 'Failed to update project: ' + id + '. PUT status: ' + status });
|
||||
ProcessErrors(scope, data, status, form,
|
||||
{ hdr: 'Error!', msg: 'Failed to update project: ' + id + '. PUT status: ' + status });
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
@@ -34,7 +34,6 @@ function TeamsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Ale
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
//SetTeamListeners({ scope: scope, set: 'teams', iterator: list.iterator });
|
||||
SearchInit({ scope: scope, set: 'teams', list: list, url: defaultUrl });
|
||||
PaginateInit({ scope: scope, list: list, url: defaultUrl });
|
||||
|
||||
Reference in New Issue
Block a user