2019-08-19 01:04:53 +02:00
|
|
|
<div class="row">
|
|
|
|
<div class="col-lg-12">
|
2019-10-11 21:37:59 +02:00
|
|
|
<div class="card">
|
2019-10-14 22:18:16 +02:00
|
|
|
<div class="card-header">
|
|
|
|
<div class="row">
|
2021-03-07 18:36:48 +01:00
|
|
|
<div class="col">
|
|
|
|
<i class="fas fa-tachometer-alt fa-fw mr-2"></i><?php echo _("Dashboard"); ?>
|
|
|
|
</div>
|
|
|
|
<div class="col">
|
|
|
|
<button class="btn btn-light btn-icon-split btn-sm service-status float-right">
|
|
|
|
<span class="icon"><i class="fas fa-circle service-status-<?php echo $ifaceStatus ?>"></i></span>
|
2021-03-28 14:44:05 +02:00
|
|
|
<span class="text service-status"><?php echo $type_name; if ( $isClientConfigured ) echo ' '. _($ifaceStatus); ?></span>
|
2021-03-07 18:36:48 +01:00
|
|
|
</button>
|
|
|
|
</div>
|
2019-10-14 22:18:16 +02:00
|
|
|
</div><!-- /.row -->
|
|
|
|
</div><!-- /.card-header -->
|
2019-10-11 21:37:59 +02:00
|
|
|
<div class="card-body">
|
2019-08-19 01:04:53 +02:00
|
|
|
<div class="row">
|
2020-02-02 09:37:15 +01:00
|
|
|
|
|
|
|
<div class="col-lg-12">
|
|
|
|
<div class="card mb-3">
|
|
|
|
<div class="card-body">
|
2021-04-02 00:03:33 +02:00
|
|
|
<h4 class="card-title"><?php echo _("Hourly traffic amount"); ?></h4>
|
2021-02-02 13:26:14 +01:00
|
|
|
<div id="divInterface" class="d-none"><?php echo $apInterface; ?></div>
|
2020-02-02 14:37:17 +01:00
|
|
|
<div class="col-md-12">
|
2020-02-02 15:58:35 +01:00
|
|
|
<canvas id="divDBChartBandwidthhourly"></canvas>
|
2020-02-02 14:37:17 +01:00
|
|
|
</div>
|
2020-02-02 09:37:15 +01:00
|
|
|
</div><!-- /.card-body -->
|
|
|
|
</div><!-- /.card-->
|
|
|
|
</div>
|
|
|
|
|
2020-02-03 10:31:39 +01:00
|
|
|
<div class="col-sm-6 align-items-stretch">
|
|
|
|
<div class="card h-100">
|
2019-10-14 12:32:40 +02:00
|
|
|
<div class="card-body wireless">
|
2021-04-15 09:00:48 +02:00
|
|
|
<h4 class="card-title"><?php echo _("$client_title"); ?></h4>
|
2021-04-09 16:05:40 +02:00
|
|
|
<div class="row ml-1">
|
|
|
|
<div class="col-sm">
|
2021-03-12 12:20:34 +01:00
|
|
|
<?php $valEcho=function($cl,$id) {$val = isset($cl[$id])&& !empty($cl[$id]) ? $cl[$id] : "-"; echo htmlspecialchars($val,ENT_QUOTES);} ?>
|
2021-03-07 18:36:48 +01:00
|
|
|
<?php if ($clientinfo["type"] == "wlan") : // WIRELESS ?>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("Connected To"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"ssid"); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("AP Mac Address"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"ap-mac"); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("Bitrate"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"bitrate"); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("Signal Level"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"signal"); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("Transmit Power"); ?></div><div class="info-value col-xs-3"><?php echo htmlspecialchars($txPower, ENT_QUOTES); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("Frequency"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"freq"); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-03-07 18:36:48 +01:00
|
|
|
<?php elseif ($clientinfo["type"] == "phone" ) : // Smartphones (tethering over USB) ?>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("Device"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"vendor")." ". $valEcho($clientinfo,"model"); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("IP Address"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"ipaddress"); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-03-07 18:36:48 +01:00
|
|
|
<?php elseif ($clientinfo["type"] == "hilink" ) : // MOBILE DATA - ROUTER MODE (HILINK) ?>
|
2021-03-12 12:20:34 +01:00
|
|
|
<?php
|
2021-03-07 18:36:48 +01:00
|
|
|
exec('ip route list | sed -rn "s/default via (([0-9]{1,3}\.){3}[0-9]{1,3}).*dev '.$clientinfo["name"].'.*/\1/p"',$gw); // get gateway
|
2021-03-12 12:20:34 +01:00
|
|
|
$gw=empty($gw) ? "" : $gw[0];
|
2021-03-07 18:36:48 +01:00
|
|
|
?>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("Device"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"model")." (Hilink)"; ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("Connection mode"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"mode"); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("Signal quality"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"signal"); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("Network"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"operator"); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("WAN IP"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"wan_ip"); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("Web-GUI"); ?></div><div class="info-value col-xs-3"><?php if(!empty($gw)) echo '<a href="http://'.$gw.'" >'.$gw."</a>"; ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-03-07 18:36:48 +01:00
|
|
|
<?php elseif ($clientinfo["type"] == "ppp" ) : // MOBILE DATA MODEM) ?>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("Device"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"model"); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("Connection mode"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"mode"); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("Signal strength"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"signal"); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("Network"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"operator"); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-03-07 18:36:48 +01:00
|
|
|
<?php elseif ($clientinfo["type"] == "eth" ) : // ETHERNET ?>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("Device"); ?></div><div class="info-value col-xs-3"><?php $valEcho($clientinfo,"vendor")." ".$valEcho($clientinfo,"model"); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("IP Address"); ?></div><div class="info-value col-xs-3"><?php echo $valEcho($clientinfo,"ipaddress"); ?></div>
|
2021-04-15 10:04:20 +02:00
|
|
|
</div>
|
2021-03-07 18:36:48 +01:00
|
|
|
<?php else : // NO CLIENT ?>
|
2021-04-15 10:04:20 +02:00
|
|
|
<div class="row mb-1">
|
|
|
|
<div class="info-item col-xs-3"><?php echo _("No Client device or not yet configured"); ?></div>
|
|
|
|
</div>
|
2021-03-07 18:36:48 +01:00
|
|
|
<?php endif; ?>
|
|
|
|
</div>
|
2021-03-28 14:44:05 +02:00
|
|
|
<?php if ($isClientConfigured) : ?>
|
2021-04-15 09:00:48 +02:00
|
|
|
<div class="col-md d-flex">
|
2021-03-28 11:59:57 +02:00
|
|
|
<?php
|
|
|
|
preg_match("/.*\((\s*\d*)\s*%\s*\)/",$clientinfo["signal"],$match);
|
|
|
|
$strLinkQuality=array_key_exists(1,$match) ? $match[1] : 0;
|
|
|
|
?>
|
|
|
|
<script>var linkQ = <?php echo json_encode($strLinkQuality); ?>;</script>
|
|
|
|
<div class="chart-container">
|
|
|
|
<canvas id="divChartLinkQ"></canvas>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
<?php endif; ?>
|
2020-02-02 09:37:15 +01:00
|
|
|
</div><!--row-->
|
2021-03-07 18:36:48 +01:00
|
|
|
</div><!-- /.card-body -->
|
2019-10-14 12:32:40 +02:00
|
|
|
</div><!-- /.card -->
|
|
|
|
</div><!-- /.col-md-6 -->
|
2020-02-03 10:31:39 +01:00
|
|
|
<div class="col-sm-6">
|
|
|
|
<div class="card h-100 mb-3">
|
|
|
|
<div class="card-body">
|
2021-04-02 00:03:33 +02:00
|
|
|
<h4 class="card-title"><?php echo _("Connected Devices"); ?></h4>
|
2019-08-19 01:04:53 +02:00
|
|
|
<div class="table-responsive">
|
|
|
|
<table class="table table-hover">
|
|
|
|
<thead>
|
|
|
|
<tr>
|
2021-02-02 13:26:14 +01:00
|
|
|
<?php if ($bridgedEnable == 1) : ?>
|
2020-03-25 07:42:53 +01:00
|
|
|
<th><?php echo _("MAC Address"); ?></th>
|
|
|
|
<?php else : ?>
|
|
|
|
<th><?php echo _("Host name"); ?></th>
|
|
|
|
<th><?php echo _("IP Address"); ?></th>
|
|
|
|
<th><?php echo _("MAC Address"); ?></th>
|
|
|
|
<?php endif; ?>
|
2019-08-19 01:04:53 +02:00
|
|
|
</tr>
|
|
|
|
</thead>
|
|
|
|
<tbody>
|
2021-02-02 13:26:14 +01:00
|
|
|
<?php if ($bridgedEnable == 1) : ?>
|
2020-03-25 07:42:53 +01:00
|
|
|
<tr>
|
2020-03-25 12:55:39 +01:00
|
|
|
<td><small class="text-muted"><?php echo _("Bridged AP mode is enabled. For Hostname and IP, see your router's admin page.");?></small></td>
|
2020-03-25 07:42:53 +01:00
|
|
|
</tr>
|
|
|
|
<?php endif; ?>
|
2020-02-03 10:31:39 +01:00
|
|
|
<?php foreach (array_slice($clients,0, 2) as $client) : ?>
|
2019-08-19 01:04:53 +02:00
|
|
|
<tr>
|
2021-03-10 23:45:04 +01:00
|
|
|
<?php if ($bridgedEnable == 1): ?>
|
2020-03-25 07:42:53 +01:00
|
|
|
<td><?php echo htmlspecialchars($client, ENT_QUOTES) ?></td>
|
|
|
|
<?php else : ?>
|
|
|
|
<?php $props = explode(' ', $client) ?>
|
|
|
|
<td><?php echo htmlspecialchars($props[3], ENT_QUOTES) ?></td>
|
|
|
|
<td><?php echo htmlspecialchars($props[2], ENT_QUOTES) ?></td>
|
|
|
|
<td><?php echo htmlspecialchars($props[1], ENT_QUOTES) ?></td>
|
|
|
|
<?php endif; ?>
|
2019-08-19 01:04:53 +02:00
|
|
|
</tr>
|
2019-09-07 17:42:31 +02:00
|
|
|
<?php endforeach ?>
|
2019-08-19 01:04:53 +02:00
|
|
|
</tbody>
|
|
|
|
</table>
|
2020-02-03 10:31:39 +01:00
|
|
|
<?php if (sizeof($clients) >2) : ?>
|
|
|
|
<div class="col-lg-12 float-right">
|
2020-03-24 13:40:18 +01:00
|
|
|
<a class="btn btn-outline-info" role="button" href="<?php echo $moreLink ?>"><?php echo _("More");?> <i class="fas fa-chevron-right"></i></a>
|
2020-02-03 10:31:39 +01:00
|
|
|
</div>
|
|
|
|
<?php elseif (sizeof($clients) ==0) : ?>
|
|
|
|
<div class="col-lg-12 mt-3"><?php echo _("No connected devices");?></div>
|
|
|
|
<?php endif; ?>
|
2019-08-19 01:04:53 +02:00
|
|
|
</div><!-- /.table-responsive -->
|
2019-10-11 21:37:59 +02:00
|
|
|
</div><!-- /.card-body -->
|
|
|
|
</div><!-- /.card -->
|
2019-08-19 01:04:53 +02:00
|
|
|
</div><!-- /.col-md-6 -->
|
|
|
|
</div><!-- /.row -->
|
2020-02-03 10:31:39 +01:00
|
|
|
<div class="col-lg-12 mt-3">
|
2019-08-19 01:04:53 +02:00
|
|
|
<div class="row">
|
2020-12-15 14:48:51 +01:00
|
|
|
<form action="wlan0_info" method="POST">
|
2021-03-15 18:07:14 +01:00
|
|
|
<?php echo CSRFTokenFieldTag(); ?>
|
2019-09-07 17:42:31 +02:00
|
|
|
<?php if (!RASPI_MONITOR_ENABLED) : ?>
|
2021-03-07 18:36:48 +01:00
|
|
|
<?php if ($ifaceStatus == "down") : ?>
|
2021-03-15 18:07:14 +01:00
|
|
|
<input type="submit" class="btn btn-success" value="<?php echo _("Start").' '.$type_name ?>" name="ifup_wlan0" data-toggle="modal" data-target="#switchClientModal"/>
|
2021-03-27 17:43:15 +01:00
|
|
|
<?php elseif ($ifaceStatus == "up") : ?>
|
2021-03-15 18:07:14 +01:00
|
|
|
<input type="submit" class="btn btn-warning" value="<?php echo _("Stop").' '.$type_name ?>" name="ifdown_wlan0" data-toggle="modal" data-target="#switchClientModal"/>
|
2019-09-07 17:42:31 +02:00
|
|
|
<?php endif ?>
|
|
|
|
<?php endif ?>
|
2021-03-15 18:07:14 +01:00
|
|
|
<button type="button" onClick="window.location.reload();" class="btn btn-outline btn-primary"><i class="fas fa-sync-alt"></i> <?php echo _("Refresh") ?></button>
|
2019-08-19 01:04:53 +02:00
|
|
|
</form>
|
|
|
|
</div>
|
|
|
|
</div>
|
2019-10-11 21:37:59 +02:00
|
|
|
</div><!-- /.card-body -->
|
2019-10-20 19:31:39 +02:00
|
|
|
<div class="card-footer"><?php echo _("Information provided by ip and iw and from system"); ?></div>
|
2019-10-11 21:37:59 +02:00
|
|
|
</div><!-- /.card -->
|
2019-08-19 01:04:53 +02:00
|
|
|
</div><!-- /.col-lg-12 -->
|
|
|
|
</div><!-- /.row -->
|
2021-03-15 18:07:14 +01:00
|
|
|
|
|
|
|
<!-- Modal -->
|
|
|
|
<div class="modal fade" id="switchClientModal" tabindex="-1" role="dialog" aria-labelledby="ModalLabel" aria-hidden="true">
|
|
|
|
<div class="modal-dialog" role="document">
|
|
|
|
<div class="modal-content">
|
|
|
|
<div class="modal-header">
|
|
|
|
<div class="modal-title" id="ModalLabel">
|
|
|
|
<i class="fas fa-sync-alt mr-2"></i>
|
2021-04-15 10:04:20 +02:00
|
|
|
<?php if($ifaceStatus=="down") echo _("Waiting for the interface to start ..."); else echo _("Stop the Interface"); ?>
|
2021-03-15 18:07:14 +01:00
|
|
|
</div>
|
|
|
|
<button type="button" class="close" data-dismiss="modal" aria-label="Close"> <span aria-hidden="true">×</span>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
2020-02-02 09:37:15 +01:00
|
|
|
<script type="text/javascript"<?php //echo ' nonce="'.$csp_page_nonce.'"'; ?>>
|
|
|
|
// js translations:
|
|
|
|
var t = new Array();
|
|
|
|
t['send'] = '<?php echo addslashes(_('Send')); ?>';
|
|
|
|
t['receive'] = '<?php echo addslashes(_('Receive')); ?>';
|
|
|
|
</script>
|