change 'name' to 'site', make label cells same width
diff --git a/planetstack/core/xoslib/static/js/xosTenant.js b/planetstack/core/xoslib/static/js/xosTenant.js
index cb816a8..929552c 100644
--- a/planetstack/core/xoslib/static/js/xosTenant.js
+++ b/planetstack/core/xoslib/static/js/xosTenant.js
@@ -103,6 +103,11 @@
app: XOSTenantApp,
detailFields: ["serviceClass", "default_image", "default_flavor", "network_ports", "mount_data_sets"],
fieldDisplayNames: {serviceClass: "Service Level", "default_flavor": "Flavor", "default_image": "Image", "mount_data_sets": "Data Sets"},
+
+ onShow: function() {
+ // the slice selector is in a different table, so make every label cell the maximal width
+ make_same_width("#xos-tenant-view-panel", ".xos-label-cell");
+ },
});
XOSTenantApp.tenantSummaryView = tenantSummaryClass;
@@ -127,6 +132,7 @@
noDeleteColumn: true,
disablePaginate: true,
disableFilter: true,
+ fieldDisplayNames: {"name": "Site"},
});
XOSTenantApp.tenantSiteListView = tenantSiteListClass;
diff --git a/planetstack/core/xoslib/static/js/xoslib/xos-util.js b/planetstack/core/xoslib/static/js/xoslib/xos-util.js
index 1d135f4..15aa1b0 100644
--- a/planetstack/core/xoslib/static/js/xoslib/xos-util.js
+++ b/planetstack/core/xoslib/static/js/xoslib/xos-util.js
@@ -111,3 +111,10 @@
});
return result;
}
+
+function make_same_width(containerSelector, itemSelector) {
+ var maxWidth = 0;
+ $(containerSelector).find(itemSelector).each( function(index) { maxWidth = Math.max(maxWidth, $(this).width()); });
+ console.log(maxWidth);
+ $(containerSelector).find(itemSelector).each( function(index) { $(this).width(maxWidth); });
+}
diff --git a/planetstack/core/xoslib/static/js/xoslib/xosHelper.js b/planetstack/core/xoslib/static/js/xoslib/xosHelper.js
index f7872cc..a46fa40 100644
--- a/planetstack/core/xoslib/static/js/xoslib/xosHelper.js
+++ b/planetstack/core/xoslib/static/js/xoslib/xosHelper.js
@@ -875,6 +875,7 @@
render: function() {
var view = this;
+ var fieldDisplayNames = view.options.fieldDisplayNames || view.fieldDisplayNames || {};
view.columnsByIndex = [];
view.columnsByFieldName = {};
@@ -882,7 +883,7 @@
inputType = view.options.inputType || view.inputType || {};
mRender = undefined;
mSearchText = undefined;
- sTitle = fieldNameToHumanReadable(fieldName);
+ sTitle = fieldName in fieldDisplayNames ? fieldDisplayNames[fieldName] : fieldNameToHumanReadable(fieldName);
bSortable = true;
if (fieldName=="backend_status") {
mRender = function(x,y,z) { return xosBackendStatusIconTemplate(z); };