|
|
@ -85,10 +85,10 @@ function renderHttpChart(data, labels, server) { |
|
|
|
font: { |
|
|
|
font: { |
|
|
|
size: 20, |
|
|
|
size: 20, |
|
|
|
}, |
|
|
|
}, |
|
|
|
padding: { |
|
|
|
|
|
|
|
top: 0, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
legend: { |
|
|
|
|
|
|
|
position: 'bottom' |
|
|
|
|
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
scales: { |
|
|
|
scales: { |
|
|
|
y: { |
|
|
|
y: { |
|
|
@ -211,9 +211,6 @@ function renderChart(data, labels, server) { |
|
|
|
font: { |
|
|
|
font: { |
|
|
|
size: 20, |
|
|
|
size: 20, |
|
|
|
}, |
|
|
|
}, |
|
|
|
padding: { |
|
|
|
|
|
|
|
top: 0, |
|
|
|
|
|
|
|
}, |
|
|
|
|
|
|
|
}, |
|
|
|
}, |
|
|
|
legend: { |
|
|
|
legend: { |
|
|
|
display: true, |
|
|
|
display: true, |
|
|
@ -224,6 +221,7 @@ function renderChart(data, labels, server) { |
|
|
|
family: 'BlinkMacSystemFont' |
|
|
|
family: 'BlinkMacSystemFont' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
|
|
|
|
position: 'bottom' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
@ -281,9 +279,9 @@ function renderServiceChart(data, labels, server, service) { |
|
|
|
font: { |
|
|
|
font: { |
|
|
|
size: 20 |
|
|
|
size: 20 |
|
|
|
}, |
|
|
|
}, |
|
|
|
padding: { |
|
|
|
legend: { |
|
|
|
top: 0 |
|
|
|
position: 'bottom' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
legend: { |
|
|
|
legend: { |
|
|
|
display: true, |
|
|
|
display: true, |
|
|
@ -293,7 +291,8 @@ function renderServiceChart(data, labels, server, service) { |
|
|
|
size: '10', |
|
|
|
size: '10', |
|
|
|
family: 'BlinkMacSystemFont' |
|
|
|
family: 'BlinkMacSystemFont' |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
position: 'bottom' |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
scales: { |
|
|
|
scales: { |
|
|
@ -341,20 +340,20 @@ function getApacheChartData(server) { |
|
|
|
}, |
|
|
|
}, |
|
|
|
type: "POST", |
|
|
|
type: "POST", |
|
|
|
success: function (result) { |
|
|
|
success: function (result) { |
|
|
|
var data = []; |
|
|
|
let data = []; |
|
|
|
data.push(result.chartData.curr_con); |
|
|
|
data.push(result.chartData.curr_con); |
|
|
|
data.push(result.chartData.server); |
|
|
|
data.push(result.chartData.server); |
|
|
|
var labels = result.chartData.labels; |
|
|
|
let labels = result.chartData.labels; |
|
|
|
renderServiceChart(data, labels, server, 'apache'); |
|
|
|
renderServiceChart(data, labels, server, 'apache'); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
} |
|
|
|
function loadMetrics() { |
|
|
|
function loadMetrics() { |
|
|
|
var service = $('#service').val(); |
|
|
|
let service = $('#service').val(); |
|
|
|
$.ajax({ |
|
|
|
$.ajax({ |
|
|
|
url: "/app/metrics/" + service + "/table-metrics", |
|
|
|
url: "/app/metrics/" + service + "/table-metrics", |
|
|
|
beforeSend: function () { |
|
|
|
beforeSend: function () { |
|
|
|
$('#table_metrics').html('<img class="loading_full_page" src="/app/static/images/loading.gif" />') |
|
|
|
$('#table_metrics').html('<img class="loading_full_page" src="/app/static/images/loading.gif" alt="loading..."/>') |
|
|
|
}, |
|
|
|
}, |
|
|
|
type: "GET", |
|
|
|
type: "GET", |
|
|
|
success: function (data) { |
|
|
|
success: function (data) { |
|
|
@ -375,11 +374,11 @@ function getChartDataHapWiRam(ip) { |
|
|
|
token: $('#token').val() |
|
|
|
token: $('#token').val() |
|
|
|
}, |
|
|
|
}, |
|
|
|
beforeSend: function() { |
|
|
|
beforeSend: function() { |
|
|
|
$('#ram').html('<img class="loading_hapwi_overview" src="/app/static/images/loading.gif" />') |
|
|
|
$('#ram').html('<img class="loading_hapwi_overview" src="/app/static/images/loading.gif" alt="loading..." />') |
|
|
|
}, |
|
|
|
}, |
|
|
|
type: "POST", |
|
|
|
type: "POST", |
|
|
|
success: function (result) {
|
|
|
|
success: function (result) {
|
|
|
|
var data = []; |
|
|
|
let data = []; |
|
|
|
data.push(result.chartData.rams); |
|
|
|
data.push(result.chartData.rams); |
|
|
|
// Получение значений из строки и разделение их на массив
|
|
|
|
// Получение значений из строки и разделение их на массив
|
|
|
|
const ramsData = data[0].trim().split(' '); |
|
|
|
const ramsData = data[0].trim().split(' '); |
|
|
@ -502,7 +501,6 @@ function renderChartHapWiCpu(data) { |
|
|
|
labels: { |
|
|
|
labels: { |
|
|
|
color: 'rgb(255, 99, 132)', |
|
|
|
color: 'rgb(255, 99, 132)', |
|
|
|
font: { size: 10, family: 'BlinkMacSystemFont' }, |
|
|
|
font: { size: 10, family: 'BlinkMacSystemFont' }, |
|
|
|
color: 'black', |
|
|
|
|
|
|
|
boxWidth: 13, |
|
|
|
boxWidth: 13, |
|
|
|
padding: 5 |
|
|
|
padding: 5 |
|
|
|
}, |
|
|
|
}, |
|
|
@ -559,7 +557,8 @@ $( function() { |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
}); |
|
|
|
function removeData() { |
|
|
|
function removeData() { |
|
|
|
for (i = 0; i < charts.length; i++) { |
|
|
|
let chart; |
|
|
|
|
|
|
|
for (let i = 0; i < charts.length; i++) { |
|
|
|
chart = charts[i]; |
|
|
|
chart = charts[i]; |
|
|
|
chart.destroy(); |
|
|
|
chart.destroy(); |
|
|
|
} |
|
|
|
} |
|
|
@ -571,9 +570,9 @@ function showOverviewHapWI() { |
|
|
|
NProgress.configure({showSpinner: false}); |
|
|
|
NProgress.configure({showSpinner: false}); |
|
|
|
} |
|
|
|
} |
|
|
|
function updatingCpuRamCharts() { |
|
|
|
function updatingCpuRamCharts() { |
|
|
|
if (cur_url[0] == 'overview.py') { |
|
|
|
if (cur_url[0] == 'overview') { |
|
|
|
showOverviewHapWI(); |
|
|
|
showOverviewHapWI(); |
|
|
|
} else if (cur_url[0] == 'hapservers.py' && cur_url[1].split('=')[0] == 'service') { |
|
|
|
} else if (cur_url[0] == 'service' && cur_url[2]) { |
|
|
|
NProgress.configure({showSpinner: false}); |
|
|
|
NProgress.configure({showSpinner: false}); |
|
|
|
showOverviewHapWI(); |
|
|
|
showOverviewHapWI(); |
|
|
|
getChartData(server_ip); |
|
|
|
getChartData(server_ip); |
|
|
@ -644,7 +643,6 @@ function renderSMONChart(data, labels, server) { |
|
|
|
labels: { |
|
|
|
labels: { |
|
|
|
color: 'rgb(255, 99, 132)', |
|
|
|
color: 'rgb(255, 99, 132)', |
|
|
|
font: { size: 10, family: 'BlinkMacSystemFont' }, |
|
|
|
font: { size: 10, family: 'BlinkMacSystemFont' }, |
|
|
|
color: 'black', |
|
|
|
|
|
|
|
boxWidth: 13, |
|
|
|
boxWidth: 13, |
|
|
|
padding: 5 |
|
|
|
padding: 5 |
|
|
|
}, |
|
|
|
}, |
|
|
|