Use spaces suffix that replaces dots in username
This assumes usernames only have . or - but not both
This commit is contained in:
@@ -11,6 +11,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
|
||||
$scope.groups = [];
|
||||
$scope.users = [];
|
||||
$scope.backupConfig = {};
|
||||
$scope.spacesSuffix = '';
|
||||
|
||||
$scope.appConfigure = {
|
||||
busy: false,
|
||||
@@ -52,7 +53,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
|
||||
if ($scope.user.admin) {
|
||||
$scope.appConfigure.location = app.location;
|
||||
} else { // strip the trailing username
|
||||
$scope.appConfigure.location = app.location === $scope.user.username ? '' : app.location.replace(new RegExp('-' + $scope.user.username + '$'),'');
|
||||
$scope.appConfigure.location = app.location === $scope.spacesSuffix ? '' : app.location.replace(new RegExp('-' + $scope.spacesSuffix + '$'),'');
|
||||
}
|
||||
$scope.appConfigure.domain = $scope.domains.filter(function (d) { return d.domain === app.domain; })[0];
|
||||
$scope.appConfigure.portBindingsInfo = angular.extend({}, app.manifest.tcpPorts, app.manifest.udpPorts); // Portbinding map only for information
|
||||
@@ -601,6 +602,8 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
|
||||
Client.onReady(function () {
|
||||
Client.refreshInstalledApps(); // refresh the new list immediately when switching from another view (appstore)
|
||||
|
||||
$scope.spacesSuffix = $scope.user.username.replace(/\./g, '-');
|
||||
|
||||
if ($scope.user.admin || $scope.config.spaces.enabled) {
|
||||
fetchUsers();
|
||||
fetchGroups();
|
||||
|
||||
Reference in New Issue
Block a user