|
|
|
@ -58,7 +58,7 @@
|
|
|
|
|
|
|
|
|
|
<script setup lang="jsx">
|
|
|
|
|
import BackHeader from '@/components/BackHeader.vue';
|
|
|
|
|
import {useRoute, useRouter} from 'vue-router';
|
|
|
|
|
import { useRoute, useRouter } from 'vue-router';
|
|
|
|
|
import { onMounted, ref, watch, watchEffect } from 'vue';
|
|
|
|
|
|
|
|
|
|
import useInstantVector from '~/vgpu/hooks/useInstantVector';
|
|
|
|
@ -236,6 +236,16 @@ const lineConfig = ref([
|
|
|
|
|
query: `avg(sum(hami_container_memory_util{container_name=~"$container",pod_name=~"$pod",namespace_name="$namespace"}) by (instance))`,
|
|
|
|
|
data: [],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: 'CPU使用趋势(%)',
|
|
|
|
|
query: `100 * (1 - avg by(instance)(irate(node_cpu_seconds_total{mode="idle", instance=~"$node"}[1m])))`,
|
|
|
|
|
data: [],
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
title: '内存使用趋势(%)',
|
|
|
|
|
query: `100 * (1 - node_memory_MemAvailable_bytes{instance=~"$node"} / node_memory_MemTotal_bytes{instance=~"$node"})`,
|
|
|
|
|
data: [],
|
|
|
|
|
},
|
|
|
|
|
]);
|
|
|
|
|
|
|
|
|
|
const fetchLineData = async () => {
|
|
|
|
@ -251,7 +261,8 @@ const fetchLineData = async () => {
|
|
|
|
|
query: item.query
|
|
|
|
|
.replaceAll(`$container`, detail.value.name)
|
|
|
|
|
.replaceAll(`$namespace`, detail.value.namespace)
|
|
|
|
|
.replaceAll(`$pod`, detail.value.appName),
|
|
|
|
|
.replaceAll(`$pod`, detail.value.appName)
|
|
|
|
|
.replaceAll(`$node`, detail.value.nodeName),
|
|
|
|
|
})
|
|
|
|
|
.then((res) => {
|
|
|
|
|
lineConfig.value[index].data = res.data[0]?.values || [];
|
|
|
|
@ -270,7 +281,7 @@ watch(times, () => {
|
|
|
|
|
onMounted(async () => {
|
|
|
|
|
const { name, podUid } = route.query;
|
|
|
|
|
detail.value = await taskApi.getTaskDetail({ name, podUid });
|
|
|
|
|
const cards = await cardApi.getCardListReq({filters: {}});
|
|
|
|
|
const cards = await cardApi.getCardListReq({ filters: {} });
|
|
|
|
|
const foundCard = cards.list.find((item) => item.uuid === detail.value.deviceIds[0]);
|
|
|
|
|
if (foundCard) {
|
|
|
|
|
detail.value.type = foundCard.type;
|
|
|
|
@ -305,6 +316,7 @@ onMounted(async () => {
|
|
|
|
|
.task-detail {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(2, 1fr);
|
|
|
|
|
|
|
|
|
|
.right {
|
|
|
|
|
display: grid;
|
|
|
|
|
grid-template-columns: repeat(2, 1fr);
|
|
|
|
|