Update templates w/ getLogLimited, add $logdata to payload

This commit is contained in:
billz 2023-11-28 10:05:06 +00:00
parent 05210e8967
commit 74656c63ed
6 changed files with 14 additions and 10 deletions

View file

@ -92,6 +92,7 @@ function DisplayAdBlockConfig()
} else {
$adblock_log = "Unable to open log file";
}
$logdata = getLogLimited(RASPI_DHCPCD_LOG, $adblock_log);
echo renderTemplate(
"adblock", compact(
@ -101,7 +102,7 @@ function DisplayAdBlockConfig()
"enabled",
"custom_enabled",
"adblock_custom_content",
"adblock_log"
"logdata"
)
);
}

View file

@ -60,6 +60,9 @@ function DisplayDHCPConfig()
count($log_dhcp) > 0 ? $conf['log-dhcp'] = true : false ;
count($log_queries) > 0 ? $conf['log-queries'] = true : false ;
exec('sudo /bin/chmod o+r '.RASPI_DHCPCD_LOG);
$logdata = getLogLimited(RASPI_DHCPCD_LOG);
echo renderTemplate(
"dhcp", compact(
"status",
@ -70,7 +73,8 @@ function DisplayDHCPConfig()
"hosts",
"upstreamServers",
"interfaces",
"leases"
"leases",
"logdata"
)
);
}

View file

@ -135,6 +135,8 @@ function DisplayHostAPDConfig()
$selectedHwMode = 'w';
}
}
exec('sudo /bin/chmod o+r '.RASPI_HOSTAPD_LOG);
$logdata = getLogLimited(RASPI_HOSTAPD_LOG);
echo renderTemplate(
"hostapd", compact(
@ -153,7 +155,8 @@ function DisplayHostAPDConfig()
"arrHostapdConf",
"operatingSystem",
"selectedHwMode",
"countryCodes"
"countryCodes",
"logdata"
)
);
}

View file

@ -3,7 +3,7 @@
<h4 class="mt-3"><?php echo _("Logging"); ?></h4>
<div class="row">
<div class="form-group col-md-8">
<?php echo '<textarea class="logoutput">'.htmlspecialchars($adblock_log, ENT_QUOTES).'</textarea>'; ?>
<?php echo '<textarea class="logoutput">'.htmlspecialchars($logdata, ENT_QUOTES).'</textarea>'; ?>
</div>
</div>
</div><!-- /.tab-pane -->

View file

@ -17,9 +17,7 @@
<div class="form-group col-md-8 mt-2">
<?php
if ($conf['log-dhcp'] == 1 || $conf['log-queries'] == 1) {
exec('sudo /bin/chmod o+r '.RASPI_DHCPCD_LOG);
$log = file_get_contents(RASPI_DHCPCD_LOG);
echo '<textarea class="logoutput" id="dnsmasq-log">'.htmlspecialchars($log, ENT_QUOTES).'</textarea>';
echo '<textarea class="logoutput" id="dnsmasq-log">'.htmlspecialchars($logdata, ENT_QUOTES).'</textarea>';
} else {
echo '<textarea class="logoutput my-3"></textarea>';
}

View file

@ -14,9 +14,7 @@
<div class="form-group col-md-8 mt-2">
<?php
if ($arrHostapdConf['LogEnable'] == 1) {
exec('sudo /bin/chmod o+r /tmp/hostapd.log');
$log = file_get_contents('/tmp/hostapd.log');
echo '<textarea class="logoutput" id="hostapd-log">'.htmlspecialchars($log, ENT_QUOTES).'</textarea>';
echo '<textarea class="logoutput" id="hostapd-log">'.htmlspecialchars($logdata, ENT_QUOTES).'</textarea>';
} else {
echo '<textarea class="logoutput my-3"></textarea>';
}