-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathindex.php
114 lines (94 loc) · 3.52 KB
/
index.php
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
<?php
/**
* Author: Abu Ashraf Masnun
* URL: http://masnun.me
*/
require_once 'config.php';
?>
<!DOCTYPE html>
<html lang="en" ng-app>
<head>
<title>Urban Terror Server Monitor</title>
<script type="text/javascript">
configured_server_list = <?php echo json_encode($servers); ?>;
</script>
<link href="static/bootstrap/css/bootstrap.min.css" rel="stylesheet"/>
<script src="static/bootstrap/js/bootstrap.min.js" type="text/javascript"></script>
<script src="static/urtnotif/jquery-1.9.1.min.js" type="text/javascript"></script>
<script src="static/urtnotif/angular.min.js" type="text/javascript"></script>
<script src="static/urtnotif/controller.js" type="text/javascript"></script>
<script type="text/javascript">
$(document).ready(function () {
$("a#start_mon").hide();
$("a#stop_dn").hide();
if (!window.webkitNotifications) {
$("a#start_dn").hide();
}
})
</script>
<style type="text/css">
body {
padding-top: 60px;
padding-bottom: 40px;
}
p.user a {
color: #adff2f;
}
</style>
</head>
<body ng-controller="UrbanTerrorController">
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</a>
<a class="brand">Urban Terror Server Monitor</a>
<p class="pull-right">
<a class="btn btn-success" id="start_mon" ng-click="startMonitoring()">Start Monitoring</a>
<a class="btn btn-danger" id="stop_mon" ng-click="stopMonitoring()">Stop Monitoring</a>
<a class="btn btn-success" id="start_dn" ng-click="startDN()">Enable Desktop Notification</a>
<a class="btn btn-danger" id="stop_dn" ng-click="stopDN()">Disable Desktop Notification</a>
</p>
</div>
</div>
</div>
<div class="container">
<div class="row">
<div class="span12">
<div ng-repeat="server in server_list">
<h1>{{ server.name }}</h1>
<br/>
<span class="label label-inverse">Map</span> {{ server.configs.mapname }}
<span class="label label-inverse">Host</span> {{ server.host }}
<span class="label label-inverse">Port</span> {{ server.port }}
<a class="btn" ng-click="updateServer(server)">Update</a>
<br/><br/>
<table class="table table-bordered table-condensed">
<thead>
<tr>
<th>Name</th>
<th>Score</th>
<th>Ping</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="player in server.players">
<td>{{ player.name }}</td>
<td>{{ player.score }}</td>
<td>{{ player.ping }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>
<br/><br/>
<footer>
<center><a target="_blank" href="https://github.com/masnun/urtweb">Fork on Github!</a></center>
</footer>
</body>
</html>