Added check for monitor setting. Resolves #378

This commit is contained in:
billz 2019-09-07 09:55:42 +01:00
parent bfc0dba6ad
commit ef406edc61
6 changed files with 48 additions and 42 deletions

View File

@ -84,13 +84,14 @@ exec('cat '.RASPI_DNSMASQ_LEASES.'| grep -E $(arp -i '.$client_iface.' -n | grep
<div class="row">
<form action="?page=wlan0_info" method="POST">
<?php echo CSRFTokenFieldTag() ?>
<?php if (!$wlan0up): ?>
<input type="submit" class="btn btn-success" value="<?php echo _("Start ").RASPI_WIFI_CLIENT_INTERFACE ?>" name="ifup_wlan0" />
<?php else: ?>
<input type="submit" class="btn btn-warning" value="<?php echo _("Stop ").RASPI_WIFI_CLIENT_INTERFACE ?>" name="ifdown_wlan0" />
<?php if (!RASPI_MONITOR_ENABLED): ?>
<?php if (!$wlan0up): ?>
<input type="submit" class="btn btn-success" value="<?php echo _("Start ").RASPI_WIFI_CLIENT_INTERFACE ?>" name="ifup_wlan0" />
<?php else: ?>
<input type="submit" class="btn btn-warning" value="<?php echo _("Stop ").RASPI_WIFI_CLIENT_INTERFACE ?>" name="ifdown_wlan0" />
<?php endif ?>
<?php endif ?>
<a href="?page=<?php echo $_GET['page'] ?>" class="btn btn-outline btn-primary"><?php echo _("Refresh") ?></a>
<a href="?page=<?php echo $_GET['page'] ?>" class="btn btn-outline btn-primary"><i class="fa fa-refresh"></i> <?php echo _("Refresh") ?></a>
</form>
</div>
</div>

View File

@ -63,13 +63,13 @@
</select>
</div>
</div>
<input type="submit" class="btn btn-outline btn-primary" value="<?php echo _("Save settings"); ?>" name="savedhcpdsettings" />
<?php if ($dnsmasq_state): ?>
<input type="submit" class="btn btn-warning" value="<?php echo _("Stop dnsmasq") ?>" name="stopdhcpd" />
<?php else: ?>
<input type="submit" class="btn btn-success" value="<?php echo _("Start dnsmasq") ?>" name="startdhcpd" />
<?php if (!RASPI_MONITOR_ENABLED): ?>
<input type="submit" class="btn btn-outline btn-primary" value="<?php echo _("Save settings"); ?>" name="savedhcpdsettings" />
<?php if ($dnsmasq_state): ?>
<input type="submit" class="btn btn-warning" value="<?php echo _("Stop dnsmasq") ?>" name="stopdhcpd" />
<?php else: ?>
<input type="submit" class="btn btn-success" value="<?php echo _("Start dnsmasq") ?>" name="startdhcpd" />
<?php endif ?>
<?php endif ?>
</div><!-- /.tab-pane -->
@ -153,16 +153,16 @@
</div>
</div>
</template>
<input type="submit" class="btn btn-outline btn-primary" value="<?php echo _("Save settings"); ?>" name="savedhcpdsettings" />
<?php
if ($dnsmasq_state) {
echo '<input type="submit" class="btn btn-warning" value="' . _("Stop dnsmasq") . '" name="stopdhcpd" />';
} else {
echo'<input type="submit" class="btn btn-success" value="' . _("Start dnsmasq") . '" name="startdhcpd" />';
}
?>
<?php if (!RASPI_MONITOR_ENABLED): ?>
<input type="submit" class="btn btn-outline btn-primary" value="<?php echo _("Save settings"); ?>" name="savedhcpdsettings" />
<?php
if ($dnsmasq_state) {
echo '<input type="submit" class="btn btn-warning" value="' . _("Stop dnsmasq") . '" name="stopdhcpd" />';
} else {
echo'<input type="submit" class="btn btn-success" value="' . _("Start dnsmasq") . '" name="startdhcpd" />';
}
?>
<?php endif ?>
</div>
</div><!-- /.tab-content -->
@ -171,4 +171,4 @@
<div class="panel-footer"> <?php echo _("Information provided by Dnsmasq"); ?></div>
</div><!-- /.panel-primary -->
</div><!-- /.col-lg-12 -->
</div><!-- /.row -->
</div><!-- /.row -->

View File

@ -433,15 +433,16 @@ if(ops[i].value == country){
</script>
</div>
</div><!-- /.panel-body -->
</div><!-- /.panel-primary -->
<input type="submit" class="btn btn-outline btn-primary" name="SaveHostAPDSettings" value="<?php echo _("Save settings"); ?>" />
<?php
if ($hostapdstatus[0] == 0) {
echo '<input type="submit" class="btn btn-success" name="StartHotspot" value="' . _("Start hotspot") . '"/>' , PHP_EOL;
} else {
echo '<input type="submit" class="btn btn-warning" name="StopHotspot" value="' . _("Stop hotspot") . '"/>' , PHP_EOL;
};
?>
</div><!-- /.panel-primary -->
<?php if (!RASPI_MONITOR_ENABLED): ?>
<input type="submit" class="btn btn-outline btn-primary" name="SaveHostAPDSettings" value="<?php echo _("Save settings"); ?>" />
<?php
if ($hostapdstatus[0] == 0) {
echo '<input type="submit" class="btn btn-success" name="StartHotspot" value="' . _("Start hotspot") . '"/>' , PHP_EOL;
} else {
echo '<input type="submit" class="btn btn-warning" name="StopHotspot" value="' . _("Stop hotspot") . '"/>' , PHP_EOL;
};
endif ?>
</form>
</div></div><!-- /.panel-primary -->
<div class="panel-footer"> <?php echo _("Information provided by hostapd"); ?></div>

View File

@ -86,9 +86,11 @@
<div class="form-group">
<label for="<?php echo $if_quoted ?>-dnssvralt"><?php echo _("Alternate DNS Server") ?></label>
<input type="text" class="form-control" id="<?php echo $if_quoted ?>-dnssvralt" placeholder="0.0.0.0">
</div>
<a href="#" class="btn btn-outline btn-primary intsave" data-int="<?php echo $if_quoted ?>"><?php echo _("Save settings") ?></a>
<a href="#" class="btn btn-warning intapply" data-int="<?php echo $if_quoted ?>"><?php echo _("Apply settings") ?></a>
</div>
<?php if (!RASPI_MONITOR_ENABLED): ?>
<a href="#" class="btn btn-outline btn-primary intsave" data-int="<?php echo $if_quoted ?>"><?php echo _("Save settings") ?></a>
<a href="#" class="btn btn-warning intapply" data-int="<?php echo $if_quoted ?>"><?php echo _("Apply settings") ?></a>
<?php endif ?>
</form>
</div>

View File

@ -66,10 +66,12 @@ if ($cpuload > 90) {
</div>
<form action="?page=system_info" method="POST">
<?php echo CSRFTokenFieldTag() ?>
<input type="submit" class="btn btn-warning" name="system_reboot" value="<?php echo _("Reboot"); ?>" />
<input type="submit" class="btn btn-warning" name="system_shutdown" value="<?php echo _("Shutdown"); ?>" />
<a href="?page=<?php echo $_GET['page'] ?>" class="btn btn-outline btn-primary"><?php echo _("Refresh") ?></a>
<?php echo CSRFTokenFieldTag() ?>
<?php if (!RASPI_MONITOR_ENABLED): ?>
<input type="submit" class="btn btn-warning" name="system_reboot" value="<?php echo _("Reboot"); ?>" />
<input type="submit" class="btn btn-warning" name="system_shutdown" value="<?php echo _("Shutdown"); ?>" />
<?php endif ?>
<a href="?page=<?php echo $_GET['page'] ?>" class="btn btn-outline btn-primary"><i class="fa fa-refresh"></i> <?php echo _("Refresh") ?></a>
</form>
</div>
</div>
@ -84,7 +86,7 @@ if ($cpuload > 90) {
</div>
</div>
<input type="submit" class="btn btn-outline btn-primary" name="SaveLanguage" value="<?php echo _("Save settings"); ?>" />
<a href="?page=<?php echo $_GET['page'] ?>" class="btn btn-outline btn-primary"><?php echo _("Refresh") ?></a>
<a href="?page=<?php echo $_GET['page'] ?>" class="btn btn-outline btn-primary"><i class="fa fa-refresh"></i> <?php echo _("Refresh") ?></a>
</div>
<div role="tabpanel" class="tab-pane" id="console">

View File

@ -15,7 +15,7 @@
<form action="?page=system_info" method="POST">
<?php echo CSRFTokenFieldTag() ?>
<a href="?page=<?php echo $_GET['page'] ?>" class="btn btn-outline btn-primary"><?php echo _("Refresh"); ?></a>
<a href="?page=<?php echo $_GET['page'] ?>" class="btn btn-outline btn-primary"><i class="fa fa-refresh"></i> <?php echo _("Refresh"); ?></a>
</form>
</div><!-- /.panel-body -->