fix linting errors
This commit is contained in:
parent
1b71c16eec
commit
497bd60653
@ -66,7 +66,7 @@ function createResourceUsageChart (resourceName, resourceAvail, resourceUsed, re
|
||||
const R = Math.min(usedRatio * 510, 255);
|
||||
const G = Math.min((1 - usedRatio) * 510, 255);
|
||||
const usedColor = `rgb(${R}, ${G}, 0)`;
|
||||
new Chart(canvas, {
|
||||
createChart(canvas, {
|
||||
type: "pie",
|
||||
data: {
|
||||
labels: [
|
||||
@ -103,6 +103,10 @@ function createResourceUsageChart (resourceName, resourceAvail, resourceUsed, re
|
||||
return container;
|
||||
}
|
||||
|
||||
function createChart (ctx, data) {
|
||||
return new window.Chart(ctx, data);
|
||||
}
|
||||
|
||||
function parseNumber (value, unitData) {
|
||||
if (!unitData) {
|
||||
return `${value}`;
|
||||
|
@ -47,15 +47,15 @@ async function populateInstances () {
|
||||
}
|
||||
else {
|
||||
criteria = (a, b) => {
|
||||
const a_inc = a.name.includes(searchQuery);
|
||||
const b_inc = b.name.includes(searchQuery);
|
||||
if (a_inc && b_inc) {
|
||||
const aInc = a.name.includes(searchQuery);
|
||||
const bInc = b.name.includes(searchQuery);
|
||||
if (aInc && bInc) {
|
||||
return a.vmid > b.vmid ? 1 : -1;
|
||||
}
|
||||
else if (a_inc && !b_inc) {
|
||||
else if (aInc && !bInc) {
|
||||
return -1;
|
||||
}
|
||||
else if (!a_inc && b_inc) {
|
||||
else if (!aInc && bInc) {
|
||||
return 1;
|
||||
}
|
||||
else {
|
||||
@ -64,9 +64,9 @@ async function populateInstances () {
|
||||
};
|
||||
}
|
||||
instances.sort(criteria);
|
||||
//console.log(instances)
|
||||
// console.log(instances)
|
||||
const instanceContainer = document.querySelector("#instance-container");
|
||||
instanceContainer.innerHTML = ``;
|
||||
instanceContainer.innerHTML = "";
|
||||
for (let i = 0; i < instances.length; i++) {
|
||||
const newInstance = document.createElement("instance-card");
|
||||
newInstance.data = instances[i];
|
||||
|
Loading…
Reference in New Issue
Block a user