-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
65 lines (55 loc) · 2.27 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
<!DOCTYPE html>
<html manifest="dashboard.appcache">
<head>
<meta charset="utf-8">
<!--
Crowd Dashboard
Created 2013 by Martin Giger
Licensed under GPLv2
Visit the GitHub project: http://freaktechnik.github.io/Crowd-Dashboard
-->
<title>Dashboard</title>
<link rel="stylesheet" type="text/css" href="style.css">
<script type="text/javascript" src="../crowd-dashboard.js"></script>
<script type="text/javascript">
"use strict";
var statusDashboard;
window.onload = function() {
statusDashboard = new Dashboard();
function loadDataForDashboard(fileURL,dashboard) {
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if( xhr.readyState == 4 && xhr.status != 0 && xhr.status < 400 )
dashboard.servers = JSON.parse(xhr.response);
//else if( xhr.readyState == 4 )
// dashboard.servers = [];
};
xhr.open('GET',fileURL);
xhr.send();
}
loadDataForDashboard("json/servers.json",statusDashboard);
// set up the mirrors list
var mirrorsDashboard = new Dashboard(null, {targetNodeId: 'mirrors'});
mirrorsDashboard.addEventListener('empty',function(event) {
document.getElementById('mirrorsWrapper').classList.add('hidden');
});
loadDataForDashboard("json/mirrors.json",mirrorsDashboard);
};
function refresh(dashboard) {
dashboard.checkServers();
}
</script>
</head>
<body>
<article>
<h1>Dashboard</h1>
<button onclick="refresh(statusDashboard);">Refresh</button>
<div id="crowd-dashboard-status-list">
</div>
</article>
<footer>
<a href="https://github.com/freaktechnik/Crowd-Dashboard">Source on GitHub</a>
<section id="mirrorsWrapper">Mirrors: <div id="mirrors"></div></section>
</footer>
</body>
</html>