This repository has been archived by the owner on Jul 5, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
index.html
35 lines (34 loc) · 1.56 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Steam Game Logger</title>
</head>
<body style='background-color: rgb(30, 30, 30);color: rgb(204, 204, 204);font-family: consolas,-apple-system,system-ui,BlinkMacSystemFont,"Segoe UI",Roboto,"Helvetica Neue",sans-serif;font-size: 14px;'>
<div id="log"></div>
<script src="/socket.io/socket.io.js"></script>
<script>
var password = window.prompt("Input your password")
var socket = io(window.location.host)
socket.on('connect', function() {
socket.emit('authentication', {username: "Indexyz", password: password})
socket.on('authenticated', function() {
socket.on('log', function (data) {
var newData = data.replace(/ /g, " ")
.replace(/\[info\]/g, '<font color="#3b8eea">[info]</font>')
.replace(/\[warn\]/g, '<font color="#b0d33b">[warn]</font>')
.replace(/\[error\]/g, '<font color="#c82e2e">[error]</font>')
var logElem = document.getElementById('log')
logElem.innerHTML += ('<p style="margin-top: 0px;margin-bottom: 0px;">' + newData + '</p>')
})
})
socket.on('unauthorized', function(err){
alert("Wrong password")
window.location.reload()
})
})
</script>
</body>
</html>