SCM status info now available from Projects tab.

This commit is contained in:
chouseknecht
2013-09-03 16:08:10 -04:00
parent a6c1e3385b
commit 78de6b360f
11 changed files with 167 additions and 8 deletions

View File

@@ -85,6 +85,15 @@ function InventoryHosts ($scope, $rootScope, $compile, $location, $log, $routePa
$location.url('/jobs/?id__int=' + last_job );
}
scope.allJobs = function(id) {
$location.url('/jobs/?job_host_summaries__host=' + id);
}
scope.allHostSummaries = function(id, name) {
LoadBreadCrumbs({ path: '/inventories/' + scope.inventory_id + '/hosts', title: name });
$location.url('/hosts/' + id + '/job_host_summaries');
}
scope.viewLastEvents = function(host_id, last_job, host_name, last_job_name) {
// Choose View-> Latest job events
LoadBreadCrumbs({ path: '/jobs/' + last_job, title: last_job_name });

View File

@@ -16,9 +16,9 @@ function JobHostSummaryList ($scope, $rootScope, $location, $log, $routeParams,
{
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 defaultUrl = GetBasePath(base) + $routeParams.id + '/job_host_summaries/';
var view = GenerateList;
var scope = view.inject(list, { mode: 'edit' });
scope.selected = [];

View File

@@ -41,6 +41,14 @@ function JobsListCtrl ($scope, $rootScope, $location, $log, $routeParams, Rest,
}
});
if ($routeParams['job_host_summaries__host']) {
defaultUrl += '?job_host_summaries__host=' + $routeParams['job_host_summaries__host'];
}
if ($routeParams['inventory__int'] && $routeParams['status']) {
defaultUrl += '?inventory__int=' + $routeParams['inventory__int'] + '&status=' +
$routeParams['status'];
}
SearchInit({ scope: scope, set: 'jobs', list: list, url: defaultUrl });
PaginateInit({ scope: scope, list: list, url: defaultUrl });

View File

@@ -12,7 +12,7 @@
function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest, Alert, ProjectList,
GenerateList, LoadBreadCrumbs, Prompt, SearchInit, PaginateInit, ReturnToCaller,
ClearScope, ProcessErrors, GetBasePath, SelectionInit, SCMUpdate)
ClearScope, ProcessErrors, GetBasePath, SelectionInit, SCMUpdate, ProjectStatus)
{
ClearScope('htmlTemplate'); //Garbage collection. Don't leave behind any listeners/watchers from the prior
//scope.
@@ -54,6 +54,23 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
scope.editProject = function(id) {
$location.path($location.path() + '/' + id);
}
scope.showSCMStatus = function(id) {
var project;
for (var i=0; i < scope.projects.length; i++) {
if (scope.projects[i].id == id) {
project = scope.projects[i];
break;
}
}
if (project.scm_type !== null) {
ProjectStatus({ project_id: id });
}
else {
Alert('Missing SCM Configuration', 'The selected project is not configured for SCM. You must first edit the project, provide SCM settings, ' +
'and then start an update.', 'alert-info');
}
}
scope.deleteProject = function(id, name) {
@@ -95,7 +112,7 @@ function ProjectsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
ProjectsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'ProjectList', 'GenerateList',
'LoadBreadCrumbs', 'Prompt', 'SearchInit', 'PaginateInit', 'ReturnToCaller', 'ClearScope', 'ProcessErrors',
'GetBasePath', 'SelectionInit', 'SCMUpdate'];
'GetBasePath', 'SelectionInit', 'SCMUpdate', 'ProjectStatus'];
function ProjectsAdd ($scope, $rootScope, $compile, $location, $log, $routeParams, ProjectsForm,