Updated admin panel

This commit is contained in:
2018-11-06 16:20:44 +09:00
parent a4a20366f1
commit 81764b981c
4 changed files with 126 additions and 60 deletions

View File

@ -12,68 +12,85 @@ component AdminTabs
Icon("pencil")
span.tab-text Editor
component Admin(user *arn.User, platform, family, platformVersion, kernelVersion string)
component Admin(user *arn.User, platform, family, platformVersion, kernelVersion string, cpuUsage, memUsage, diskUsage float64, cpuModel string, memTotal, diskTotal uint64, memStats *runtime.MemStats)
h1.page-title Admin Panel
AdminTabs
.admin
//- .widget.mountable
//- h3.widget-title Usage
.admin-widget.mountable
h3.widget-title Usage
//- table
//- tbody
//- tr
//- td CPU usage:
//- td
//- span= int(cpuUsage + 0.5)
//- span %
//- tr
//- td Memory usage:
//- td
//- span= int(memUsage + 0.5)
//- span %
//- tr
//- td Disk usage:
//- td
//- span= int(diskUsage + 0.5)
//- span %
table
tbody
tr
td.admin-info-key CPU usage:
td.admin-info-value
span= int(cpuUsage + 0.5)
span %
tr
td.admin-info-key Memory usage:
td.admin-info-value
span= int(memUsage + 0.5)
span %
tr
td.admin-info-key Disk usage:
td.admin-info-value
span= int(diskUsage + 0.5)
span %
.widget.mountable
.admin-widget.mountable
h3.widget-title OS
table
tbody
tr
td Platform:
td= platform
td.admin-info-key Platform:
td.admin-info-value= platform
tr
td Family:
td= family
td.admin-info-key Family:
td.admin-info-value= family
tr
td Version:
td= platformVersion
td.admin-info-key Version:
td.admin-info-value= platformVersion
tr
td Kernel:
td= kernelVersion
td.admin-info-key Kernel:
td.admin-info-value= kernelVersion
.widget.mountable
.admin-widget.mountable
h3.widget-title Hardware
table
tbody
tr
td CPUs:
td= runtime.NumCPU()
td.admin-info-key CPU model:
td.admin-info-value= cpuModel
tr
td.admin-info-key CPU cores:
td.admin-info-value= runtime.NumCPU()
tr
td.admin-info-key RAM:
td.admin-info-value= humanize.IBytes(memTotal)
.widget.mountable
tr
td.admin-info-key Disk:
td.admin-info-value= humanize.IBytes(diskTotal)
.admin-widget.mountable
h3.widget-title Go
table
tbody
tr
td Version:
td= runtime.Version()
td.admin-info-key Version:
td.admin-info-value= runtime.Version()
tr
td Goroutines:
td= runtime.NumGoroutine()
td.admin-info-key Goroutines:
td.admin-info-value= humanize.Comma(int64(runtime.NumGoroutine()))
tr
td.admin-info-key Objects:
td.admin-info-value= humanize.Comma(int64(memStats.HeapObjects))