Changes to inventory detail page -improved display of has_active_failures, added variable data field. Fixed Teams organization lookup issue. Set production min js setting to False (leave set to False until we actually have minified js).

This commit is contained in:
chouseknecht
2013-06-20 13:25:14 -04:00
parent 1d3bd62bd2
commit 89fe5c39e4
9 changed files with 67 additions and 14 deletions

View File

@@ -19,7 +19,8 @@ SECRET_KEY = None
ALLOWED_HOSTS = [] ALLOWED_HOSTS = []
# Production should only use minified JS for UI. # Production should only use minified JS for UI.
USE_MINIFIED_JS = True # CLH 6/20/13 - leave the following set to False until we actually have minified js ready
USE_MINIFIED_JS = False
INTERNAL_API_URL = 'http://127.0.0.1:80' INTERNAL_API_URL = 'http://127.0.0.1:80'

View File

@@ -307,6 +307,11 @@
color: #FF0000; color: #FF0000;
} }
.job-failures-true {
padding-top: 5px;
color: #da4f49;
}
.job-new, input[type="text"].job-new, .job-new, input[type="text"].job-new,
.job-canceled, input[type="text"].job-canceled { .job-canceled, input[type="text"].job-canceled {
color: #778899; color: #778899;

View File

@@ -40,7 +40,7 @@ angular.module('GroupFormDefinition', [])
dataPlacement: 'right', dataPlacement: 'right',
awPopOver: "<p>Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.</p>" + awPopOver: "<p>Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.</p>" +
'<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' + '<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' +
'<p>View YAML examples at <a href="http://www.ansibleworks.com/docs/YAMLSyntax.html" target="_blank">ansiblewors.com</a></p>' '<p>View YAML examples at <a href="http://www.ansibleworks.com/docs/YAMLSyntax.html" target="_blank">ansibleworks.com</a></p>'
} }
}, },

View File

@@ -43,7 +43,7 @@ angular.module('HostFormDefinition', [])
"default": "\{\}", "default": "\{\}",
awPopOver: "<p>Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.</p>" + awPopOver: "<p>Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.</p>" +
'<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' + '<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' +
'<p>View YAML examples at <a href="http://www.ansibleworks.com/docs/YAMLSyntax.html" target="_blank">ansiblewors.com</a></p>', '<p>View YAML examples at <a href="http://www.ansibleworks.com/docs/YAMLSyntax.html" target="_blank">ansibleworks.com</a></p>',
dataTitle: 'Host Variables', dataTitle: 'Host Variables',
dataPlacement: 'right' dataPlacement: 'right'
} }

View File

@@ -17,22 +17,34 @@ angular.module('InventoryFormDefinition', [])
collapse: true, collapse: true,
collapseTitle: 'Edit Inventory', collapseTitle: 'Edit Inventory',
collapseMode: 'edit', collapseMode: 'edit',
twoColumns: true,
fields: { fields: {
has_active_failures: {
label: 'Host Status',
control: '<div class="job-failures-\{\{ has_active_failures \}\}">' +
'<i class="icon-exclamation-sign"></i> Failed jobs</div>',
type: 'custom',
ngShow: 'has_active_failures',
readonly: true,
column: 1
},
inventory_name: { inventory_name: {
realName: 'name', realName: 'name',
label: 'Name', label: 'Name',
type: 'text', type: 'text',
addRequired: true, addRequired: true,
editRequired: true, editRequired: true,
capitalize: false capitalize: false,
column: 1
}, },
inventory_description: { inventory_description: {
realName: 'description', realName: 'description',
label: 'Description', label: 'Description',
type: 'text', type: 'text',
addRequired: false, addRequired: false,
editRequired: false editRequired: false,
column: 1
}, },
organization: { organization: {
label: 'Organization', label: 'Organization',
@@ -41,12 +53,23 @@ angular.module('InventoryFormDefinition', [])
sourceField: 'name', sourceField: 'name',
addRequired: true, addRequired: true,
editRequired: true, editRequired: true,
ngClick: 'lookUpOrganization()' ngClick: 'lookUpOrganization()',
column: 1
}, },
has_active_failures: { variables: {
label: 'Failures', label: 'Variables',
readonly: true, type: 'textarea',
type: 'text' addRequired: false,
editRequird: false,
rows: 10,
"class": "modal-input-xlarge",
"default": "\{\}",
awPopOver: "<p>Enter variables using either JSON or YAML syntax. Use the radio button to toggle between the two.</p>" +
'<p>View JSON examples at <a href="http://www.json.org" target="_blank">www.json.org</a></p>' +
'<p>View YAML examples at <a href="http://www.ansibleworks.com/docs/YAMLSyntax.html" target="_blank">ansibleworks.com</a></p>',
dataTitle: 'Inventory Variables',
dataPlacement: 'bottom',
column: 2
} }
}, },

View File

@@ -68,7 +68,7 @@ angular.module('TeamHelper', [ 'RestServices', 'Utilities', 'OrganizationListDef
var list = OrganizationList; var list = OrganizationList;
var listGenerator = GenerateList; var listGenerator = GenerateList;
var listScope = listGenerator.inject(list, { mode: 'lookup', hdr: 'Select Organization' }); var listScope = listGenerator.inject(list, { mode: 'lookup', hdr: 'Select Organization' });
var defaultUrl = '/api/v1/organizations'; var defaultUrl = '/api/v1/organizations/';
listScope.selectAction = function() { listScope.selectAction = function() {
var found = false; var found = false;

View File

@@ -33,9 +33,9 @@ angular.module('InventoriesListDefinition', [])
sourceField: 'name' sourceField: 'name'
}, },
has_active_failures: { has_active_failures: {
label: 'Failures', label: 'Host Status',
showValue: false, showValue: false,
text: 'Failed events', text: 'Failed jobs',
ngShow: "\{\{ inventory.has_active_failures \}\}", ngShow: "\{\{ inventory.has_active_failures \}\}",
icon: 'icon-exclamation-sign', icon: 'icon-exclamation-sign',
"class": 'active-failures-\{\{ inventory.has_active_failures \}\}', "class": 'active-failures-\{\{ inventory.has_active_failures \}\}',

View File

@@ -149,7 +149,7 @@ angular.module('AWDirectives', ['RestServices'])
} }
}) })
/* /*
* Enable TB pop-overs. To add a pop-over to an element, include the following directive in * Enable TB pop-overs. To add a pop-over to an element, include the following directive in
* the element's attributes: * the element's attributes:
* *

View File

@@ -410,6 +410,30 @@ angular.module('FormGenerator', ['GeneratorHelpers'])
html += "</div>\n"; html += "</div>\n";
} }
//text fields
if (field.type == 'custom') {
if ( (! field.readonly) || (field.readonly && options.mode == 'edit') ) {
html += "<div class=\"control-group\""
html += (field.ngShow) ? this.attr(field,'ngShow') : "";
html += ">\n";
html += "<label class=\"control-label";
html += (field.labelClass) ? " " + field.labelClass : "";
html += "\" for=\"" + fld + '">';
if (field.awPopOver) {
html += "<a href=\"\" " + this.attr(field,'awPopOver');
html += (field.dataTitle) ? this.attr(field, 'dataTitle') : "";
html += (field.dataPlacement) ? this.attr(field, 'dataPlacement') : "";
html += "><i class=\"icon-info-sign\"></i></a> ";
}
html += (field.icon) ? this.icon(field.icon) : "";
html += field.label + '</label>' + "\n";
html += "<div class=\"controls\">\n";
html += field.control;
html += "</div>\n";
html += "</div>\n";
}
}
return html; return html;
}, },