pcm对接

This commit is contained in:
jhnine 2022-12-02 17:52:19 +08:00
parent 91c09b5d2e
commit ef73f86835
3 changed files with 90 additions and 57 deletions

View File

@ -18,20 +18,18 @@ export function getDataList1(params) {
})
}
// 获取作业列表
export function getDataList2(params) {
// 获取运行中作业列表
export function getListJobs() {
return request({
url: '/jcc-schedule/api/v1/resource/getServerResources',
method: 'get',
params
url: '/apis/slurm/listJobs',
method: 'get'
})
}
// 获取资源利用率情况
export function getDataList3(params) {
// 获取历史作业列表
export function getListDbJobs() {
return request({
url: '/jcc-schedule/api/v1/resource/getServerResources',
method: 'get',
params
url: '/apis/slurm/listDbJobs',
method: 'get'
})
}

View File

@ -35,15 +35,15 @@
</el-row>
<el-row>
<el-col :span="12">
<el-card>
<el-card class="list-card">
<div slot="header" class="clearfix">
<span>作业</span>
<span>运行中作业</span>
</div>
<List
ref="multipleTable"
class="multipleTable"
:columns="taskColumns"
height="315"
height="250"
:table-list-data="taskList"
:pagination="false"
/>
@ -51,11 +51,19 @@
</el-col>
<el-col :span="12">
<el-col :span="24">
<el-card>
<el-card class="list-card">
<div slot="header" class="clearfix">
<span>资源</span>
<span>历史作业</span>
</div>
<el-row class="resource">
<List
ref="multipleTable"
class="multipleTable"
:columns="taskDBColumns"
height="250"
:table-list-data="taskDBList"
:pagination="false"
/>
<!-- <el-row class="resource">
<el-col :span="12">
<div>CPU <span class="impact num">{{ resource.cpu.core }}</span> </div>
<div class="money">
@ -86,7 +94,7 @@
<p>{{ resource.gpu.percent }}%</p>
<span class="tips">过去24小时利用率</span>
</el-col>
</el-row>
</el-row> -->
</el-card>
</el-col>
</el-col>
@ -98,7 +106,7 @@
import List from '@/components/list'
import Exhibition from '@/components/Exhibition'
import BarChart from './components/barChart.vue'
// import { getDataList0, getDataList1, getDataList2, getDataList3 } from '@/api/hpc/hpcManagement'
import { getListJobs, getListDbJobs } from '@/api/hpc/hpcManagement'
export default {
components: {
@ -130,6 +138,7 @@ export default {
}],
chooseRow: [],
taskList: [],
taskDBList: [],
exhibitionArray: [
{ name: '高性能计算域合计', src: 'hpc-1', value: '0' },
{ name: '已适配异构软件栈', src: 'blockChainBrowser-4', value: '0' },
@ -144,8 +153,17 @@ export default {
],
taskColumns: [
{ prop: 'name', label: '作业名称' },
{ prop: 'status', label: '运行状态' },
{ prop: 'detail', label: '作业详情' }
{ prop: 'StateOfJob', label: '作业状态' },
{ prop: 'JobRunTime', label: '作业运行时长' },
{ prop: 'JobStartTime', label: '作业开始时间' },
{ prop: 'slurmVersion', label: '作业所在域' }
],
taskDBColumns: [
{ prop: 'jobname', label: '作业名称' },
{ prop: 'StateOfJob', label: '作业状态' },
{ prop: 'JobRunTime', label: '作业运行时长' },
{ prop: 'JobStartTime', label: '作业开始时间' },
{ prop: 'slurmVersion', label: '作业所在域' }
]
}
},
@ -162,41 +180,44 @@ export default {
detail: 11
}]
// Promise.all([
// getDataList0(),
// getDataList1(),
// getDataList2()
// ]).then(res => {
// const topData = res[0]
// this.exhibitionArray[0].value = topData.aaa
// this.exhibitionArray[1].value = topData.bbb
// this.exhibitionArray[2].value = topData.ccc
Promise.all([
getListJobs(),
getListDbJobs()
]).then(res => {
this.taskList = res[0]?.jobInfos || []
// const domainData = res[1].data
// this.domainList = domainData || []
this.clickLeft([{
name: '11',
version: 11,
num: 11,
task: 11
}])
this.taskDBList = res[1]?.jobInfoDbs || []
// const resourceData = res[1].data
// this.resource = {
// cpu: {
// cpu: 0,
// ram: 0,
// core: 0,
// percent: 100
// },
// gpu: {
// cpu: 0,
// ram: 0,
// core: 0,
// percent: 100
// }
// }
// })
// const topData = res[0]
// this.exhibitionArray[0].value = topData.aaa
// this.exhibitionArray[1].value = topData.bbb
// this.exhibitionArray[2].value = topData.ccc
// const domainData = res[1].data
// this.domainList = domainData || []
// this.clickLeft([{
// name: '11',
// version: 11,
// num: 11,
// task: 11
// }])
// const resourceData = res[1].data
// this.resource = {
// cpu: {
// cpu: 0,
// ram: 0,
// core: 0,
// percent: 100
// },
// gpu: {
// cpu: 0,
// ram: 0,
// core: 0,
// percent: 100
// }
// }
})
},
clickLeft(row) {
this.chooseRow = row
@ -253,6 +274,11 @@ export default {
.list-btns {
display: none;
}
.list-card{
.el-card__body{
height: 300px;
}
}
}
</style>

View File

@ -60,7 +60,15 @@ module.exports = {
},
'^/jcc-': {
ws: false,
target: 'https://10.101.15.6/apis', /* 测试环境 */
// target: 'https://10.101.15.6/apis', /* 测试环境 */
target: 'https://jointcloud.net/apis', /* 演示环境 */
changeOrigin: true,
secure: false
},
'/apis': {
ws: false,
// target: 'https://10.101.15.6/apis', /* 测试环境 */
target: 'http://192.168.249.113:8880', /* 演示环境 */
changeOrigin: true,
secure: false
},
@ -72,13 +80,14 @@ module.exports = {
// },
'/monitoringscreen/': {
ws: false,
target: 'https://10.101.15.6/apis',
// target: 'https://10.101.15.6/apis',
target: 'https://jointcloud.net/apis', /* 演示环境 */
changeOrigin: true
},
'^/edgex': {
ws: false,
target: 'https://10.101.15.6/' /* 测试环境 */
// target: 'https://jointcloud.net/prod-api/' /* 演示环境 */
// target: 'https://10.101.15.6/' /* 测试环境 */
target: 'https://jointcloud.net/prod-api/' /* 演示环境 */
}
}
// before: require('./mock/mock-server.js')