Skip to content

Commit

Permalink
feat(auth): fix some naming error and bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
BlackBear2003 committed Jan 12, 2025
1 parent 142b9ef commit 88ce290
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 31 deletions.
30 changes: 7 additions & 23 deletions apollo-portal/src/main/resources/static/app/cluster_manage.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
<link rel="stylesheet" type="text/css" media='all' href="../vendor/angular/loading-bar.min.css">
<link rel="stylesheet" type="text/css" href="../styles/common-style.css">
<link rel="stylesheet" type="text/css" href="../vendor/select2/select2.min.css">
<title>{{'Config.ClusterManage' | translate }}</title>
<title>{{'Config.ManageCluster' | translate }}</title>
</head>

<body>
Expand All @@ -38,13 +38,13 @@
<header class="panel-heading">
<div class="row">
<div class="col-md-9">
<h4 class="modal-title">{{'Config.ClusterManage' | translate }} (
{{'Common.AppId' | translate }}:<label ng-bind="appId"></label> )
<h4 class="modal-title">{{'Config.ManageCluster' | translate }} (
{{'Common.AppId' | translate }}: <label ng-bind="appId"></label> )
</h4>
</div>
<div class="col-md-3 text-right">
<a type="button" class="btn btn-info" data-dismiss="modal"
href="{{ '/config.html' | prefixPath }}?#appid={{pageContext.appId}}">{{'Common.ReturnToIndex' | translate }}
href="{{ '/config.html' | prefixPath }}?#appid={{appId}}">{{'Common.ReturnToIndex' | translate }}
</a>
</div>
</div>
Expand All @@ -53,24 +53,8 @@ <h4 class="modal-title">{{'Config.ClusterManage' | translate }} (
<div class="panel-body row" >

<section class="context">
<!-- <section class="form-horizontal">-->
<!-- <div class="alert alert-info no-radius" role="alert">-->
<!-- <strong>Tips:</strong>-->
<!-- <ul>-->
<!-- <li>{{'AccessKey.Tips.1' | translate }}</li>-->
<!-- <li>{{'AccessKey.Tips.2' | translate }}</li>-->
<!-- <li>{{'AccessKey.Tips.3' | translate }}</li>-->
<!-- <li>{{'AccessKey.Tips.4' | translate }}</li>-->
<!-- <ul>-->
<!-- <li>{{'AccessKey.Tips.4.1' | translate }}</li>-->
<!-- <li>{{'AccessKey.Tips.4.2' | translate }}</li>-->
<!-- <li>{{'AccessKey.Tips.4.3' | translate }}</li>-->
<!-- </ul>-->
<!-- </ul>-->
<!-- </div>-->
<!-- </section>-->

<!--application info-->

<!--env-cluster info-->
<section ng-repeat="env in envs">
<hr>
<h4>{{'Common.Environment' | translate }}: {{env.name}}
Expand All @@ -80,7 +64,7 @@ <h4>{{'Common.Environment' | translate }}: {{env.name}}
<div class="row">
<div class="col-md-6 col-sm-6 header-namespace">
<b class="namespace-name" data-tooltip="tooltip" data-placement="bottom">
{{'Common.Cluster' | translate }}:{{cluster.name}}
{{'Common.Cluster' | translate }}: {{cluster.name}}
</b>
</div>
<div class="col-md-6 col-sm-6 text-right header-buttons">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ <h4 class="modal-title">
</div>
<div class="col-md-3 text-right">
<a type="button" class="btn btn-info" data-dismiss="modal"
href="{{ '/config.html' | prefixPath }}?#appid={{pageContext.appId}}">{{'Common.ReturnToIndex' | translate }}
href="{{ '/app/cluster_manage.html' | prefixPath }}?#appid={{pageContext.appId}}">{{'Common.ReturnToClusterManagePage' | translate }}
</a>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion apollo-portal/src/main/resources/static/config.html
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,7 @@
apollo-img-src="'accesskey-manage'"
apollo-href="'app/access_key.html?#/appid=' + pageContext.appId"></apolloentrance>

<apolloentrance apollo-title="'Config.ClusterManage' | translate"
<apolloentrance apollo-title="'Config.ManageCluster' | translate"
apollo-img-src="'project-manage'"
apollo-href="'app/cluster_manage.html?#/appid=' + pageContext.appId"></apolloentrance>

Expand Down
9 changes: 8 additions & 1 deletion apollo-portal/src/main/resources/static/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -455,7 +455,14 @@
"Config.SortByKey": "Filter Config by Key",
"Config.FilterConfig": "Filter",
"Config.Reset": "Reset",
"Config.ClusterManage": "Cluster Manage",
"Config.ManageCluster": "Manage Cluster",
"Cluster.Role.InitClusterPermissionError": "Error initializing authorization",
"Cluster.Role.GetGrantUserError": "Failed to load authorized users",
"Cluster.Role.PleaseChooseUser": "Please select the user",
"Cluster.Role.Added": "Add Successfully",
"Cluster.Role.AddFailed": "Failed to add",
"Cluster.Role.Deleted": "Delete Successfully",
"Cluster.Role.DeleteFailed": "Failed to Delete",
"Delete.Title": "Delete applications, clusters, AppNamespace",
"Delete.DeleteApp": "Delete application",
"Delete.DeleteAppTips": "(Because deleting applications has very large impacts, only system administrators are allowed to delete them for the time being. Make sure that no client fetches the configuration of the application before deleting it.)",
Expand Down
10 changes: 9 additions & 1 deletion apollo-portal/src/main/resources/static/i18n/zh-CN.json
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
"Common.Deleted": "删除成功",
"Common.DeleteFailed": "删除失败",
"Common.ReturnToIndex": "返回到应用首页",
"Common.ReturnToClusterManagePage": "返回到管理集群页面",
"Common.Cancel": "取消",
"Common.Ok": "确定",
"Common.Search": "查询",
Expand Down Expand Up @@ -370,6 +371,13 @@
"Cluster.Role.GrantPublishTo2": "(可以发布配置)",
"Cluster.Role.Add": "添加",
"Cluster.Role.NoPermission": "您没有权限哟!",
"Cluster.Role.InitClusterPermissionError": "初始化授权出错",
"Cluster.Role.GetGrantUserError": "加载授权用户出错",
"Cluster.Role.PleaseChooseUser": "请选择用户",
"Cluster.Role.Added": "添加成功",
"Cluster.Role.AddFailed": "添加失败",
"Cluster.Role.Deleted": "删除成功",
"Cluster.Role.DeleteFailed": "删除失败",
"Config.Title": "Apollo 配置中心",
"Config.AppIdNotFound": "不存在,",
"Config.ClickByCreate": "点击创建",
Expand Down Expand Up @@ -455,7 +463,7 @@
"Config.SortByKey": "按Key值过滤",
"Config.FilterConfig": "过滤配置",
"Config.Reset": "重置",
"Config.ClusterManage": "集群管理",
"Config.ManageCluster": "管理集群",
"Delete.Title": "删除应用、集群、AppNamespace",
"Delete.DeleteApp": "删除应用",
"Delete.DeleteAppTips": "(由于删除应用影响面较大,所以现在暂时只允许系统管理员删除,请确保没有客户端读取该应用的配置后再做删除动作)",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ role_module.controller('ClusterNamespaceRoleController',
};

$scope.modifyRoleSubmitBtnDisabled = false;
$scope.ReleaseRoleSubmitBtnDisabled = false;
$scope.releaseRoleSubmitBtnDisabled = false;

$scope.releaseRoleWidgetId = 'releaseRoleWidgetId';
$scope.modifyRoleWidgetId = 'modifyRoleWidgetId';
Expand Down Expand Up @@ -62,7 +62,7 @@ role_module.controller('ClusterNamespaceRoleController',
toastr.warning($translate.instant('Cluster.Role.PleaseChooseUser'));
return;
}
$scope.ReleaseRoleSubmitBtnDisabled = true;
$scope.releaseRoleSubmitBtnDisabled = true;
var toAssignReleaseNamespacesInClusterRoleUser = user.id;

var assignReleaseNamespacesInClusterRoleFunc = function (appId, env, clusterName, user) {
Expand All @@ -76,12 +76,12 @@ role_module.controller('ClusterNamespaceRoleController',
toAssignReleaseNamespacesInClusterRoleUser
).then(function () {
toastr.success($translate.instant('Cluster.Role.Added'));
$scope.ReleaseRoleSubmitBtnDisabled = false;
$scope.releaseRoleSubmitBtnDisabled = false;
$scope.rolesAssignedUsers.releaseRoleUsers.push({ userId: toAssignReleaseNamespacesInClusterRoleUser });

$('.' + $scope.releaseRoleWidgetId).select2("val", "");
}, function (result) {
$scope.ReleaseRoleSubmitBtnDisabled = false;
$scope.releaseRoleSubmitBtnDisabled = false;
toastr.error(AppUtil.errorMsg(result), $translate.instant('Cluster.Role.AddFailed'));
});
} else if ("ModifyNamespacesInCluster" === roleType) {
Expand Down

0 comments on commit 88ce290

Please sign in to comment.