From 9f7f101e7f7a22717e63497d5598f473b1026aec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=A5=B6=E7=88=B8?= Date: Tue, 10 Dec 2019 15:33:05 +0800 Subject: [PATCH] =?UTF-8?q?=E5=BC=95=E5=85=A5Vue?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- cmd/agent/main.go | 4 +- resource/static/main.css | 4 ++ resource/template/common/footer.html | 1 + resource/template/page/home.html | 88 +++++++++++++++++++--------- 4 files changed, 67 insertions(+), 30 deletions(-) diff --git a/cmd/agent/main.go b/cmd/agent/main.go index e383789..d33581e 100644 --- a/cmd/agent/main.go +++ b/cmd/agent/main.go @@ -123,11 +123,13 @@ func reportState() { for { if endReport.After(time.Now()) { monitor.TrackNetworkSpeed() - _, err = client.ReportState(ctx, monitor.GetState(1).PB()) + _, err = client.ReportState(ctx, monitor.GetState(2).PB()) if err != nil { log.Printf("reportState error %v", err) time.Sleep(delayWhenError) } + } else { + time.Sleep(time.Second * 1) } } } diff --git a/resource/static/main.css b/resource/static/main.css index 9332e56..2a1157f 100644 --- a/resource/static/main.css +++ b/resource/static/main.css @@ -52,4 +52,8 @@ .status.cards .description { padding-bottom: 1rem !important; +} + +.status.cards .ui.content.popup { + min-width: 250px; } \ No newline at end of file diff --git a/resource/template/common/footer.html b/resource/template/common/footer.html index e0ecc84..c11e475 100644 --- a/resource/template/common/footer.html +++ b/resource/template/common/footer.html @@ -7,6 +7,7 @@ + diff --git a/resource/template/page/home.html b/resource/template/page/home.html index 1120e8b..ef1e362 100644 --- a/resource/template/page/home.html +++ b/resource/template/page/home.html @@ -4,28 +4,43 @@
- {{range $server := .Servers}} -
+
-
{{if $server.Host.CountryCode}}{{end}}{{$server.Name}} - +
+ + +
CPU
-
+
@@ -33,8 +48,8 @@
内存
-
+
@@ -42,8 +57,8 @@
交换
-
+
@@ -51,14 +66,15 @@
网络
- {{$server.State.NetInSpeed|bf}}/s - {{$server.State.NetOutSpeed|bf}}/s + + /s + + /s
硬盘
-
+
@@ -66,19 +82,33 @@
在线
- {{$server.State.Uptime|sf}} + +
- {{end}}
{{template "common/footer" .}} {{end}} \ No newline at end of file