mirror of
https://github.com/0xJacky/nginx-ui.git
synced 2025-05-11 10:25:52 +02:00
dashboard
This commit is contained in:
parent
3bf1655db7
commit
edc412a8e5
28 changed files with 187 additions and 954 deletions
|
@ -9,6 +9,8 @@ import (
|
|||
"github.com/gorilla/websocket"
|
||||
"github.com/mackerelio/go-osstat/cpu"
|
||||
"github.com/mackerelio/go-osstat/memory"
|
||||
"github.com/mackerelio/go-osstat/uptime"
|
||||
"github.com/mackerelio/go-osstat/loadavg"
|
||||
"net/http"
|
||||
"strconv"
|
||||
"time"
|
||||
|
@ -72,6 +74,10 @@ func Analytic(c *gin.Context) {
|
|||
response["cpu_idle"], _ = strconv.ParseFloat(fmt.Sprintf("%.2f",
|
||||
float64(after.Idle-before.Idle)/total*100), 64)
|
||||
|
||||
response["uptime"], _ = uptime.Get()
|
||||
response["uptime"] = response["uptime"].(time.Duration) / time.Second
|
||||
response["loadavg"], _ = loadavg.Get()
|
||||
|
||||
used, _total, percentage, err := tool.DiskUsage(".")
|
||||
|
||||
response["disk_used"] = used
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue