mirror of
https://github.com/Lissy93/dashy.git
synced 2025-12-06 08:34:14 +01:00
resolve lint issues in uptime and metric handling
This commit is contained in:
parent
00b32704c4
commit
e1f040ce89
1 changed files with 3 additions and 3 deletions
|
|
@ -325,7 +325,7 @@ export default {
|
|||
},
|
||||
|
||||
formatBytes(bytes) {
|
||||
if (!bytes || bytes === 0 || Number.isNaN(bytes)) return '0 B';
|
||||
if (!bytes || Number.isNaN(bytes)) return '0 B';
|
||||
const k = 1024;
|
||||
const sizes = ['B', 'KB', 'MB', 'GB', 'TB'];
|
||||
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
||||
|
|
@ -333,7 +333,7 @@ export default {
|
|||
},
|
||||
|
||||
formatUptime(seconds) {
|
||||
if (!seconds || Number.isNaN(seconds) || seconds <= 0) return '-';
|
||||
if (!seconds || seconds <= 0) return '-';
|
||||
|
||||
const days = Math.floor(seconds / 86400);
|
||||
const hours = Math.floor((seconds % 86400) / 3600);
|
||||
|
|
@ -360,7 +360,7 @@ export default {
|
|||
uptime = this.detailData.uptime;
|
||||
|
||||
if (typeof uptime === 'string') {
|
||||
return uptime.replace('days', 'days').replace('day', 'day');
|
||||
return uptime;
|
||||
}
|
||||
} else if (this.detailData.system && this.detailData.system.uptime) {
|
||||
// 3. System object uptime
|
||||
|
|
|
|||
Loading…
Reference in a new issue