-
Notifications
You must be signed in to change notification settings - Fork 5
/
page_html.go
119 lines (114 loc) · 2.88 KB
/
page_html.go
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
package main
var defaultPageHTML = `<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<title>{{.Title}} - Powered by Tower</title>
<style>
*{font-family: Helvetica Neue, Arial, Verdana, sans-serif;}
body{margin: 0;}
.header{
width:100%;
height: 70px;
background-color: burlywood;
}
h1{
font-size: 30px;
line-height: 70px;
max-width: 880px;
margin: 0 auto;
padding-left: 20px;
}
.content{
max-width: 880px;
margin: 0 auto;
padding-left:20px;
}
h2{font-size:20px;}
.message{margin: 40px 0 60px 0;}
.snippet, .trace{
margin-left: -15px;
padding:14px;
border: 1px solid burlywood;
border-radius: 5px;
-moz-border-radius: 5px;
-webkit-border-radius: 5px;
margin-bottom: 30px;
}
dl{margin:0}
.numbers, .codes{line-height: 22px;}
.bold{font-weight:bold;}
dd.codes{margin:0;min-height:22px}
.numbers{
float:left;
text-align: right;
margin-right: 15px;
color: #929292;
}
.trace ul{
padding: 0;
margin: 0;
list-style: none;
}
.trace ul li{margin-bottom: 10px;}
.trace .func{color: #929292;}
.clearfix{clear: both;}
</style>
</head>
<body>
<div class="header">
<h1>{{.Title}} -- {{.Time}}</h1>
</div>
<div class="content">
<div class="message">
{{.Message}}
<p><a href="/tower-proxy/watch/restart" target="_blank">[Restart]</a>
[
Watcher:
<a href="/tower-proxy/watch" target="_blank">Status</a>
|
<a href="/tower-proxy/watch/begin" target="_blank">Start</a>
|
<a href="/tower-proxy/watch/pause" target="_blank">Pause</a>
]</p>
</div>
{{if .ShowSnippet}}
<h2>{{.SnippetPath}}</h2>
<div class="snippet">
{{range .Snippet}}
<dl>
{{if .Current}}
<dt class="numbers bold">{{.Number}}</dt>
<dd class="codes bold">{{.Code}}</dd>
{{else}}
<dt class="numbers">{{.Number}}</dt>
<dd class="codes">{{.Code}}</dd>
{{end}}
</dl>
{{end}}
</div>
{{end}}
{{if .ShowTrace}}
<h2>Trace</h2>
<div class="trace">
<ul>
{{range .Trace}}
<li>
{{if .AppFile}}
<strong>{{.File}}:{{.Line}}</strong>
{{end}}
{{if not .AppFile}}
{{.File}}:{{.Line}}
{{end}}
<br/>
<span class="func">{{.Func}}</span>
</li>
{{end}}
</ul>
</div>
{{end}}
</div>
</body>
</html>
`