* [bug#57876] adjust js load logic for system dashboard.
This commit is contained in:
@@ -1,23 +1,5 @@
|
||||
var baseFontSize = parseInt($("html").css("font-size"), 10);
|
||||
var progressTemplate = '<div class="progress rounded-lg w-40 h-2 mr-2 inline-block" style="width:120px;" title="{tip}"><div class="progress-bar {color}" style="width: {rate};"></div></div>';
|
||||
var statusTemplate = '<span id="instance-status-{id}" data-status="{status}" class="{class}">{text}</span>';
|
||||
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 = '<div class="progress rounded-lg w-40 h-2 mr-2 inline-block" style="width:120px;" title="{tip}"><div class="progress-bar {color}" style="width: {rate};"></div></div>';
|
||||
let statusTemplate = '<span id="instance-status-{id}" data-status="{status}" class="{class}">{text}</span>';
|
||||
|
||||
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);
|
||||
|
||||
Reference in New Issue
Block a user