diff --git a/.gitattributes b/.gitattributes index addcfaa..52a2176 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1 +1,3 @@ -resource/** linguist-vendored \ No newline at end of file +resource/** linguist-vendored +resource/static/* !linguist-vendored +resource/template/dashboard/* !linguist-vendored \ No newline at end of file diff --git a/README.md b/README.md index 112df16..07be232 100644 --- a/README.md +++ b/README.md @@ -101,21 +101,21 @@ URL 里面也可放置占位符,请求时会进行简单的字符串替换。 1. 添加通知方式 - server酱示例 - - 备注:server酱 + - 名称:server酱 - URL:https://sc.ftqq.com/SCUrandomkeys.send?text=#NEZHA# - 请求方式: GET - 请求类型: 默认 - Body: 空 - wxpusher示例,需要关注你的应用 - - 备注: wxpusher + - 名称: wxpusher - URL:http://wxpusher.zjiecode.com/api/send/message - 请求方式: POST - 请求类型: JSON - Body: `{"appToken":"你的appToken","topicIds":[],"content":"#NEZHA#","contentType":"1","uids":["你的uid"]}` - telegram示例 [@haitau](https://github.com/haitau) 贡献 - - 备注:telegram机器人消息通知 + - 名称:telegram机器人消息通知 - URL:https://api.telegram.org/botXXXXXX/sendMessage?chat_id=YYYYYY&text=#NEZHA# - 请求方式: GET - 请求类型: 默认 @@ -124,13 +124,13 @@ URL 里面也可放置占位符,请求时会进行简单的字符串替换。 2. 添加一个离线报警 - - 备注:离线通知 + - 名称:离线通知 - 规则:`[{"Type":"offline","Min":0,"Max":0,"Duration":10}]` - 启用:√ 3. 添加一个监控 CPU 持续 10s 超过 50% **且** 内存持续 20s 占用低于 20% 的报警 - - 备注:CPU+内存 + - 名称:CPU+内存 - 规则:`[{"Type":"cpu","Min":0,"Max":50,"Duration":10},{"Type":"memory","Min":20,"Max":0,"Duration":20}]` - 启用:√ diff --git a/cmd/dashboard/controller/member_page.go b/cmd/dashboard/controller/member_page.go index be09547..4e2e04e 100644 --- a/cmd/dashboard/controller/member_page.go +++ b/cmd/dashboard/controller/member_page.go @@ -62,7 +62,7 @@ func (mp *memberPage) notification(c *gin.Context) { var ar []model.AlertRule dao.DB.Find(&ar) c.HTML(http.StatusOK, "dashboard/notification", mygin.CommonEnvironment(c, gin.H{ - "Title": "通知管理", + "Title": "报警通知", "Notifications": nf, "AlertRules": ar, })) diff --git a/model/server.go b/model/server.go index 8d65296..ff7709f 100644 --- a/model/server.go +++ b/model/server.go @@ -14,7 +14,7 @@ type Server struct { Tag string // 分组名 Secret string `json:"-"` Note string `json:"-"` // 管理员可见备注 - DisplayIndex int // 展示权重,越大越靠前 + DisplayIndex int // 展示排序,越大越靠前 Host *Host `gorm:"-"` State *HostState `gorm:"-"` diff --git a/resource/static/main.css b/resource/static/main.css index ca722ff..9c78381 100644 --- a/resource/static/main.css +++ b/resource/static/main.css @@ -6,30 +6,25 @@ .nb-container { padding-top: 75px; - min-height: 80%; - padding-bottom: 75px; + min-height: 100%; + padding-bottom: 55px; + margin-bottom: -47px; } -.footer.segment { +.login.nb-container { + display: flex; + align-items: center; + padding-top: unset; +} + +.login.nb-container>.grid { width: 100%; - position: fixed; - bottom: 0; - padding-top: 20px; - padding-bottom: 20px; } -.login-form { - height: 82%; -} - -.login-form .column { +.login.nb-container>.grid .column { max-width: 450px; } -.login-form .grid { - height: 100%; -} - .status.cards .flag { margin-right: 0 !important; } diff --git a/resource/template/common/footer.html b/resource/template/common/footer.html index 3c3bbdd..70bb7da 100644 --- a/resource/template/common/footer.html +++ b/resource/template/common/footer.html @@ -1,7 +1,8 @@ {{define "common/footer"}}
diff --git a/resource/template/common/menu.html b/resource/template/common/menu.html index 330e207..d38f60e 100644 --- a/resource/template/common/menu.html +++ b/resource/template/common/menu.html @@ -5,11 +5,10 @@ {{if .IsAdminPage}} - 服务器 - 服务监控 - 计划任务 - 通知 - 设置 + Agent + Service + Cron + 报警 {{else}} 首页 服务状态 @@ -24,6 +23,9 @@