@ -18,7 +18,7 @@
< block -box >
< block -box >
< ul class = "card-gauges" >
< ul class = "card-gauges" >
< li v-for ="(item, index) in gaugeConfig " :key ="index" >
< li v-for ="(item, index) in gaugeConfig .slice(-3) " :key ="index" >
< template v-if ="!detail.isExternal || index >= 2" >
< template v-if ="!detail.isExternal || index >= 2" >
< Gauge v -bind = " item " / >
< Gauge v -bind = " item " / >
< / template >
< / template >
@ -39,14 +39,11 @@
< time -picker v -model = " times " type = "datetimerange" size = "small" / >
< time -picker v -model = " times " type = "datetimerange" size = "small" / >
< / template >
< / template >
< div style = "height: 200px" >
< div style = "height: 200px" >
< echarts -plus
< echarts -plus : options = " getRangeOptions ( {
: options = "
core : gaugeConfig [ 0 ] . data ,
getRangeOptions ( {
memory : gaugeConfig [ 1 ] . data ,
core : gaugeConfig [ 0 ] . data ,
} )
memory : gaugeConfig [ 1 ] . data ,
" / >
} )
"
/ >
< / div >
< / div >
< / b l o c k - b o x >
< / b l o c k - b o x >
< block -box title = "资源使用趋势(%) " >
< block -box title = "资源使用趋势(%) " >
@ -54,14 +51,11 @@
< time -picker v -model = " times " type = "datetimerange" size = "small" / >
< time -picker v -model = " times " type = "datetimerange" size = "small" / >
< / template >
< / template >
< div style = "height: 200px" >
< div style = "height: 200px" >
< echarts -plus
< echarts -plus : options = " getRangeOptions ( {
: options = "
core : gaugeConfig [ 2 ] . data ,
getRangeOptions ( {
memory : gaugeConfig [ 3 ] . data ,
core : gaugeConfig [ 2 ] . data ,
} )
memory : gaugeConfig [ 3 ] . data ,
" / >
} )
"
/ >
< / div >
< / div >
< / b l o c k - b o x >
< / b l o c k - b o x >
@ -93,7 +87,7 @@ import { useRoute } from 'vue-router';
import BlockBox from '@/components/BlockBox.vue' ;
import BlockBox from '@/components/BlockBox.vue' ;
import { onMounted , ref , watch , defineProps } from 'vue' ;
import { onMounted , ref , watch , defineProps } from 'vue' ;
import TaskList from '~/vgpu/views/task/admin/index.vue' ;
import TaskList from '~/vgpu/views/task/admin/index.vue' ;
import { ElPopover } from 'element-plus' ;
import { ElPopover } from 'element-plus' ;
import Gauge from '~/vgpu/components/gauge.vue' ;
import Gauge from '~/vgpu/components/gauge.vue' ;
import useInstantVector from '~/vgpu/hooks/useInstantVector' ;
import useInstantVector from '~/vgpu/hooks/useInstantVector' ;
import { QuestionFilled } from '@element-plus/icons-vue' ;
import { QuestionFilled } from '@element-plus/icons-vue' ;
@ -134,36 +128,36 @@ const columns = [
const text = health ? '健康' : '硬件错误' ;
const text = health ? '健康' : '硬件错误' ;
const color = health ? '#2563eb' : '#EF4444' ;
const color = health ? '#2563eb' : '#EF4444' ;
return (
return (
< div
< div
style = { {
style = { {
color ,
color ,
position : 'relative' ,
position : 'relative' ,
display : 'inline-flex' ,
display : 'inline-flex' ,
alignItems : 'center' ,
alignItems : 'center' ,
justifyContent : 'center' ,
justifyContent : 'center' ,
gap : '5px' ,
gap : '5px' ,
} }
>
< el -tag disable -transitions type = { isExternal ? 'warning' : ( health ? 'success' : 'danger' ) } >
{ isExternal ? '未纳管' : ( health ? '健康' : '硬件错误' ) }
< / e l - t a g >
{ ! health && (
< ElPopover trigger = "hover" popper -style = {{ width : ' 190px ' }} >
{ {
reference : ( ) => (
< el -icon color = "#939EA9" size = "14" >
< QuestionFilled / >
< / e l - i c o n >
) ,
default : ( ) => (
< span style = { { marginLeft : '5px' } } >
请排查该 GPU 硬件问题
< / span >
) ,
} }
} }
>
< / ElPopover >
< el -tag disable -transitions type = { isExternal ? 'warning' : ( health ? 'success' : 'danger' ) } >
) }
{ isExternal ? '未纳管' : ( health ? '健康' : '硬件错误' ) }
< / div >
< / e l - t a g >
{ ! health && (
< ElPopover trigger = "hover" popper -style = {{ width : ' 190px ' }} >
{ {
reference : ( ) => (
< el -icon color = "#939EA9" size = "14" >
< QuestionFilled / >
< / e l - i c o n >
) ,
default : ( ) => (
< span style = { { marginLeft : '5px' } } >
请排查该 GPU 硬件问题
< / span >
) ,
} }
< / ElPopover >
) }
< / div >
) ;
) ;
} else {
} else {
return < el -tag disable -transitions size = "small" type = "info" > 加载中 ... < / e l - t a g > ;
return < el -tag disable -transitions size = "small" type = "info" > 加载中 ... < / e l - t a g > ;
@ -201,9 +195,9 @@ const columns = [
width : 120 ,
width : 120 ,
value : 'mode' ,
value : 'mode' ,
render : ( { mode , type } ) => (
render : ( { mode , type } ) => (
< el -tag disable -transitions >
< el -tag disable -transitions >
{ type ? . split ( '-' ) [ 0 ] === "NVIDIA" ? mode : 'default' }
{ type ? . split ( '-' ) [ 0 ] === "NVIDIA" ? mode : 'default' }
< / e l - t a g >
< / e l - t a g >
)
)
}
}
] ;
] ;
@ -362,9 +356,11 @@ watch(
/ / l i n e - h e i g h t : 2 0 p x ;
/ / l i n e - h e i g h t : 2 0 p x ;
margin - bottom : 20 px ;
margin - bottom : 20 px ;
}
}
. card - detail - left {
. card - detail - left {
min - width : 1050 px ;
min - width : 1050 px ;
}
}
. card - detail - info {
. card - detail - info {
/ / d i s p l a y : f l e x ;
/ / d i s p l a y : f l e x ;
/ / f l e x - d i r e c t i o n : c o l u m n ;
/ / f l e x - d i r e c t i o n : c o l u m n ;
@ -393,6 +389,7 @@ watch(
list - style : none ;
list - style : none ;
display : flex ;
display : flex ;
height : 200 px ;
height : 200 px ;
li {
li {
flex : 1 ;
flex : 1 ;
}
}
@ -407,6 +404,7 @@ watch(
. node - block {
. node - block {
display : flex ;
display : flex ;
flex - direction : column ;
flex - direction : column ;
. home - block - content {
. home - block - content {
flex : 1 ;
flex : 1 ;
}
}