On inventory tree widget, has_active_failures turns node text color to red. Checkbox at bottom filters nodes based on value of has_active_failures.

This commit is contained in:
chouseknecht
2013-06-13 16:08:17 -04:00
parent 365a21f103
commit 6806619e98
8 changed files with 83 additions and 19 deletions

View File

@@ -691,6 +691,8 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
"<i class=\"icon-remove\"></i> Delete Group</button>";
html += "</div>\n";
html += "<div id=\"tree-view\"></div>\n";
html += "<div class=\" inventory-filter\" ng-show=\"has_active_failures == true\"><label class=\"checkbox inline\">" +
"<input ng-model=\"inventoryFailureFilter\" ng-change=\"filterInventory()\" type=\"checkbox\" >Only show groups with active failures</label></div>\n";
html += "</div>\n";
}
else {
@@ -757,11 +759,11 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
html += (rfield['class']) ? 'class="'+ rfield['class'] + '"' : "";
html += ">";
if (rfield.icon) {
if (rfield.ngShow) {
html += "<i ng-show=\"" + rfield.ngShow + "\" class=\"" + rfield.icon + "\"></i>";
if (rfield.ngShowIcon) {
html += "<i ng-show=\"" + rfield.ngShowIcon + "\" class=\"" + rfield.icon + "\"></i>";
}
else {
html += this.attr(rfield,'icon');
html += this.icon(rfield.icon);
}
}
if (rfield.showValue == undefined || rfield.showValue == true) {

View File

@@ -239,13 +239,23 @@ angular.module('ListGenerator', ['GeneratorHelpers'])
html += "<a href=\"#/" + base + "/{{" + list.iterator + ".id }}\">";
}
}
html += (list.fields[fld].icon) ? this.icon(list.fields[fld].icon) : "";
if (list.fields[fld].ngBind) {
html += "{{ " + list.fields[fld].ngBind + " }}";
if (list.fields[fld].ngShowIcon) {
html += "<i ng-show=\"" + list.fields[fld].ngShowIcon + "\" class=\"" + list.fields[fld].icon + "\"></i>";
}
else {
html += "{{" + list.iterator + "." + fld + "}}";
html += this.icon(list.fields[fld].icon);
}
if (list.fields[fld].showValue == undefined || list.fields[fld].showValue == true) {
if (list.fields[fld].ngBind) {
html += "{{ " + list.fields[fld].ngBind + " }}";
}
else {
html += "{{" + list.iterator + "." + fld + "}}";
}
}
html += ((list.fields[fld].key || list.fields[fld].link) && options.mode != 'lookup' && options.mode != 'select') ? "</a>" : "";
html += "</td>\n";
}

View File

@@ -30,6 +30,13 @@
.jstree-ansible .jstree-hovered { background:#e7f4f9; border:1px solid #e7f4f9; padding:0 2px 0 1px; }
.jstree-ansible .jstree-clicked { background:#d9edf7; border:1px solid #3a87ad; padding:0 2px 0 1px; color: #000; }
/* if data-failures=true (set usng has_active_failures on hosts, groups, inventory), link color is red */
.jstree-ansible li[data-failures="true"] .jstree-clicked { color: #FF0000; }
.jstree-ansible li[data-failures="false"] .jstree-clicked { color: #000; }
.jstree-ansible li[data-failures="true"] a { color: #FF0000; }
.jstree-ansible li[data-failures="false"] a { color: #000; }
.jstree-ansible a .jstree-icon { background-position:-56px -19px; }
.jstree-ansible .jstree-open > a .jstree-icon { background-position:-56px -36px; }
.jstree-ansible a.jstree-loading .jstree-icon { background:url("throbber.gif") center center no-repeat !important; }
@@ -90,4 +97,5 @@
.jstree-ansible .jstree-undetermined a .jstree-checkbox { _background-position:-20px -19px; }
.jstree-ansible .jstree-checked a .jstree-checkbox { _background-position:-38px -19px; }
.jstree-ansible .jstree-unchecked a .jstree-checkbox { _background-position:-2px -19px; }
/* IE6 END */
/* IE6 END */