diff --git a/gui/ConfigModule.js b/gui/ConfigModule.js index 07d84dac..33eee9bb 100644 --- a/gui/ConfigModule.js +++ b/gui/ConfigModule.js @@ -17,6 +17,22 @@ angular * Make lodash available for injection into controllers */ .constant('_', window._) + +/** + * Toggles for hiding the more advanced UI features + */ +.constant('AdvancedFeatures', { + showConsole: true, + showEditService: false, + showRemoveService: false, + showCreateSpec: false, + showImportSpec: false, + showFileManager: false, + showServiceHelpIcon: false, + showLogs: false, + showConfig: false, +}) + /** * The back-up (default) administrator e-mail to use for support, * in case the /api/contact endpoint is unavailable @@ -46,7 +62,7 @@ angular .constant('EditSpecPathSuffix', '/store/edit/:specKey/') // Navigate here when clicking "Sign In" -.constant('SigninUrl', 'https://www.local.ndslabs.org/oauth2/authorize') +.constant('SigninUrl', 'https://www.local.ndslabs.org/login/') /** * The name of the product to display in the UI and the URL to link to when clicked diff --git a/gui/Dockerfile b/gui/Dockerfile index 35b9bf40..c9853ed3 100644 --- a/gui/Dockerfile +++ b/gui/Dockerfile @@ -30,6 +30,14 @@ ENV APISERVER_HOST="localhost" \ APISERVER_PATH="/api" \ APISERVER_SECURE="true" \ ANALYTICS_ACCOUNT="" \ + SHOW_CONSOLE="true" \ + SHOW_CONFIG="false" \ + SHOW_LOGS="false" \ + SHOW_IMPORT_SPEC="false" \ + SHOW_CREATE_SPEC="false" \ + SHOW_FILE_MANAGER="false" \ + SHOW_EDIT_SERVICE="false" \ + SHOW_SVC_HELP_ICON="false" \ SUPPORT_EMAIL="ndslabs-support@nationaldataservice.org" # Expose port 3000 for ExpressJS diff --git a/gui/dashboard/catalog/CatalogController.js b/gui/dashboard/catalog/CatalogController.js index 7e830ddd..2e998ad1 100644 --- a/gui/dashboard/catalog/CatalogController.js +++ b/gui/dashboard/catalog/CatalogController.js @@ -23,10 +23,12 @@ angular * @see https://opensource.ncsa.illinois.edu/confluence/display/~lambert8/3.%29+Controllers%2C+Scopes%2C+and+Partial+Views */ .controller('CatalogController', [ '$scope', '$filter', '$interval', '$uibModal', '$location', '$log', '_', 'Analytics', 'NdsLabsApi', 'Project', 'Stack', 'Stacks', - 'StackService', 'Specs', 'clipboard', 'Vocabulary', 'RandomPassword', 'AuthInfo', 'ProductName', 'ApiUri', 'DashboardAppPath', 'HomePathSuffix', - function($scope, $filter, $interval, $uibModal, $location, $log, _, Analytics, NdsLabsApi, Project, Stack, Stacks, StackService, Specs, clipboard, Vocabulary, RandomPassword, AuthInfo, ProductName, ApiUri, DashboardAppPath, HomePathSuffix) { + 'StackService', 'Specs', 'clipboard', 'Vocabulary', 'RandomPassword', 'AuthInfo', 'ProductName', 'ApiUri', 'DashboardAppPath', 'HomePathSuffix', 'AdvancedFeatures', + function($scope, $filter, $interval, $uibModal, $location, $log, _, Analytics, NdsLabsApi, Project, Stack, Stacks, StackService, Specs, clipboard, Vocabulary, RandomPassword, AuthInfo, ProductName, ApiUri, DashboardAppPath, HomePathSuffix, AdvancedFeatures) { "use strict"; + $scope.showCreateSpec = AdvancedFeatures.showCreateSpec; + $scope.showImportSpec = AdvancedFeatures.showImportSpec; $scope.productName = ProductName; $scope.tags = { all: [], selected: [] }; diff --git a/gui/dashboard/catalog/catalog.html b/gui/dashboard/catalog/catalog.html index 0bba0ab2..1126e0ad 100644 --- a/gui/dashboard/catalog/catalog.html +++ b/gui/dashboard/catalog/catalog.html @@ -33,11 +33,11 @@
Status | -Name | -ID | -Console | -- Config - Edit - | -- Logs - Remove - | -Help | +Name | +ID | +Console | +Edit | +Config | +Logs | +Remove | +Help | - {{ svc.service | specProperty:'label' }} + | + {{ svc.service | specProperty:'label' }} | {{ svc.id }} | -+ | + + + | - - | - + | + + +
|
- + |
|
+
+
+
|
- + | @@ -200,7 +204,7 @@ | {{ stack.selectedOption | specProperty:'description' }} | -+ |
diff --git a/gui/entrypoint.sh b/gui/entrypoint.sh
index 1949faa4..6b20d7e7 100755
--- a/gui/entrypoint.sh
+++ b/gui/entrypoint.sh
@@ -16,5 +16,16 @@
# Substitute the ANALYTICS_ACCOUNT passed in by "docker run -e" or kubernetes
/bin/sed -i -e "s#^\.constant('GaAccount', .*)#.constant('GaAccount', '${ANALYTICS_ACCOUNT}')#" "$BASEDIR/ConfigModule.js"
+# In lieu of actual user management, some instance-wide flags to toggle the more advanced features
+/bin/sed -i -e "s#^\showConfig: .*,#showConfig: ${SHOW_CONFIG:-false},#" "$BASEDIR/ConfigModule.js"
+/bin/sed -i -e "s#^\showLogs: .*,#showLogs: ${SHOW_LOGS:-false},#" "$BASEDIR/ConfigModule.js"
+/bin/sed -i -e "s#^\showConsole: .*,#showConsole: ${SHOW_CONSOLE:-true},#" "$BASEDIR/ConfigModule.js"
+/bin/sed -i -e "s#^\showEditService: .*,#showEditService: ${SHOW_EDIT_SERVICE:-false},#" "$BASEDIR/ConfigModule.js"
+/bin/sed -i -e "s#^\showRemoveService: .*,#showRemoveService: ${SHOW_REMOVE_SERVICE:-false},#" "$BASEDIR/ConfigModule.js"
+/bin/sed -i -e "s#^\showServiceHelpIcon: .*,#showServiceHelpIcon: ${SHOW_SERVICE_HELP_ICON:-false},#" "$BASEDIR/ConfigModule.js"
+/bin/sed -i -e "s#^\showCreateSpec: .*,#showCreateSpec: ${SHOW_CREATE_SPEC:-false},#" "$BASEDIR/ConfigModule.js"
+/bin/sed -i -e "s#^\showImportSpec: .*,#showImportSpec: ${SHOW_IMPORT_SPEC:-false},#" "$BASEDIR/ConfigModule.js"
+/bin/sed -i -e "s#^\showFileManager: .*,#showFileManager: ${SHOW_FILE_MANAGER:-false},#" "$BASEDIR/ConfigModule.js"
+
# Start ExpressJS
node server.js
diff --git a/gui/shared/navbar/NavbarController.js b/gui/shared/navbar/NavbarController.js
index 857d99dc..73144543 100755
--- a/gui/shared/navbar/NavbarController.js
+++ b/gui/shared/navbar/NavbarController.js
@@ -29,8 +29,8 @@ angular
* @author lambert8
* @see https://opensource.ncsa.illinois.edu/confluence/display/~lambert8/3.%29+Controllers%2C+Scopes%2C+and+Partial+Views
*/
-.controller('NavbarController', [ '$scope', '$rootScope', '$window', '$location', '$cookies', 'Project', 'AuthInfo', 'ProductName', 'ProductUrl', 'HelpLinks', 'FileManager', 'AutoRefresh', 'ReturnRoute', 'CookieOptions', 'SigninUrl',
- function($scope, $rootScope, $window, $location, $cookies, Project, AuthInfo, ProductName, ProductUrl, HelpLinks, FileManager, AutoRefresh, ReturnRoute, CookieOptions, SigninUrl) {
+.controller('NavbarController', [ '$scope', '$rootScope', '$window', '$location', '$cookies', 'Project', 'AuthInfo', 'ProductName', 'ProductUrl', 'HelpLinks', 'FileManager', 'AutoRefresh', 'ReturnRoute', 'CookieOptions', 'SigninUrl', 'AdvancedFeatures',
+ function($scope, $rootScope, $window, $location, $cookies, Project, AuthInfo, ProductName, ProductUrl, HelpLinks, FileManager, AutoRefresh, ReturnRoute, CookieOptions, SigninUrl, AdvancedFeatures) {
"use strict"
// Enable JS dropdowns on the navbar
@@ -59,6 +59,7 @@ angular
$scope.signinLink = $scope.enableOAuth ? SigninUrl : '/login/' + ($rootScope.rd ? 'rd=' : '');
$scope.helpLinks = HelpLinks;
+ $scope.showFileManager = AdvancedFeatures.showFileManager;
$scope.fileManager = FileManager;
$scope.launchingFileManager = FileManager.busy;
$scope.$watch('fileManager.busy', function(newValue, oldValue) {
diff --git a/gui/shared/navbar/navbar.html b/gui/shared/navbar/navbar.html
index 2bbebef3..ea1224d8 100755
--- a/gui/shared/navbar/navbar.html
+++ b/gui/shared/navbar/navbar.html
@@ -30,7 +30,7 @@
- |