mirror of
https://github.com/ansible/awx.git
synced 2026-01-14 11:20:39 -03:30
AC-331 Latest changes and cleanup from testing
This commit is contained in:
parent
b76bf268f9
commit
82833c848f
@ -94,6 +94,11 @@ function InventoriesAdd ($scope, $rootScope, $compile, $location, $log, $routePa
|
||||
var defaultUrl = GetBasePath('inventory');
|
||||
var form = InventoryForm;
|
||||
var generator = GenerateForm;
|
||||
|
||||
form.well = true,
|
||||
form.formLabelSize = null;
|
||||
form.formFieldSize = null;
|
||||
|
||||
var scope = generator.inject(form, {mode: 'add', related: false});
|
||||
scope.inventoryParseType = 'yaml';
|
||||
|
||||
@ -398,7 +403,7 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
|
||||
scope.inventoryEditHide = true;
|
||||
scope.groupDeleteHide = false;
|
||||
scope.createButtonShow = true;
|
||||
//scope.group_id = node.attr('group_id');
|
||||
scope.group_id = node.attr('group_id');
|
||||
//scope.groupName = n.data;
|
||||
//scope.groupTitle = '<h4>' + n.data + '</h4>';
|
||||
//scope.groupTitle += (node.attr('description')) ? '<p>' + node.attr('description') + '</p>' : '';
|
||||
@ -413,7 +418,7 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
|
||||
scope.createButtonShow = false;
|
||||
//scope.groupName = 'All Hosts';
|
||||
//scope.groupTitle = '<h4>All Hosts</h4>';
|
||||
//scope.group_id = null;
|
||||
scope.group_id = null;
|
||||
}
|
||||
|
||||
if (!scope.$$phase) {
|
||||
@ -463,20 +468,18 @@ function InventoriesEdit ($scope, $rootScope, $compile, $location, $log, $routeP
|
||||
request: 'remove' });
|
||||
} */
|
||||
|
||||
scope.showEvents = function(host_name, last_job) {
|
||||
// When click on !Failed Events link, redirect to latest job/job_events for the host
|
||||
Rest.setUrl(last_job);
|
||||
Rest.get()
|
||||
.success( function(data, status, headers, config) {
|
||||
LoadBreadCrumbs({ path: '/jobs/' + data.id, title: data.name });
|
||||
$location.url('/jobs/' + data.id + '/job_events/?host=' + escape(host_name));
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
ProcessErrors(scope, data, status, form,
|
||||
{ hdr: 'Error!', msg: 'Failed to lookup last job: ' + last_job + '. GET status: ' + status });
|
||||
});
|
||||
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 });
|
||||
$location.url('/jobs/' + last_job + '/job_events/?host=' + escape(host_name));
|
||||
}
|
||||
|
||||
scope.viewLastSummary = function(host_id, last_job, host_name, last_job_name) {
|
||||
// Choose View-> Latest job events
|
||||
LoadBreadCrumbs({ path: '/jobs/' + last_job, title: last_job_name });
|
||||
$location.url('/jobs/' + last_job + '/job_host_summaries/?host=' + escape(host_name));
|
||||
}
|
||||
|
||||
scope.toggleAllHosts = function() {
|
||||
scope.hostDeleteDisabled = (scope.toggleAllFlag) ? false : true;
|
||||
scope.hostDeleteDisabledClass = (scope.hostDeleteDisabled) ? "disabled" : "";
|
||||
|
||||
@ -35,6 +35,14 @@ function JobHostSummaryList ($scope, $rootScope, $location, $log, $routeParams,
|
||||
|
||||
SearchInit({ scope: scope, set: 'jobhosts', list: list, url: defaultUrl });
|
||||
PaginateInit({ scope: scope, list: list, url: defaultUrl });
|
||||
|
||||
// Called from Inventories tab, host failed events link:
|
||||
if ($routeParams.host) {
|
||||
scope[list.iterator + 'SearchField'] = 'host';
|
||||
scope[list.iterator + 'SearchValue'] = $routeParams.host;
|
||||
scope[list.iterator + 'SearchFieldLabel'] = list.fields['host'].label;
|
||||
}
|
||||
|
||||
scope.search(list.iterator);
|
||||
|
||||
LoadBreadCrumbs();
|
||||
|
||||
@ -14,19 +14,12 @@ angular.module('InventoryFormDefinition', [])
|
||||
editTitle: '{{ inventory_name }}',
|
||||
name: 'inventory',
|
||||
parseTypeName: 'inventoryParseType',
|
||||
well: false,
|
||||
well: true,
|
||||
/*,
|
||||
formLabelSize: 'col-lg-3',
|
||||
formFieldSize: 'col-lg-9',
|
||||
formFieldSize: 'col-lg-9',*/
|
||||
|
||||
fields: {
|
||||
has_active_failures: {
|
||||
label: 'Status',
|
||||
control: '<div class="job-failures-\{\{ has_active_failures \}\}">' +
|
||||
'<i class="icon-exclamation-sign"></i> Contains hosts with failed jobs</div>',
|
||||
type: 'custom',
|
||||
ngShow: 'has_active_failures',
|
||||
readonly: true
|
||||
},
|
||||
inventory_name: {
|
||||
realName: 'name',
|
||||
label: 'Name',
|
||||
@ -116,18 +109,26 @@ angular.module('InventoryFormDefinition', [])
|
||||
badgeShow: "\{\{ host.has_active_failures \}\}",
|
||||
badgeIcon: 'icon-exclamation-sign',
|
||||
badgeToolTip: 'Most recent job failed',
|
||||
badgePlacement: 'bottom'
|
||||
badgePlacement: 'bottom',
|
||||
columnClass: 'col-lg-3'
|
||||
},
|
||||
/*description: {
|
||||
label: 'Description',
|
||||
ngClick: "editHost(\{\{ host.id \}\}, '\{\{ host.name \}\}')"
|
||||
},*/
|
||||
groups: {
|
||||
label: 'Groups',
|
||||
searchable: false,
|
||||
sourceModel: 'groups',
|
||||
sourceField: 'name',
|
||||
nosort: true
|
||||
},
|
||||
dropdown: {
|
||||
type: 'DropDown',
|
||||
label: 'View',
|
||||
options: [
|
||||
{ ngClick: 'viewJobs(\{\{ host.id \}\})', label: 'Jobs' },
|
||||
{ ngClick: "viewLastEvents(\{\{ host.id \}\}, '\{\{ host.last_job \}\}', '\{\{ host.name \}\}', " +
|
||||
"'\{\{ host.summary_fields.last_job.name \}\}')", label: 'Latest job events' },
|
||||
{ ngClick: "viewLastSummary(\{\{ host.id \}\}, '\{\{ host.last_job \}\}', '\{\{ host.name \}\}', " +
|
||||
"'\{\{ host.summary_fields.last_job.name \}\}')", label: 'Latest host summary' }
|
||||
]
|
||||
}
|
||||
},
|
||||
fieldActions: {
|
||||
|
||||
@ -341,14 +341,14 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
|
||||
|
||||
.factory('GroupsDelete', ['$rootScope', '$location', '$log', '$routeParams', 'Rest', 'Alert', 'GroupForm', 'GenerateForm',
|
||||
'Prompt', 'ProcessErrors', 'GetBasePath', 'RefreshTree',
|
||||
'Prompt', 'ProcessErrors', 'GetBasePath', 'RefreshTree', 'Wait',
|
||||
function($rootScope, $location, $log, $routeParams, Rest, Alert, GroupForm, GenerateForm, Prompt, ProcessErrors,
|
||||
GetBasePath, RefreshTree) {
|
||||
GetBasePath, RefreshTree, Wait) {
|
||||
return function(params) {
|
||||
// Delete the selected group node. Disassociates it from its parent.
|
||||
var scope = params.scope;
|
||||
var group_id = params.group_id;
|
||||
var inventory_id = params.inventory_id;
|
||||
var inventory_id = params.inventory_id;
|
||||
var obj = $('#tree-view li[group_id="' + group_id + '"]');
|
||||
var parent = (obj.parent().last().prop('tagName') == 'LI') ? obj.parent().last() : obj.parent().parent().last();
|
||||
var url;
|
||||
@ -360,16 +360,19 @@ angular.module('GroupsHelper', [ 'RestServices', 'Utilities', 'ListGenerator', '
|
||||
url = GetBasePath('inventory') + inventory_id + '/groups/';
|
||||
}
|
||||
var action_to_take = function() {
|
||||
$('#prompt-modal').modal('hide');
|
||||
Wait('start');
|
||||
Rest.setUrl(url);
|
||||
Rest.post({ id: group_id, disassociate: 1 })
|
||||
.success( function(data, status, headers, config) {
|
||||
$('#prompt-modal').modal('hide');
|
||||
scope.selectedNode = scope.selectedNode.parent().parent();
|
||||
RefreshTree({ scope: scope });
|
||||
Wait('stop');
|
||||
})
|
||||
.error( function(data, status, headers, config) {
|
||||
$('#prompt-modal').modal('hide');
|
||||
//$('#prompt-modal').modal('hide');
|
||||
RefreshTree({ scope: scope });
|
||||
Wait('stop');
|
||||
ProcessErrors(scope, data, status, null,
|
||||
{ hdr: 'Error!', msg: 'Call to ' + url + ' failed. DELETE returned status: ' + status });
|
||||
});
|
||||
|
||||
@ -179,7 +179,7 @@ angular.module('InventoryHelper', [ 'RestServices', 'Utilities', 'OrganizationLi
|
||||
items: scope.treeController
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$(tree_id).bind("loaded.jstree", function () {
|
||||
scope['treeLoading'] = false;
|
||||
scope.$emit('treeLoaded');
|
||||
@ -374,7 +374,7 @@ angular.module('InventoryHelper', [ 'RestServices', 'Utilities', 'OrganizationLi
|
||||
// Call after GroupsEdit controller saves changes
|
||||
$('#tree-view').jstree('rename_node', node, name);
|
||||
node.attr('description', description);
|
||||
scope = angular.element(getElementById('htmlTemplate')).scope();
|
||||
scope = angular.element(document.getElementById('htmlTemplate')).scope();
|
||||
scope['selectedNodeName'] = name;
|
||||
}
|
||||
}])
|
||||
@ -450,7 +450,11 @@ angular.module('InventoryHelper', [ 'RestServices', 'Utilities', 'OrganizationLi
|
||||
var form = InventoryForm;
|
||||
var defaultUrl=GetBasePath('inventory');
|
||||
var scope = params.scope
|
||||
|
||||
|
||||
form.well = false,
|
||||
form.formLabelSize = 'col-lg-3';
|
||||
form.formFieldSize = 'col-lg-9';
|
||||
|
||||
generator.inject(form, {mode: 'edit', modal: true, related: false});
|
||||
|
||||
ParseTypeChange(scope,'inventory_variables', 'inventoryParseType');
|
||||
|
||||
@ -112,6 +112,7 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
||||
scope[iterator + 'Loading'] = true;
|
||||
scope[iterator + 'SearchParms'] = '';
|
||||
var url = defaultUrl;
|
||||
|
||||
if ( (scope[iterator + 'SelectShow'] == false && scope[iterator + 'SearchValue'] != '' && scope[iterator + 'SearchValue'] != undefined) ||
|
||||
(scope[iterator + 'SelectShow'] && scope[iterator + 'SearchSelectValue']) ||
|
||||
(list.fields[scope[iterator + 'SearchField']].searchType && list.fields[scope[iterator + 'SearchField']].searchType == 'gtzero') ) {
|
||||
@ -156,6 +157,11 @@ angular.module('SearchHelper', ['RestServices', 'Utilities', 'RefreshHelper'])
|
||||
else {
|
||||
scope[iterator + 'SearchParams'] = (sort_order) ? 'order_by=' + escape(sort_order) : "";
|
||||
}
|
||||
|
||||
if (iterator == 'inventory' && scope.inventoryFailureFilter) {
|
||||
scope[iterator + 'SearchParams'] += '&has_active_failures=true';
|
||||
}
|
||||
|
||||
scope[iterator + 'Page'] = (page) ? parseInt(page) - 1 : 0;
|
||||
if (/\/$/.test(url)) {
|
||||
url += '?' + scope[iterator + 'SearchParams'];
|
||||
|
||||
@ -21,7 +21,11 @@ angular.module('InventoriesListDefinition', [])
|
||||
fields: {
|
||||
name: {
|
||||
key: true,
|
||||
label: 'Name'
|
||||
label: 'Name',
|
||||
badgeShow: "\{\{ inventory.has_active_failures \}\}",
|
||||
badgeIcon: 'icon-exclamation-sign',
|
||||
badgeToolTip: 'Contains hosts with active job failures',
|
||||
badgePlacement: 'bottom'
|
||||
},
|
||||
description: {
|
||||
label: 'Description'
|
||||
@ -32,7 +36,8 @@ angular.module('InventoriesListDefinition', [])
|
||||
sourceModel: 'organization',
|
||||
sourceField: 'name',
|
||||
excludeModal: true
|
||||
},
|
||||
}
|
||||
/*,
|
||||
has_active_failures: {
|
||||
label: 'Failed Jobs?',
|
||||
showValue: false,
|
||||
@ -45,7 +50,7 @@ angular.module('InventoriesListDefinition', [])
|
||||
searchType: 'boolean',
|
||||
searchOptions: [{ name: "No", value: 0 }, { name: "Yes", value: 1 }],
|
||||
excludeModal: true
|
||||
}
|
||||
}*/
|
||||
},
|
||||
|
||||
actions: {
|
||||
|
||||
@ -179,8 +179,6 @@ a:hover {
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.site-footer {
|
||||
width: 100%;
|
||||
padding-top: 20px;
|
||||
@ -225,10 +223,6 @@ a:hover {
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
.login-header {
|
||||
text-align: center;
|
||||
}
|
||||
@ -620,7 +614,7 @@ input[type="text"].job-successful {
|
||||
|
||||
}
|
||||
|
||||
.host-badge {
|
||||
.field-badge {
|
||||
color: @red;
|
||||
font-size: 12px;
|
||||
}
|
||||
|
||||
@ -533,7 +533,7 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Hos
|
||||
html += "<a href=\"\" class=\"activate\">" + data.results[i].name + "</a> ";
|
||||
html += "<a href=\"\" aw-tool-tip=\"Contains hosts with failed jobs\" ng-show=\"" +
|
||||
data.results[i].has_active_failures + "\" data-placement=\"bottom\">" +
|
||||
"<i class=\"host-badge icon-exclamation-sign\"></i></a></li>\n";
|
||||
"<i class=\"field-badge icon-exclamation-sign\"></i></a></li>\n";
|
||||
}
|
||||
html = (html !== '') ? "<ul>" + html + "</ul>\n" : "";
|
||||
var compiled = $compile(html)(scope);
|
||||
@ -580,7 +580,7 @@ angular.module('AWDirectives', ['RestServices', 'Utilities', 'AuthService', 'Hos
|
||||
"><a href=\"\" class=\"expand\"><i class=\"icon-caret-right\"></i></a> " +
|
||||
"<a href=\"\" class=\"activate active\">{{ treeData[0].name }}</a> " +
|
||||
"<a href=\"\" aw-tool-tip=\"Contains hosts with failed jobs\" ng-show=\"\{\{ treeData[0].failures \}\}\" data-placement=\"bottom\">" +
|
||||
"<i class=\"host-badge icon-exclamation-sign\"></i></a>" +
|
||||
"<i class=\"field-badge icon-exclamation-sign\"></i></a>" +
|
||||
"</li>\n" +
|
||||
"</ul>\n";
|
||||
var compiled = $compile(html)(scope);
|
||||
|
||||
@ -63,7 +63,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
|
||||
// From here use 'scope' to manipulate the form, as the form is not in '$scope'
|
||||
$compile(element)(this.scope);
|
||||
|
||||
if (!options.buildTree == false && !options.html) {
|
||||
if (!options.buildTree && !options.html) {
|
||||
// Reset the scope to prevent displaying old data from our last visit to this form
|
||||
for (var fld in form.fields) {
|
||||
this.scope[fld] = null;
|
||||
@ -72,6 +72,7 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
|
||||
this.scope[set] = null;
|
||||
}
|
||||
if ( ((!options.modal) && options.related) || this.form.forceListeners ) {
|
||||
console.log('adding listeners');
|
||||
this.addListeners();
|
||||
}
|
||||
if (options.mode == 'add') {
|
||||
@ -1052,20 +1053,6 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
|
||||
}
|
||||
}
|
||||
|
||||
html += "<td>";
|
||||
html += "<div class=\"btn-group btn-group-sm\">\n";
|
||||
html += "<button type=\"button\" class=\"btn btn-default btn-mini dropdown-toggle\" data-toggle=\"dropdown\">";
|
||||
html += "View <span class=\"caret\"></span></button>\n";
|
||||
html += "<ul class=\"dropdown-menu pull-right\" role=\"menu\" aria-labelledby=\"dropdownMenu1\">\n";
|
||||
html += "<li role=\"presentation\"><a role=\"menuitem\" tabindex=\"-1\" href=\"#\">Action</a></li>\n";
|
||||
html += "<li role=\"presentation\"><a role=\"menuitem\" tabindex=\"-1\" href=\"#\">Another action</a></li>\n";
|
||||
html += "<li role=\"presentation\"><a role=\"menuitem\" tabindex=\"-1\" href=\"#\">Something else here</a></li>\n";
|
||||
html += "<li role=\"presentation\" class=\"divider\"></li>\n";
|
||||
html += "<li role=\"presentation\"><a role=\"menuitem\" tabindex=\"-1\" href=\"#\">Separated link</a></li>\n";
|
||||
html += "</ul>\n";
|
||||
html += "</div>\n";
|
||||
html += "</td>\n";
|
||||
|
||||
html += "</tr>\n";
|
||||
|
||||
// Message for when a related collection is empty
|
||||
|
||||
@ -91,7 +91,38 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers'])
|
||||
}
|
||||
})
|
||||
|
||||
.factory('Column', ['Attr', 'Icon', function(Attr, Icon) {
|
||||
|
||||
.factory('DropDown', ['Attr', 'Icon', function(Attr, Icon) {
|
||||
return function(params) {
|
||||
|
||||
var list = params['list'];
|
||||
var fld = params['fld'];
|
||||
var options = params['options'];
|
||||
var base = params['base'];
|
||||
var field = list['fields'][fld];
|
||||
|
||||
html = "<td>\n";
|
||||
html += "<div class=\"btn-group btn-group-sm\">\n";
|
||||
html += "<button type=\"button\" class=\"btn btn-default btn-mini dropdown-toggle\" data-toggle=\"dropdown\">";
|
||||
html += field.label;
|
||||
html += " <span class=\"caret\"></span></button>\n";
|
||||
html += "<ul class=\"dropdown-menu pull-right\" role=\"menu\" aria-labelledby=\"dropdownMenu1\">\n";
|
||||
for (var i=0; i < field.options.length; i++) {
|
||||
html += "<li role=\"presentation\"><a role=\"menuitem\" tabindex=\"-1\" ";
|
||||
html += "ng-click=\"" + field.options[i].ngClick + "\" ";
|
||||
html += "href=\"\">" + field.options[i].label + "</a></li>\n";
|
||||
}
|
||||
html += "</ul>\n";
|
||||
html += "</div>\n";
|
||||
html += "</td>\n";
|
||||
|
||||
return html;
|
||||
|
||||
}
|
||||
}])
|
||||
|
||||
|
||||
.factory('Column', ['Attr', 'Icon', 'DropDown', function(Attr, Icon, DropDown) {
|
||||
return function(params) {
|
||||
var list = params['list'];
|
||||
var fld = params['fld'];
|
||||
@ -101,93 +132,99 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers'])
|
||||
var field = list['fields'][fld];
|
||||
var html = '';
|
||||
|
||||
html += "<td class=\"" + fld + "-column";
|
||||
html += (field['class']) ? " " + field['class'] : "";
|
||||
html += (field['columnClass']) ? " " + field['columnClass'] : "";
|
||||
html += "\" ";
|
||||
html += (field.ngClass) ? Attr(field, 'ngClass') : "";
|
||||
html += (options.mode == 'lookup' || options.mode == 'select') ? " ng-click=\"toggle_" + list.iterator +"({{ " + list.iterator + ".id }})\"" : "";
|
||||
html += ">\n";
|
||||
|
||||
// Add ngShow
|
||||
html += (field.ngShow) ? "<span " + Attr(field,'ngShow') + ">" : "";
|
||||
|
||||
// Add collapse/expand icon --used on job_events page
|
||||
if (list['hasChildren'] && field.hasChildren) {
|
||||
html += "<span class=\"level-\{\{ " + list.iterator + ".event_level \}\}\"><a href=\"\" ng-click=\"\{\{ " + list.iterator + ".ngclick \}\}\"> " +
|
||||
"<i class=\"\{\{ " + list.iterator + ".ngicon \}\}\" ng-show=\"'\{\{ " +
|
||||
list.iterator + ".related.children \}\}' !== ''\" ></i></a> ";
|
||||
}
|
||||
|
||||
// Start the Link
|
||||
if ((field.key || field.link || field.linkTo || field.ngClick ) && options['mode'] != 'lookup' && options['mode'] != 'select') {
|
||||
if (field.linkTo) {
|
||||
html += "<a href=\"#" + field.linkTo + "\">";
|
||||
}
|
||||
else if (field.ngClick) {
|
||||
html += "<a href=\"\"" + Attr(field, 'ngClick') + "\">";
|
||||
}
|
||||
else if (field.link == undefined || field.link) {
|
||||
html += "<a href=\"#/" + base + "/{{" + list.iterator + ".id }}\">";
|
||||
}
|
||||
}
|
||||
|
||||
// Add icon:
|
||||
if (field.ngShowIcon) {
|
||||
html += "<i ng-show=\"" + field.ngShowIcon + "\" class=\"" + field.icon + "\"></i> ";
|
||||
if (field.type !== undefined && field.type == 'DropDown') {
|
||||
html = DropDown(params);
|
||||
}
|
||||
else {
|
||||
if (field.icon) {
|
||||
html += Icon(field.icon) + " ";
|
||||
}
|
||||
}
|
||||
html += "<td class=\"" + fld + "-column";
|
||||
html += (field['class']) ? " " + field['class'] : "";
|
||||
html += (field['columnClass']) ? " " + field['columnClass'] : "";
|
||||
html += "\" ";
|
||||
html += (field.ngClass) ? Attr(field, 'ngClass') : "";
|
||||
html += (options.mode == 'lookup' || options.mode == 'select') ? " ng-click=\"toggle_" + list.iterator +"({{ " + list.iterator + ".id }})\"" : "";
|
||||
html += ">\n";
|
||||
|
||||
// Add data binds
|
||||
if (field.showValue == undefined || field.showValue == true) {
|
||||
if (field.ngBind) {
|
||||
html += "{{ " + field.ngBind + " }}";
|
||||
}
|
||||
else {
|
||||
html += "{{" + list.iterator + "." + fld + "}}";
|
||||
}
|
||||
}
|
||||
|
||||
// Add additional text:
|
||||
if (field.text) {
|
||||
html += field.text;
|
||||
}
|
||||
// Add ngShow
|
||||
html += (field.ngShow) ? "<span " + Attr(field,'ngShow') + ">" : "";
|
||||
|
||||
// Add collapse/expand icon --used on job_events page
|
||||
if (list['hasChildren'] && field.hasChildren) {
|
||||
html += "<span class=\"level-\{\{ " + list.iterator + ".event_level \}\}\"><a href=\"\" ng-click=\"\{\{ " + list.iterator + ".ngclick \}\}\"> " +
|
||||
"<i class=\"\{\{ " + list.iterator + ".ngicon \}\}\" ng-show=\"'\{\{ " +
|
||||
list.iterator + ".related.children \}\}' !== ''\" ></i></a> ";
|
||||
}
|
||||
|
||||
if (list['hasChildren'] && field.hasChildren) {
|
||||
html += "</span>";
|
||||
}
|
||||
|
||||
// close the link
|
||||
if ((field.key || field.link || field.linkTo || field.ngClick )
|
||||
&& options.mode != 'lookup' && options.mode != 'select') {
|
||||
html += "</a>";
|
||||
}
|
||||
// Start the Link
|
||||
if ((field.key || field.link || field.linkTo || field.ngClick ) && options['mode'] != 'lookup' && options['mode'] != 'select') {
|
||||
if (field.linkTo) {
|
||||
html += "<a href=\"#" + field.linkTo + "\">";
|
||||
}
|
||||
else if (field.ngClick) {
|
||||
html += "<a href=\"\"" + Attr(field, 'ngClick') + "\">";
|
||||
}
|
||||
else if (field.link == undefined || field.link) {
|
||||
html += "<a href=\"#/" + base + "/{{" + list.iterator + ".id }}\">";
|
||||
}
|
||||
}
|
||||
|
||||
// close ngShow
|
||||
html += (field.ngShow) ? "</span>" : "";
|
||||
|
||||
// Specific to Job Events page -showing event detail/results
|
||||
html += (field.appendHTML) ? "<div ng-show=\"" + field.appendHTML + " !== null\" " +
|
||||
"ng-bind-html-unsafe=\"" + field.appendHTML + "\" " +
|
||||
"class=\"level-\{\{ " + list.iterator + ".event_level \}\}-detail\" " +
|
||||
"></div>\n" : "";
|
||||
|
||||
// Badge
|
||||
if (field.badgeIcon) {
|
||||
if (field.badgeToolTip) {
|
||||
html += "<a href=\"\" aw-tool-tip=\"Most recent job failed\"";
|
||||
html += (field.badgePlacement) ? " data-placement=\"" + field.badgePlacement + "\"" : "";
|
||||
html += " ng-show=\"" + field.badgeShow + "\">";
|
||||
html += " <i class=\"host-badge " + field.badgeIcon + "\"></i></a>\n";
|
||||
// Add icon:
|
||||
if (field.ngShowIcon) {
|
||||
html += "<i ng-show=\"" + field.ngShowIcon + "\" class=\"" + field.icon + "\"></i> ";
|
||||
}
|
||||
else {
|
||||
html += " <i class=\"host-badge " + field.badgeIcon + "\" ";
|
||||
html += "ng-show=\"" + field.badgeShow + "\"></i>\n";
|
||||
}
|
||||
if (field.icon) {
|
||||
html += Icon(field.icon) + " ";
|
||||
}
|
||||
}
|
||||
|
||||
// Add data binds
|
||||
if (field.showValue == undefined || field.showValue == true) {
|
||||
if (field.ngBind) {
|
||||
html += "{{ " + field.ngBind + " }}";
|
||||
}
|
||||
else {
|
||||
html += "{{" + list.iterator + "." + fld + "}}";
|
||||
}
|
||||
}
|
||||
|
||||
// Add additional text:
|
||||
if (field.text) {
|
||||
html += field.text;
|
||||
}
|
||||
|
||||
if (list['hasChildren'] && field.hasChildren) {
|
||||
html += "</span>";
|
||||
}
|
||||
|
||||
// close the link
|
||||
if ((field.key || field.link || field.linkTo || field.ngClick )
|
||||
&& options.mode != 'lookup' && options.mode != 'select') {
|
||||
html += "</a>";
|
||||
}
|
||||
|
||||
// close ngShow
|
||||
html += (field.ngShow) ? "</span>" : "";
|
||||
|
||||
// Specific to Job Events page -showing event detail/results
|
||||
html += (field.appendHTML) ? "<div ng-show=\"" + field.appendHTML + " !== null\" " +
|
||||
"ng-bind-html-unsafe=\"" + field.appendHTML + "\" " +
|
||||
"class=\"level-\{\{ " + list.iterator + ".event_level \}\}-detail\" " +
|
||||
"></div>\n" : "";
|
||||
|
||||
// Badge
|
||||
if (field.badgeIcon) {
|
||||
if (field.badgeToolTip) {
|
||||
html += "<a href=\"\" aw-tool-tip=\"" + field.badgeToolTip + "\"";
|
||||
html += (field.badgePlacement) ? " data-placement=\"" + field.badgePlacement + "\"" : "";
|
||||
html += (field.badgeShow) ? " ng-show=\"" + field.badgeShow + "\"" : ""
|
||||
html += ">";
|
||||
html += " <i class=\"field-badge " + field.badgeIcon + "\"></i></a>\n";
|
||||
}
|
||||
else {
|
||||
html += " <i class=\"field-badge " + field.badgeIcon + "\" ";
|
||||
html += "ng-show=\"" + field.badgeShow + "\"></i>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return html += "</td>\n";
|
||||
@ -195,6 +232,7 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers'])
|
||||
}
|
||||
}])
|
||||
|
||||
|
||||
.factory('SearchWidget', function() {
|
||||
return function(params) {
|
||||
//
|
||||
|
||||
@ -142,6 +142,7 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
|
||||
if (options.mode != 'lookup' && (list.well == undefined || list.well == 'true')) {
|
||||
html += "<div class=\"well\">\n";
|
||||
}
|
||||
|
||||
|
||||
if (options.mode == 'lookup' || options.id != undefined) {
|
||||
html += SearchWidget({ iterator: list.iterator, template: list, mini: true , size: 'col-lg-8' });
|
||||
@ -164,6 +165,12 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (list.name == 'inventories' && options.mode !== 'select') {
|
||||
html += "<label class=\"checkbox-inline pull-right\"><input type=\"checkbox\" ng-model=\"inventoryFailureFilter\" " +
|
||||
"ng-change=\"search('inventory')\" > Show only inventories with failed jobs</label>\n";
|
||||
}
|
||||
|
||||
//select instructions
|
||||
if (options.mode == 'select' && list.selectInstructions) {
|
||||
var btn = {
|
||||
|
||||
@ -104,26 +104,25 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<div class="navbar navbar-inverse navbar-fixed-top main-menu">
|
||||
<div class="navbar navbar-inverse navbar-fixed-top main-menu" role="navigation">
|
||||
<div class="container">
|
||||
|
||||
<a class="navbar-brand" href="#organizations"><img class="logo" src="{{ STATIC_URL }}img/logo.png" /></a>
|
||||
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
|
||||
<div class="nav-collapse collapse navbar-responsive-collapse">
|
||||
<div class="navbar-header">
|
||||
<a class="navbar-brand" href="#organizations"><img class="logo" src="{{ STATIC_URL }}img/logo.png" /></a>
|
||||
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-responsive-collapse">
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
<span class="icon-bar"></span>
|
||||
</button>
|
||||
</div>
|
||||
<div class="nav-collapse navbar-responsive-collapse">
|
||||
<ul class="nav navbar-nav pull-right">
|
||||
<li ng-show="current_user.username != null && current_user.username != undefined">
|
||||
<a href="" ng-click="viewCurrentUser()" ng-bind="'Hello! ' + current_user.username"></a></li>
|
||||
<li ng-show="userLoggedIn == true"><a href="" ng-click="viewLicense()">View License</a></li>
|
||||
<a href="" ng-click="viewCurrentUser()" ng-bind="'Hello! ' + current_user.username"></a></li>
|
||||
<li ng-show="userLoggedIn == true"><a href="" ng-click="viewLicense()">View License</a></li>
|
||||
<li ng-show="userLoggedIn == true"><a href="#/logout">Logout</a></li>
|
||||
</ul>
|
||||
</div><!-- nav-collapse -->
|
||||
</div><!-- container -->
|
||||
</div>
|
||||
</div><!-- navbar -->
|
||||
|
||||
<div class="container main-container">
|
||||
@ -219,7 +218,7 @@
|
||||
<div class="modal-body" id="form-modal-body"></div>
|
||||
<div class="modal-footer">
|
||||
<button ng-show="formModalInfo !== undefined && formModalInfo != ''" ng-click="formModalInfoAction()"
|
||||
class="btn btn-mini pull-left"><i class="icon-zoom-in"></i> <span ng-bind="formModalInfo"></span></button>
|
||||
class="btn btn-sm pull-left"><i class="icon-zoom-in"></i> <span ng-bind="formModalInfo"></span></button>
|
||||
<a href="#" ng-show="formModalCancelShow" data-target="#form-modal" data-dismiss="modal" class="btn btn-default">Cancel</a>
|
||||
<a href="" ng-bind="formModalActionLabel" ng-click="formModalAction()" ng-disabled="formModalActionDisabled" class="btn btn-primary"></a>
|
||||
</div>
|
||||
@ -238,7 +237,7 @@
|
||||
<div class="modal-body" id="form-modal2-body"></div>
|
||||
<div class="modal-footer">
|
||||
<a href="" ng-bind="formModal2Info" ng-show="formModal2Info !== undefined && formModal2Info != ''" ng-click="formModal2InfoAction()"
|
||||
class="btn btn-small pull-left"><i class="icon-zoom-in"></i> <span ng-bind="formModal2Info"></span></a>
|
||||
class="btn btn-sm pull-left"><i class="icon-zoom-in"></i> <span ng-bind="formModal2Info"></span></a>
|
||||
<a href="#" ng-show="formModal2CancelShow" data-target="#form-modal2" data-dismiss="modal" class="btn btn-default">Cancel</a>
|
||||
<a href="" ng-bind="formModal2ActionLabel" ng-click="formModal2Action()" class="btn btn-primary"></a>
|
||||
</div>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user