🎉 [dashboard v0.3.4] theme: daynight by @JackieSung4ev
This commit is contained in:
		
							parent
							
								
									03908e7e05
								
							
						
					
					
						commit
						9f98f7a489
					
				
							
								
								
									
										10
									
								
								README.md
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								README.md
									
									
									
									
									
								
							@ -1,12 +1,12 @@
 | 
				
			|||||||
# 哪吒面板
 | 
					# 哪吒面板
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
					 
 | 
				
			||||||
 | 
					
 | 
				
			||||||
系统状态监控报警、API(SSL证书变更、即将到期、到期)/TCP端口存活/PING 监控、计划任务(可以定时在Agent上执行命令,备份、重启、What ever you want)、极省资源,64M 服务器也能装 agent。
 | 
					系统状态监控报警、API(SSL证书变更、即将到期、到期)/TCP端口存活/PING 监控、计划任务(可以定时在Agent上执行命令,备份、重启、What ever you want)、极省资源,64M 服务器也能装 agent。
 | 
				
			||||||
 | 
					
 | 
				
			||||||
|   首页截图1   |   首页截图2   |
 | 
					|   默认主题   | DayNight [@JackieSung](https://github.com/JackieSung4ev) |  hotaru [@CokeMine](https://github.com/CokeMine)   |
 | 
				
			||||||
| ---- | ---- |
 | 
					| ---- | ---- | ---- |
 | 
				
			||||||
|        | <img src="https://s3.ax1x.com/2020/12/09/rPF4xJ.png" width="1600px" /> |
 | 
					|      | <img src="https://s3.ax1x.com/2021/01/20/sfJv2q.jpg"/> | <img src="https://s3.ax1x.com/2020/12/09/rPF4xJ.png" width="1600px" /> |
 | 
				
			||||||
 | 
					
 | 
				
			||||||
\>> [查看针友列表](https://www.google.com/search?q=%22powered+by+%E5%93%AA%E5%90%92%E9%9D%A2%E6%9D%BF%22&filter=0) (Google)
 | 
					\>> [查看针友列表](https://www.google.com/search?q=%22powered+by+%E5%93%AA%E5%90%92%E9%9D%A2%E6%9D%BF%22&filter=0) (Google)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
@ -114,7 +114,7 @@ URL 里面也可放置占位符,请求时会进行简单的字符串替换。
 | 
				
			|||||||
      - 请求类型: JSON
 | 
					      - 请求类型: JSON
 | 
				
			||||||
      - Body: `{"appToken":"你的appToken","topicIds":[],"content":"#NEZHA#","contentType":"1","uids":["你的uid"]}`
 | 
					      - Body: `{"appToken":"你的appToken","topicIds":[],"content":"#NEZHA#","contentType":"1","uids":["你的uid"]}`
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    - telegram示例 @haitau 贡献
 | 
					    - telegram示例 [@haitau](https://github.com/haitau) 贡献
 | 
				
			||||||
      - 备注:telegram机器人消息通知
 | 
					      - 备注:telegram机器人消息通知
 | 
				
			||||||
      - URL:https://api.telegram.org/botXXXXXX/sendMessage?chat_id=YYYYYY&text=#NEZHA#
 | 
					      - URL:https://api.telegram.org/botXXXXXX/sendMessage?chat_id=YYYYYY&text=#NEZHA#
 | 
				
			||||||
      - 请求方式: GET
 | 
					      - 请求方式: GET
 | 
				
			||||||
 | 
				
			|||||||
@ -17,7 +17,6 @@
 | 
				
			|||||||
                    <option value="default"{{if eq .Conf.Site.Theme "default"}} selected="selected"{{end}}>默认主题</option>
 | 
					                    <option value="default"{{if eq .Conf.Site.Theme "default"}} selected="selected"{{end}}>默认主题</option>
 | 
				
			||||||
                    <option value="daynight"{{if eq .Conf.Site.Theme "daynight"}} selected="selected"{{end}}>JackieSung DayNight</option>
 | 
					                    <option value="daynight"{{if eq .Conf.Site.Theme "daynight"}} selected="selected"{{end}}>JackieSung DayNight</option>
 | 
				
			||||||
                    <option value="hotaru"{{if eq .Conf.Site.Theme "hotaru"}} selected="selected"{{end}}>CokeMine Hotaru</option>
 | 
					                    <option value="hotaru"{{if eq .Conf.Site.Theme "hotaru"}} selected="selected"{{end}}>CokeMine Hotaru</option>
 | 
				
			||||||
                    <option value="daynight"{{if eq .Conf.Site.Theme "daynight"}} selected="selected"{{end}}>JackieSung DayNight</option>
 | 
					 | 
				
			||||||
                </select>
 | 
					                </select>
 | 
				
			||||||
            </div>
 | 
					            </div>
 | 
				
			||||||
            <div class="field">
 | 
					            <div class="field">
 | 
				
			||||||
 | 
				
			|||||||
@ -1,40 +1,41 @@
 | 
				
			|||||||
{{define "theme-daynight/service"}}
 | 
					{{define "theme-daynight/service"}}
 | 
				
			||||||
{{template "common/header" .}}
 | 
					{{template "common/header" .}}
 | 
				
			||||||
 | 
					{{if ts .CustomCode}}
 | 
				
			||||||
 | 
					{{.CustomCode|safe}}
 | 
				
			||||||
 | 
					{{end}}
 | 
				
			||||||
{{template "common/menu" .}}
 | 
					{{template "common/menu" .}}
 | 
				
			||||||
<div class="nb-container">
 | 
					<div class="nb-container">
 | 
				
			||||||
    <div class="ui container">
 | 
					    <div class="ui container">
 | 
				
			||||||
        <div class="ui segment service-status">
 | 
					        <div class="service-status">
 | 
				
			||||||
            {{range $service := .Services}}
 | 
					
 | 
				
			||||||
            <div class="ui grid">
 | 
					            <table class="ui celled table">
 | 
				
			||||||
                <div class="three wide column">
 | 
					                <thead>
 | 
				
			||||||
                    <p>{{$service.Monitor.Name}}</p>
 | 
					                    <tr>
 | 
				
			||||||
                    <p>30天在线率{{divU64 $service.TotalDown (addU64 $service.TotalUp $service.TotalDown)}}%</p>
 | 
					                        <th class="ui center aligned">名称</th>
 | 
				
			||||||
                </div>
 | 
					                        <th class="ui center aligned">30天在线率</th>
 | 
				
			||||||
                <div class="eleven wide column">
 | 
					                        <th class="ui center aligned">详情</th>
 | 
				
			||||||
                    {{range $i,$d := $service.Delay}}
 | 
					                        <th class="ui center aligned">状态</th>
 | 
				
			||||||
                    <div class="ui icon button{{if gt (add (index $service.Up $i) (index $service.Down $i)) 0}}
 | 
					                    </tr>
 | 
				
			||||||
                    {{if gt (div (index $service.Down $i) (add (index $service.Up $i) (index $service.Down $i))) 30.0}}danger
 | 
					                </thead>
 | 
				
			||||||
                    {{else if gt (div (index $service.Down $i) (add (index $service.Up $i) (index $service.Down $i))) 10.0}}
 | 
					                <tbody>
 | 
				
			||||||
                    warning{{else}}good{{end}}
 | 
					                    {{range $service := .Services}}
 | 
				
			||||||
                    {{end}}" data-tooltip="{{dayBefore $i}},平均延迟:{{$d}}ms">
 | 
					                    <tr>
 | 
				
			||||||
                        <i class="delay"></i>
 | 
					                        <td class="ui center aligned">{{$service.Monitor.Name}}</td>
 | 
				
			||||||
                    </div>
 | 
					                        <td class="ui center aligned">
 | 
				
			||||||
                    {{end}}
 | 
					                            {{float32f (divU64 $service.TotalUp (addU64 $service.TotalUp $service.TotalDown))}}%
 | 
				
			||||||
                </div>
 | 
					                        </td>
 | 
				
			||||||
                <div class="two wide column round{{if gt (addU64 $service.TotalUp $service.TotalDown) 0}}
 | 
					                        <td class="ui center aligned">{{range $i,$d := $service.Delay}}
 | 
				
			||||||
                    {{if gt (divU64 $service.TotalDown (addU64 $service.TotalUp $service.TotalDown)) 30.0}}danger{{else if gt (divU64 $service.TotalDown (addU64 $service.TotalUp $service.TotalDown)) 10.0}}warning{{else}}good{{end}}
 | 
					                            <div class="ui icon button {{className (div (index $service.Up $i) (add (index $service.Up $i) (index $service.Down $i)))}}"
 | 
				
			||||||
                {{end}}">
 | 
					                                data-tooltip="{{dayBefore $i}},在线率:{{float32f (div (index $service.Up $i) (add (index $service.Up $i) (index $service.Down $i)))}}%,平均延迟:{{float32f $d}}ms">
 | 
				
			||||||
                    <i></i>
 | 
					                            </div> {{end}}
 | 
				
			||||||
                    {{if gt (addU64 $service.TotalUp $service.TotalDown) 0}}
 | 
					                        </td>
 | 
				
			||||||
                    {{if gt (divU64 $service.TotalDown (addU64 $service.TotalUp $service.TotalDown)) 30.0}}故障
 | 
					                        <td class="ui center aligned delay-today">
 | 
				
			||||||
                    {{else if gt (divU64 $service.TotalDown (addU64 $service.TotalUp $service.TotalDown)) 10.0}}
 | 
					                            <i class="delay-today {{className (divU64 $service.CurrentUp (addU64 $service.CurrentUp $service.CurrentDown))}}"></i>
 | 
				
			||||||
                    低可用{{else}}良好{{end}}
 | 
					                            {{statusName (divU64 $service.CurrentUp (addU64 $service.CurrentUp $service.CurrentDown))}}
 | 
				
			||||||
                    {{else}}无数据
 | 
					                        </td>
 | 
				
			||||||
                    {{end}}
 | 
					                    </tr> {{end}}
 | 
				
			||||||
                </div>
 | 
					                </tbody>
 | 
				
			||||||
            </div>
 | 
					            </table>
 | 
				
			||||||
            <div class="ui divider"></div>
 | 
					 | 
				
			||||||
            {{end}}
 | 
					 | 
				
			||||||
        </div>
 | 
					        </div>
 | 
				
			||||||
    </div>
 | 
					    </div>
 | 
				
			||||||
</div>
 | 
					</div>
 | 
				
			||||||
 | 
				
			|||||||
@ -34,7 +34,7 @@ var CronLock sync.RWMutex
 | 
				
			|||||||
var Crons map[uint64]*model.Cron
 | 
					var Crons map[uint64]*model.Cron
 | 
				
			||||||
var Cron *cron.Cron
 | 
					var Cron *cron.Cron
 | 
				
			||||||
 | 
					
 | 
				
			||||||
var Version = "v0.3.3"
 | 
					var Version = "v0.3.4"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
func ReSortServer() {
 | 
					func ReSortServer() {
 | 
				
			||||||
	ServerLock.RLock()
 | 
						ServerLock.RLock()
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user