Add do=brmstatus

This commit is contained in:
Dominik Pantůček 2023-07-02 16:56:20 +02:00
parent cc99471482
commit 1818e93635

View file

@ -5,6 +5,12 @@
* @license GPL 2 http://www.gnu.org/licenses/gpl-2.0.html
* @author Dominik Pantůček <dominik.pantucek@trustica.cz>
*/
// must be run within DokuWiki
if(!defined('DOKU_INC')) die();
require_once("common.php");
class action_plugin_hackerbase extends DokuWiki_Action_Plugin
{
@ -30,6 +36,22 @@ class action_plugin_hackerbase extends DokuWiki_Action_Plugin
echo file_get_contents($this->getConf("htmlexports") . '/' . $user . ".html");
die();
} else if ($act === 'brmstatus') {
$spaceapi_status_json = $this->getConf("spaceapijson");
$status = hackerbase_spaceapi_html_snippet($spaceapi_status_json);
// The following was taken from original /var/www/status-renderer/status.php verbatim for now:
echo '<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">';
echo '<html>';
echo '<head>';
echo '<title>Brmlab space status page</title>';
echo '<style>';
echo 'p {font: 80% "Lucida Grande",Verdana,Lucida,Helvetica,Arial,sans-serif;}';
echo 'h3 {font: 1em "Lucida Grande",Verdana,Lucida,Helvetica,Arial,sans-serif; font-weight: bold;}';
echo '</style>';
echo '</head>';
echo '<body>';
echo $status;
echo '</body>';
echo '</html>';
}
}