]>
Commit | Line | Data |
---|---|---|
9ffc5134 VP |
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 | ?> | |
75c101fd | 23 | <table class="container-xxl table table-responsive caption-top table-striped"> |
9ffc5134 VP |
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" type="submit" value="Search"></th></form> | |
29 | </thead></table> | |
30 | ||
75c101fd | 31 | <table class="container-xxl table table-responsive caption-top table-striped"> |
9ffc5134 VP |
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">Host / IP</th> | |
9ffc5134 VP |
36 | <th scope="col">Connected to</th> |
37 | </thead> | |
38 | ||
39 | <tbody> | |
40 | <form method="post"> | |
41 | <?php | |
42 | ||
43 | foreach($servers as $server) | |
44 | { | |
45 | ||
46 | ||
47 | /* Some basic filtering for NAME */ | |
48 | if (isset($_POST['sf_name']) && strlen($_POST['sf_name']) && | |
49 | strpos(strtolower($server->name), strtolower($_POST['sf_name'])) !== 0 && | |
50 | strpos(strtolower($server->name), strtolower($_POST['sf_name'])) == false) | |
51 | continue; | |
52 | ||
53 | ||
54 | echo "<tr>"; | |
55 | echo "<th scope=\"row\"><input type=\"checkbox\" value='" . base64_encode($server->id)."' name=\"serverch[]\"></th>"; | |
ab64cfc4 | 56 | echo "<td><a href=\"details.php?server=".$server->id."\">$server->name</a></td>"; |
9ffc5134 | 57 | echo "<td>".$server->hostname." (".$server->ip.")</td>"; |
9ffc5134 VP |
58 | echo "<td>".$server->server->uplink."</td>"; |
59 | } | |
60 | ?> | |
61 | </tbody></table> | |
62 | </div> | |
63 | ||
64 | <?php require_once UPATH.'/footer.php'; ?> |