X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetstack%2Fcore%2Fxoslib%2Fstatic%2Fjs%2FxosTenant.js;h=9c45460a3039fc6c3e036d06034d9e1c001a11c1;hb=b4fcd4005bcebbafc988a2e6bc0d2da2b7ffc908;hp=cb816a860fb28c138ee241410ea02832467c80f0;hpb=462341a013fac9032894eb2e56f5a36dfa4fd468;p=plstackapi.git diff --git a/planetstack/core/xoslib/static/js/xosTenant.js b/planetstack/core/xoslib/static/js/xosTenant.js index cb816a8..9c45460 100644 --- a/planetstack/core/xoslib/static/js/xosTenant.js +++ b/planetstack/core/xoslib/static/js/xosTenant.js @@ -103,6 +103,11 @@ XOSTenantApp.buildViews = function() { 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 @@ XOSTenantApp.buildViews = function() { noDeleteColumn: true, disablePaginate: true, disableFilter: true, + fieldDisplayNames: {"name": "Site"}, }); XOSTenantApp.tenantSiteListView = tenantSiteListClass; @@ -258,6 +264,8 @@ XOSTenantApp.viewSlice = function(model) { tenantSites = new XOSTenantSiteCollection(); tenantSites.getFromSlice(model); model.usersBuffer = model.attributes.users; /* save a copy of 'users' that we can edit. This prevents another view (developer) from overwriting our copy with a fetch from the server */ + model.usersOrig = model.attributes.users; /* save an immutable copy that we'll use for username lookups */ + model.user_namesOrig = model.attributes.user_names; model.tenantSiteCollection = tenantSites; XOSTenantApp.tenantSites = tenantSites; @@ -291,6 +299,9 @@ XOSTenantApp.sanityCheck = function() { if (xos.tenant().blessed_sites.length == 0) { errors.push("no blessed sites"); } + if (xos.tenant().current_user_site_id == null) { + errors.push("current user does not have a site"); + } if (errors.length > 0) { $("#tenantSummary").html("Tenant view sanity check failed
" + errors.join("
"));