Improve and unify graphs
This commit is contained in:
parent
0103f34a62
commit
9375219fef
@ -25,15 +25,12 @@
|
|||||||
{{ connectionStatusMessage }}
|
{{ connectionStatusMessage }}
|
||||||
</div>
|
</div>
|
||||||
<div class="content-grid">
|
<div class="content-grid">
|
||||||
<div class="overview-row">
|
|
||||||
<ClusterOverview
|
<ClusterOverview
|
||||||
:clusterData="clusterData"
|
:clusterData="clusterData"
|
||||||
:metricsHistory="metricsHistory.health"
|
:metricsData="metricsHistory"
|
||||||
/>
|
/>
|
||||||
<NodeStatus :nodeData="nodeData" />
|
<NodeStatus :nodeData="nodeData" />
|
||||||
</div>
|
</div>
|
||||||
<MetricsCharts :metricsData="metricsHistory" class="metrics-section" />
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
@ -246,23 +243,6 @@ onUnmounted(() => {
|
|||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.overview-row {
|
|
||||||
display: grid;
|
|
||||||
gap: 0.5rem;
|
|
||||||
grid-template-columns: 2fr 3fr;
|
|
||||||
}
|
|
||||||
|
|
||||||
.overview-row > * {
|
|
||||||
height: 100%;
|
|
||||||
min-height: 400px;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 1200px) {
|
|
||||||
.overview-row {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.metric-card {
|
.metric-card {
|
||||||
/* Remove transition and hover effect */
|
/* Remove transition and hover effect */
|
||||||
}
|
}
|
||||||
|
@ -5,9 +5,12 @@
|
|||||||
</div>
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<div class="overview-container">
|
<div class="overview-container">
|
||||||
|
<div class="graphs-row">
|
||||||
<div class="health-card">
|
<div class="health-card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h6 class="card-title mb-0 metric-label">Cluster Health</h6>
|
||||||
|
</div>
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<h6 class="card-subtitle mb-2 text-muted">Cluster Health</h6>
|
|
||||||
<div class="health-content-wrapper">
|
<div class="health-content-wrapper">
|
||||||
<div class="health-graph">
|
<div class="health-graph">
|
||||||
<div class="health-percentage">
|
<div class="health-percentage">
|
||||||
@ -50,6 +53,49 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<!-- CPU Chart -->
|
||||||
|
<div class="metric-card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h6 class="card-title mb-0">
|
||||||
|
<span class="metric-label">CPU Utilization</span>
|
||||||
|
<span class="metric-value">
|
||||||
|
{{ metricsData.cpu.data[metricsData.cpu.data.length - 1] || 0 }}%
|
||||||
|
</span>
|
||||||
|
</h6>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<Line :data="cpuChartData" :options="chartOptions" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Memory Chart -->
|
||||||
|
<div class="metric-card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h6 class="card-title mb-0">
|
||||||
|
<span class="metric-label">Memory Utilization</span>
|
||||||
|
<span class="metric-value">
|
||||||
|
{{ metricsData.memory.data[metricsData.memory.data.length - 1] || 0 }}%
|
||||||
|
</span>
|
||||||
|
</h6>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<Line :data="memoryChartData" :options="chartOptions" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- Storage Chart -->
|
||||||
|
<div class="metric-card">
|
||||||
|
<div class="card-header">
|
||||||
|
<h6 class="card-title mb-0">
|
||||||
|
<span class="metric-label">Storage Utilization</span>
|
||||||
|
<span class="metric-value">
|
||||||
|
{{ metricsData.storage?.data[metricsData.storage?.data.length - 1] || 0 }}%
|
||||||
|
</span>
|
||||||
|
</h6>
|
||||||
|
</div>
|
||||||
|
<div class="card-body">
|
||||||
|
<Line :data="storageChartData" :options="chartOptions" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="metrics-row">
|
<div class="metrics-row">
|
||||||
<!-- Card 2: PVC Version -->
|
<!-- Card 2: PVC Version -->
|
||||||
<div class="metric-card">
|
<div class="metric-card">
|
||||||
@ -145,10 +191,10 @@ const props = defineProps({
|
|||||||
required: true,
|
required: true,
|
||||||
default: () => ({})
|
default: () => ({})
|
||||||
},
|
},
|
||||||
metricsHistory: {
|
metricsData: {
|
||||||
type: Object,
|
type: Object,
|
||||||
required: true,
|
required: true,
|
||||||
default: () => ({ labels: [], data: [] })
|
default: () => ({})
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -173,9 +219,9 @@ const getDeltaClass = (delta) => {
|
|||||||
|
|
||||||
const healthChartData = computed(() => {
|
const healthChartData = computed(() => {
|
||||||
return {
|
return {
|
||||||
labels: props.metricsHistory.labels,
|
labels: props.metricsData.health.labels,
|
||||||
datasets: [{
|
datasets: [{
|
||||||
data: props.metricsHistory.data,
|
data: props.metricsData.health.data,
|
||||||
fill: true,
|
fill: true,
|
||||||
segment: {
|
segment: {
|
||||||
borderColor: (ctx) => {
|
borderColor: (ctx) => {
|
||||||
@ -263,6 +309,83 @@ const healthChartOptions = {
|
|||||||
intersect: false
|
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
|
||||||
|
}
|
||||||
|
};
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style scoped>
|
<style scoped>
|
||||||
@ -270,7 +393,18 @@ const healthChartOptions = {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
height: 100%;
|
}
|
||||||
|
|
||||||
|
.graphs-row {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(4, 1fr);
|
||||||
|
gap: 0.5rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.metrics-row {
|
||||||
|
display: grid;
|
||||||
|
grid-template-columns: repeat(4, 1fr);
|
||||||
|
gap: 0.5rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.health-card {
|
.health-card {
|
||||||
@ -284,7 +418,6 @@ const healthChartOptions = {
|
|||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
height: calc(100% - 2rem); /* Account for header */
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
position: relative;
|
position: relative;
|
||||||
}
|
}
|
||||||
@ -292,7 +425,7 @@ const healthChartOptions = {
|
|||||||
.health-graph {
|
.health-graph {
|
||||||
position: relative;
|
position: relative;
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
min-height: 0; /* Allow shrinking */
|
min-height: 0;
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
}
|
}
|
||||||
@ -314,6 +447,7 @@ const healthChartOptions = {
|
|||||||
margin: 0;
|
margin: 0;
|
||||||
text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
|
text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
|
||||||
line-height: 1;
|
line-height: 1;
|
||||||
|
color: #333;
|
||||||
}
|
}
|
||||||
|
|
||||||
.health-messages {
|
.health-messages {
|
||||||
@ -323,8 +457,9 @@ const healthChartOptions = {
|
|||||||
position: relative;
|
position: relative;
|
||||||
bottom: 0;
|
bottom: 0;
|
||||||
min-height: 2.5rem;
|
min-height: 2.5rem;
|
||||||
max-height: 30%; /* Reduce maximum height */
|
max-height: 30%;
|
||||||
overflow-y: auto;
|
overflow-y: auto;
|
||||||
|
margin-top: auto; /* Push to bottom of container */
|
||||||
}
|
}
|
||||||
|
|
||||||
.messages-grid {
|
.messages-grid {
|
||||||
@ -409,48 +544,6 @@ const healthChartOptions = {
|
|||||||
background: rgba(0, 0, 0, 0.3);
|
background: rgba(0, 0, 0, 0.3);
|
||||||
}
|
}
|
||||||
|
|
||||||
.metrics-row {
|
|
||||||
display: grid;
|
|
||||||
grid-template-columns: repeat(4, 1fr);
|
|
||||||
gap: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.metric-card {
|
|
||||||
background: white;
|
|
||||||
border: 1px solid rgba(0,0,0,0.125);
|
|
||||||
border-radius: 0.25rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.storage-metrics {
|
|
||||||
min-height: 3.5rem;
|
|
||||||
display: flex;
|
|
||||||
align-items: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 1400px) {
|
|
||||||
.metrics-row {
|
|
||||||
grid-template-columns: repeat(2, 1fr);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@media (max-width: 992px) {
|
|
||||||
.metrics-row {
|
|
||||||
grid-template-columns: 1fr;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-body {
|
|
||||||
padding: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.card-subtitle {
|
|
||||||
margin-bottom: 0.5rem !important;
|
|
||||||
}
|
|
||||||
|
|
||||||
.metric-card .card-body {
|
|
||||||
padding: 0.5rem;
|
|
||||||
}
|
|
||||||
|
|
||||||
.health-delta {
|
.health-delta {
|
||||||
margin-left: 0.5rem;
|
margin-left: 0.5rem;
|
||||||
font-size: 0.8em;
|
font-size: 0.8em;
|
||||||
@ -470,4 +563,59 @@ const healthChartOptions = {
|
|||||||
background: rgba(220, 53, 69, 0.1);
|
background: rgba(220, 53, 69, 0.1);
|
||||||
color: #721c24; /* Darker red */
|
color: #721c24; /* Darker red */
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.metric-card {
|
||||||
|
background: white;
|
||||||
|
border: 1px solid rgba(0,0,0,0.125);
|
||||||
|
border-radius: 0.25rem;
|
||||||
|
height: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.metric-card .card-body {
|
||||||
|
flex: 1;
|
||||||
|
padding: 0.5rem;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
}
|
||||||
|
|
||||||
|
.metric-card .card-body > * {
|
||||||
|
flex: 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.current-value {
|
||||||
|
font-size: 1.1rem;
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 1400px) {
|
||||||
|
.graphs-row {
|
||||||
|
grid-template-columns: 1fr 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@media (max-width: 768px) {
|
||||||
|
.graphs-row {
|
||||||
|
grid-template-columns: 1fr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.card-header h6 {
|
||||||
|
font-size: 0.95rem;
|
||||||
|
font-weight: 600;
|
||||||
|
display: flex;
|
||||||
|
justify-content: space-between;
|
||||||
|
align-items: center;
|
||||||
|
}
|
||||||
|
|
||||||
|
.metric-label {
|
||||||
|
color: #666;
|
||||||
|
}
|
||||||
|
|
||||||
|
.metric-value {
|
||||||
|
font-weight: bold;
|
||||||
|
color: #333;
|
||||||
|
}
|
||||||
</style>
|
</style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user