Skip to content

Commit

Permalink
fix(label): 标签修改、集群成员创建样式优化
Browse files Browse the repository at this point in the history
  • Loading branch information
ssongliu committed Sep 13, 2021
1 parent 23ae578 commit a911f2d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion web/dashboard/src/utils/permission.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export const checkPermissions = function (p) {
return true
}
for (const clusterRole of userClusterRoles) {
const scope = clusterRole.metadata.labels["kubeoperator.io/role-type"]
const scope = clusterRole.metadata.labels["kubepi.org/role-type"]
if (clusterRole.rules.length > 0) {
for (const rule of clusterRole.rules) {
if (((scope === p.scope || scope === 'cluster') && rule.apiGroups.includes("*")) || rule.apiGroups.includes(p.apiGroup)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@
:title="$t('commons.button.'+operation)+$t('business.cluster.member')"
:visible.sync="formDialogOpened"
z-index="10"
width="60%"
width="70%"
center>
<el-form v-loading="isSubmitGoing" element-loading-spinner="el-icon-loading"
element-loading-background="rgba(0, 0, 0, 0.8)" :model="memberForm" label-position="left"
label-width="144px">
<el-form-item :label="$t('business.user.user')+$t('commons.table.name')">
<el-select v-model="memberForm.userName" style="width: 80%" :disabled="operation==='edit'">
<el-select v-model="memberForm.userName" style="width: 85%" :disabled="operation==='edit'">
<el-option v-for="(item, index) in getUserOptions" :key="index" :value="item.name">
{{ item.name }}
</el-option>
Expand All @@ -49,7 +49,7 @@
</el-form-item>
<div v-if="memberForm.roleType==='custom'">
<el-form-item>
<el-select v-model="memberForm.customClusterRoles" multiple style="width: 80%">
<el-select v-model="memberForm.customClusterRoles" multiple style="width: 85%">
<el-option
v-for="(item,index) in getClusterRolesOptions"
:key="index"
Expand All @@ -61,7 +61,7 @@

<el-form-item :label="$t('business.cluster.namespace')+$t('business.cluster.role')">
<el-button @click="onNamespaceRoleCreate"><i class="el-icon-plus "></i></el-button>
<table border="1" cellspacing="0" style="width: 80%">
<table border="1" cellspacing="0" style="width: 85%">
<thead style="background-color: #1d3e4d">
<tr>
<th style="width: 45%">{{ $t('business.cluster.namespace') }}</th>
Expand Down Expand Up @@ -216,10 +216,10 @@ export default {
listClusterRoles() {
listClusterRoles(this.name).then(data => {
this.clusterRolesOptions = data.data.filter((r) => {
return r.metadata["labels"]["kubeoperator.io/role-type"] === "cluster"
return r.metadata["labels"]["kubepi.org/role-type"] === "cluster"
})
this.namespaceRoleOptions = data.data.filter((r) => {
return r.metadata["labels"]["kubeoperator.io/role-type"] === "namespace"
return r.metadata["labels"]["kubepi.org/role-type"] === "namespace"
})
})
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ export default {
"description": this.clusterRoleForm.description
},
labels: {
"kubeoperator.io/role-type": "cluster",
"kubepi.org/role-type": "cluster",
}
},
rules: []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ export default {
metadata: {
name: this.clusterRoleForm.name,
labels: {
"kubeoperator.io/role-type": "namespace",
"kubepi.org/role-type": "namespace",
}
},
rules: []
Expand Down

0 comments on commit a911f2d

Please sign in to comment.