diff --git a/localwebsite/config.php b/localwebsite/config.php index 68c1ed5..d16ef1c 100644 --- a/localwebsite/config.php +++ b/localwebsite/config.php @@ -74,4 +74,7 @@ return [ 'auth_cookie_host' => '', 'auth_need' => false, // bool|callable 'auth_pw_salt' => '', + + 'grafana_sensors_url' => '', + 'grafana_inverter_url' => '' ]; diff --git a/localwebsite/handlers/MiscHandler.php b/localwebsite/handlers/MiscHandler.php index 4d2e20a..657395e 100644 --- a/localwebsite/handlers/MiscHandler.php +++ b/localwebsite/handlers/MiscHandler.php @@ -4,7 +4,12 @@ class MiscHandler extends RequestHandler { public function GET_main() { + global $config; $this->tpl->set_title('Главная'); + $this->tpl->set([ + 'grafana_sensors_url' => $config['grafana_sensors_url'], + 'grafana_inverter_url' => $config['grafana_inverter_url'], + ]); $this->tpl->render_page('index.twig'); } diff --git a/localwebsite/templates-web/index.twig b/localwebsite/templates-web/index.twig index 8a0bdaf..620ad40 100644 --- a/localwebsite/templates-web/index.twig +++ b/localwebsite/templates-web/index.twig @@ -20,9 +20,9 @@
Другое
\ No newline at end of file