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 @@

Applications

-
-
+
Create diff --git a/gui/dashboard/dashboard/DashboardController.js b/gui/dashboard/dashboard/DashboardController.js index c01d769c..e76b56fd 100755 --- a/gui/dashboard/dashboard/DashboardController.js +++ b/gui/dashboard/dashboard/DashboardController.js @@ -9,16 +9,20 @@ angular * @author lambert8 * @see https://opensource.ncsa.illinois.edu/confluence/display/~lambert8/3.%29+Controllers%2C+Scopes%2C+and+Partial+Views */ -.controller('DashboardController', [ '$scope', 'Loading', '$log', '$routeParams', '$location', '$interval', '$q', '$window', '$filter', '$uibModal', '_', 'Analytics', 'Project', 'RandomPassword', 'Stack', 'Stacks', 'Specs', 'AutoRefresh', 'AuthInfo', - 'StackService', 'NdsLabsApi', 'ProductName', 'FileManager', 'QuickStart', - function($scope, Loading, $log, $routeParams, $location, $interval, $q, $window, $filter, $uibModal, _, Analytics, Project, RandomPassword, Stack, Stacks, Specs, AutoRefresh, AuthInfo, StackService, NdsLabsApi, - ProductName, FileManager, QuickStart) { +.controller('DashboardController', [ '$scope', 'Loading', '$log', '$routeParams', '$location', '$interval', '$q', '$window', '$filter', '$uibModal', '_', 'Analytics', 'Project', 'RandomPassword', 'Stack', 'Stacks', 'Specs', 'AutoRefresh', 'AuthInfo', 'StackService', 'NdsLabsApi', 'ProductName', 'FileManager', 'QuickStart', 'AdvancedFeatures', + function($scope, Loading, $log, $routeParams, $location, $interval, $q, $window, $filter, $uibModal, _, Analytics, Project, RandomPassword, Stack, Stacks, Specs, AutoRefresh, AuthInfo, StackService, NdsLabsApi, ProductName, FileManager, QuickStart, AdvancedFeatures) { "use strict"; if ($routeParams.quickstart) { QuickStart.get($routeParams.quickstart).launch(); } - + + $scope.showRemoveService = AdvancedFeatures.showRemoveService; + $scope.showServiceHelpIcon = AdvancedFeatures.showServiceHelpIcon; + $scope.showEditService = AdvancedFeatures.showEditService; + $scope.showConsole = AdvancedFeatures.showConsole; + $scope.showConfigColumn = AdvancedFeatures.showConfig; + $scope.showLogsColumn = AdvancedFeatures.showLogs; $scope.fileManager = FileManager; $scope.productName = ProductName; diff --git a/gui/dashboard/dashboard/dashboard.html b/gui/dashboard/dashboard/dashboard.html index f8195b8e..a2c995ab 100755 --- a/gui/dashboard/dashboard/dashboard.html +++ b/gui/dashboard/dashboard/dashboard.html @@ -79,24 +79,21 @@

+
- - - - - - + + + + + + + + @@ -116,8 +113,8 @@

-

- + + + + + + - + + + - + @@ -200,7 +204,7 @@

-
StatusNameIDConsole - Config - Edit - - Logs - Remove - HelpNameIDConsoleEditConfigLogsRemoveHelp
- {{ svc.service | specProperty:'label' }} + + {{ svc.service | specProperty:'label' }} {{ svc.id }} + - - - + + - +
{{ 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 @@ -
  • +
  • Files