forked from feiyu563/PrometheusAlert
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.html
More file actions
94 lines (83 loc) · 3.04 KB
/
Copy pathmain.html
File metadata and controls
94 lines (83 loc) · 3.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
{{define "main"}}
<!DOCTYPE html>
<html>
<head>
<link rel="shortcut icon" href="/static/img/prometheus-ico.png" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="/static/css/bootstrap.min.css" rel="stylesheet" />
<link href="/static/css/docs.css" rel="stylesheet" />
<style>
#myBtn {
display: none;
position: fixed;
right: 5px;
top: 70%;
z-index: 99;
border: none;
outline: none;
cursor: pointer;
padding: 12px;
border-radius: 18px;
background-color:rgba(255,255,255,.15);
border-color:#4cae4c;
}
#myBtn:hover {
background-color:#f9f9f9;
border-color:#eea236;
}
</style>
{{end}}
{{define "head"}}
<div class="navbar navbar-static-top bs-docs-nav">
<div class="container">
<a class="navbar-brand" href="#">
<img alt="Brand" width="20" height="20" src="/static/img/prometheus-ico.png">
</a>
<a class="navbar-brand" href="/">PrometheusAlert</a>
<ul class="nav nav-tabs">
<li role="presentation" {{if .IsIndex}}class="active"{{end}}><a href="/">Index</a></li>
<li role="presentation" {{if .IsTest}}class="active"{{end}}><a href="/test">Test</a></li>
<li role="presentation" {{if .IsTemplate}}class="active"{{end}}><a href="/template">AlertTemplate</a></li>
<li role="presentation" {{if .IsSilences}}class="active"{{end}}><a href="javascript:if(confirm('即将上线,敬请期待......'))location='/'">Silences</a></li>
<li role="presentation" {{if .IsSetup}}class="active"{{end}}><a href="javascript:if(confirm('即将上线,敬请期待......'))location='/'">Setup</a></li>
<li role="presentation"><a href="https://feiyu563.github.io/">Help</a></li>
{{if .IsLogin}}
<!--<li role="presentation" class="navbar-right"><a href="/login?exit=true"><span class="glyphicon glyphicon-off"></span></a></li>-->
{{else}}
<!--<li role="presentation" class="navbar-right"><a href="/login"><span class="glyphicon glyphicon-user"></span></a></li>-->
{{end}}
</ul>
</div>
</div>
{{end}}
{{define "endhtml"}}
<script type="text/javascript" src="/static/js/jquery-3.3.1.min.js"></script>
<script type="text/javascript" src="/static/js/bootstrap.min.js"></script>
<div class="container">
<button onclick="topFunction()" id="myBtn"><span class="glyphicon glyphicon-plane"></span><p>返回顶部</p></button>
<script>
// 当网页向下滑动 20px 出现"返回顶部" 按钮
window.onscroll = function() {scrollFunction()};
function scrollFunction() {console.log(121);
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("myBtn").style.display = "block";
} else {
document.getElementById("myBtn").style.display = "none";
}
}
// 点击按钮,返回顶部
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script>
</div>
<div class="bs-docs-footer">
<div class="container">
<p>Designed and built with all the love in the world by jikun.zhang</p>
<p>PrometheusAlert</p>
</div>
</div>
</body>
</html>
{{end}}