forked from JointCloud/JCC-RIP
temp
This commit is contained in:
parent
3c99e55a1a
commit
79bba963fd
|
@ -0,0 +1,8 @@
|
|||
import request from '@/utils/request'
|
||||
|
||||
export function getProjectDetails(customurl) {
|
||||
return request({
|
||||
url: 'api/v1/namespaces/' + customurl,
|
||||
method: 'get'
|
||||
})
|
||||
}
|
|
@ -15,38 +15,25 @@
|
|||
|
||||
<script>
|
||||
import { FormData } from '@/components/FormData'
|
||||
import { getProjectDetails } from '@/api/second-class-page/projectInfo'
|
||||
// import path from 'path'
|
||||
export default {
|
||||
components: { FormData },
|
||||
data() {
|
||||
return {
|
||||
formData: {
|
||||
status: '运行中',
|
||||
ip: '192.168.0.227',
|
||||
dispatch: 'false',
|
||||
character: '-',
|
||||
os: 'Ubuntu 20.04.1 LTS',
|
||||
osType: 'linux',
|
||||
core: '5.4.0-58-generic',
|
||||
pod: 'docker://20.10.5',
|
||||
kubelet: 'v1.18.17',
|
||||
proxy: 'v1.18.17',
|
||||
structure: 'amd64',
|
||||
createTime: '2021-04-12 13:56:47'
|
||||
status: '异常中',
|
||||
cluster: 'default',
|
||||
workspace: '-',
|
||||
createTime: '-',
|
||||
creator: '-'
|
||||
},
|
||||
dataMap: {
|
||||
status: '状态',
|
||||
ip: 'IP',
|
||||
dispatch: '无法调度',
|
||||
character: '角色',
|
||||
os: '操作系统',
|
||||
osType: '操作系统类型',
|
||||
core: '内核版本',
|
||||
pod: '容器版本',
|
||||
kubelet: 'Kubelet 版本',
|
||||
proxy: 'Kube-Proxy 版本',
|
||||
structure: '系统架构',
|
||||
createTime: '创建时间'
|
||||
cluster: '集群',
|
||||
workspace: '企业空间',
|
||||
createTime: '创建时间',
|
||||
creator: '创建者'
|
||||
},
|
||||
activeName: '',
|
||||
tabList: {
|
||||
|
@ -62,6 +49,9 @@ export default {
|
|||
}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getFormData()
|
||||
},
|
||||
methods: {
|
||||
goBack() {
|
||||
this.$router.push({ path: '/' + this.$route.path.split('/')[1] + '/' + this.$route.path.split('/')[2] })
|
||||
|
@ -71,6 +61,24 @@ export default {
|
|||
if (this.$route.path.indexOf(tab) === -1) {
|
||||
this.$router.push(tab)
|
||||
}
|
||||
},
|
||||
getFormData() {
|
||||
const customurl = this.$route.path.split('/')[3]
|
||||
console.log(customurl)
|
||||
getProjectDetails(customurl).then(res => {
|
||||
this.formData.status = (res.status.phase === 'Active') ? '运行中' : '异常中'
|
||||
this.formData.workspace = (res.metadata.labels['kubesphere.io/workspace'] != null) ? res.metadata.labels['kubesphere.io/workspace'] : '-'
|
||||
// this.formData.character = this.getRoles(res.metadata.labels) || '-'
|
||||
// this.formData.os = res.status.nodeInfo.osImage
|
||||
// this.formData.osType = res.status.nodeInfo.operatingSystem
|
||||
// this.formData.core = res.status.nodeInfo.kernelVersion
|
||||
// this.formData.pod = res.status.nodeInfo.containerRuntimeVersion
|
||||
// this.formData.kubelet = res.status.nodeInfo.kubeletVersion
|
||||
// this.formData.proxy = res.status.nodeInfo.kubeProxyVersion
|
||||
// this.formData.structure = res.status.nodeInfo.architecture
|
||||
// this.formData.createTime = res.metadata.creationTimestamp
|
||||
console.log(res)
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,23 +1,14 @@
|
|||
<template>
|
||||
<div>
|
||||
<h5>
|
||||
资源使用状态
|
||||
资源状态
|
||||
</h5>
|
||||
<FormData :column="4" :data="formData" :data-map="dataMap" />
|
||||
<div id="lineChart" ref="lineChart" />
|
||||
<h5>
|
||||
已分配资源
|
||||
</h5>
|
||||
<FormData :column="4" :data="formData1" :data-map="dataMap1" />
|
||||
<h5>健康状态</h5>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { FormData } from '@/components/FormData'
|
||||
import * as echarts from 'echarts'
|
||||
export default {
|
||||
components: { FormData },
|
||||
data() {
|
||||
return {
|
||||
dataMap: {
|
||||
|
|
|
@ -1,6 +1,8 @@
|
|||
<template>
|
||||
<div>
|
||||
ddd
|
||||
<h5>
|
||||
容器组
|
||||
</h5>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
|
|
|
@ -56,6 +56,13 @@ module.exports = {
|
|||
pathRewrite: {
|
||||
'^/prom': ''
|
||||
}
|
||||
},
|
||||
'/api': {
|
||||
ws: false,
|
||||
// target: 'http://192.168.0.243:30881/'
|
||||
// target: 'http://124.71.196.205:30881/'
|
||||
target: 'http://119.3.157.144:30881/',
|
||||
// changeOrigin: true,
|
||||
}
|
||||
},
|
||||
// before: require('./mock/mock-server.js')
|
||||
|
|
Loading…
Reference in New Issue