Commit a911f2d9 authored by ssongliu's avatar ssongliu
Browse files

fix(label): 标签修改、集群成员创建样式优化

parent 23ae578a
Showing with 9 additions and 9 deletions
+9 -9
...@@ -7,7 +7,7 @@ export const checkPermissions = function (p) { ...@@ -7,7 +7,7 @@ export const checkPermissions = function (p) {
return true return true
} }
for (const clusterRole of userClusterRoles) { 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) { if (clusterRole.rules.length > 0) {
for (const rule of clusterRole.rules) { for (const rule of clusterRole.rules) {
if (((scope === p.scope || scope === 'cluster') && rule.apiGroups.includes("*")) || rule.apiGroups.includes(p.apiGroup)) { if (((scope === p.scope || scope === 'cluster') && rule.apiGroups.includes("*")) || rule.apiGroups.includes(p.apiGroup)) {
......
...@@ -28,13 +28,13 @@ ...@@ -28,13 +28,13 @@
:title="$t('commons.button.'+operation)+$t('business.cluster.member')" :title="$t('commons.button.'+operation)+$t('business.cluster.member')"
:visible.sync="formDialogOpened" :visible.sync="formDialogOpened"
z-index="10" z-index="10"
width="60%" width="70%"
center> center>
<el-form v-loading="isSubmitGoing" element-loading-spinner="el-icon-loading" <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" element-loading-background="rgba(0, 0, 0, 0.8)" :model="memberForm" label-position="left"
label-width="144px"> label-width="144px">
<el-form-item :label="$t('business.user.user')+$t('commons.table.name')"> <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"> <el-option v-for="(item, index) in getUserOptions" :key="index" :value="item.name">
{{ item.name }} {{ item.name }}
</el-option> </el-option>
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
</el-form-item> </el-form-item>
<div v-if="memberForm.roleType==='custom'"> <div v-if="memberForm.roleType==='custom'">
<el-form-item> <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 <el-option
v-for="(item,index) in getClusterRolesOptions" v-for="(item,index) in getClusterRolesOptions"
:key="index" :key="index"
...@@ -61,7 +61,7 @@ ...@@ -61,7 +61,7 @@
<el-form-item :label="$t('business.cluster.namespace')+$t('business.cluster.role')"> <el-form-item :label="$t('business.cluster.namespace')+$t('business.cluster.role')">
<el-button @click="onNamespaceRoleCreate"><i class="el-icon-plus "></i></el-button> <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"> <thead style="background-color: #1d3e4d">
<tr> <tr>
<th style="width: 45%">{{ $t('business.cluster.namespace') }}</th> <th style="width: 45%">{{ $t('business.cluster.namespace') }}</th>
...@@ -216,10 +216,10 @@ export default { ...@@ -216,10 +216,10 @@ export default {
listClusterRoles() { listClusterRoles() {
listClusterRoles(this.name).then(data => { listClusterRoles(this.name).then(data => {
this.clusterRolesOptions = data.data.filter((r) => { 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) => { this.namespaceRoleOptions = data.data.filter((r) => {
return r.metadata["labels"]["kubeoperator.io/role-type"] === "namespace" return r.metadata["labels"]["kubepi.org/role-type"] === "namespace"
}) })
}) })
}, },
......
...@@ -327,7 +327,7 @@ export default { ...@@ -327,7 +327,7 @@ export default {
"description": this.clusterRoleForm.description "description": this.clusterRoleForm.description
}, },
labels: { labels: {
"kubeoperator.io/role-type": "cluster", "kubepi.org/role-type": "cluster",
} }
}, },
rules: [] rules: []
......
...@@ -315,7 +315,7 @@ export default { ...@@ -315,7 +315,7 @@ export default {
metadata: { metadata: {
name: this.clusterRoleForm.name, name: this.clusterRoleForm.name,
labels: { labels: {
"kubeoperator.io/role-type": "namespace", "kubepi.org/role-type": "namespace",
} }
}, },
rules: [] rules: []
......
Supports Markdown
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