diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2022-07-12 16:14:26 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2022-07-12 16:14:26 +0300 |
commit | 36c90356aa291b65661b523e2f79375a72d588b0 (patch) | |
tree | c91b874d508f3f98f16fb81801eafe54a77f800d | |
parent | c9d16ad69525986096ed265a6ac9ec01696eb0ac (diff) |
localwebsite: add grafana links
-rw-r--r-- | localwebsite/config.php | 3 | ||||
-rw-r--r-- | localwebsite/handlers/MiscHandler.php | 5 | ||||
-rw-r--r-- | localwebsite/templates-web/index.twig | 4 |
3 files changed, 10 insertions, 2 deletions
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 @@ <h6 class="mt-4">Другое</h6> <ul class="list-group list-group-flush"> - <li class="list-group-item"><a href="/inverter/">Инвертор</a></li> + <li class="list-group-item"><a href="/inverter/">Инвертор</a> (<a href="{{ grafana_inverter_url }}">Grafana</a>)</li> <li class="list-group-item"><a href="/pump/">Насос</a></li> - <li class="list-group-item"><a href="/sensors/">Датчики</a></li> + <li class="list-group-item"><a href="/sensors/">Датчики</a> (<a href="{{ grafana_sensors_url }}">Grafana</a>)</li> <li class="list-group-item"><a href="/cams/">Камеры</a></li> </ul> </div>
\ No newline at end of file |