mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Update w/ openvpn service status indicator
This commit is contained in:
parent
23d40b138d
commit
93e3af0ecd
@ -1,8 +1,23 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="card-header"><i class="fas fa-key fa-fw mr-2"></i>Configure OpenVPN</div>
|
<div class="card-header">
|
||||||
|
<div class="row">
|
||||||
|
<div class="col">
|
||||||
|
<i class="fas fa-key fa-fw mr-2"></i><?php echo _("Configure OpenVPN"); ?>
|
||||||
|
</div>
|
||||||
|
<div class="col">
|
||||||
|
<button class="btn btn-light btn-icon-split btn-sm service-status float-right">
|
||||||
|
<span class="icon text-gray-600"><i class="fas fa-circle service-status-<?php echo $serviceStatus ?>"></i></span>
|
||||||
|
<span class="text service-status">openvpn <?php echo _($serviceStatus) ?></span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div><!-- /.row -->
|
||||||
|
</div><!-- /.card-header -->
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
|
<?php $status->showMessages(); ?>
|
||||||
|
<form role="form" action="?page=openvpn_conf" enctype="multipart/form-data" method="POST">
|
||||||
|
<?php echo CSRFTokenFieldTag() ?>
|
||||||
<!-- Nav tabs -->
|
<!-- Nav tabs -->
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
<li class="nav-item"><a class="nav-link active" id="clienttab" href="#openvpnclient" data-toggle="tab"><?php echo _("Client settings"); ?></a></li>
|
<li class="nav-item"><a class="nav-link active" id="clienttab" href="#openvpnclient" data-toggle="tab"><?php echo _("Client settings"); ?></a></li>
|
||||||
@ -10,53 +25,50 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<!-- Tab panes -->
|
<!-- Tab panes -->
|
||||||
<div class="tab-content">
|
<div class="tab-content">
|
||||||
<p><?php echo $status; ?></p>
|
<div class="tab-pane active" id="openvpnclient">
|
||||||
<div class="tab-pane active" id="openvpnclient">
|
<h4 class="mt-3"><?php echo _("Client settings"); ?></h4>
|
||||||
<h4>Client settings</h4>
|
<div class="row">
|
||||||
<form role="form" action="?page=save_hostapd_conf" method="POST">
|
<div class="form-group col-md-6">
|
||||||
<?php echo CSRFTokenFieldTag() ?>
|
<label for="code"><?php echo _("Username"); ?></label>
|
||||||
|
<input type="text" class="form-control" name="authUser" value="<?php echo htmlspecialchars($authUser, ENT_QUOTES); ?>" />
|
||||||
<div class="row">
|
</div>
|
||||||
<div class="form-group col-md-6">
|
</div>
|
||||||
<label for="code"><?php echo _("Username"); ?></label>
|
<div class="row">
|
||||||
<input type="text" class="form-control" name="Username" value="<?php echo htmlspecialchars($Username, ENT_QUOTES); ?>" />
|
<div class="form-group col-md-6">
|
||||||
</div>
|
<label for="code"><?php echo _("Password"); ?></label>
|
||||||
</div>
|
<input type="password" class="form-control" name="authPassword" value="<?php echo htmlspecialchars($authPassword, ENT_QUOTES); ?>" />
|
||||||
<div class="row">
|
</div>
|
||||||
<div class="form-group col-md-6">
|
</div>
|
||||||
<label for="code"><?php echo _("Password"); ?></label>
|
<div class="row">
|
||||||
<input type="password" class="form-control" name="Password" value="<?php echo htmlspecialchars($Password, ENT_QUOTES); ?>" />
|
<div class="form-group col-md-6">
|
||||||
</div>
|
<div class="custom-file">
|
||||||
</div>
|
<input type="file" class="custom-file-input" name="customFile" id="customFile">
|
||||||
<div class="row">
|
<label class="custom-file-label" for="customFile"><?php echo _("Select OpenVPN configuration file (.ovpn)"); ?></label>
|
||||||
<div class="form-group col-md-6">
|
</div>
|
||||||
<div class="custom-file">
|
|
||||||
<input type="file" class="custom-file-input" id="customFile">
|
|
||||||
<label class="custom-file-label" for="customFile">Select OpenVPN configuration file (.ovpn)</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="tab-pane fade" id="openvpnlogoutput">
|
</div>
|
||||||
<h4><?php echo _("Client log"); ?></h4>
|
<div class="tab-pane fade" id="openvpnlogoutput">
|
||||||
<div class="row">
|
<h4 class="mt-3"><?php echo _("Client log"); ?></h4>
|
||||||
<div class="form-group col-md-8">
|
<div class="row">
|
||||||
<?php
|
<div class="form-group col-md-8">
|
||||||
$log = file_get_contents('/tmp/hostapd.log');
|
<?php
|
||||||
echo '<br /><textarea class="logoutput">'.htmlspecialchars($log, ENT_QUOTES).'</textarea>';
|
$log = file_get_contents('/tmp/openvpn.log');
|
||||||
?>
|
echo '<textarea class="logoutput">'.htmlspecialchars($log, ENT_QUOTES).'</textarea>';
|
||||||
</div>
|
?>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<input type="submit" class="btn btn-outline btn-primary" name="SaveOpenVPNSettings" value="Save settings" />
|
</div>
|
||||||
<?php
|
<?php if (!RASPI_MONITOR_ENABLED) : ?>
|
||||||
if ($hostapdstatus[0] == 0) {
|
<input type="submit" class="btn btn-outline btn-primary" name="SaveOpenVPNSettings" value="Save settings" />
|
||||||
echo '<input type="submit" class="btn btn-success" name="StartOpenVPN" value="Start OpenVPN" />' , PHP_EOL;
|
<?php if ($openvpnstatus[0] == 0) {
|
||||||
} else {
|
echo '<input type="submit" class="btn btn-success" name="StartOpenVPN" value="Start OpenVPN" />' , PHP_EOL;
|
||||||
|
} else {
|
||||||
echo '<input type="submit" class="btn btn-warning" name="StopOpenVPN" value="Stop OpenVPN" />' , PHP_EOL;
|
echo '<input type="submit" class="btn btn-warning" name="StopOpenVPN" value="Stop OpenVPN" />' , PHP_EOL;
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
</form>
|
<?php endif ?>
|
||||||
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.card-body -->
|
</div><!-- /.card-body -->
|
||||||
<div class="card-footer"> Information provided by openvpn</div>
|
<div class="card-footer"> Information provided by openvpn</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user