🎨 优化进度条颜色、报警策略

This commit is contained in:
naiba 2020-12-20 21:19:27 +08:00
parent 13e8ea76ed
commit b46827f244
6 changed files with 12 additions and 9 deletions

View File

@ -1,5 +1,3 @@
/*! Source: https://github.com/h5bp/html5-boilerplate/blob/master/src/css/main.css */
@media print {
*, *:before, *:after {
color: #000 !important;

View File

@ -170,6 +170,7 @@ h1 {
.ui.progress .bar {
line-height: unset !important;
height: unset !important;
}
table tr {

View File

@ -9,7 +9,7 @@
<script src="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.1/dist/semantic.min.js"></script>
<script src="/static/semantic-ui-alerts.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
<script src="/static/main.js?v202012091024"></script>
<script src="/static/main.js?v202012202118"></script>
</body>
</html>

View File

@ -126,7 +126,7 @@
this.cache[percent].style['background-color'] = 'slategray'
this.cache[percent].class.offline = true
} else if (percent < 51) {
this.cache[percent].style['background-color'] = 'lime'
this.cache[percent].style['background-color'] = 'rgb(0, 235, 139)'
this.cache[percent].class.fine = true
} else if (percent < 81) {
this.cache[percent].style['background-color'] = 'orange'

View File

@ -17,7 +17,7 @@
<link rel="stylesheet" type="text/css" href="https://cdn.jsdelivr.net/npm/semantic-ui@2.4.2/dist/semantic.min.css">
<link rel="stylesheet" type="text/css" href="/static/semantic-ui-alerts.min.css">
<link rel="stylesheet" href="/static/theme-hotaru/css/core.css?v202012121912" type="text/css">
<link rel="stylesheet" href="/static/theme-hotaru/css/main.css?v202012121912" type="text/css">
<link rel="stylesheet" href="/static/theme-hotaru/css/main.css?v202012202117" type="text/css">
<link rel="stylesheet" href="/static/theme-hotaru/css/darkmode.css?v202012121912" type="text/css">
{{if ts .CustomCSS}}
{{tag "style"}}
@ -177,7 +177,7 @@
this.cache[percent].style['background-color'] = 'slategray'
this.cache[percent].class.offline = true
} else if (percent < 51) {
this.cache[percent].style['background-color'] = 'lime'
this.cache[percent].style['background-color'] = 'rgb(0, 235, 139)'
this.cache[percent].class.fine = true
} else if (percent < 81) {
this.cache[percent].style['background-color'] = 'orange'

View File

@ -113,14 +113,18 @@ func checkStatus() {
var flag bool
if cacheN, has := dao.Cache.Get(nID); has {
nHistory := cacheN.(NotificationHistory)
// 超过一天或者超过上次提醒阈值
if time.Now().After(nHistory.Until) || nHistory.Duration >= time.Hour*24 {
// 每次提醒都增加一倍等待时间,最后每天最多提醒一次
if time.Now().After(nHistory.Until) {
flag = true
nHistory.Duration *= 2
if nHistory.Duration > time.Hour*24 {
nHistory.Duration = time.Hour * 24
}
nHistory.Until = time.Now().Add(nHistory.Duration)
dao.Cache.Set(nID, nHistory, nHistory.Duration)
}
} else {
// 新提醒
// 新提醒直接通知
flag = true
dao.Cache.Set(nID, NotificationHistory{
Duration: firstNotificationDelay,