提交 97b749ab 编写于 作者: Z zhangle

permission tips

上级 1a1ea212
...@@ -75,10 +75,22 @@ ...@@ -75,10 +75,22 @@
<apolloentrance apollo-title="'添加集群'" apollo-img-src="'plus-orange'" <apolloentrance apollo-title="'添加集群'" apollo-img-src="'plus-orange'"
apollo-href="'cluster.html?#/appid=' + pageContext.appId" apollo-href="'cluster.html?#/appid=' + pageContext.appId"
ng-show="hasCreateClusterPermission"></apolloentrance> 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'" <apolloentrance apollo-title="'添加Namespace'" apollo-img-src="'plus-orange'"
apollo-href="'namespace.html?#/appid=' + pageContext.appId" apollo-href="'namespace.html?#/appid=' + pageContext.appId"
ng-show="hasCreateNamespacePermission"></apolloentrance> 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'" <apolloentrance apollo-title="'项目权限'" apollo-img-src="'user-manage'"
apollo-href="'/app/role.html?#/appid=' + pageContext.appId" apollo-href="'/app/role.html?#/appid=' + pageContext.appId"
...@@ -125,7 +137,8 @@ ...@@ -125,7 +137,8 @@
pre-release-ns="prepareReleaseNamespace" pre-release-ns="prepareReleaseNamespace"
create-item="createItem" edit-item="editItem" create-item="createItem" edit-item="editItem"
pre-delete-item="preDeleteItem" commit-change="commitChange" 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> </div>
<!-- delete modal--> <!-- delete modal-->
...@@ -133,7 +146,16 @@ ...@@ -133,7 +146,16 @@
apollo-detail="'确定要删除配置吗?'" apollo-confirm="deleteItem"></apolloconfirmdialog> apollo-detail="'确定要删除配置吗?'" apollo-confirm="deleteItem"></apolloconfirmdialog>
<apolloconfirmdialog apollo-dialog-id="'releaseNoPermissionDialog'" apollo-title="'发布'" <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> apollo-show-cancel-btn="false"></apolloconfirmdialog>
<apolloconfirmdialog apollo-dialog-id="'namespaceLockedDialog'" apollo-title="'编辑受限'" <apolloconfirmdialog apollo-dialog-id="'namespaceLockedDialog'" apollo-title="'编辑受限'"
......
...@@ -207,5 +207,9 @@ application_module.controller("ConfigBaseInfoController", ...@@ -207,5 +207,9 @@ application_module.controller("ConfigBaseInfoController",
}); });
$scope.showMasterPermissionTips = function () {
$("#masterNoPermissionDialog").modal('show');
}
}]); }]);
...@@ -47,6 +47,8 @@ application_module.controller("ConfigNamespaceController", ...@@ -47,6 +47,8 @@ application_module.controller("ConfigNamespaceController",
$scope.showText = showText; $scope.showText = showText;
$scope.showNoModifyPermissionDialog = showNoModifyPermissionDialog;
$scope.releaseBtnDisabled = false; $scope.releaseBtnDisabled = false;
$scope.rollbackBtnDisabled = false; $scope.rollbackBtnDisabled = false;
$scope.addItemBtnDisabled = false; $scope.addItemBtnDisabled = false;
...@@ -384,6 +386,10 @@ application_module.controller("ConfigNamespaceController", ...@@ -384,6 +386,10 @@ application_module.controller("ConfigNamespaceController",
$('#showText').modal('show'); $('#showText').modal('show');
} }
function showNoModifyPermissionDialog() {
$("#modifyNoPermissionDialog").modal('show');
}
$('.config-item-container').removeClass('hide'); $('.config-item-container').removeClass('hide');
new Clipboard('.clipboard'); new Clipboard('.clipboard');
......
...@@ -17,7 +17,8 @@ directive_module.directive('apollonspanel', ...@@ -17,7 +17,8 @@ directive_module.directive('apollonspanel',
editItem: '=', editItem: '=',
preDeleteItem: '=', preDeleteItem: '=',
commitChange: '=', commitChange: '=',
showText: '=' showText: '=',
showNoModifyPermissionDialog: '='
}, },
link: function (scope, element, attrs) { 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}}"> <div class="row icon-text icon-{{imgSrc}}">
<p class="btn-title">{{title}}</p> <p class="btn-title">{{title}}</p>
</div> </div>
......
...@@ -57,6 +57,12 @@ ...@@ -57,6 +57,12 @@
<img src="img/sync.png"> <img src="img/sync.png">
同步配置 同步配置
</a> </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>
</div> </div>
</header> </header>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册