v8.1.2: Update JS regex, un-comment CSS, and refactor metrics JS

Modified regex in ha.js to include uppercase letters. Un-commented and removed unused CSS code. Refactored the structure of options in metrics.js for readability and consistency.
pull/411/head
Aidaho 2024-11-07 10:57:41 +03:00
parent 3d642a61c4
commit e240b673fd
3 changed files with 33 additions and 43 deletions

View File

@ -1338,13 +1338,8 @@ label {
float: left; float: left;
margin-top: var(--indent); margin-top: var(--indent);
margin-left: var(--indent); margin-left: var(--indent);
margin-bottom: 20px;
} }
/*.metrics-refresh {*/
/* text-align: right;*/
/* margin-top: -25px;*/
/* margin-right: 10px;*/
/* margin-bottom: 20px;*/
/*}*/
.ajaxwafstatus { .ajaxwafstatus {
padding-top: 2px; padding-top: 2px;
padding-left: 10px; padding-left: 10px;

View File

@ -182,7 +182,7 @@ function createHaClusterStep1(edited=false, cluster_id=0, clean=true) {
} }
}); });
$.getScript(ha); $.getScript(ha);
let regx = /^[a-z0-9_-]+$/; let regx = /^[a-zA-Z0-9_-]+$/;
let dialog_div = $("#create-ha-cluster-step-1").dialog({ let dialog_div = $("#create-ha-cluster-step-1").dialog({
autoOpen: false, autoOpen: false,
resizable: false, resizable: false,

View File

@ -163,6 +163,23 @@ function renderHttpChart(data, labels, server) {
}, },
options: { options: {
maintainAspectRatio: false, maintainAspectRatio: false,
scales: {
y: {
beginAtZero: true,
},
x: {
ticks: {
major: {
enabled: true,
fontStyle: 'bold'
},
source: 'data',
autoSkip: true,
autoSkipPadding: 45,
maxRotation: 0
}
}
},
plugins: { plugins: {
title: { title: {
display: true, display: true,
@ -171,41 +188,19 @@ function renderHttpChart(data, labels, server) {
size: 20, size: 20,
}, },
}, },
legend: {
position: 'bottom'
}
},
scales: {
y: {
ticks: {
beginAtZero: true,
},
},
x: {
ticks: {
beginAtZero: true,
major: {
enabled: true,
fontStyle: 'bold',
},
source: 'data',
autoSkip: true,
autoSkipPadding: 45,
maxRotation: 0,
},
},
},
legend: { legend: {
display: true, display: true,
labels: { labels: {
color: 'rgb(255, 99, 132)', color: 'rgb(255, 99, 132)',
font: { font: {
size: 10, size: 10,
family: 'BlinkMacSystemFont', family: 'BlinkMacSystemFont'
}, }
},
},
}, },
position: 'bottom'
}
}
}
}); });
charts.push(myChart) charts.push(myChart)
stream_chart(myChart, 'haproxy', server, 1); stream_chart(myChart, 'haproxy', server, 1);