lint truenas widget

pull/482/head
Michael Shamoon 2 years ago
parent be5a8c0060
commit 872d2a8ace

@ -6,9 +6,9 @@ import useWidgetAPI from "utils/proxy/use-widget-api";
const processUptime = uptime => { const processUptime = uptime => {
let seconds = uptime.toFixed(0); const seconds = uptime.toFixed(0);
var levels = [ const levels = [
[Math.floor(seconds / 31536000), 'year'], [Math.floor(seconds / 31536000), 'year'],
[Math.floor((seconds % 31536000) / 2592000), 'month'], [Math.floor((seconds % 31536000) / 2592000), 'month'],
[Math.floor(((seconds % 31536000) % 2592000) / 86400), 'day'], [Math.floor(((seconds % 31536000) % 2592000) / 86400), 'day'],
@ -17,9 +17,9 @@ const processUptime = uptime => {
[(((seconds % 31536000) % 86400) % 3600) % 60, 'second'], [(((seconds % 31536000) % 86400) % 3600) % 60, 'second'],
]; ];
for(let i = 0; i< levels.length; i++){ for (let i = 0; i< levels.length; i += 1) {
let level = levels[i]; const level = levels[i];
if(level[0] > 0){ if (level[0] > 0){
return { return {
value: level[0], value: level[0],
unit: level[1] unit: level[1]

Loading…
Cancel
Save