🐛 fix(alert): 添加报警规则

This commit is contained in:
naiba
2020-12-21 16:34:21 +08:00
parent 789065cb5f
commit 4ec61d0043
5 changed files with 33 additions and 22 deletions

View File

@@ -151,10 +151,13 @@
},
secondToDate(s) {
var d = Math.floor(s / 3600 / 24);
if (d > 0) {
return d + "天"
}
var h = Math.floor(s / 3600 % 24);
var m = Math.floor((s / 60 % 60));
var s = Math.floor((s % 60));
return result = d + "" + h + "小时" + m + "分钟" + s + "秒";
var m = Math.floor(s / 60 % 60);
var s = Math.floor(s % 60);
return h + ":" + ("0" + m).slice(-2) + ":" + ("0" + s).slice(-2);
},
formatTimestamp(t) {
return new Date(t * 1000).toLocaleString()