forked from JointCloud/JCC-RIP
资源清单
This commit is contained in:
parent
942d49b2d2
commit
45e3ac9acd
|
@ -8,3 +8,11 @@ export function getClusterList(params) {
|
|||
params
|
||||
})
|
||||
}
|
||||
|
||||
// 资源清单
|
||||
export function getServerResources() {
|
||||
return request({
|
||||
url: '/jcc-schedule/api/v1/resource/getServerResources',
|
||||
method: 'get'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -84,6 +84,7 @@
|
|||
:data="paginationAuto ? (tableData.slice((page - 1) * 10, page * 10)) : tableData"
|
||||
v-bind="$attrs"
|
||||
:max-height="height"
|
||||
:border="border"
|
||||
:highlight-current-row="listColumns.length>0 && listColumns[0].type !== 'selection'"
|
||||
tooltip-effect="dark"
|
||||
style="width: 100%"
|
||||
|
@ -222,7 +223,11 @@ export default {
|
|||
height: {
|
||||
type: String,
|
||||
default: 'auto'
|
||||
} // 固定表头 表内高度
|
||||
}, // 固定表头 表内高度
|
||||
border: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
data() {
|
||||
const filterData = { ...this.defaultFilterData }
|
||||
|
|
|
@ -91,6 +91,11 @@ export const constantRoutes = [
|
|||
component: () => import('@/views/cluster/index'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/resourceList',
|
||||
component: () => import('@/views/cluster/resourceList'),
|
||||
hidden: true
|
||||
},
|
||||
{
|
||||
path: '/cluster/clusterMapViews',
|
||||
component: () => import('@/views/cluster/mapviews'),
|
||||
|
|
|
@ -7,6 +7,15 @@ import { filterSystem, filterFleetManaged } from '@/utils/data-process'
|
|||
|
||||
import { parseSi } from '@/utils'
|
||||
import { numberToStr } from '@/utils/data-process'
|
||||
import { getServerResources } from '@/api/container/cluster'
|
||||
|
||||
const getServerResourceData = (clusterName, params) => {
|
||||
return new Promise(function(resolve) {
|
||||
getServerResources(params).then(res => {
|
||||
resolve({ total: 0, rows: res.data })
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
const getProjectListFun = (clusterName, params) => {
|
||||
return new Promise(function(resolve) {
|
||||
|
@ -265,4 +274,4 @@ const getAllNamespace = () => {
|
|||
})
|
||||
}
|
||||
|
||||
export default { getNodeStatusList, getProjectListFun, getVirtualMachineList, getVirtualHostList, getDataVolumeList, getImagesList, getAllNamespace }
|
||||
export default { getServerResourceData, getNodeStatusList, getProjectListFun, getVirtualMachineList, getVirtualHostList, getDataVolumeList, getImagesList, getAllNamespace }
|
||||
|
|
|
@ -25,14 +25,15 @@
|
|||
<Earth ref="earthChart" :map-type="mapType" />
|
||||
</el-col>
|
||||
</el-row>
|
||||
<el-carousel height="120px" direction="vertical" :autoplay="true">
|
||||
<el-carousel-item>
|
||||
<Exhibition :data="exhibitionArray1" :span="8" class="exhibition" />
|
||||
</el-carousel-item>
|
||||
<!-- <el-carousel height="120px" direction="vertical" :autoplay="true">
|
||||
<el-carousel-item> -->
|
||||
<Exhibition :data="exhibitionArray1" :span="6" class="exhibition" />
|
||||
<!-- </el-carousel-item>
|
||||
<el-carousel-item>
|
||||
<Exhibition :data="exhibitionArray2" :span="8" class="exhibition" />
|
||||
</el-carousel-item>
|
||||
</el-carousel>
|
||||
</el-carousel> -->
|
||||
<el-button style="float: right; padding: 0 9px 18px" type="text" @click="toResourceList">更多</el-button>
|
||||
</el-card>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
|
@ -92,25 +93,25 @@ export default {
|
|||
name: '容器创建数量',
|
||||
src: 'dataIcon-3',
|
||||
value: '-'
|
||||
}
|
||||
],
|
||||
exhibitionArray2: [
|
||||
},
|
||||
{
|
||||
name: '纳管算力总计',
|
||||
src: 'dataIcon-3',
|
||||
value: '-'
|
||||
},
|
||||
{
|
||||
name: '峰值算力',
|
||||
src: 'dataIcon-3',
|
||||
value: '-'
|
||||
},
|
||||
{
|
||||
name: '当前运行算力',
|
||||
src: 'dataIcon-3',
|
||||
value: '-'
|
||||
}
|
||||
],
|
||||
// exhibitionArray2: [
|
||||
// {
|
||||
// name: '峰值算力',
|
||||
// src: 'dataIcon-3',
|
||||
// value: '-'
|
||||
// },
|
||||
// {
|
||||
// name: '当前运行算力',
|
||||
// src: 'dataIcon-3',
|
||||
// value: '-'
|
||||
// }
|
||||
// ],
|
||||
columns: [
|
||||
{ prop: 'ns_name', width: 100, label: '项目名称', formatter: (row) => { return (row.state === 'Active' ? <div><span class='round ' />{row.ns_name}</div> : <div><span class='round error' />{row.ns_name}</div>) } },
|
||||
{ prop: 'available_pod_num', width: 80, label: 'Pods', formatter: (row) => { return <span class='box'>{row.available_pod_num}</span> } },
|
||||
|
@ -140,6 +141,9 @@ export default {
|
|||
this.getResourceData()
|
||||
},
|
||||
methods: {
|
||||
toResourceList() {
|
||||
this.$router.push({ path: '/resourceList' })
|
||||
},
|
||||
toSelect() {
|
||||
this.$router.push({ path: '/clusterSelect' })
|
||||
},
|
||||
|
@ -221,9 +225,9 @@ export default {
|
|||
this.exhibitionArray1[2].value = e.data?.pod || '-'
|
||||
})
|
||||
getComputility().then(e => {
|
||||
this.exhibitionArray2[0].value = e.data?.all || '-'
|
||||
this.exhibitionArray2[1].value = e.data?.top || '-'
|
||||
this.exhibitionArray2[2].value = e.data?.now || '-'
|
||||
this.exhibitionArray1[3].value = e.data?.all || '-'
|
||||
// this.exhibitionArray2[1].value = e.data?.top || '-'
|
||||
// this.exhibitionArray2[2].value = e.data?.now || '-'
|
||||
})
|
||||
},
|
||||
// 获取地图的全量数据
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
<template>
|
||||
<div>
|
||||
<Navbar />
|
||||
<el-card>
|
||||
<el-page-header content="资源清单" @back="goBack" />
|
||||
<List
|
||||
ref="multipleTable"
|
||||
class="multipleTable"
|
||||
:columns="columns"
|
||||
:pagination="false"
|
||||
:border="true"
|
||||
func-name="getServerResourceData"
|
||||
/>
|
||||
</el-card>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import List from '@/components/list'
|
||||
import Navbar from '@/layout/components/Navbar'
|
||||
|
||||
export default {
|
||||
components: { List, Navbar },
|
||||
data() {
|
||||
return {
|
||||
columns: [
|
||||
{ prop: 'name', label: '资产名称' },
|
||||
{ prop: 'ip', label: 'ip' },
|
||||
{ prop: 'publicIp', label: '公网ip' },
|
||||
{ prop: 'hpcPartition', label: '超算队列' },
|
||||
{ prop: 'cpuName', label: 'cpu名称' },
|
||||
{ prop: 'cpuGHz', label: 'cpu单核主频' },
|
||||
{ prop: 'cpuCores', label: 'cpu单节点核心数' },
|
||||
{ prop: 'totalThreads', label: 'cpu单节点线程数' },
|
||||
{ prop: 'memory', label: '内存' },
|
||||
{ prop: 'gpuDcu', label: 'gpu或dcu名称' },
|
||||
{ prop: 'cpuSingleCycle', label: 'cpu单周期指令执行数' },
|
||||
{ prop: 'num', label: '节点数' },
|
||||
{ prop: 'cpuGFlops', label: 'cpu理论峰值/GFlops' },
|
||||
{ prop: 'gpuGFlops', label: 'gpu理论峰值/GFlops' },
|
||||
{ prop: 'region', label: '地域' },
|
||||
{ prop: 'flops', label: '理论峰值/GFlops' }
|
||||
]
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
this.$router.push('/cluster/clusterMapViews')
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
</script>
|
||||
|
||||
<style>
|
||||
|
||||
</style>
|
Loading…
Reference in New Issue