summaryrefslogtreecommitdiff
path: root/localwebsite/htdocs/index.php
diff options
context:
space:
mode:
authorEvgeny Zinoviev <me@ch1p.io>2022-05-21 01:45:56 +0300
committerEvgeny Zinoviev <me@ch1p.io>2022-05-21 01:45:56 +0300
commit6f53e6e997c9f4647a667bd58b11bc622fa3b47f (patch)
tree226bd65a04576de4f41bf8396af97cd43ca27829 /localwebsite/htdocs/index.php
parent902a3bfbe2c4645e6725fb7583500d1a28026fad (diff)
move local website to homekit's tree
Diffstat (limited to 'localwebsite/htdocs/index.php')
-rw-r--r--localwebsite/htdocs/index.php44
1 files changed, 44 insertions, 0 deletions
diff --git a/localwebsite/htdocs/index.php b/localwebsite/htdocs/index.php
new file mode 100644
index 0000000..a825fcb
--- /dev/null
+++ b/localwebsite/htdocs/index.php
@@ -0,0 +1,44 @@
+<?php
+
+require_once __DIR__.'/../init.php';
+
+global $lang;
+
+$router = new router;
+
+// modem
+$router->add('modem/status/', 'Modem status_page');
+$router->add('modem/status/get.ajax', 'Modem status_get_ajax');
+
+$router->add('routing/', 'Modem routing_smallhome_page');
+$router->add('routing/switch-small-home/', 'Modem routing_smallhome_switch');
+$router->add('routing/{ipsets,dhcp}/', 'Modem routing_${1}_page');
+$router->add('routing/ipsets/{add,del}/', 'Modem routing_ipsets_${1}');
+
+$router->add('modem/sms/', 'Modem sms_page');
+// $router->add('modem/set.ajax', 'Modem ctl_set_ajax');
+
+// inverter
+$router->add('inverter/', 'Inverter status_page');
+$router->add('inverter/status.ajax', 'Inverter status_ajax');
+
+// misc
+$router->add('/', 'Misc main');
+$router->add('sensors/', 'Misc sensors_page');
+$router->add('pump/', 'Misc pump_page');
+$router->add('phpinfo/', 'Misc phpinfo');
+
+
+$route = routerFind($router);
+if ($route === false)
+ (new FakeRequestHandler)->dispatch('404');
+
+list($handler, $act, $RouterInput) = $route;
+
+$handler_class = $handler.'Handler';
+if (!class_exists($handler_class)) {
+ debugError('index.php: class '.$handler_class.' not found');
+ (new FakeRequestHandler)->dispatch('404');
+}
+
+(new $handler_class)->dispatch($act);