]> jfr.im git - irc/unrealircd/unrealircd-webpanel.git/blob - servers/index.php
Make the start of modules listing
[irc/unrealircd/unrealircd-webpanel.git] / servers / index.php
1 <?php
2 require_once "../common.php";
3 require_once UPATH . "/header.php";
4
5 if (!empty($_POST)) {
6 do_log($_POST);
7 }
8
9 /* Get the server list */
10 $servers = $rpc->server()->getAll();
11 ?>
12 <h4>Servers Overview</h4>
13
14 Click on a server name to view more information.
15
16 <div id="Servers">
17
18 <?php
19 if (isset($_POST['sf_name']) && strlen($_POST['sf_name']))
20 Message::Info("Listing servers which match name: \"" . $_POST['sf_name'] . "\"");
21
22 ?>
23 <table class="container-xxl table table-sm table-responsive caption-top table-striped">
24 <thead>
25 <th scope="col"><h5>Filter:</h5></th>
26 <form action="" method="post">
27 <th scope="col" colspan="2">Name<input name="sf_name" type="text" class="form-control short-form-control">
28 <th scope="col"> <input class="btn btn-primary btn-sm" type="submit" value="Search"></th></form>
29 </thead></table>
30
31 <table class="container-xxl table table-sm table-responsive caption-top table-striped">
32 <thead class="table-primary">
33 <th scope="col"><input type="checkbox" label='selectall' onClick="toggle_server(this)" /></th>
34 <th scope="col">Name</th>
35 <th scope="col">Users</th>
36 <th scope="col">Version</th>
37 <th scope="col">Host / IP</th>
38 <th scope="col">Connected to</th>
39 <th scope="col">Up since</th>
40 </thead>
41
42 <tbody>
43 <form method="post">
44 <?php
45
46 foreach($servers as $server)
47 {
48
49
50 /* Some basic filtering for NAME */
51 if (isset($_POST['sf_name']) && strlen($_POST['sf_name']) &&
52 strpos(strtolower($server->name), strtolower($_POST['sf_name'])) !== 0 &&
53 strpos(strtolower($server->name), strtolower($_POST['sf_name'])) == false)
54 continue;
55
56
57 echo "<tr>";
58 echo "<th scope=\"row\"><input type=\"checkbox\" value='" . base64_encode($server->id)."' name=\"serverch[]\"></th>";
59 echo "<td><a href=\"details.php?server=".$server->id."\">$server->name</a></td>";
60 echo "<td>".$server->server->num_users."</td>";
61 $s = "";
62 if (isset($server->server->features->software)) // not (always) present on services
63 $s .= $server->server->features->software;
64
65 if ($server->server->ulined == true)
66 $s .= " <span class=\"badge rounded-pill badge-warning\">Services</span>";
67
68 echo "<td>$s</td>";
69 echo "<td>".$server->hostname." (".$server->ip.")</td>";
70 if (isset($server->server->uplink))
71 echo "<td>".$server->server->uplink."</td>";
72 else
73 echo "<td></td>"; /* self */
74 echo "<td>".$server->server->boot_time."</td>";
75 }
76 ?>
77 </tbody></table>
78 </div>
79
80 <?php require_once UPATH.'/footer.php'; ?>