mirror of
https://github.com/1Panel-dev/KubePi.git
synced 2026-04-22 16:27:10 +08:00
fix(label): 标签修改、集群成员创建样式优化
This commit is contained in:
@@ -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)) {
|
||||
|
||||
@@ -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>
|
||||
@@ -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"
|
||||
@@ -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>
|
||||
@@ -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"
|
||||
})
|
||||
})
|
||||
},
|
||||
|
||||
@@ -327,7 +327,7 @@ export default {
|
||||
"description": this.clusterRoleForm.description
|
||||
},
|
||||
labels: {
|
||||
"kubeoperator.io/role-type": "cluster",
|
||||
"kubepi.org/role-type": "cluster",
|
||||
}
|
||||
},
|
||||
rules: []
|
||||
|
||||
@@ -315,7 +315,7 @@ export default {
|
||||
metadata: {
|
||||
name: this.clusterRoleForm.name,
|
||||
labels: {
|
||||
"kubeoperator.io/role-type": "namespace",
|
||||
"kubepi.org/role-type": "namespace",
|
||||
}
|
||||
},
|
||||
rules: []
|
||||
|
||||
Reference in New Issue
Block a user