+
+
+
+
+ {{ clusterData.cluster_health?.health || 0 }}%
+
+
+
-
-
-
-
-
-
-
-
- {{ msg.id || 'Unknown Issue' }}
-
- ({{ msg.health_delta }}%)
+
+
+
+
+
+
+ {{ msg.id || 'Unknown Issue' }}
+
+ ({{ msg.health_delta }}%)
+
-
+
+
+
+
+ No issues detected
-
-
-
- No issues detected
+
+
+
+
+
+
@@ -145,10 +191,10 @@ const props = defineProps({
required: true,
default: () => ({})
},
- metricsHistory: {
+ metricsData: {
type: Object,
required: true,
- default: () => ({ labels: [], data: [] })
+ default: () => ({})
}
});
@@ -173,9 +219,9 @@ const getDeltaClass = (delta) => {
const healthChartData = computed(() => {
return {
- labels: props.metricsHistory.labels,
+ labels: props.metricsData.health.labels,
datasets: [{
- data: props.metricsHistory.data,
+ data: props.metricsData.health.data,
fill: true,
segment: {
borderColor: (ctx) => {
@@ -263,6 +309,83 @@ const healthChartOptions = {
intersect: false
}
};
+
+const cpuChartData = computed(() => ({
+ labels: props.metricsData.cpu.labels,
+ datasets: [{
+ label: 'CPU',
+ data: props.metricsData.cpu.data,
+ borderColor: 'rgb(75, 192, 192)',
+ fill: false
+ }]
+}));
+
+const memoryChartData = computed(() => ({
+ labels: props.metricsData.memory.labels,
+ datasets: [{
+ label: 'Memory',
+ data: props.metricsData.memory.data,
+ borderColor: 'rgb(153, 102, 255)',
+ fill: false
+ }]
+}));
+
+const storageChartData = computed(() => ({
+ labels: props.metricsData.storage?.labels || [],
+ datasets: [{
+ label: 'Storage',
+ data: props.metricsData.storage?.data || [],
+ borderColor: 'rgb(255, 159, 64)',
+ fill: false
+ }]
+}));
+
+const chartOptions = {
+ responsive: true,
+ maintainAspectRatio: false,
+ clip: false,
+ plugins: {
+ legend: {
+ display: false
+ },
+ tooltip: {
+ callbacks: {
+ label: (context) => `${context.parsed.y}%`
+ }
+ }
+ },
+ scales: {
+ x: {
+ display: false,
+ grid: {
+ display: false
+ }
+ },
+ y: {
+ display: true,
+ grid: {
+ display: true
+ },
+ min: 0,
+ max: 100,
+ ticks: {
+ stepSize: 20
+ }
+ }
+ },
+ elements: {
+ point: {
+ radius: 0,
+ hoverRadius: 4
+ }
+ },
+ animation: false,
+ interaction: {
+ enabled: true,
+ mode: 'nearest',
+ intersect: false
+ }
+};