spaces: Strip the trailing username when configuring

This commit is contained in:
Girish Ramakrishnan
2018-08-28 10:38:53 -07:00
parent 22c402ca3d
commit 937a165711

View File

@@ -49,7 +49,11 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
// fill relevant info from the app
$scope.appConfigure.app = app;
$scope.appConfigure.location = app.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.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
$scope.appConfigure.memoryLimit = app.memoryLimit || app.manifest.memoryLimit || (256 * 1024 * 1024);
@@ -233,7 +237,7 @@ angular.module('Application').controller('AppsController', ['$scope', '$location
});
}
// reflect the new app state immediately
// reflect the new app state immediately
Client.refreshAppCache($scope.appRestore.app.id, waitForBackupFinish);
});
},