This commit is contained in:
@@ -1,11 +1,13 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-row v-if="this.formState.ready">
|
<v-row v-if="this.formState.ready">
|
||||||
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
<gz-error :errorBoxMessage="formState.errorBoxMessage"></gz-error>
|
||||||
<!-- <v-col>
|
|
||||||
{{ obj }}
|
<v-col cols="12">
|
||||||
</v-col> -->
|
<gz-chart-line :chartdata="cpuChartData" :options="chartOptions" />
|
||||||
<v-col>
|
</v-col>
|
||||||
<gz-chart-line :chartdata="chartData" :options="chartOptions" />
|
|
||||||
|
<v-col cols="12">
|
||||||
|
<gz-chart-line :chartdata="memChartData" :options="chartOptions" />
|
||||||
</v-col>
|
</v-col>
|
||||||
</v-row>
|
</v-row>
|
||||||
</template>
|
</template>
|
||||||
@@ -33,9 +35,8 @@ export default {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
obj: {},
|
obj: {},
|
||||||
chartData: {
|
xxcpuChartData: {
|
||||||
labels: [],
|
labels: [],
|
||||||
|
|
||||||
datasets: [
|
datasets: [
|
||||||
{
|
{
|
||||||
label: "CPU %",
|
label: "CPU %",
|
||||||
@@ -65,6 +66,34 @@ export default {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
computed: {
|
||||||
|
cpuChartData() {
|
||||||
|
return {
|
||||||
|
labels: this.obj.metricMM.labels,
|
||||||
|
datasets: [
|
||||||
|
{
|
||||||
|
label: "CPU %",
|
||||||
|
borderColor: "indigo",
|
||||||
|
fill: false,
|
||||||
|
data: this.obj.metricMM.cpu
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
},
|
||||||
|
memChartData() {
|
||||||
|
return {
|
||||||
|
labels: this.obj.metricMM.labels,
|
||||||
|
datasets: [
|
||||||
|
{
|
||||||
|
label: "Memory allocated",
|
||||||
|
borderColor: "green",
|
||||||
|
fill: false,
|
||||||
|
data: this.obj.metricMM.allocated
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onResize() {
|
onResize() {
|
||||||
this.logCardHeight = window.innerHeight * 0.7;
|
this.logCardHeight = window.innerHeight * 0.7;
|
||||||
@@ -108,13 +137,7 @@ export default {
|
|||||||
vm.formState.serverError = res.error;
|
vm.formState.serverError = res.error;
|
||||||
window.$gz.form.setErrorBoxErrors(vm);
|
window.$gz.form.setErrorBoxErrors(vm);
|
||||||
} else {
|
} else {
|
||||||
if (res) {
|
vm.obj = res.data;
|
||||||
vm.chartData.labels = res.data.metricMM.labels;
|
|
||||||
//vm.obj = res.data;
|
|
||||||
//vm.chartData.datasets[0].data = res.data.cpu;
|
|
||||||
} else {
|
|
||||||
vm.log = vm.$ay.t("NoData");
|
|
||||||
}
|
|
||||||
|
|
||||||
window.$gz.form.setFormState({
|
window.$gz.form.setFormState({
|
||||||
vm: vm,
|
vm: vm,
|
||||||
|
|||||||
Reference in New Issue
Block a user