Commit d083cfd0 by 杨琪琪

parent 8dff59c0
...@@ -104,7 +104,7 @@ var defaultXBarOptions = { ...@@ -104,7 +104,7 @@ var defaultXBarOptions = {
} }
var defaultYBarOptions = { var defaultYBarOptions = {
title: { title: {
text: '服务器资源实时监控', text: 'OCR服务器资源实时监控',
textStyle: {fontSize: '14px', color: "#fff"}, textStyle: {fontSize: '14px', color: "#fff"},
left: 'center' left: 'center'
}, },
......
...@@ -199,7 +199,6 @@ ...@@ -199,7 +199,6 @@
initChart('court-bar', 'Xbar', 'courtBarChart'); initChart('court-bar', 'Xbar', 'courtBarChart');
initChart('ocr-hardware-chart', 'Ybar', 'hardwareBarChart') initChart('ocr-hardware-chart', 'Ybar', 'hardwareBarChart')
callInterval();
// 表单初始赋值 // 表单初始赋值
form.val('areaForm', { form.val('areaForm', {
isRegion: true, isRegion: true,
...@@ -278,11 +277,14 @@ ...@@ -278,11 +277,14 @@
form.on('radio(radio-time)', function (data) { form.on('radio(radio-time)', function (data) {
restartBrokenLineInterval(); restartBrokenLineInterval();
}); });
callInterval();
restartBrokenLineInterval(); restartBrokenLineInterval();
getServerMonitoring(true); getServerMonitoring(true);
monitorInterval = setInterval(function () { monitorInterval = setInterval(function () {
getServerMonitoring(); getServerMonitoring();
}, 5000) }, 5000)
// 表格初始 // 表格初始
table.render({ table.render({
elem: '#call-table', elem: '#call-table',
...@@ -854,8 +856,7 @@ ...@@ -854,8 +856,7 @@
}, 5000) }, 5000)
} }
// 页面即将销毁 function stopInterval() {
$(window).on('beforeunload', function () {
if (monitorInterval) { if (monitorInterval) {
clearInterval(monitorInterval) clearInterval(monitorInterval)
} }
...@@ -868,6 +869,11 @@ ...@@ -868,6 +869,11 @@
if (tableInterval) { if (tableInterval) {
clearInterval(tableInterval) clearInterval(tableInterval)
} }
}
// 页面即将销毁
$(window).on('beforeunload', function () {
stopInterval();
window.removeEventListener('resize', function () { window.removeEventListener('resize', function () {
if (timeLineChart && timeLineChart.resize) { if (timeLineChart && timeLineChart.resize) {
timeLineChart.resize(); timeLineChart.resize();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment