diff --git a/apollo-portal/src/main/resources/static/delete_app_cluster_namespace.html b/apollo-portal/src/main/resources/static/delete_app_cluster_namespace.html index 3b66a12bc4a..10fcc117b95 100644 --- a/apollo-portal/src/main/resources/static/delete_app_cluster_namespace.html +++ b/apollo-portal/src/main/resources/static/delete_app_cluster_namespace.html @@ -176,7 +176,7 @@
-

{{'Common.IsRootUserTips' | translate }}

+

{{'Common.IsRootUser' | translate }}

diff --git a/apollo-portal/src/main/resources/static/i18n/en.json b/apollo-portal/src/main/resources/static/i18n/en.json index cff3572e7f8..df985ac8bb2 100644 --- a/apollo-portal/src/main/resources/static/i18n/en.json +++ b/apollo-portal/src/main/resources/static/i18n/en.json @@ -731,9 +731,9 @@ "ItemModal.PleaseChooseCluster": "Please Select Cluster", "ItemModal.ModifiedTips": "Update Successfully. need to release configuration to take effect", "ItemModal.ModifyFailed": "Failed to Update", - "ItemModal.Tabs": "Tab character", - "ItemModal.NewLine": "Newline character", - "ItemModal.Space": "Blank space", + "ItemModal.Tabs": "Tab-character", + "ItemModal.NewLine": "Newline-character", + "ItemModal.Space": "Blank-space", "ApolloNsPanel.LoadingHistoryError": "Failed to load change history", "ApolloNsPanel.LoadingGrayscaleError": "Failed to load change history", "ApolloNsPanel.Deleted": "Delete Successfully", diff --git a/apollo-portal/src/main/resources/static/scripts/controller/ServerConfigController.js b/apollo-portal/src/main/resources/static/scripts/controller/ServerConfigController.js index 18d8c27faaf..a809702ceb8 100644 --- a/apollo-portal/src/main/resources/static/scripts/controller/ServerConfigController.js +++ b/apollo-portal/src/main/resources/static/scripts/controller/ServerConfigController.js @@ -1,10 +1,19 @@ server_config_module.controller('ServerConfigController', - ['$scope', '$window', '$translate', 'toastr', 'ServerConfigService', 'AppUtil', - function ($scope, $window, $translate, toastr, ServerConfigService, AppUtil) { + ['$scope', '$window', '$translate', 'toastr', 'ServerConfigService', 'AppUtil', 'PermissionService', + function ($scope, $window, $translate, toastr, ServerConfigService, AppUtil, PermissionService) { $scope.serverConfig = {}; $scope.saveBtnDisabled = true; + initPermission(); + + function initPermission() { + PermissionService.has_root_permission() + .then(function (result) { + $scope.isRootUser = result.hasPermission; + }) + } + $scope.create = function () { ServerConfigService.create($scope.serverConfig).then(function (result) { toastr.success($translate.instant('ServiceConfig.Saved')); diff --git a/apollo-portal/src/main/resources/static/scripts/controller/UserController.js b/apollo-portal/src/main/resources/static/scripts/controller/UserController.js index d707a006b6d..989d76957c5 100644 --- a/apollo-portal/src/main/resources/static/scripts/controller/UserController.js +++ b/apollo-portal/src/main/resources/static/scripts/controller/UserController.js @@ -1,11 +1,20 @@ user_module.controller('UserController', - ['$scope', '$window', '$translate', 'toastr', 'AppUtil', 'UserService', + ['$scope', '$window', '$translate', 'toastr', 'AppUtil', 'UserService', 'PermissionService', UserController]); -function UserController($scope, $window, $translate, toastr, AppUtil, UserService) { +function UserController($scope, $window, $translate, toastr, AppUtil, UserService, PermissionService) { $scope.user = {}; + initPermission(); + + function initPermission() { + PermissionService.has_root_permission() + .then(function (result) { + $scope.isRootUser = result.hasPermission; + }) + } + $scope.createOrUpdateUser = function () { UserService.createOrUpdateUser($scope.user).then(function (result) { toastr.success($translate.instant('UserMange.Created')); diff --git a/apollo-portal/src/main/resources/static/scripts/controller/config/ConfigNamespaceController.js b/apollo-portal/src/main/resources/static/scripts/controller/config/ConfigNamespaceController.js index b451906b5b7..4bf40a0b2b8 100644 --- a/apollo-portal/src/main/resources/static/scripts/controller/config/ConfigNamespaceController.js +++ b/apollo-portal/src/main/resources/static/scripts/controller/config/ConfigNamespaceController.js @@ -156,7 +156,9 @@ function controller($rootScope, $scope, $translate, toastr, AppUtil, EventManage return; } - $scope.config = item; + $scope.config = {}; + $scope.config.key = _.escape(item.key); + $scope.config.value = _.escape(item.value); $scope.toOperationNamespace = namespace; toDeleteItemId = item.id; diff --git a/apollo-portal/src/main/resources/static/scripts/controller/role/SystemRoleController.js b/apollo-portal/src/main/resources/static/scripts/controller/role/SystemRoleController.js index 67ca77ca2e8..ccaa7a34ebe 100644 --- a/apollo-portal/src/main/resources/static/scripts/controller/role/SystemRoleController.js +++ b/apollo-portal/src/main/resources/static/scripts/controller/role/SystemRoleController.js @@ -69,8 +69,10 @@ angular.module('systemRole', ['app.service', 'apollo.directive', 'app.util', 'to PermissionService.has_root_permission() .then(function (result) { $scope.isRootUser = result.hasPermission; + if ($scope.isRootUser) { + getCreateApplicationRoleUsers(); + } }); - getCreateApplicationRoleUsers(); } $scope.getAppInfo = function () { diff --git a/apollo-portal/src/main/resources/static/scripts/directive/item-modal-directive.js b/apollo-portal/src/main/resources/static/scripts/directive/item-modal-directive.js index cf03919f638..992e4caa7b5 100644 --- a/apollo-portal/src/main/resources/static/scripts/directive/item-modal-directive.js +++ b/apollo-portal/src/main/resources/static/scripts/directive/item-modal-directive.js @@ -144,7 +144,7 @@ function itemModalDirective($translate, toastr, $sce, AppUtil, EventManager, Con return; } - var hiddenCharCounter = 0, valueWithHiddenChars = value; + var hiddenCharCounter = 0, valueWithHiddenChars = _.escape(value); for (var i = 0; i < value.length; i++) { var c = value[i]; diff --git a/apollo-portal/src/main/resources/static/server_config.html b/apollo-portal/src/main/resources/static/server_config.html index 4326a4abb88..0efa6ba76c9 100644 --- a/apollo-portal/src/main/resources/static/server_config.html +++ b/apollo-portal/src/main/resources/static/server_config.html @@ -16,18 +16,17 @@ -
- -
-
-
+
+
+
+
{{'ServiceConfig.Title' | translate }} {{'ServiceConfig.Tips' | translate }}
-
+
-
+
+
+

{{'Common.IsRootUser' | translate }}

+
diff --git a/apollo-portal/src/main/resources/static/user-manage.html b/apollo-portal/src/main/resources/static/user-manage.html index e8cb3f2f536..5a485c6dc2a 100644 --- a/apollo-portal/src/main/resources/static/user-manage.html +++ b/apollo-portal/src/main/resources/static/user-manage.html @@ -17,20 +17,18 @@ -
- -
-
-
+
+
+
+
{{'UserMange.Title' | translate }} {{'UserMange.TitleTips' | translate }}
- -
+
-
-
+ +
+

{{'Common.IsRootUser' | translate }}

+