mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-04-23 11:17:54 +08:00
fixbugs in linux plugin
This commit is contained in:
@@ -1,27 +1,30 @@
|
||||
header Linux
|
||||
- limit = account.resources_limit
|
||||
|
||||
mixin displayProgressBar(now, limit, unit)
|
||||
- per = parseInt((now / limit * 100).toFixed())
|
||||
- color = per < 85 ? 'success' : 'danger'
|
||||
|
||||
.progress
|
||||
.progress-bar(class="progress-bar-#{color}", role='progressbar', aria-valuenow='#{per}',
|
||||
aria-valuemin='0', aria-valuemax='100', style='width: #{per}%;')
|
||||
span #{now} / #{limit} #{unit}
|
||||
|
||||
header= t('')
|
||||
table.table.table-hover
|
||||
tbody
|
||||
tr
|
||||
td(style='width: 200px;') 一小时 CPU 时间
|
||||
td(style='width: 200px;')= t('widget.hour_cpu')
|
||||
td
|
||||
.progress
|
||||
.progress-bar.progress-bar-success(role='progressbar', aria-valuenow='#{resources_usage.cpu.now_per}', aria-valuemin='0', aria-valuemax='100', style='width: #{resources_usage.cpu.now_per}%;')
|
||||
span #{resources_usage.cpu.now} / #{resources_usage.cpu.limit} s
|
||||
mixin displayProgressBar(usage.cpu, limit.cpu, 's')
|
||||
tr
|
||||
td 一小时内存占用
|
||||
td= t('widget.hour_memory')
|
||||
td
|
||||
.progress
|
||||
.progress-bar.progress-bar-success(role='progressbar', aria-valuenow='#{(resources_usage.memory.now_per}', aria-valuemin='0', aria-valuemax='100', style='width: #{resources_usage.memory.now_per}%;')
|
||||
span #{resources_usage.memory.now} / #{resources_usage.memory.limit} M
|
||||
mixin displayProgressBar(usage.memory, limit.memory, 'M')
|
||||
tr
|
||||
td 储存空间
|
||||
td= t('widget.storage')
|
||||
td
|
||||
.progress
|
||||
.progress-bar(class='progress-bar-#{storage_usage.color}',role='progressbar', aria-valuenow='#{storage_usage.now_per}', aria-valuemin='0', aria-valuemax='100', style='width: #{storage_usage.now_per}%;')
|
||||
span #{storage_usage.now} / #{storage_usage.limit} M
|
||||
mixin displayProgressBar(usage.storage, limit.storage, 'M')
|
||||
tr
|
||||
td 月流量
|
||||
td= t('widget.month_transfer')
|
||||
td
|
||||
.progress
|
||||
.progress-bar.progress-bar-success(role='progressbar', aria-valuenow='0', aria-valuemin='0', aria-valuemax='100', style='width: 0%;')
|
||||
span 0 / #{account.attribute.resources_limit.transfer} G
|
||||
mixin displayProgressBar(0, limit.transfer, 'G')
|
||||
|
||||
Reference in New Issue
Block a user