-
Notifications
You must be signed in to change notification settings - Fork 0
/
temp.html
97 lines (88 loc) · 2.43 KB
/
temp.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
<!doctype html>
<html lang="en">
<head>
<title>Golang Test </title>
<meta charset="utf-8">
<meta name="description" content="This is a simple template loading test with Golang">
<meta name="description" content="TEsto si es bonito! y en español, Go Golang!">
<meta name="author" content="twogg-git">
<style>
.button {
background:green;
color: white;
text-align: center;
display: inline-block;
font-size: 14px;
}
.title {
color:purple;
font-size: 24px;
}
.content {
color:green;
font-size: 18px;
}
.table {
color:blue;
font-size: 16px;
}
</style>
</head>
<body>
<h1 class="title">Simple Deploy with Golang<h1>
<div class="content">
Current IP: {{.ServerIP}}<br>
Version: {{.Version}}<br><br>
Last Refresh: {{.Deployed}}
</div>
<div class="table">
<br>Active endpoints:
<ul id="infoTable" class="table">
{{range .Endpoints}}
{{if .Active}}
<li class="true">{{.Path}}, {{.Type}}</li>
{{end}}
{{end}}
</ul>
</div>
<div>
<button type="button" class= "button" onclick="flipFunc()">Flip Text</button>
<input id="toflip" name="toflip" type="text" value="" />
<label id="fliResult" class="table"></label>
</div>
<script>
function flipFunc() {
var callTo = "https://go-circle.herokuapp.com/flip?text=" + toflip.value;
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById('fliResult').innerHTML = this.responseText;
}
};
xhttp.open("GET", callTo, true);
xhttp.setRequestHeader("Content-type", "text/plain");
xhttp.send();
}
</script>
<div>
<button type="button" class= "button" onclick="timeFunc()">Server Time</button>
<label id="currentTime" class="table"></label>
</div>
<script>
function timeFunc() {
var xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
document.getElementById('currentTime').innerHTML = this.responseText;
}
};
xhttp.open("GET", "http://{{.ServerIP}}:{{.Port}}/time", true);
xhttp.setRequestHeader("Content-type", "text/plain");
xhttp.send();
}
</script>
<div class="content"><br>Test Flip Endpoint:
<br>Locally http://{{.ServerIP}}:{{.Port}}/flip?text=texToFlip
<br>Heroku: https://go-circle.herokuapp.com/flip?text=texToFlip</div>
</body>
</html>