From fd2a6df24593edbd51f497190649ebaa0b917936 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Tue, 12 Sep 2017 00:20:59 +0200 Subject: [PATCH] added git hashes to about page --- _debug_replacements.php | 6 ++++++ pages/about.php | 5 +++++ 2 files changed, 11 insertions(+) diff --git a/_debug_replacements.php b/_debug_replacements.php index 878baf2..520a5ad 100644 --- a/_debug_replacements.php +++ b/_debug_replacements.php @@ -8,6 +8,8 @@ $vers = '???'; $versfn = __DIR__ . '/../user/version.h'; +$myHash = shell_exec('git rev-parse --short HEAD'); +$fwHash = '00000000'; if (file_exists($versfn)) { $f = file_get_contents($versfn); preg_match_all('/#define FW_V_.*? (\d+)/', $f, $vm); @@ -15,6 +17,7 @@ if (file_exists($versfn)) { #define FW_V_MINOR 0 #define FW_V_PATCH 0 $vers = $vm[1][0] . '.' . $vm[1][1] . '.' . $vm[1][2]; + $fwHash = shell_exec('cd .. && git rev-parse --short HEAD'); } return [ @@ -59,6 +62,9 @@ return [ 'vers_httpd' => '0.4', 'vers_sdk' => '010502', 'githubrepo' => 'https://github.com/espterm/espterm-firmware', + 'githubrepo_front' => 'https://github.com/espterm/espterm-front-end', + 'hash_backend' => $fwHash, + 'hash_frontend' => $myHash, // TODO actual versions? 'ap_dhcp_time' => '120', 'ap_dhcp_start' => '192.168.4.100', diff --git a/pages/about.php b/pages/about.php index a40f181..f698792 100644 --- a/pages/about.php +++ b/pages/about.php @@ -22,6 +22,11 @@ ESPTerm v%vers_fw%, built %date% at %time% + + Git hash + back-end: %hash_backend%, + front-end: %hash_frontend% + libesphttpd v%vers_httpd%