-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
171 lines (118 loc) · 3.78 KB
/
index.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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!doctype html>
<html>
<head>
<meta charset="utf-8">
<link href='//fonts.googleapis.com/css?family=Raleway:400,300,600' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="css/skeleton.css">
<link rel="stylesheet" href="css/normalize.css">
<title>Governor</title>
</head>
<body>
<script src="wasm_exec.js"></script>
<script>
if (!WebAssembly.instantiateStreaming) {
WebAssembly.instantiateStreaming = async (resp, importObject) => {
const source = await (await resp).arrayBuffer();
return await WebAssembly.instantiate(source, importObject);
};
}
const go = new Go();
let mod, inst;
WebAssembly.instantiateStreaming(fetch("test.wasm"), go.importObject).then(async (result) => {
mod = result.module;
inst = result.instance;
document.getElementById("runButton").disabled = false;
});
async function run() {
await go.run(inst);
inst = await WebAssembly.instantiate(mod, go.importObject);
}
async function clean() {
document.getElementById("target").innerHTML = "";
document.getElementById("code").innerHTML = "";
}
function IncludeHTML() {
var z, i, elmnt, file, xhttp;
z = document.getElementsByTagName("*");
for (i = 0; i < z.length; i++) {
elmnt = z[i];
file = elmnt.getAttribute("w3-include-html");
if (file) {
xhttp = new XMLHttpRequest();
xhttp.onreadystatechange = function() {
if (this.readyState == 4) {
if (this.status == 200) {elmnt.innerHTML = this.responseText;}
if (this.status == 404) {elmnt.innerHTML = "Page not found.";}
elmnt.removeAttribute("w3-include-html");
IncludeHTML();
}
}
xhttp.open("GET", file, true);
xhttp.send();
return;
}
}
setTimeout(IncludeHTML, 1000);
}
// setInterval(refreshQuote, 1000); //every 1 second
// function refreshQuote() {
// $("tasks").load("tasks.html");
// }
</script>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
var auto_refresh = setInterval( function(){$("#target").load("tasks.html").fadeIn("slow");}, 500);
var auto_refresh = setInterval( function(){$("#dns").load("dns.html").fadeIn("slow");}, 500);
</script>
<!-- User: <input type="text" id="user">
Action: <input type="text" id="action">
Email: <input type="text" id="email"> -->
<!-- <button onClick="clean();" id="clearButton">Clean</button> -->
<!-- <div id="target">
</div> -->
<div class="container">
<div class="row">
<div class="one column" >
</div>
<div class="eleven columns" >
<h1>Governor</h1>
</div>
</div>
<div class="row"></div>
<div class="row">
<!-- <div class="one column" >
</div> -->
<div class="eleven columns" >
<input class="u-full-width" type="text" id="chat" size="100" placeholder="Example: please create A record in zone verf.local with hostname gov and ip 10.0.0.1">
<button class="button" onClick="run();" id="runButton" disabled>Send</button>
<!-- <p>Example: please create user brian and send credentials to [email protected]</p> -->
</div>
</div>
<div class="row">
<!-- <div id="target" w3-include-html="tasks.html"> -->
<div class="one column">
</div>
<div class="six columns" id="tasks">
</div>
<div class="eleven columns" id="tasks">
</div>
</div>
<div class="row">
<!-- <div class="one column" id="tasks">
</div> -->
<div class="five columns" id="target">
<!-- <script>
IncludeHTML();
</script> -->
</div>
<div class="six columns" id="dns">
<!-- <script>
IncludeHTML();
</script> -->
</div>
</div>
<!-- <div id="tasks">
</div> -->
</div>
</body>
</html>