Oppaitime's version of Gazelle
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

network.php 1.1KB

12345678910111213141516171819202122232425262728293031323334
  1. <?
  2. $Servers = array_diff(scandir(SERVER_ROOT.'/misc/heartbeat', 1), array('.', '..'));
  3. View::show_header('Network status');
  4. ?>
  5. <h2>Network Status</h2>
  6. <div style="font-size: 0; text-align: center;">
  7. <div class="net_box">
  8. <div class="head">Webserver</div>
  9. <div class="box pad center">
  10. <span class="r10">Online</span>
  11. </div>
  12. </div>
  13. <?
  14. foreach ($Servers as $Server) {
  15. $Contents = file_get_contents(SERVER_ROOT.'/misc/heartbeat/'.$Server);
  16. if (substr($Server, 0, 7) == 'Tracker' || substr($Server, 0, 3) == 'IRC') {
  17. $Contents = explode("\n", $Contents);
  18. $Contents = '<span class="'.(((time() - (int)array_slice($Contents, -2)[0]) < 610) ? 'r10">Online' : 'r03">Offline').'</span>'.((substr($Server,0,7)=='Tracker')?'<br><br>'.('Backup From: '.time_diff((int)$Contents[0], 2, false)):'');
  19. } else if (substr($Server, 0, 6) == 'Backup') {
  20. $Contents = 'Backup From: '.time_diff((int)$Contents, 2, false);
  21. }
  22. ?>
  23. <div class="net_box">
  24. <div class="head"><?=$Server?></div>
  25. <div class="box pad center">
  26. <span><?=$Contents?></span>
  27. </div>
  28. </div>
  29. <?
  30. echo ($Server == 'IRC' ? '<br>' : '');
  31. } ?>
  32. </div>
  33. <? View::show_footer();