-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadmin.html
More file actions
46 lines (41 loc) · 1.41 KB
/
admin.html
File metadata and controls
46 lines (41 loc) · 1.41 KB
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
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, width=device-width, height=device-height">
<title>lisyoen's admin</title>
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"></script>
<script src="http://lisyoen.cafe24.com:8000/socket.io/socket.io.js"></script>
<script>
var socket = io.connect('http://lisyoen.cafe24.com:8000');
function git_pull() {
socket.emit('git pull');
}
function restart() {
socket.emit('restart');
}
$(function() {
socket.on('message', function(data) {
console.log(data);
message_list.innerHTML = "Other: " + data.message + "<br />" + message_list.innerHTML;
});
socket.on('my_message', function(data) {
message_list.innerHTML = "You: " + data.message + "<br />" + message_list.innerHTML;
});
socket.on('system report', function(data) {
if (data.err) {
message_list.innerHTML = "Error: " + data.stderr.replace('\n', '<br />') + '<br />' + message_list.innerHTML;
} else {
message_list.innerHTML = "System: " + data.stdout.replace('\n', '<br />') + '<br />' + message_list.innerHTML;
}
});
});
</script>
</head>
<body>
<h3>admin page</h3>
<button type="button" onclick="send()">Send</button>
<button type="button" onclick="git_pull()">git pull</button>
<button type="button" onclick="restart()">restart</button>
<div id="message_list"></div>
</body>
</html>