mirror of
https://github.com/ansible/awx.git
synced 2026-03-04 02:01:01 -03:30
Better inventory navigation. Breadcrumbs now includes a hover activated drop-down. Debating whether using hover activation is a good thing. Obviously doesn't work on mobile, so will need to build a work around.
This commit is contained in:
@@ -17,12 +17,18 @@ angular.module('InventoryFormDefinition', [])
|
|||||||
well: true,
|
well: true,
|
||||||
|
|
||||||
navigationLinks: {
|
navigationLinks: {
|
||||||
|
inventory: {
|
||||||
|
href: "/#/inventories/{{ inventory_id }}",
|
||||||
|
label: "Inventory Properties",
|
||||||
|
icon: "icon-edit",
|
||||||
|
active: true
|
||||||
|
},
|
||||||
hosts: {
|
hosts: {
|
||||||
href: "/#/inventories/{{ inventory_id }}/hosts",
|
href: "/#/inventories/{{ inventory_id }}/hosts",
|
||||||
label: 'Hosts',
|
label: 'Hosts',
|
||||||
icon: 'icon-laptop'
|
icon: 'icon-laptop'
|
||||||
},
|
},
|
||||||
Groups: {
|
groups: {
|
||||||
href: "/#/inventories/{{ inventory_id }}/groups",
|
href: "/#/inventories/{{ inventory_id }}/groups",
|
||||||
label: 'Groups',
|
label: 'Groups',
|
||||||
icon: 'icon-sitemap'
|
icon: 'icon-sitemap'
|
||||||
|
|||||||
@@ -32,25 +32,6 @@ angular.module('InventoryHostsFormDefinition', [])
|
|||||||
sourceModel: 'groups',
|
sourceModel: 'groups',
|
||||||
sourceField: 'name',
|
sourceField: 'name',
|
||||||
nosort: true
|
nosort: true
|
||||||
},
|
|
||||||
dropdown: {
|
|
||||||
type: 'DropDown',
|
|
||||||
searchable: false,
|
|
||||||
nosort: true,
|
|
||||||
label: 'Jobs',
|
|
||||||
"class": "btn-sm",
|
|
||||||
//ngDisabled: 'host.last_job == null',
|
|
||||||
options: [
|
|
||||||
{ ngClick: "allJobs(\{\{ host.id \}\})", label: 'All jobs', ngShow: 'host.last_job' },
|
|
||||||
{ ngClick: "allHostSummaries(\{\{ host.id \}\},'\{\{ host.name \}\}', \{\{ inventory_id \}\})", label: 'All host summaries',
|
|
||||||
ngShow: 'host.last_job' },
|
|
||||||
{ ngClick: 'viewJobs(\{\{ host.last_job \}\})', label: 'Latest job', ngShow: 'host.last_job' },
|
|
||||||
{ ngClick: "viewLastEvents(\{\{ host.id \}\}, '\{\{ host.last_job \}\}', '\{\{ host.name \}\}', " +
|
|
||||||
"'\{\{ host.summary_fields.last_job.name \}\}')", label: 'Latest job events', ngShow: 'host.last_job' },
|
|
||||||
{ ngClick: "viewLastSummary(\{\{ host.id \}\}, '\{\{ host.last_job \}\}', '\{\{ host.name \}\}', " +
|
|
||||||
"'\{\{ host.summary_fields.last_job.name \}\}')", label: 'Latest host summary', ngShow: 'host.last_job' },
|
|
||||||
{ ngClick: "", label: 'No job data available', ngShow: 'host.last_job == null' }
|
|
||||||
]
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -76,6 +57,25 @@ angular.module('InventoryHostsFormDefinition', [])
|
|||||||
},
|
},
|
||||||
|
|
||||||
fieldActions: {
|
fieldActions: {
|
||||||
|
|
||||||
|
ViewJobs: {
|
||||||
|
type: 'DropDown',
|
||||||
|
label: 'Jobs',
|
||||||
|
icon: 'icon-zoom-in',
|
||||||
|
"class": "btn-default btn-sm",
|
||||||
|
options: [
|
||||||
|
{ ngClick: "allJobs(\{\{ host.id \}\})", label: 'All jobs', ngShow: 'host.last_job' },
|
||||||
|
{ ngClick: "allHostSummaries(\{\{ host.id \}\},'\{\{ host.name \}\}', \{\{ inventory_id \}\})", label: 'All host summaries',
|
||||||
|
ngShow: 'host.last_job' },
|
||||||
|
{ ngClick: 'viewJobs(\{\{ host.last_job \}\})', label: 'Latest job', ngShow: 'host.last_job' },
|
||||||
|
{ ngClick: "viewLastEvents(\{\{ host.id \}\}, '\{\{ host.last_job \}\}', '\{\{ host.name \}\}', " +
|
||||||
|
"'\{\{ host.summary_fields.last_job.name \}\}')", label: 'Latest job events', ngShow: 'host.last_job' },
|
||||||
|
{ ngClick: "viewLastSummary(\{\{ host.id \}\}, '\{\{ host.last_job \}\}', '\{\{ host.name \}\}', " +
|
||||||
|
"'\{\{ host.summary_fields.last_job.name \}\}')", label: 'Latest host summary', ngShow: 'host.last_job' },
|
||||||
|
{ ngClick: "", label: 'No job data available', ngShow: 'host.last_job == null' }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
|
||||||
"delete": {
|
"delete": {
|
||||||
ngClick: "deleteHost(\{\{ host.id \}\},'\{\{ host.name \}\}')",
|
ngClick: "deleteHost(\{\{ host.id \}\},'\{\{ host.name \}\}')",
|
||||||
icon: 'icon-trash',
|
icon: 'icon-trash',
|
||||||
|
|||||||
@@ -28,7 +28,8 @@ angular.module('InventoriesListDefinition', [])
|
|||||||
badgeTipPlacement: 'bottom'
|
badgeTipPlacement: 'bottom'
|
||||||
},
|
},
|
||||||
description: {
|
description: {
|
||||||
label: 'Description'
|
label: 'Description',
|
||||||
|
link: true
|
||||||
},
|
},
|
||||||
organization: {
|
organization: {
|
||||||
label: 'Organization',
|
label: 'Organization',
|
||||||
@@ -56,37 +57,25 @@ angular.module('InventoriesListDefinition', [])
|
|||||||
type: 'DropDown',
|
type: 'DropDown',
|
||||||
label: 'Jobs',
|
label: 'Jobs',
|
||||||
icon: 'icon-zoom-in',
|
icon: 'icon-zoom-in',
|
||||||
'class': 'btn-xs',
|
'class': 'btn-default btn-xs',
|
||||||
options: [
|
options: [
|
||||||
{ ngClick: 'viewJobs(\{\{ inventory.id \}\})', label: 'All Jobs' },
|
{ ngClick: 'viewJobs(\{\{ inventory.id \}\})', label: 'All Jobs' },
|
||||||
{ ngClick: "viewFailedJobs(\{\{ inventory.id \}\})", label: 'Failed jobs' }
|
{ ngClick: "viewFailedJobs(\{\{ inventory.id \}\})", label: 'Failed jobs' }
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
hosts: {
|
|
||||||
label: 'Hosts',
|
|
||||||
ngClick: "editHosts(\{\{ inventory.id \}\})",
|
|
||||||
icon: 'icon-laptop',
|
|
||||||
"class": 'btn-xs btn-default',
|
|
||||||
awToolTip: 'Edit Hosts'
|
|
||||||
},
|
|
||||||
|
|
||||||
groups: {
|
|
||||||
label: 'Groups',
|
|
||||||
ngClick: "editGroups(\{\{ inventory.id \}\})",
|
|
||||||
icon: 'icon-sitemap',
|
|
||||||
"class": 'btn-xs btn-default',
|
|
||||||
awToolTip: 'Edit Groups'
|
|
||||||
},
|
|
||||||
|
|
||||||
edit: {
|
edit: {
|
||||||
ngClick: "editInventory(\{\{ inventory.id \}\})",
|
type: 'DropDown',
|
||||||
|
label: 'Edit',
|
||||||
icon: 'icon-edit',
|
icon: 'icon-edit',
|
||||||
"class": 'btn-xs btn-default',
|
'class': 'btn-default btn-xs',
|
||||||
awToolTip: 'Edit Inventory Properties'
|
options: [
|
||||||
|
{ ngClick: "editInventory(\{\{ inventory.id \}\})", label: 'Inventory Properties' },
|
||||||
|
{ ngClick: "editHosts(\{\{ inventory.id \}\})", label: 'Hosts' },
|
||||||
|
{ ngClick: "editGroups(\{\{ inventory.id \}\})", label: 'Groups' }
|
||||||
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
"delete": {
|
"delete": {
|
||||||
|
label: 'Delete',
|
||||||
ngClick: "deleteInventory(\{\{ inventory.id \}\},'\{\{ inventory.name \}\}')",
|
ngClick: "deleteInventory(\{\{ inventory.id \}\},'\{\{ inventory.name \}\}')",
|
||||||
icon: 'icon-trash',
|
icon: 'icon-trash',
|
||||||
"class": 'btn-xs btn-danger',
|
"class": 'btn-xs btn-danger',
|
||||||
|
|||||||
@@ -423,6 +423,8 @@ legend {
|
|||||||
vertical-align: middle;
|
vertical-align: middle;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/* breadcrumbs */
|
||||||
.nav-path {
|
.nav-path {
|
||||||
padding: 5px 0 10px 0;
|
padding: 5px 0 10px 0;
|
||||||
margin-right: 5px;
|
margin-right: 5px;
|
||||||
@@ -433,15 +435,57 @@ legend {
|
|||||||
border: 1px solid #d8d8d8;
|
border: 1px solid #d8d8d8;
|
||||||
border-radius: 6px;
|
border-radius: 6px;
|
||||||
box-shadow: 3px 3px 4px 0 #808080;
|
box-shadow: 3px 3px 4px 0 #808080;
|
||||||
|
|
||||||
|
.breadcrumb {
|
||||||
|
display: inline-block;
|
||||||
|
padding-bottom: 0;
|
||||||
|
padding-left: 0;
|
||||||
|
padding-right: 0;
|
||||||
|
margin-bottom: 0;
|
||||||
|
margin-left: 10px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown {
|
||||||
|
display: inline-block;
|
||||||
|
margin-right: 0;
|
||||||
|
paddding-right: 0;
|
||||||
|
|
||||||
|
.toggle, .toggle:visited, .toggle:hover, .toggle:active {
|
||||||
|
color: @black;
|
||||||
|
}
|
||||||
|
|
||||||
|
li a.active {
|
||||||
|
color: @grey;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.nav-path ul {
|
.actions .dropdown {
|
||||||
padding-bottom: 0;
|
display: inline-block;
|
||||||
padding-left: 0;
|
|
||||||
margin-bottom: 0;
|
|
||||||
margin-left: 10px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Display drop-down menus on hover. Remove margin between toggle link
|
||||||
|
and menu, allowing smooth mouse movement between toggle and menu
|
||||||
|
|
||||||
|
http://stackoverflow.com/questions/8878033/how-to-make-twitter-bootstrap-menu-dropdown-on-hover-rather-than-click
|
||||||
|
*/
|
||||||
|
.dropdown-toggle:hover .dropdown-menu, .dropdown:hover .dropdown-menu {
|
||||||
|
display: block;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-menu li:hover {
|
||||||
|
visibility: visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
.dropdown-menu {
|
||||||
|
margin-top: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
/* end */
|
||||||
|
|
||||||
|
|
||||||
.greeting {
|
.greeting {
|
||||||
padding-right: 22px;
|
padding-right: 22px;
|
||||||
}
|
}
|
||||||
@@ -996,7 +1040,7 @@ tr td button i {
|
|||||||
white-space: normal;
|
white-space: normal;
|
||||||
}
|
}
|
||||||
|
|
||||||
td.actions button {
|
td.actions .btn {
|
||||||
width: 75px;
|
width: 75px;
|
||||||
margin-bottom: 5px;
|
margin-bottom: 5px;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,8 +10,9 @@
|
|||||||
|
|
||||||
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',
|
||||||
'NavigationLink', 'HelpCollapse', 'Button',
|
'NavigationLink', 'HelpCollapse', 'Button', 'DropDown',
|
||||||
function($location, $cookieStore, $compile, SearchWidget, PaginateWidget, Attr, Icon, Column, NavigationLink, HelpCollapse, Button) {
|
function($location, $cookieStore, $compile, SearchWidget, PaginateWidget, Attr, Icon, Column, NavigationLink, HelpCollapse, Button,
|
||||||
|
DropDown) {
|
||||||
return {
|
return {
|
||||||
|
|
||||||
setForm: function(form) {
|
setForm: function(form) {
|
||||||
@@ -844,19 +845,48 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
|
|||||||
return html;
|
return html;
|
||||||
},
|
},
|
||||||
|
|
||||||
breadCrumbs: function(options) {
|
breadCrumbs: function(options, navigation) {
|
||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
html += "<div class=\"nav-path\">\n";
|
html += "<div class=\"nav-path\">\n";
|
||||||
html += "<ul class=\"breadcrumb\">\n";
|
html += "<ul class=\"breadcrumb\">\n";
|
||||||
html += "<li ng-repeat=\"crumb in breadcrumbs\"><a href=\"{{ '#' + crumb.path }}\">{{ crumb.title | capitalize }}</a></li>\n";
|
html += "<li ng-repeat=\"crumb in breadcrumbs\"><a href=\"{{ '#' + crumb.path }}\">{{ crumb.title | capitalize }}</a></li>\n";
|
||||||
html += "<li class=\"active\">";
|
|
||||||
if (options.mode == 'edit') {
|
if (navigation) {
|
||||||
html += this.form.editTitle;
|
html += "<li class=\"active\"> </li>\n";
|
||||||
|
html += "</ul>\n";
|
||||||
|
html += "<div class=\"dropdown\">\n";
|
||||||
|
for (var itm in navigation) {
|
||||||
|
if (navigation[itm].active) {
|
||||||
|
html += "<a href=\"\" class=\"toggle\">" +
|
||||||
|
navigation[itm].label + " <i class=\"icon-chevron-sign-down\"></i></a>";
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
html += "<ul class=\"dropdown-menu\" role=\"menu\">\n";
|
||||||
|
for (var itm in navigation) {
|
||||||
|
html += "<li role=\"presentation\"><a role=\"menuitem\" tabindex=\"-1\" href=\"" +
|
||||||
|
navigation[itm].href + "\" ";
|
||||||
|
html += (navigation[itm].active) ? "class=\"active\" " : "";
|
||||||
|
html += ">";
|
||||||
|
html += navigation[itm].label;
|
||||||
|
html += (navigation[itm].active) ? " <i class=\"icon-angle-left\"></i>" : "";
|
||||||
|
html += "</a></li>\n";
|
||||||
|
}
|
||||||
|
html += "</ul>\n";
|
||||||
|
html += "</div><!-- dropdown -->\n";
|
||||||
|
html += "</div><!-- nav-path -->\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
html += this.form.addTitle;
|
html += "<li class=\"active\">";
|
||||||
|
if (options.mode == 'edit') {
|
||||||
|
html += this.form.editTitle;
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
html += this.form.addTitle;
|
||||||
|
}
|
||||||
|
html += "</li>\n</ul>\n</div><!-- nav-path -->\n";
|
||||||
}
|
}
|
||||||
html += "</li>\n</ul>\n</div>\n";
|
|
||||||
return html;
|
return html;
|
||||||
},
|
},
|
||||||
|
|
||||||
@@ -868,15 +898,12 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
|
|||||||
var html = '';
|
var html = '';
|
||||||
|
|
||||||
if (!this.modal) {
|
if (!this.modal) {
|
||||||
html += this.breadCrumbs(options);
|
if (this.form.navigationLinks) {
|
||||||
}
|
html += this.breadCrumbs(options, this.form.navigationLinks);
|
||||||
|
}
|
||||||
if (!this.modal && this.form.navigationLinks) {
|
else {
|
||||||
html += "<div class=\"navigation-links text-right\">\n";
|
html += this.breadCrumbs(options);
|
||||||
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)) {
|
||||||
@@ -921,17 +948,6 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
|
|||||||
html += "<div>\n";
|
html += "<div>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/* if (this.form.navigation) {
|
|
||||||
html += "<div class=\"navigation-buttons navigation-buttons-top\">\n";
|
|
||||||
for (btn in this.form.navigation) {
|
|
||||||
var btn = this.form.navigation[btn];
|
|
||||||
if ( btn.position.indexOf('top-left') >= 0 || btn.position.indexOf('top-right') >= 0 ) {
|
|
||||||
html += this.button(btn, 'top');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
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";
|
||||||
@@ -1059,17 +1075,6 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
|
|||||||
html += "</div>\n";
|
html += "</div>\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*if (this.form.navigation) {
|
|
||||||
html += "<div class=\"navigation-buttons navigation-buttons-bottom\">\n";
|
|
||||||
for (btn in this.form.navigation) {
|
|
||||||
var btn = this.form.navigation[btn];
|
|
||||||
if ( btn.position.indexOf('bottom-left') >= 0 || btn.position.indexOf('bottom-right') >= 0 ) {
|
|
||||||
html += this.button(btn, 'bottom');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
html += "</div>\n";
|
|
||||||
}*/
|
|
||||||
|
|
||||||
if ( this.form.collapse && this.form.collapseMode == options.mode ) {
|
if ( this.form.collapse && this.form.collapseMode == options.mode ) {
|
||||||
html += "</div>\n";
|
html += "</div>\n";
|
||||||
html += "</div>\n";
|
html += "</div>\n";
|
||||||
@@ -1118,28 +1123,36 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
|
|||||||
// Used to create the inventory detail view
|
// Used to create the inventory detail view
|
||||||
//
|
//
|
||||||
|
|
||||||
function navigationLinks(page) {
|
|
||||||
// Returns html for navigation links
|
|
||||||
var html = "<div class=\"navigation-links text-right\">\n";
|
|
||||||
html += "<a href=\"/#/inventories/{{ inventory_id }}\"><i class=\"icon-edit\"></i> Inventory Properties</a>\n";
|
|
||||||
if (page == 'group') {
|
|
||||||
html += "<a href=\"/#/inventories/{{ inventory_id }}/hosts\"><i class=\"icon-laptop\"></i> Hosts</a>\n";
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
html += "<a href=\"/#/inventories/{{ inventory_id }}/groups\"><i class=\"icon-sitemap\"></i> Groups</a>\n";
|
|
||||||
}
|
|
||||||
html += "</div>\n";
|
|
||||||
return html;
|
|
||||||
}
|
|
||||||
|
|
||||||
var form = this.form;
|
var form = this.form;
|
||||||
var itm = "groups";
|
var itm = "groups";
|
||||||
|
|
||||||
var html = '';
|
var html = '';
|
||||||
|
var navigation = {
|
||||||
|
inventory: {
|
||||||
|
href: "/#/inventories/{{ inventory_id }}",
|
||||||
|
label: "Inventory Properties",
|
||||||
|
icon: "icon-edit"
|
||||||
|
},
|
||||||
|
hosts: {
|
||||||
|
href: "/#/inventories/{{ inventory_id }}/hosts",
|
||||||
|
label: 'Hosts',
|
||||||
|
icon: 'icon-laptop'
|
||||||
|
},
|
||||||
|
groups: {
|
||||||
|
href: "/#/inventories/{{ inventory_id }}/groups",
|
||||||
|
label: 'Groups',
|
||||||
|
icon: 'icon-sitemap'
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
html += this.breadCrumbs(options);
|
|
||||||
|
|
||||||
if (form.type == 'groupsview') {
|
if (form.type == 'groupsview') {
|
||||||
|
|
||||||
|
navigation.inventory.active = false;
|
||||||
|
navigation.hosts.active = false;
|
||||||
|
navigation.groups.active = true;
|
||||||
|
|
||||||
|
html += this.breadCrumbs(options, navigation);
|
||||||
|
|
||||||
// build the groups page
|
// build the groups page
|
||||||
html += "<div ng-show=\"showGroupHelp\" class=\"alert alert-dismissable alert-info\">\n";
|
html += "<div ng-show=\"showGroupHelp\" class=\"alert alert-dismissable alert-info\">\n";
|
||||||
html += "<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button>\n";
|
html += "<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button>\n";
|
||||||
@@ -1147,15 +1160,12 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
|
|||||||
"use the <a href=\"/#/inventories/\{\{ inventory_id \}\}/hosts\"><em>Inventories->Hosts</em></a> page to " +
|
"use the <a href=\"/#/inventories/\{\{ inventory_id \}\}/hosts\"><em>Inventories->Hosts</em></a> page to " +
|
||||||
"add hosts to the group.</p>";
|
"add hosts to the group.</p>";
|
||||||
html += "</div>\n";
|
html += "</div>\n";
|
||||||
|
|
||||||
html += navigationLinks('group');
|
|
||||||
|
|
||||||
html += "<div class=\"tree-container\">\n";
|
html += "<div class=\"tree-container\">\n";
|
||||||
html += "<div class=\"tree-controls\">\n";
|
html += "<div class=\"tree-controls\">\n";
|
||||||
html += "<div class=\"title col-lg-2\" ng-bind=\"selectedNodeName\"></div>\n";
|
html += "<div class=\"title col-lg-2\" ng-bind=\"selectedNodeName\"></div>\n";
|
||||||
html += "<button type=\"button\" id=\"edit_group_btn\" class=\"btn btn-default btn-sm\" ng-click=\"editGroup()\" ng-hide=\"groupEditHide\" " +
|
html += "<button type=\"button\" id=\"edit_group_btn\" class=\"btn btn-default btn-sm\" ng-click=\"editGroup()\" ng-hide=\"groupEditHide\" " +
|
||||||
"aw-tool-tip=\"Edit the selected group's properties\" data-placement=\"bottom\"><i class=\"icon-edit\"></i> " +
|
"aw-tool-tip=\"Edit the selected group's properties\" data-placement=\"bottom\"><i class=\"icon-edit\"></i> " +
|
||||||
"Properties</button>\n";
|
"properties</button>\n";
|
||||||
html += "<button type=\"button\" id=\"copy_group_btn\" class=\"btn btn-success btn-sm\" ng-click=\"addGroup()\" ng-hide=\"groupAddHide\" " +
|
html += "<button type=\"button\" id=\"copy_group_btn\" class=\"btn btn-success btn-sm\" ng-click=\"addGroup()\" ng-hide=\"groupAddHide\" " +
|
||||||
"aw-tool-tip=\"Copy existing groups to the selected group\" data-placement=\"bottom\"><i class=\"icon-check\"></i> Copy</button>\n";
|
"aw-tool-tip=\"Copy existing groups to the selected group\" data-placement=\"bottom\"><i class=\"icon-check\"></i> Copy</button>\n";
|
||||||
html += "<button type=\"button\" id=\"create_group_btn\" class=\"btn btn-success btn-sm\" ng-click=\"createGroup()\" ng-hide=\"groupCreateHide\" " +
|
html += "<button type=\"button\" id=\"create_group_btn\" class=\"btn btn-success btn-sm\" ng-click=\"createGroup()\" ng-hide=\"groupCreateHide\" " +
|
||||||
@@ -1170,6 +1180,12 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
|
|||||||
else {
|
else {
|
||||||
// build the hosts page
|
// build the hosts page
|
||||||
|
|
||||||
|
navigation.inventory.active = false;
|
||||||
|
navigation.hosts.active = true;
|
||||||
|
navigation.groups.active = false;
|
||||||
|
|
||||||
|
html += this.breadCrumbs(options, navigation);
|
||||||
|
|
||||||
// Hint text
|
// Hint text
|
||||||
html += "<div ng-show=\"showGroupHelp\" class=\"alert alert-dismissable alert-info\">\n";
|
html += "<div ng-show=\"showGroupHelp\" class=\"alert alert-dismissable alert-info\">\n";
|
||||||
html += "<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button>\n";
|
html += "<button type=\"button\" class=\"close\" data-dismiss=\"alert\" aria-hidden=\"true\">×</button>\n";
|
||||||
@@ -1191,8 +1207,6 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
|
|||||||
html += "</div><!-- col-lg-3 -->\n";
|
html += "</div><!-- col-lg-3 -->\n";
|
||||||
html += "<div class=\"col-lg-9\">\n";
|
html += "<div class=\"col-lg-9\">\n";
|
||||||
|
|
||||||
html += navigationLinks('host');
|
|
||||||
|
|
||||||
html += "<div class=\"hosts-well well\">\n";
|
html += "<div class=\"hosts-well well\">\n";
|
||||||
|
|
||||||
html += SearchWidget({ iterator: form.iterator, template: form, mini: true, size: 'col-md-6 col-lg-6'});
|
html += SearchWidget({ iterator: form.iterator, template: form, mini: true, size: 'col-md-6 col-lg-6'});
|
||||||
@@ -1292,16 +1306,21 @@ angular.module('FormGenerator', ['GeneratorHelpers', 'ngCookies'])
|
|||||||
html += "<td class=\"actions\">";
|
html += "<td class=\"actions\">";
|
||||||
for (act in form.fieldActions) {
|
for (act in form.fieldActions) {
|
||||||
var action = form.fieldActions[act];
|
var action = form.fieldActions[act];
|
||||||
html += "<button type=\"button\" ";
|
if (action.type && action.type == 'DropDown') {
|
||||||
html += "id=\"row_" + act + "_btn\" ";
|
html += DropDown({ field: action, td: false });
|
||||||
html += "class=\"btn";
|
}
|
||||||
html += (action['class']) ? " " + action['class'] : "";
|
else {
|
||||||
html += "\" " + this.attr(action,'ngClick');
|
html += "<button type=\"button\" ";
|
||||||
html += (action.awToolTip) ? this.attr(action,'awToolTip') : "";
|
html += "id=\"row_" + act + "_btn\" ";
|
||||||
html += (action.awToolTip) ? "data-placement=\"top\" " : "";
|
html += "class=\"btn";
|
||||||
html += ">" + this.icon(action.icon);
|
html += (action['class']) ? " " + action['class'] : "";
|
||||||
html += (action.label) ? " " + action.label : "";
|
html += "\" " + this.attr(action,'ngClick');
|
||||||
html += "</button> ";
|
html += (action.awToolTip) ? this.attr(action,'awToolTip') : "";
|
||||||
|
html += (action.awToolTip) ? "data-placement=\"top\" " : "";
|
||||||
|
html += ">" + this.icon(action.icon);
|
||||||
|
html += (action.label) ? " " + action.label : "";
|
||||||
|
html += "</button> ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
html += "</td>";
|
html += "</td>";
|
||||||
html += "</tr>\n";
|
html += "</tr>\n";
|
||||||
|
|||||||
@@ -172,16 +172,22 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers'])
|
|||||||
var options = params['options'];
|
var options = params['options'];
|
||||||
var field;
|
var field;
|
||||||
|
|
||||||
if (params.type) {
|
if (params.field) {
|
||||||
field = list[params.type][fld];
|
field = params.field;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
field = list['fields'][fld];
|
if (params.type) {
|
||||||
|
field = list[params.type][fld];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
field = list['fields'][fld];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var name = field['label'].replace(/ /g,'_');
|
var name = field['label'].replace(/ /g,'_');
|
||||||
|
|
||||||
html = (params.td == undefined || params.td !== false) ? "<td>\n" : "";
|
html = (params.td == undefined || params.td !== false) ? "<td>\n" : "";
|
||||||
|
/*
|
||||||
html += "<div class=\"btn-group\">\n";
|
html += "<div class=\"btn-group\">\n";
|
||||||
html += "<button type=\"button\" ";
|
html += "<button type=\"button\" ";
|
||||||
html += (field.ngDisabled) ? "ng-disabled=\"" + field.ngDisabled + "\" " : "";
|
html += (field.ngDisabled) ? "ng-disabled=\"" + field.ngDisabled + "\" " : "";
|
||||||
@@ -193,6 +199,16 @@ angular.module('GeneratorHelpers', ['GeneratorHelpers'])
|
|||||||
html += (field.icon) ? Icon(field.icon) : "";
|
html += (field.icon) ? Icon(field.icon) : "";
|
||||||
html += field.label;
|
html += field.label;
|
||||||
html += " <span class=\"caret\"></span></button>\n";
|
html += " <span class=\"caret\"></span></button>\n";
|
||||||
|
*/
|
||||||
|
html += "<div class=\"dropdown\">\n";
|
||||||
|
html += "<a href=\"\" class=\"toggle btn ";
|
||||||
|
html += (field['class']) ? field['class'] : 'btn-default btn-xs';
|
||||||
|
html += "\" ";
|
||||||
|
html += (field.ngDisabled) ? "ng-disabled=\"" + field.ngDisabled + "\" " : "";
|
||||||
|
html += ">";
|
||||||
|
html += (field.icon) ? Icon(field.icon) : "";
|
||||||
|
html += field.label;
|
||||||
|
html += " <span class=\"caret\"></span></a>\n";
|
||||||
html += "<ul class=\"dropdown-menu pull-right\" role=\"menu\" aria-labelledby=\"dropdownMenu1\">\n";
|
html += "<ul class=\"dropdown-menu pull-right\" role=\"menu\" aria-labelledby=\"dropdownMenu1\">\n";
|
||||||
for (var i=0; i < field.options.length; i++) {
|
for (var i=0; i < field.options.length; i++) {
|
||||||
html += "<li role=\"presentation\"><a role=\"menuitem\" tabindex=\"-1\" ";
|
html += "<li role=\"presentation\"><a role=\"menuitem\" tabindex=\"-1\" ";
|
||||||
|
|||||||
Reference in New Issue
Block a user