diff --git a/module/system/js/dashboard.ui.js b/module/system/js/dashboard.ui.js index c466e93622..9b4e5fcd69 100644 --- a/module/system/js/dashboard.ui.js +++ b/module/system/js/dashboard.ui.js @@ -1,23 +1,5 @@ -var baseFontSize = parseInt($("html").css("font-size"), 10); -var progressTemplate = '
'; -var statusTemplate = '{text}'; -var enableTimer = false; - -const cpuProgressCircle = new zui.ProgressCircle('#progressCpu', { - percent: cpuInfo.rate, - size: baseFontSize * 10, - circleColor: cpuInfo.color, - circleWidth: 8, - text: '', -}); - -const memoryProgressCircle = new zui.ProgressCircle('#progressMemory', { - percent: memoryInfo.rate, - size: baseFontSize * 10, - circleColor: memoryInfo.color, - circleWidth: 8, - text: '', -}); +let progressTemplate = '
'; +let statusTemplate = '{text}'; window.renderInstanceList = function (result, {col, row, value}) { @@ -47,6 +29,23 @@ window.renderInstanceList = function (result, {col, row, value}) $(function() { + const baseFontSize = parseInt($("html").css("font-size"), 10); + new zui.ProgressCircle('#progressCpu', { + percent: cpuInfo.rate, + size: baseFontSize * 10, + circleColor: cpuInfo.color, + circleWidth: 8, + text: '', + }); + + new zui.ProgressCircle('#progressMemory', { + percent: memoryInfo.rate, + size: baseFontSize * 10, + circleColor: memoryInfo.color, + circleWidth: 8, + text: '', + }); + if(typeof timer !== 'undefined') clearInterval(timer); if(instanceIdList.length === 0) return; if(inQuickon) timer = setInterval(refreshStatus, 5000);