From 7156cc541f65202fb01be159ddc161d97db06036 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Wed, 26 Apr 2023 21:57:11 +0200 Subject: [PATCH] Port PHP to Lua Pages Signed-off-by: DL6ER --- .php-cs-fixer.dist.php | 31 ----- cname_records.php | 8 +- composer.json | 7 +- dns_records.php | 10 +- gravity.php | 8 +- groups-adlists.php | 12 +- groups-clients.php | 14 +-- groups-domains.php | 12 +- groups.php | 12 +- img/favicons/manifest.json | 2 +- index.php => index.lp | 47 ++++---- login.php => login.lp | 31 +++-- messages.php => messages.lp | 15 +-- network.php | 10 +- package.json | 4 +- queries.php => queries.lp | 30 ++--- queryads.php | 8 +- scripts/pi-hole/js/footer.js | 8 +- scripts/pi-hole/js/index.js | 10 +- scripts/pi-hole/js/login.js | 7 +- scripts/pi-hole/js/queries.js | 2 +- scripts/pi-hole/js/settings-system.js | 19 +++ .../pi-hole/{php/footer.php => lua/footer.lp} | 8 +- scripts/pi-hole/lua/header.lp | 84 +++++++++++++ .../header_authenticated.lp} | 74 ++++++------ .../{php/sidebar.php => lua/sidebar.lp} | 110 +++++++++--------- scripts/pi-hole/lua/theme.lua | 57 +++++++++ scripts/pi-hole/php/header.php | 75 ------------ settings-advanced.lp | 21 ++++ settings-advanced.php | 24 ---- settings-api.php => settings-api.lp | 33 +++--- settings-dhcp.php => settings-dhcp.lp | 25 ++-- ...dns-records.php => settings-dns-records.lp | 29 +++-- settings-dns.php => settings-dns.lp | 25 ++-- settings-system.php => settings-system.lp | 34 +++--- style/pi-hole.css | 2 +- taillog.php => taillog.lp | 13 +-- 37 files changed, 458 insertions(+), 463 deletions(-) delete mode 100644 .php-cs-fixer.dist.php rename index.php => index.lp (88%) rename login.php => login.lp (85%) rename messages.php => messages.lp (83%) rename queries.php => queries.lp (92%) rename scripts/pi-hole/{php/footer.php => lua/footer.lp} (94%) create mode 100644 scripts/pi-hole/lua/header.lp rename scripts/pi-hole/{php/header_authenticated.php => lua/header_authenticated.lp} (70%) rename scripts/pi-hole/{php/sidebar.php => lua/sidebar.lp} (70%) create mode 100644 scripts/pi-hole/lua/theme.lua delete mode 100644 scripts/pi-hole/php/header.php create mode 100644 settings-advanced.lp delete mode 100644 settings-advanced.php rename settings-api.php => settings-api.lp (89%) rename settings-dhcp.php => settings-dhcp.lp (96%) rename settings-dns-records.php => settings-dns-records.lp (90%) rename settings-dns.php => settings-dns.lp (96%) rename settings-system.php => settings-system.lp (93%) rename taillog.php => taillog.lp (84%) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php deleted file mode 100644 index dfcb0c3e..00000000 --- a/.php-cs-fixer.dist.php +++ /dev/null @@ -1,31 +0,0 @@ -ignoreDotFiles(false) - ->ignoreVCSIgnored(true) - ->exclude('scripts/vendor') - ->in(__DIR__) -; - -$config = new PhpCsFixer\Config(); -$config - ->setRules(array( - '@Symfony' => true, - 'array_syntax' => array('syntax' => 'long'), - 'yoda_style' => array('equal' => false, 'identical' => false, 'less_and_greater' => false, 'always_move_variable' => false), - )) - ->setLineEnding(PHP_EOL) - ->setFinder($finder) -; - -return $config; diff --git a/cname_records.php b/cname_records.php index 323ba476..9e9288b1 100644 --- a/cname_records.php +++ b/cname_records.php @@ -8,7 +8,7 @@ * Please see LICENSE file for your rights under this license. */ -require 'scripts/pi-hole/php/header_authenticated.php'; +mg.include('scripts/pi-hole/lua/header_authenticated.lp','r') ?> @@ -79,8 +79,6 @@ require 'scripts/pi-hole/php/header_authenticated.php'; - + - + diff --git a/composer.json b/composer.json index e14afd81..1084f48a 100644 --- a/composer.json +++ b/composer.json @@ -7,10 +7,5 @@ "phpstan/phpstan": "1.*" }, "license": "EUPL-1.2", - "minimum-stability": "stable", - "autoload": { - "files": [ - "scripts/vendor/qrcode.php" - ] - } + "minimum-stability": "stable" } diff --git a/dns_records.php b/dns_records.php index 25870f4e..7a175f06 100644 --- a/dns_records.php +++ b/dns_records.php @@ -8,7 +8,7 @@ * Please see LICENSE file for your rights under this license. */ -require 'scripts/pi-hole/php/header_authenticated.php'; +mg.include('scripts/pi-hole/lua/header_authenticated.lp','r') ?> @@ -83,9 +83,7 @@ require 'scripts/pi-hole/php/header_authenticated.php'; - - + + - + diff --git a/gravity.php b/gravity.php index 99f2636b..38b0b5ef 100644 --- a/gravity.php +++ b/gravity.php @@ -8,7 +8,7 @@ * Please see LICENSE file for your rights under this license. */ -require 'scripts/pi-hole/php/header_authenticated.php'; +mg.include('scripts/pi-hole/lua/header_authenticated.lp','r') ?> - - - + + + - + diff --git a/groups-clients.php b/groups-clients.php index 3867a5d1..5a027b39 100644 --- a/groups-clients.php +++ b/groups-clients.php @@ -8,7 +8,7 @@ * Please see LICENSE file for your rights under this license. */ -require 'scripts/pi-hole/php/header_authenticated.php'; +mg.include('scripts/pi-hole/lua/header_authenticated.lp','r') ?> @@ -91,11 +91,9 @@ require 'scripts/pi-hole/php/header_authenticated.php'; - - - - + + + + - + diff --git a/groups-domains.php b/groups-domains.php index f49f8f4e..8231ea97 100644 --- a/groups-domains.php +++ b/groups-domains.php @@ -8,7 +8,7 @@ * Please see LICENSE file for your rights under this license. */ -require 'scripts/pi-hole/php/header_authenticated.php'; +mg.include('scripts/pi-hole/lua/header_authenticated.lp','r') ?> @@ -148,10 +148,8 @@ require 'scripts/pi-hole/php/header_authenticated.php'; - - - + + + - + diff --git a/groups.php b/groups.php index 66247bb5..97ccd674 100644 --- a/groups.php +++ b/groups.php @@ -8,7 +8,7 @@ * Please see LICENSE file for your rights under this license. */ -require 'scripts/pi-hole/php/header_authenticated.php'; +mg.include('scripts/pi-hole/lua/header_authenticated.lp','r') ?> @@ -80,10 +80,8 @@ require 'scripts/pi-hole/php/header_authenticated.php'; - - - + + + - + diff --git a/img/favicons/manifest.json b/img/favicons/manifest.json index a4c4defe..0bc82ffc 100644 --- a/img/favicons/manifest.json +++ b/img/favicons/manifest.json @@ -13,7 +13,7 @@ "type": "image/png" } ], - "theme_color": "#367fa9", + "theme.color": "#367fa9", "background_color": "#367fa9", "display": "standalone" } diff --git a/index.php b/index.lp similarity index 88% rename from index.php rename to index.lp index 50003af1..91cec9a7 100644 --- a/index.php +++ b/index.lp @@ -1,14 +1,14 @@ -
@@ -22,7 +22,7 @@ require 'scripts/pi-hole/php/header_authenticated.php';
- + - active clients
@@ -38,7 +38,7 @@ require 'scripts/pi-hole/php/header_authenticated.php';
- + List blocked queries @@ -54,7 +54,7 @@ require 'scripts/pi-hole/php/header_authenticated.php';
- + List all queries @@ -70,7 +70,7 @@ require 'scripts/pi-hole/php/header_authenticated.php';
- + Manage adlists @@ -152,14 +152,9 @@ require 'scripts/pi-hole/php/header_authenticated.php'; - +
-
+

Top Permitted Domains

@@ -188,7 +183,7 @@ require 'scripts/pi-hole/php/header_authenticated.php';
-
+

Top Blocked Domains

@@ -219,7 +214,7 @@ require 'scripts/pi-hole/php/header_authenticated.php';
-
+

Top Clients (total)

@@ -248,7 +243,7 @@ require 'scripts/pi-hole/php/header_authenticated.php';
-
+

Top Clients (blocked only)

@@ -280,8 +275,6 @@ require 'scripts/pi-hole/php/header_authenticated.php';
- + - + diff --git a/login.php b/login.lp similarity index 85% rename from login.php rename to login.lp index c0db0dd3..fc50cf53 100644 --- a/login.php +++ b/login.lp @@ -1,15 +1,14 @@ - @@ -26,14 +25,14 @@ require 'scripts/pi-hole/php/header.php';
\ + ') end ?>
-