mirror of
https://github.com/ansible/awx.git
synced 2024-10-28 19:25:40 +03:00
AC-502 Changed sort order of System Summary and indented Groups, Hosts under Inventory.
This commit is contained in:
parent
5efc44a833
commit
c563f040ba
@ -99,7 +99,6 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
|
||||
|
||||
if (passwords.length > 0) {
|
||||
// Prompt for passwords
|
||||
console.log(passwords);
|
||||
html += "<form class=\"form-horizontal\" name=\"password_form\" novalidate>\n";
|
||||
html += (extra_html) ? extra_html : "";
|
||||
var current_form;
|
||||
|
@ -23,7 +23,8 @@ angular.module('ObjectCountWidget', ['RestServices', 'Utilities'])
|
||||
scope.removeCountReady();
|
||||
}
|
||||
scope.removeCountReady = scope.$on('countReady', function(e, obj, count) {
|
||||
var keys=[];
|
||||
var keys=[ 'organizations', 'users', 'teams', 'projects', 'inventory', 'groups', 'hosts',
|
||||
'credentials', 'job_templates', 'jobs' ];
|
||||
var html, itm;
|
||||
var cnt = 0;
|
||||
for (itm in counts) {
|
||||
@ -31,25 +32,25 @@ angular.module('ObjectCountWidget', ['RestServices', 'Utilities'])
|
||||
}
|
||||
if (cnt == expected) {
|
||||
// sort the list of objs
|
||||
for (var key in counts) {
|
||||
if (key !== 'hosts' && key !== 'groups') {
|
||||
keys.push(key);
|
||||
}
|
||||
}
|
||||
//for (var key in counts) {
|
||||
// if (key !== 'hosts' && key !== 'groups') {
|
||||
// keys.push(key);
|
||||
// }
|
||||
//}
|
||||
// sort the keys, forcing groups and hosts to appear directlry after inventory
|
||||
keys.sort();
|
||||
var new_keys = [];
|
||||
for (var i=0; i < keys.length; i++) {
|
||||
if (keys[i] == 'inventory') {
|
||||
new_keys.push('inventory');
|
||||
new_keys.push('groups');
|
||||
new_keys.push('hosts');
|
||||
}
|
||||
else {
|
||||
new_keys.push(keys[i]);
|
||||
}
|
||||
}
|
||||
keys = new_keys;
|
||||
//keys.sort();
|
||||
//var new_keys = [];
|
||||
//for (var i=0; i < keys.length; i++) {
|
||||
// if (keys[i] == 'inventory') {
|
||||
// new_keys.push('inventory');
|
||||
// new_keys.push('groups');
|
||||
// new_keys.push('hosts');
|
||||
// }
|
||||
// else {
|
||||
// new_keys.push(keys[i]);
|
||||
// }
|
||||
//}
|
||||
//keys = new_keys;
|
||||
html = "<div class=\"panel panel-default\">\n";
|
||||
html += "<div class=\"panel-heading\">System Summary</div>\n";
|
||||
html += "<div class=\"panel-body\">\n";
|
||||
@ -62,18 +63,18 @@ angular.module('ObjectCountWidget', ['RestServices', 'Utilities'])
|
||||
html += "</thead>\n";
|
||||
html += "<tbody>\n";
|
||||
for (var i=0; i < keys.length; i++) {
|
||||
html += "<tr><td ";
|
||||
html += (keys[i] == 'hosts' || keys[i] == 'groups') ? "class=\"pad-left-md\"" : '';
|
||||
html += ">\n";
|
||||
html += "<tr><td class=\"capitalize\">\n";
|
||||
html += "<a href=\"/#/";
|
||||
html += (keys[i] == 'inventory') ? 'inventories' : keys[i];
|
||||
html += "\">";
|
||||
html += "\"";
|
||||
html += (keys[i] == 'hosts' || keys[i] == 'groups') ? " class=\"pad-left-sm\" " : "";
|
||||
html += ">";
|
||||
if (keys[i] == 'inventory') {
|
||||
html += 'Inventories';
|
||||
}
|
||||
else {
|
||||
var txt = keys[i].replace(/\_/g,' ');
|
||||
html += txt.substring(0,1).toUpperCase() + txt.substring(1);
|
||||
html += keys[i].replace(/\_/g,' ');
|
||||
//html += txt.substring(0,1).toUpperCase() + txt.substring(1);
|
||||
}
|
||||
html += "</a></td>\n"
|
||||
html += "<td class=\"text-right\"><a href=\"/#/";
|
||||
|
@ -29,6 +29,7 @@ body {
|
||||
/* Helper Classes */
|
||||
.pad-right-sm { padding-right: 10px; }
|
||||
.pad-left-md { padding-left: 30px; }
|
||||
.pad-left-sm { padding-left: 10px; }
|
||||
.pad-left-lg { padding-left: 50px; }
|
||||
.normal-weight { font-weight: normal; }
|
||||
.no-bullets { list-style: none; }
|
||||
|
Loading…
Reference in New Issue
Block a user