Commit 2fd37c26 by Jason Song Committed by GitHub

Merge pull request #418 from lepdou/bugfix_0928

permission tips
parents 1a1ea212 97b749ab
......@@ -75,10 +75,22 @@
<apolloentrance apollo-title="'添加集群'" apollo-img-src="'plus-orange'"
apollo-href="'cluster.html?#/appid=' + pageContext.appId"
ng-show="hasCreateClusterPermission"></apolloentrance>
<span class="list-group-item cursor-pointer hover" ng-click="showMasterPermissionTips()"
ng-show="!hasCreateClusterPermission">
<div class="row icon-text icon-plus-orange">
<p class="btn-title">添加集群</p>
</div>
</span>
<apolloentrance apollo-title="'添加Namespace'" apollo-img-src="'plus-orange'"
apollo-href="'namespace.html?#/appid=' + pageContext.appId"
ng-show="hasCreateNamespacePermission"></apolloentrance>
<span class="list-group-item cursor-pointer hover" ng-click="showMasterPermissionTips()"
ng-show="!hasCreateNamespacePermission">
<div class="row icon-text icon-plus-orange">
<p class="btn-title">添加Namespace</p>
</div>
</span>
<apolloentrance apollo-title="'项目权限'" apollo-img-src="'user-manage'"
apollo-href="'/app/role.html?#/appid=' + pageContext.appId"
......@@ -125,7 +137,8 @@
pre-release-ns="prepareReleaseNamespace"
create-item="createItem" edit-item="editItem"
pre-delete-item="preDeleteItem" commit-change="commitChange"
pre-rollback="preRollback" show-text="showText"></apollonspanel>
pre-rollback="preRollback" show-text="showText"
show-no-modify-permission-dialog="showNoModifyPermissionDialog"></apollonspanel>
</div>
<!-- delete modal-->
......@@ -133,7 +146,16 @@
apollo-detail="'确定要删除配置吗?'" apollo-confirm="deleteItem"></apolloconfirmdialog>
<apolloconfirmdialog apollo-dialog-id="'releaseNoPermissionDialog'" apollo-title="'发布'"
apollo-detail="'您没有发布权限哦~ 请找 ' + masterUsers + ' 分配权限'"
apollo-detail="'您没有发布权限哦~ 请找项目管理员 ' + masterUsers + ' 分配发布权限'"
apollo-show-cancel-btn="false"></apolloconfirmdialog>
<apolloconfirmdialog apollo-dialog-id="'modifyNoPermissionDialog'" apollo-title="'申请配置权限'"
apollo-detail="'请找项目管理员 ' + masterUsers + ' 分配编辑或发布权限'"
apollo-show-cancel-btn="false"></apolloconfirmdialog>
<apolloconfirmdialog apollo-dialog-id="'masterNoPermissionDialog'" apollo-title="'申请配置权限'"
apollo-detail="'您不是项目管理员, 只有项目管理员才有添加集群、namespace的权限。
如需管理员权限,请找项目管理员 ' + masterUsers + ' 分配管理员权限'"
apollo-show-cancel-btn="false"></apolloconfirmdialog>
<apolloconfirmdialog apollo-dialog-id="'namespaceLockedDialog'" apollo-title="'编辑受限'"
......
......@@ -207,5 +207,9 @@ application_module.controller("ConfigBaseInfoController",
});
$scope.showMasterPermissionTips = function () {
$("#masterNoPermissionDialog").modal('show');
}
}]);
......@@ -47,6 +47,8 @@ application_module.controller("ConfigNamespaceController",
$scope.showText = showText;
$scope.showNoModifyPermissionDialog = showNoModifyPermissionDialog;
$scope.releaseBtnDisabled = false;
$scope.rollbackBtnDisabled = false;
$scope.addItemBtnDisabled = false;
......@@ -383,6 +385,10 @@ application_module.controller("ConfigNamespaceController",
$scope.text = text;
$('#showText').modal('show');
}
function showNoModifyPermissionDialog() {
$("#modifyNoPermissionDialog").modal('show');
}
$('.config-item-container').removeClass('hide');
......
......@@ -17,7 +17,8 @@ directive_module.directive('apollonspanel',
editItem: '=',
preDeleteItem: '=',
commitChange: '=',
showText: '='
showText: '=',
showNoModifyPermissionDialog: '='
},
link: function (scope, element, attrs) {
......
<a class="list-group-item" href="{{href}}">
<a class="list-group-item hover" href="{{href}}">
<div class="row icon-text icon-{{imgSrc}}">
<p class="btn-title">{{title}}</p>
</div>
......
......@@ -57,6 +57,12 @@
<img src="img/sync.png">
同步配置
</a>
<a type="button" class="btn btn-danger btn-sm J_tableview_btn"
data-tooltip="tooltip" data-placement="bottom" title="您没有任何配置权限,请申请"
ng-click="showNoModifyPermissionDialog()"
ng-show="!namespace.hasModifyPermission && !namespace.hasReleasePermission">
申请配置权限
</a>
</div>
</div>
</header>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment