forked from JointCloud/JCC-RIP
fix merge conflict
This commit is contained in:
commit
3fadfaffcd
File diff suppressed because one or more lines are too long
|
@ -20,7 +20,7 @@ const permissionRouter = {
|
|||
path: 'warnStrategy',
|
||||
component: () => import('@/views/strategyManagement/warnSet/index'),
|
||||
name: 'warnStrategy',
|
||||
meta: { title: 'warnStrategy', icon: 'xunijiguanli-zhuji', affix: true },
|
||||
meta: { title: 'warnStrategy', icon: 'gaojing', affix: true },
|
||||
hidden: false
|
||||
}
|
||||
]
|
||||
|
|
|
@ -2,7 +2,6 @@ import { getClusterList } from '@/api/container/cluster'
|
|||
const state = {
|
||||
clusterName: '',
|
||||
clusterId: '',
|
||||
hasEdge: false,
|
||||
hasMonitor: false
|
||||
}
|
||||
|
||||
|
@ -15,10 +14,6 @@ const mutations = {
|
|||
state.clusterId = clusterId
|
||||
localStorage.setItem('clusterId', clusterId)
|
||||
},
|
||||
SET_EDGE: (state, hasEdge) => {
|
||||
state.hasEdge = hasEdge
|
||||
localStorage.setItem('edgeNodePage', hasEdge)
|
||||
},
|
||||
SET_MONITOR: (state, hasMonitor) => {
|
||||
state.hasMonitor = hasMonitor
|
||||
localStorage.setItem('monitorPage', hasMonitor)
|
||||
|
@ -34,15 +29,10 @@ const actions = {
|
|||
getClusterList({ commit }, data) {
|
||||
return getClusterList({ pageNum: 1, pageSize: 999 }).then(response => {
|
||||
const List = response.data.list.filter(e => e.cluster_name === state.clusterName)
|
||||
const hasEdge = List.length === 1 ? List[0].edge : false
|
||||
commit('SET_EDGE', hasEdge)
|
||||
const hasMonitor = List.length === 1 ? List[0].monitoring : false
|
||||
commit('SET_MONITOR', hasMonitor)
|
||||
})
|
||||
},
|
||||
setEdge({ commit }, data) {
|
||||
commit('SET_EDGE', data)
|
||||
},
|
||||
setMonitor({ commit }, data) {
|
||||
commit('SET_MONITOR', data)
|
||||
}
|
||||
|
|
|
@ -913,4 +913,8 @@ span.default {
|
|||
}
|
||||
.el-message-box__headerbtn {
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
.el-table__expand-icon {
|
||||
color: #FFFFFF;
|
||||
}
|
|
@ -22,12 +22,17 @@
|
|||
<el-input v-model="editInfoForm.name" :maxlength="63" />
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
prop="type"
|
||||
:label="$t('page.calculationType')"
|
||||
prop="bothType"
|
||||
:label="$t('page.resourceType')"
|
||||
>
|
||||
<el-radio v-model="editInfoForm.type" label="0">{{ $t('page.cloud') }}</el-radio>
|
||||
<el-radio v-model="editInfoForm.type" label="1">{{ $t('page.ai') }}</el-radio>
|
||||
<el-radio v-model="editInfoForm.type" label="2">{{ $t('page.hpc') }}</el-radio>
|
||||
<el-cascader
|
||||
ref="cascader"
|
||||
v-model="editInfoForm.bothType"
|
||||
style="width: 100%;"
|
||||
class="cascader-box"
|
||||
:options="dict.adapter_type"
|
||||
:props="{ value: 'itemValue', label: 'itemText', expandTrigger: 'hover' }"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
prop="nickname"
|
||||
|
@ -58,6 +63,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import { createAdapter, updateAdapter } from '@/api/pcm/adapter'
|
||||
import Driver from 'driver.js' // import driver.js
|
||||
import 'driver.js/dist/driver.min.css'
|
||||
|
@ -85,6 +91,7 @@ export default {
|
|||
editInfoForm: {
|
||||
name: '',
|
||||
type: '0',
|
||||
resourceType: '0',
|
||||
nickname: '',
|
||||
version: '',
|
||||
server: ''
|
||||
|
@ -92,9 +99,10 @@ export default {
|
|||
}
|
||||
},
|
||||
computed: {
|
||||
guideNum() {
|
||||
return localStorage.getItem('guideNum')
|
||||
},
|
||||
...mapGetters([
|
||||
'dict',
|
||||
'guideNum'
|
||||
]),
|
||||
createFormVisible: {
|
||||
get() {
|
||||
return this.value
|
||||
|
@ -114,6 +122,9 @@ export default {
|
|||
nickname: [
|
||||
{ required: true, message: this.$t('message.pleaseInput') }
|
||||
],
|
||||
bothType: [
|
||||
{ required: true, message: this.$t('message.pleaseChoose') }
|
||||
],
|
||||
version: [
|
||||
{ required: true, message: this.$t('message.pleaseInput') }
|
||||
],
|
||||
|
@ -126,6 +137,7 @@ export default {
|
|||
watch: {
|
||||
data(val) {
|
||||
this.editInfoForm = val
|
||||
this.editInfoForm.bothType = [val.type, val.resourceType]
|
||||
},
|
||||
createFormVisible(val) {
|
||||
if (val) {
|
||||
|
@ -141,7 +153,7 @@ export default {
|
|||
})
|
||||
}
|
||||
})
|
||||
if (!this.isEdit) { this.editInfoForm = { type: '0' } }
|
||||
if (!this.isEdit) { this.editInfoForm = { bothType: '0' } }
|
||||
}
|
||||
}
|
||||
},
|
||||
|
@ -160,14 +172,19 @@ export default {
|
|||
this.driver.reset()
|
||||
this.$refs.editInfoForm.validate((valid) => {
|
||||
if (valid) {
|
||||
const params = {
|
||||
...this.editInfoForm,
|
||||
type: this.editInfoForm.bothType[0],
|
||||
resourceType: this.editInfoForm.bothType[1]
|
||||
}
|
||||
if (this.isEdit) {
|
||||
updateAdapter(this.editInfoForm).then(res => {
|
||||
updateAdapter(params).then(res => {
|
||||
this.$message.success(this.$t('message.success'))
|
||||
this.createFormVisible = false
|
||||
this.$emit('getList')
|
||||
})
|
||||
} else {
|
||||
createAdapter(this.editInfoForm).then(res => {
|
||||
createAdapter(params).then(res => {
|
||||
this.$message.success(this.$t('message.success'))
|
||||
this.createFormVisible = false
|
||||
this.$store.dispatch('user/setGuideNum', 1)
|
||||
|
|
|
@ -61,6 +61,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
import { mapGetters } from 'vuex'
|
||||
import List from '@/components/list'
|
||||
import CreateAdapter from './components/CreateAdapter'
|
||||
import CreateCluster from './components/CreateCluster'
|
||||
|
@ -89,8 +90,20 @@ export default {
|
|||
}
|
||||
},
|
||||
computed: {
|
||||
guideNum() {
|
||||
return localStorage.getItem('guideNum')
|
||||
...mapGetters([
|
||||
'dict',
|
||||
'guideNum'
|
||||
]),
|
||||
resourceList() {
|
||||
const obj = {}
|
||||
this.dict.adapter_type.forEach(e => {
|
||||
if (e.children) {
|
||||
e.children.forEach(i => {
|
||||
obj[i.itemValue] = i.itemText
|
||||
})
|
||||
}
|
||||
})
|
||||
return obj
|
||||
},
|
||||
filterMap() {
|
||||
return {
|
||||
|
@ -104,6 +117,7 @@ export default {
|
|||
{ prop: 'name', label: this.$t('page.participantName') },
|
||||
{ prop: 'id', label: 'ID' },
|
||||
{ prop: 'type', label: this.$t('page.calculationType'), formatter: (row) => this.typeList[row.type] },
|
||||
{ prop: 'resourceType', label: this.$t('page.resourceType'), formatter: (row) => this.resourceList[row.resourceType] || '' },
|
||||
{ prop: 'nickname', label: this.$t('page.stackName') },
|
||||
{ prop: 'version', label: this.$t('page.stackVersion') },
|
||||
{ prop: 'server', label: this.$t('page.address') },
|
||||
|
@ -149,13 +163,6 @@ export default {
|
|||
this.driver = new Driver({
|
||||
allowClose: false
|
||||
})
|
||||
// if (true) { // set
|
||||
// this.$nextTick(() => {
|
||||
// console.log(this.$refs.multipleTable0.tableData)
|
||||
|
||||
// })
|
||||
// }
|
||||
// this.tabSwitch()
|
||||
},
|
||||
methods: {
|
||||
switchTab() {
|
||||
|
@ -195,13 +202,6 @@ export default {
|
|||
this.driver.defineSteps(steps)
|
||||
this.driver.start()
|
||||
},
|
||||
// tabSwitch() {
|
||||
// if (this.activeName === '0') {
|
||||
// getAdapterList().then(e => (this.num = e.data?.list?.length || 0))
|
||||
// } else if (this.activeName === '1') {
|
||||
// getAdapterRelation().then(e => (this.num = e.data?.list?.length || 0))
|
||||
// }
|
||||
// },
|
||||
addFun(type) {
|
||||
this.driver.moveNext()
|
||||
this.isEdit = false
|
||||
|
@ -229,7 +229,6 @@ export default {
|
|||
deleteAdapter(id).then(e => {
|
||||
if (e.code === 200) {
|
||||
this.$message.success(this.$t('page.deleteSuccess'))
|
||||
// this.tabSwitch()
|
||||
this.$refs.multipleTable0.getList()
|
||||
} else {
|
||||
this.$message.error(e.msg)
|
||||
|
@ -239,7 +238,6 @@ export default {
|
|||
deleteCluster(id).then(e => {
|
||||
if (e.code === 200) {
|
||||
this.$message.success(this.$t('page.deleteSuccess'))
|
||||
// this.tabSwitch()
|
||||
this.$refs.multipleTable1.getList()
|
||||
} else {
|
||||
this.$message.error(e.msg)
|
||||
|
|
|
@ -51,7 +51,7 @@
|
|||
class="multipleTable"
|
||||
:columns="kubeColumns"
|
||||
:pagination="true"
|
||||
:query="{'type': '0'}"
|
||||
:query="{'type': '0', 'resourceType': '01'}"
|
||||
page-key="pageNum"
|
||||
limit-key="pageSize"
|
||||
:get-list-action="getClusterList"
|
||||
|
@ -66,7 +66,7 @@
|
|||
class="multipleTable"
|
||||
:columns="openColumns"
|
||||
:pagination="true"
|
||||
:query="{'type': '3'}"
|
||||
:query="{'type': '0', 'resourceType': '02'}"
|
||||
page-key="pageNum"
|
||||
limit-key="pageSize"
|
||||
:get-list-action="getClusterList"
|
||||
|
@ -123,7 +123,7 @@ export default {
|
|||
setColumn(type) {
|
||||
return [
|
||||
{ prop: 'name', label: this.$t('page.clusterName'), formatter: (row) => { return <a onClick={() => this.selectCluster(row)}>{row.name}</a> } },
|
||||
{ prop: 'label', label: this.$t('page.classification'), formatter: (row) => { return row.label === 'openstack' ? this.$t('page.vmCluster') : this.$t('page.containerCluster') } },
|
||||
{ prop: 'label', label: this.$t('page.classification'), formatter: (row) => { return row.label === 'kubernetes' ? this.$t('page.containerCluster') : this.$t('page.vmCluster') } },
|
||||
{ prop: 'description', label: this.$t('page.description') },
|
||||
{ prop: 'version', label: type === 'open' ? this.$t('page.openVersion') : this.$t('page.kbVersion') },
|
||||
{ prop: 'region', label: this.$t('page.region'), formatter: (row) => { return this.getRegion(row) } },
|
||||
|
@ -158,8 +158,6 @@ export default {
|
|||
this.$store.dispatch('user/setRouteType', row.label === 'openstack' ? 'virtual' : 'cluster')
|
||||
this.$store.dispatch('cluster/setCluster', row.name)
|
||||
this.$store.dispatch('cluster/setClusterId', row.id)
|
||||
// edge node
|
||||
// this.$store.dispatch('cluster/setEdge', row.edge)
|
||||
this.$store.dispatch('cluster/setMonitor', row.monitoring)
|
||||
|
||||
// Jump to container overview or virtual machine overview based on cluster type
|
||||
|
|
|
@ -81,7 +81,6 @@ export default {
|
|||
// set cluster
|
||||
this.$store.dispatch('user/setRouteType', 'cluster')
|
||||
this.$store.dispatch('cluster/setCluster', row.cluster_name)
|
||||
this.$store.dispatch('cluster/setEdge', row.edge)
|
||||
this.$store.dispatch('cluster/setMonitor', row.monitoring)
|
||||
this.$router.push({ name: `${localStorage.getItem('monitorPage') === 'false' ? 'NodeManagement' : 'clusterOverview'}`, params: { 'clusterName': row.cluster_name }})
|
||||
},
|
||||
|
|
|
@ -168,7 +168,6 @@ export default {
|
|||
// set cluster
|
||||
this.$store.dispatch('user/setRouteType', 'cluster')
|
||||
this.$store.dispatch('cluster/setCluster', row.cluster_name)
|
||||
this.$store.dispatch('cluster/setEdge', row.edge)
|
||||
this.$store.dispatch('cluster/setMonitor', row.monitoring)
|
||||
this.$router.push({ name: `${localStorage.getItem('monitorPage') === 'false' ? 'NodeManagement' : 'clusterOverview'}`, params: { 'clusterName': row.cluster_name }})
|
||||
},
|
||||
|
|
|
@ -48,14 +48,14 @@
|
|||
v-if="selectedDict"
|
||||
ref="multipleTable"
|
||||
:key="$i18n.locale && selectedDict"
|
||||
row-key="itemValue"
|
||||
class="multipleTable"
|
||||
:columns="columns"
|
||||
:get-list-action="getDictItems"
|
||||
:pagination="true"
|
||||
:pagination-auto="true"
|
||||
:default-filter-data="{'dictId': selectedDict}"
|
||||
list-key="list"
|
||||
page-key="pageNum"
|
||||
limit-key="pageSize"
|
||||
tooltip-effect="dark"
|
||||
/>
|
||||
</el-card>
|
||||
|
@ -110,6 +110,22 @@
|
|||
</el-dialog>
|
||||
<el-dialog v-if="dialogItemFormVisible" :close-on-click-modal="false" :title="(isEditItem?$t('page.edit'):$t('page.add'))+$t('page.dictItem')" :visible.sync="dialogItemFormVisible">
|
||||
<el-form ref="editItemForm" label-width="auto" :model="editItemForm">
|
||||
<el-form-item
|
||||
prop="fatherNode"
|
||||
:label="$t('permission.fatherNode')"
|
||||
>
|
||||
<el-cascader
|
||||
ref="cascader"
|
||||
v-model="editItemForm.fatherNode"
|
||||
style="width: 100%;"
|
||||
class="cascader-box"
|
||||
:options="dictItemList"
|
||||
:props="{ value: 'id', label: 'itemText', checkStrictly: true, expandTrigger: 'hover' }"
|
||||
:show-all-levels="false"
|
||||
clearable
|
||||
@change="handleCascader"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
prop="itemText"
|
||||
:label="$t('page.dictItem')"
|
||||
|
@ -182,7 +198,8 @@ export default {
|
|||
isEditItem: false,
|
||||
dialogItemFormVisible: false,
|
||||
editItemForm: {},
|
||||
labelWidth: ''
|
||||
labelWidth: '',
|
||||
dictItemList: []
|
||||
// columns: []
|
||||
}
|
||||
},
|
||||
|
@ -203,6 +220,11 @@ export default {
|
|||
// console.log('fff')
|
||||
// this.setColumn()
|
||||
// }
|
||||
selectedDict(val) {
|
||||
getDictItems({ page: 1, limit: 10, dictId: val }).then(res => {
|
||||
this.dictItemList = res.data.list
|
||||
})
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
// this.setColumn()
|
||||
|
@ -210,6 +232,9 @@ export default {
|
|||
this.labelWidth = Math.round(document.body.offsetHeight / 1048 * 100) + 'px'
|
||||
},
|
||||
methods: {
|
||||
handleCascader(val) {
|
||||
this.editItemForm.parentId = val[0]
|
||||
},
|
||||
getList() {
|
||||
getDictList({ pageSize: 1000, pageNum: 1 }).then(e => {
|
||||
this.dictionaryData = e.data.list
|
||||
|
@ -218,8 +243,8 @@ export default {
|
|||
},
|
||||
setColumn() {
|
||||
return [
|
||||
{ prop: 'itemText', label: this.$t('page.showValue'), sortable: true },
|
||||
{ prop: 'itemValue', label: this.$t('page.dictValue'), width: 80 },
|
||||
{ prop: 'itemText', label: this.$t('page.showValue'), sortable: true },
|
||||
{ prop: 'description', label: this.$t('page.description') },
|
||||
{ prop: 'status', label: this.$t('page.status'), formatter: row => { return <div>{row.type === '0' ? this.$t('page.unAvailable') : this.$t('page.available')}</div> } },
|
||||
{ prop: 'type', label: this.$t('page.type'), formatter: row => { return <div>{row.type === '0' ? this.$t('page.character') : this.$t('page.number')}</div> } },
|
||||
|
@ -296,6 +321,7 @@ export default {
|
|||
editItem(item) {
|
||||
this.isEditItem = true
|
||||
this.editItemForm = item
|
||||
this.editItemForm.fatherNode = [item.parentId]
|
||||
this.dialogItemFormVisible = true
|
||||
},
|
||||
deleteItem(item) {
|
||||
|
|
|
@ -391,7 +391,7 @@ export default {
|
|||
},
|
||||
methods: {
|
||||
getCluster() {
|
||||
const query = { 'type': this.taskType === 'application' ? '0' : (this.taskType === 'aiBase' || this.taskType === 'aiCard') ? '1' : this.taskType === 'hpcBase' ? '2' : '3', 'adapterId': this.formData.adapterId, pageNum: 1, pageSize: 1000 }
|
||||
const query = { 'type': this.taskType === 'application' ? '0' : (this.taskType === 'aiBase' || this.taskType === 'aiCard') ? '1' : this.taskType === 'hpcBase' ? '2' : '0', 'adapterId': this.formData.adapterId, pageNum: 1, pageSize: 1000 }
|
||||
this.getClusterList(query).then(e => {
|
||||
this.currentClusterList = e.data.list || []
|
||||
})
|
||||
|
|
Loading…
Reference in New Issue