Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 3025 #3037

Merged
merged 2 commits into from
Apr 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ <h5 ng-show="appNamespace.info" ng-bind="appNamespace.info"></h5>
</section>

<section class="panel-body text-center" ng-if="!isRootUser">
<h4>{{'Common.IsRootUserTips' | translate }}</h4>
<h4>{{'Common.IsRootUser' | translate }}</h4>
</section>

</div>
Expand Down
6 changes: 3 additions & 3 deletions apollo-portal/src/main/resources/static/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
Original file line number Diff line number Diff line change
@@ -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'));
Expand Down
Original file line number Diff line number Diff line change
@@ -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'));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 () {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down
16 changes: 9 additions & 7 deletions apollo-portal/src/main/resources/static/server_config.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,18 +16,17 @@
<body>

<apollonav></apollonav>
<div class="container-fluid apollo-container">

<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel">
<div class="container-fluid apollo-container" ng-controller="ServerConfigController">
<div class="col-md-8 col-md-offset-2 panel">
<section class="panel-body" ng-show="isRootUser">
<div class="row">
<header class="panel-heading">
{{'ServiceConfig.Title' | translate }}
<small>{{'ServiceConfig.Tips' | translate }}</small>
</header>

<div class="panel-body">
<form class="form-horizontal" ng-controller="ServerConfigController">
<form class="form-horizontal">
<div class="form-group">
<label class="col-sm-2 control-label">
<apollorequiredfield></apollorequiredfield>
Expand Down Expand Up @@ -73,7 +72,10 @@
</form>
</div>
</div>
</div>
</section>
<section class="panel-body text-center" ng-if="!isRootUser">
<h4>{{'Common.IsRootUser' | translate }}</h4>
</section>
</div>
</div>

Expand Down
20 changes: 10 additions & 10 deletions apollo-portal/src/main/resources/static/user-manage.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,20 +17,18 @@
<body>

<apollonav></apollonav>
<div class="container-fluid apollo-container">

<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel">
<div class="container-fluid apollo-container" ng-controller="UserController">
<div class="col-md-8 col-md-offset-2 panel">
<section class="panel-body" ng-show="isRootUser">
<div class="row">
<header class="panel-heading">
{{'UserMange.Title' | translate }}
<small>
{{'UserMange.TitleTips' | translate }}
</small>
</header>

<form class="form-horizontal panel-body" name="appForm" ng-controller="UserController"
valdr-type="App" ng-submit="createOrUpdateUser()">
<form class="form-horizontal panel-body" name="appForm"
valdr-type="App" ng-submit="createOrUpdateUser()">
<div class="form-group" valdr-form-group>
<label class="col-sm-2 control-label">
<apollorequiredfield></apollorequiredfield>
Expand Down Expand Up @@ -69,9 +67,11 @@
</div>
</div>
</form>

</div>
</div>
</section>
<section class="panel-body text-center" ng-if="!isRootUser">
<h4>{{'Common.IsRootUser' | translate }}</h4>
</section>
</div>
</div>

Expand Down