-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathui.go
84 lines (78 loc) · 4.85 KB
/
ui.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
package main
const (
alias = `<!doctype html>
<html lang="en-US">
<head>
<meta charset="utf-8">
<meta http-equiv="x-ua-compatible" content="ie=edge">
<title>GoSlash</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="robots" content="noindex">
<link href="https://fonts.googleapis.com/css?family=Bitter|Source+Sans+Pro" rel="stylesheet">
<style>
body {
background: #3a7bd5;
background: -webkit-linear-gradient(to left, #3a6073, #3a7bd5);
background: -webkit-linear-gradient(right, #3a6073, #3a7bd5);
background: linear-gradient(to left, #3a6073, #3a7bd5);
}
body h1 {
font-family: 'Bitter', serif;
}
body .inner {
max-width: 1024px;
margin: 0 auto;
}
body .inner #alias-list {
background: #ffffff;
border-radius: 3px;
overflow: hidden;
}
body .inner #alias-list .alias:nth-child(1) {
border-top: none;
}
body .inner #alias-list .alias {
border-top: 1px solid #333;
padding: 16px;
position: relative;
cursor: pointer;
}
body .inner #alias-list .alias h3 {
display: inline-block;
font-family: 'Bitter', serif;
margin: 0;
padding: 0 0 4px;
}
body .inner #alias-list .alias p {
font-family: 'Source Sans Pro', sans-serif;
margin: 0;
padding: 0;
}
body .inner #alias-list .alias .target {
display: inline-block;
}
body .inner #alias-list .alias .icon {
position: absolute;
top: 16px;
right: 16px;
bottom: 16px;
height: 32px;
margin: auto;
}
body .inner #alias-list .alias:hover {
background: #EEE;
}
/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImFsaWFzLmxlc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7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NrZ3JvdW5kOiAjRUVFO1xufVxuIl19 */ </style>
<link href="https://fonts.googleapis.com/css?family=Bitter|Source+Sans+Pro:400,700" rel="stylesheet">
</head>
<body>
<div class="inner">
<h1>GoSlash</h1>
<div id="alias-list"></div>
</div>
<script>
!function(){function a(){var a=document.getElementById("alias-list");b.forEach(function(b){console.log(b);var c=document.createElement("div");c.classList.add("alias"),c.innerHTML="<h3>"+b.alias+'</h3><p class="target"> - '+b.target+"</p><p>"+b.description+'</p><span class="icon"><?xml version="1.0" encoding="UTF-8"?><!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd"><svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="32" height="32" viewBox="0 0 24 24"><path d="M4,11V13H16L10.5,18.5L11.92,19.92L19.84,12L11.92,4.08L10.5,5.5L16,11H4Z" /></svg></span>',c.addEventListener("click",function(){window.location.href="/"+b.alias}),a.appendChild(c)})}var b=[],c=new XMLHttpRequest;c.onload=function(c){b=c.target.response,a()},c.open("GET","http://127.0.0.1:8080/dump?"+(new Date).getTime(),!0),c.responseType="json",c.send()}(); </script>
</body>
</html>
`
)