X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=planetstack%2Fcore%2Fxoslib%2Fstatic%2Fjs%2FxosTenant.js;h=96465d3effd05ef54b753e630ba9d1a81339f18e;hb=85743c1a683903301d2d69b4a552b56ab6effcba;hp=268b8ca1dee5a3e07b2b5968c757551377abc986;hpb=5b94c4decf6ac7d563b81e895c55c68c8a7f2561;p=plstackapi.git diff --git a/planetstack/core/xoslib/static/js/xosTenant.js b/planetstack/core/xoslib/static/js/xosTenant.js index 268b8ca..96465d3 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; @@ -170,6 +176,12 @@ XOSTenantApp.adjustCollectionField = function(collectionName, id, fieldName, amo XOSTenantApp.addSlice = function() { var app=this; + + if (!xos.tenant().current_user_can_create_slice) { + window.alert("You do not have sufficient rights to create a slice on your site"); + return; + } + model = new xos.slicesPlus.model({site: xos.tenant().current_user_site_id, name: xos.tenant().current_user_login_base + "_"}); console.log(model); @@ -252,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;