Browse Source

Apply functionality to openvpn log

pull/1235/head
billz 2 months ago
parent
commit
b1870d40e8
  1. 8
      app/js/custom.js
  2. 5
      templates/openvpn/logging.php

8
app/js/custom.js

@ -136,6 +136,14 @@ $(document).on("click", "#js-cleardnsmasq-log", function(e) {
});
});
$(document).on("click", "#js-clearopenvpn-log", function(e) {
$.post('ajax/logging/clearlog.php?',{'logfile':'/tmp/openvpn.log'},function(data){
jsonData = JSON.parse(data);
$("#openvpn-log").val("");
});
});
// Enable Bootstrap tooltips
$(function () {
$('[data-toggle="tooltip"]').tooltip()

5
templates/openvpn/logging.php

@ -5,11 +5,12 @@
<div class="custom-control custom-switch">
<input class="custom-control-input" id="log-openvpn" type="checkbox" name="log-openvpn" value="1" <?php echo $logEnable ? ' checked="checked"' : "" ?> aria-describedby="log-openvpn">
<label class="custom-control-label" for="log-openvpn"><?php echo _("Enable logging") ?></label>
<label class="custom-control-label align-middle" for="log-openvpn"><?php echo _("Enable logging") ?></label>
<input type="button" class="btn btn-outline btn-warning btn-sm align-top ml-2" id="js-clearopenvpn-log" value="<?php echo _("Clear log"); ?>" />
</div>
<div class="row">
<div class="form-group col-md-8 mt-2">
<textarea class="logoutput"><?php echo htmlspecialchars($logOutput, ENT_QUOTES); ?></textarea>
<textarea class="logoutput" id="openvpn-log"><?php echo htmlspecialchars($logOutput, ENT_QUOTES); ?></textarea>
</div>
</div>
</div><!-- /.tab-pane -->

Loading…
Cancel
Save