修正
修复负值显示错误 改进页面显示
This commit is contained in:
parent
6c3dbb6acd
commit
1091b430c5
@ -150,6 +150,9 @@ var funcMap = template.FuncMap{
|
|||||||
},
|
},
|
||||||
"Transleft": func(a, b float64) (n float64) {
|
"Transleft": func(a, b float64) (n float64) {
|
||||||
n, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (100-(a/b)*100)), 64)
|
n, _ = strconv.ParseFloat(fmt.Sprintf("%.2f", (100-(a/b)*100)), 64)
|
||||||
|
if n < 0 {
|
||||||
|
n = 0
|
||||||
|
}
|
||||||
return
|
return
|
||||||
},
|
},
|
||||||
"UintToFloat": func(a uint64) (n float64) {
|
"UintToFloat": func(a uint64) (n float64) {
|
||||||
|
2
resource/template/theme-default/service.html
vendored
2
resource/template/theme-default/service.html
vendored
@ -69,7 +69,7 @@
|
|||||||
<td class="ui center aligned">{{$stats.Min|bf}}</td>
|
<td class="ui center aligned">{{$stats.Min|bf}}</td>
|
||||||
<td class="ui center aligned">{{(index $stats.NextUpdate $innerId)|sft}}</td>
|
<td class="ui center aligned">{{(index $stats.NextUpdate $innerId)|sft}}</td>
|
||||||
<td class="ui center aligned">{{$transfer|bf}}</td>
|
<td class="ui center aligned">{{$transfer|bf}}</td>
|
||||||
<td class="ui center aligned" style="padding: 14px 0px 0px 0px; position: relative;"><div class="thirteen wide column"><div class="ui progress fine"><div class="bar" style="transition-duration: 300ms; min-width: unset; background-color: rgb(10, 148, 242); width: {{Transleft (UintToFloat $transfer) (UintToFloat $stats.Max)}}% !important;"><small>{{Transleft (UintToFloat $transfer) (UintToFloat $stats.Max)}} %</small></div></div></div></td>
|
<td class="ui center aligned" style="padding: 14px 0px 0px 0px; position: relative;"><div class="thirteen wide column"><div class="ui progress fine"><div class="bar" style="transition-duration: 300ms; min-width: unset; background-color: rgb(10, 148, 242); width: {{Transleft (UintToFloat $transfer) (UintToFloat $stats.Max)}}% !important;"></div><small style="position: absolute; top: 4px; margin-left: -20px;">{{Transleft (UintToFloat $transfer) (UintToFloat $stats.Max)}} %</small></div></div></td>
|
||||||
</tr>
|
</tr>
|
||||||
{{end}}
|
{{end}}
|
||||||
{{end}}
|
{{end}}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user