Fixed zip code in footer. Changed job navigation to match inventory navigation (links at top of page rather than buttons).

This commit is contained in:
chouseknecht
2013-09-11 11:49:52 -04:00
parent ab6a20c525
commit fd16c0827a
10 changed files with 88 additions and 94 deletions

View File

@@ -25,6 +25,7 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
var base = $location.path().replace(/^\//,'').split('/')[0]; var base = $location.path().replace(/^\//,'').split('/')[0];
var scope = view.inject(list, { mode: 'edit' }); var scope = view.inject(list, { mode: 'edit' });
scope.job_id = $routeParams.id;
$rootScope.flashMessage = null; $rootScope.flashMessage = null;
scope.selected = []; scope.selected = [];
scope.expand = true; //on load, automatically expand all nodes scope.expand = true; //on load, automatically expand all nodes
@@ -168,11 +169,6 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
LoadBreadCrumbs(); LoadBreadCrumbs();
scope.viewJobEvent = function(id) { scope.viewJobEvent = function(id) {
//var url = '/jobs/' + $routeParams.id + '/job_events/' + id;
//if (scope['jobeventPage']) {
// url += '?&page=' + (scope['jobeventPage'] + 1);
//}
//$location.url(url);
EventView({ event_id: id }); EventView({ event_id: id });
} }
@@ -180,15 +176,6 @@ function JobEventsList ($scope, $rootScope, $location, $log, $routeParams, Rest,
scope.expand = true; scope.expand = true;
scope.search(list.iterator); scope.search(list.iterator);
} }
scope.jobDetails = function() {
$location.path('/jobs/' + $routeParams.id);
};
scope.jobSummary = function() {
$location.path('/jobs/' + $routeParams.id + '/job_host_summaries');
};
} }
JobEventsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobEventList', JobEventsList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobEventList',

View File

@@ -29,6 +29,7 @@ function JobHostSummaryList ($scope, $rootScope, $location, $log, $routeParams,
var view = GenerateList; var view = GenerateList;
var scope = view.inject(list, { mode: 'edit' }); var scope = view.inject(list, { mode: 'edit' });
scope.selected = []; scope.selected = [];
// control enable/disable/show of job specific view elements // control enable/disable/show of job specific view elements
@@ -88,14 +89,6 @@ function JobHostSummaryList ($scope, $rootScope, $location, $log, $routeParams,
scope.search(list.iterator); scope.search(list.iterator);
} }
scope.jobDetails = function() {
$location.path('/jobs/' + $routeParams.id);
};
scope.jobEvents = function() {
$location.path('/jobs/' + $routeParams.id + '/job_events');
};
} }
JobHostSummaryList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobHostList', JobHostSummaryList.$inject = [ '$scope', '$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'JobHostList',

View File

@@ -176,6 +176,7 @@ function JobsEdit ($scope, $rootScope, $compile, $location, $log, $routeParams,
var id = $routeParams.id; var id = $routeParams.id;
var relatedSets = {}; var relatedSets = {};
scope.job_id = id;
scope.parseType = 'yaml'; scope.parseType = 'yaml';
scope.statusSearchSpin = false; scope.statusSearchSpin = false;

View File

@@ -16,6 +16,21 @@ angular.module('JobFormDefinition', [])
well: true, well: true,
twoColumns: true, twoColumns: true,
navigationLinks: {
hosts: {
href: "/#/jobs/{{ job_id }}/job_host_summaries",
label: 'Hosts',
icon: 'icon-laptop'
},
events: {
href: "/#/jobs/{{ job_id }}/job_events",
label: 'Events',
icon: 'icon-list-ul'
}
},
fields: { fields: {
name: { name: {
label: 'Name', label: 'Name',
@@ -282,22 +297,6 @@ angular.module('JobFormDefinition', [])
"class": 'btn-sm btn-primary', "class": 'btn-sm btn-primary',
awToolTip: 'Refresh job status & output', awToolTip: 'Refresh job status & output',
mode: 'all' mode: 'all'
},
summary: {
label: 'Hosts',
icon: 'icon-laptop',
ngClick: "jobSummary()",
"class": 'btn btn-default btn-sm',
awToolTip: 'View host summary',
mode: 'all'
},
events: {
label: 'Events',
icon: 'icon-list-ul',
ngClick: "jobEvents()",
"class": 'btn btn-default btn-sm',
awToolTip: 'Edit job events',
mode: 'all'
} }
} }

View File

@@ -18,6 +18,19 @@ angular.module('JobEventsListDefinition', [])
hasChildren: true, hasChildren: true,
filterBy: '\{ show: true \}', filterBy: '\{ show: true \}',
navigationLinks: {
details: {
href: "/#/jobs/{{ job_id }}",
label: 'Details',
icon: 'icon-zoom-in'
},
summary: {
href: "/#/jobs/{{ job_id }}/job_host_summaries",
label: 'Hosts',
icon: 'icon-laptop'
}
},
fields: { fields: {
created: { created: {
label: 'Date', label: 'Date',
@@ -65,22 +78,6 @@ angular.module('JobEventsListDefinition', [])
awToolTip: 'Refresh the page', awToolTip: 'Refresh the page',
"class": 'btn-sm btn-primary', "class": 'btn-sm btn-primary',
mode: 'all' mode: 'all'
},
edit: {
label: 'Details',
ngClick: "jobDetails()",
icon: 'icon-zoom-in',
"class": 'btn btn-default btn-sm',
awToolTip: 'Edit job details',
mode: 'all'
},
summary: {
label: 'Hosts',
icon: 'icon-laptop',
ngClick: "jobSummary()",
"class": 'btn btn-default btn-sm',
awToolTip: 'View host summary',
mode: 'all'
} }
}, },

View File

@@ -16,6 +16,21 @@ angular.module('JobHostDefinition', [])
index: true, index: true,
hover: true, hover: true,
navigationLinks: {
details: {
href: "/#/jobs/{{ job_id }}",
label: 'Details',
icon: 'icon-zoom-in',
ngShow: "job_id !== null"
},
events: {
href: "/#/jobs/{{ job_id }}/job_events",
label: 'Events',
icon: 'icon-list-ul',
ngShow: "job_id !== null"
}
},
fields: { fields: {
id: { id: {
label: 'Job ID', label: 'Job ID',
@@ -71,24 +86,6 @@ angular.module('JobHostDefinition', [])
awToolTip: 'Refresh the page', awToolTip: 'Refresh the page',
mode: 'all' mode: 'all'
}, },
edit: {
label: 'Details',
icon: 'icon-edit',
ngClick: "jobDetails()",
ngShow: 'job_id !== null',
"class": 'btn btn-default btn-sm',
awToolTip: 'Edit job details',
mode: 'all'
},
events: {
label: 'Events',
icon: 'icon-list-ul',
ngClick: "jobEvents()",
ngShow: 'job_id !== null',
"class": 'btn btn-default btn-sm',
awToolTip: 'View job events',
mode: 'all'
},
help: { help: {
awPopOver: "<dl>\n<dt>Success</dt><dd>Tasks successfully executed on the host.</dd>\n" + awPopOver: "<dl>\n<dt>Success</dt><dd>Tasks successfully executed on the host.</dd>\n" +
"<dt>Changed</dt><dd>Actions taken on the host.</dd>\n" + "<dt>Changed</dt><dd>Actions taken on the host.</dd>\n" +

View File

@@ -10,7 +10,8 @@
angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies']) angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
.factory('GenerateForm', [ '$location', '$cookieStore', '$compile', 'SearchWidget', 'PaginateWidget', 'Attr', 'Icon', 'Column', .factory('GenerateForm', [ '$location', '$cookieStore', '$compile', 'SearchWidget', 'PaginateWidget', 'Attr', 'Icon', 'Column',
function($location, $cookieStore, $compile, SearchWidget, PaginateWidget, Attr, Icon, Column) { 'NavigationLink',
function($location, $cookieStore, $compile, SearchWidget, PaginateWidget, Attr, Icon, Column, NavigationLink) {
return { return {
setForm: function(form) { setForm: function(form) {
@@ -288,9 +289,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
return html; return html;
}, },
navigationLink: function(link) { navigationLink: NavigationLink,
return "<a href=\"" + link.href + "\">" + this.attr(link, 'icon') + ' ' + link.label + "</a>\n";
},
buildField: function(fld, field, options, form) { buildField: function(fld, field, options, form) {
@@ -771,6 +770,14 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
html += this.breadCrumbs(options); html += this.breadCrumbs(options);
} }
if (!this.modal && this.form.navigationLinks) {
html += "<div class=\"navigation-links text-right\">\n";
for (var link in this.form.navigationLinks) {
html += this.navigationLink(this.form.navigationLinks[link]);
}
html += "</div>\n";
}
if ((!this.modal && this.form.statusFields)) { if ((!this.modal && this.form.statusFields)) {
// Add status fields section (used in Jobs form) // Add status fields section (used in Jobs form)
html += "<div class=\"well\">\n"; html += "<div class=\"well\">\n";
@@ -831,14 +838,6 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
html += "</div>\n"; html += "</div>\n";
} }
if (this.form.navigationLinks) {
html += "<div class=\"navigation-links text-right\">\n";
for (var link in this.form.navigationLinks) {
html += this.navigationLink(this.form.navigationLinks[link]);
}
html += "</div>\n";
}
// Start the well // Start the well
if ( this.has('well') ) { if ( this.has('well') ) {
html += "<div class=\"well\">\n"; html += "<div class=\"well\">\n";

View File

@@ -90,10 +90,23 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers'])
.factory('Icon', function() { .factory('Icon', function() {
return function(icon) { return function(icon) {
return "<i class=\"" + icon + "\"></i> "; return "<i class=\"" + icon + "\"></i> ";
} }
}) })
.factory('NavigationLink', ['Attr', 'Icon', function(Attr, Icon) {
return function(link) {
var html = "<a ";
html += (link.href) ? Attr(link, 'href') : '';
html += (link.ngClick) ? Attr(link, 'ngClick') : '';
html += (link.ngShow) ? Attr(link, 'ngShow') : '';
html += '>';
html += (link.icon) ? Icon(link.icon) : '';
html += (link.label) ? link.label : '';
html += "</a>\n";
return html;
}
}])
.factory('DropDown', ['Attr', 'Icon', function(Attr, Icon) { .factory('DropDown', ['Attr', 'Icon', function(Attr, Icon) {
return function(params) { return function(params) {

View File

@@ -9,8 +9,8 @@
angular.module('ListGenerator', ['GeneratorHelpers']) angular.module('ListGenerator', ['GeneratorHelpers'])
.factory('GenerateList', [ '$location', '$compile', '$rootScope', 'SearchWidget', 'PaginateWidget', 'Attr', 'Icon', .factory('GenerateList', [ '$location', '$compile', '$rootScope', 'SearchWidget', 'PaginateWidget', 'Attr', 'Icon',
'Column', 'DropDown', 'Column', 'DropDown', 'NavigationLink',
function($location, $compile, $rootScope, SearchWidget, PaginateWidget, Attr, Icon, Column, DropDown) { function($location, $compile, $rootScope, SearchWidget, PaginateWidget, Attr, Icon, Column, DropDown, NavigationLink) {
return { return {
setList: function(list) { setList: function(list) {
@@ -139,6 +139,14 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
html += "</div>\n"; html += "</div>\n";
} }
if (options.mode != 'lookup' && list.navigationLinks) {
html += "<div class=\"navigation-links text-right\">\n";
for (var link in list.navigationLinks) {
html += NavigationLink(list.navigationLinks[link]);
}
html += "</div>\n";
}
if (options.mode != 'lookup' && (list.well == undefined || list.well == 'true')) { if (options.mode != 'lookup' && (list.well == undefined || list.well == 'true')) {
html += "<div class=\"well\">\n"; html += "<div class=\"well\">\n";
} }

View File

@@ -343,7 +343,7 @@
</div> </div>
<div class="copyright"> <div class="copyright">
Copyright &copy; 2013 AnsibleWorks, Inc. All rights reservied.<br /> Copyright &copy; 2013 AnsibleWorks, Inc. All rights reservied.<br />
1482 East Valley Road, Suite 888 &middot; Montecito, California 9308 &middot; +1-800-825-0212<br /> 1482 East Valley Road, Suite 888 &middot; Montecito, California 93108 &middot; +1-800-825-0212<br />
<a href="http://www.ansibleworks.com" target="_blank">www.ansibleworks.com</a> <a href="http://www.ansibleworks.com" target="_blank">www.ansibleworks.com</a>
</div> </div>
<div class="logo pull-right"> <div class="logo pull-right">