mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-01-12 22:27:09 +08:00
31 lines
911 B
Plaintext
31 lines
911 B
Plaintext
- 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.linux-widget-table
|
|
tbody
|
|
tr
|
|
td= t('widget.hour_cpu')
|
|
td
|
|
mixin displayProgressBar(usage.cpu, limit.cpu, 's')
|
|
tr
|
|
td= t('widget.hour_memory')
|
|
td
|
|
mixin displayProgressBar(usage.memory, limit.memory, 'M')
|
|
tr
|
|
td= t('widget.storage')
|
|
td
|
|
mixin displayProgressBar(usage.storage, limit.storage, 'M')
|
|
tr
|
|
td= t('widget.month_transfer')
|
|
td
|
|
mixin displayProgressBar(0, limit.transfer, 'G')
|