• R/O
  • SSH
  • HTTPS

ogup: 提交


Commit MetaInfo

修訂42 (tree)
時間2021-12-07 21:22:00
作者mateuszviste

Log Message

filter feature added in dbdump menu

Change Summary

差異

--- trunk/frontend/dbdump/gophermap.php (revision 41)
+++ trunk/frontend/dbdump/gophermap.php (revision 42)
@@ -12,13 +12,24 @@
1212 echo "i\n";
1313 echo "i >>> OGUP live database dump (as of {$dbtimestamp} UTC) <<<\n";
1414 echo "i\n";
15-echo "i ### | HOSTNAME | STATUS | NEXT CHECK\n";
15+echo "7Apply a filter on hostname\t$\n";
16+echo "i\n";
17+if (!empty($_SERVER['QUERY_STRING_SEARCH'])) {
18+ $filter = trim($_SERVER['QUERY_STRING_SEARCH']);
19+ echo "iResults are filtered to hostnames matching '{$filter}'\n";
20+ echo "i\n";
21+}
22+echo "i ### | HOSTNAME | STATUS | NEXT CHECK (UTC)\n";
1623 echo "i-----+---------------------------------+-----------------------+-----------------\n";
1724
1825 $i = 1;
1926 foreach ($db as $item) {
20- $host = str_pad($item['host'] . ' ', 32, '.', STR_PAD_RIGHT);
21- $port = $item['port'];
27+ $host = $item['host'];
28+ if ($item['port'] != 70) $host .= ':' . $item['port'];
29+ if ((!empty($filter)) && (stripos($host, $filter) === FALSE)) continue;
30+
31+ $host = str_pad($host . ' ', 32, '.', STR_PAD_RIGHT);
32+
2233 if ($item['failedsince'] == 0) {
2334 $status = 'OK';
2435 } else if ($item['failedsince'] == 1) {
Show on old repository browser