-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathindex.go.html
138 lines (117 loc) · 2.54 KB
/
index.go.html
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
<html>
<head>
<title>CTF Password Manager Service</title>
<style>
h1 {
text-align: center;
}
div {
margin-bottom: 10px;
}
.buttons {
margin: 20px 0 0 155px;
}
.buttons input {
padding: 10px 15px;
}
.error {
border: 1px solid darkred;
background: salmon;
}
.info {
border: 1px solid darkgreen;
background: #73ECFA;
}
label {
display: inline-block;
width: 150px;
text-align: right;
}
input[name="login"] {
border-radius: 2px;
background-color: #88B04B;
}
input[name="register"] {
border-radius: 2px;
background-color: #92A8D1;
}
input[name="logout"] {
border-radius: 2px;
background-color: #92A8D1;
}
input[name="add"] {
border-radius: 2px;
background-color: #88B04B;
}
</style>
</head>
<body>
<h1>CTF Password Manager Service</h1>
{{ if .User }}
<form action="/logout" method="POST">
<div>
Welcome, <b>{{ .User.Name }}</b>!
<input type="submit" name="logout" value="Logout" />
</div>
</form>
<hr />
<div>
<table>
<tr>
<th>Address</th>
<th>User</th>
<th>Password</th>
</tr>
{{ if .Sites }}
{{ range $i := .Sites }}
<tr>
<td>{{ $i.Address }}</td>
<td>{{ $i.User }}</td>
<td>{{ $i.Pass }}</td>
</tr>
{{ end }}
{{ end }}
</table>
</div>
<hr />
<form action="/add" method="POST">
<div>
<label>Address:</label>
<input type="text" name="address" placeholder="required" autocomplete="off" autofocus/>
</div>
<div>
<label>Username:</label>
<input type="text" name="user" placeholder="required" autocomplete="off" autofocus/>
</div>
<div>
<label>Password:</label>
<input type="password" name="password" maxlength="20" placeholder="required"/>
</div>
<div class="buttons">
<input type="submit" name="add" value="Add site" />
</div>
</form>
{{ else }}
<form action="/" method="POST">
<div>
<label>Username:</label>
<input type="text" name="user" maxlength="20" placeholder="required" autocomplete="off" autofocus/>
</div>
<div>
<label>Password:</label>
<input type="password" name="password" maxlength="20" placeholder="required"/>
</div>
<div class="buttons">
<input type="submit" name="login" value="Login" />
<input type="submit" name="register" value="Register" />
</div>
</form>
{{ end }}
{{ if .Error }}
<div class="error"> <i>⚠</i> {{ .Error }} </div>
{{ end }}
{{ if .Info }}
<div class="info"> ⓘ {{ .Info }} </div>
{{ end }}
</body>
</html>