Prima gestione vendors con icone

This commit is contained in:
loviuz 2020-08-08 19:29:15 +02:00
parent 0fca421b77
commit 892783e83f
8 changed files with 19 additions and 1 deletions

3
gui/css/wpa.css Normal file
View File

@ -0,0 +1,3 @@
td.vendor-img > img{
width: 40px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.9 KiB

BIN
gui/img/vendors/unknown.png vendored Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.1 KiB

View File

@ -32,7 +32,7 @@ function leggi_devices(interval){
if( $('#devices-table > tbody').find('tr[data-id="' + row_id + '"]').length == 0 ){
$('#devices-table > tbody').prepend(
'<tr data-id="' + row_id + '">' +
'<td></td>' +
'<td class="vendor-img"><img title="' + result.records[i].vendor + '" src="vendor.php?name=' + result.records[i].vendor + '"></td>' +
'<td>' + device + '</td>' +
'<td>' + result.records[i].ssid + '</td>' +
'<td><time class="timeago" title="' + moment(result.records[i].received_at).format('DD/MM/YYYY H:mm:ss') + '" datetime="' + result.records[i].received_at + '"></time></td>' +

View File

@ -16,6 +16,7 @@ $config = parse_ini_file('../config.ini');
<!-- Custom styles for this template-->
<link href="css/sb-admin-2.min.css" rel="stylesheet">
<link href="css/wpa.css" rel="stylesheet">
<!-- Bootstrap core JavaScript-->
<script src="vendor/jquery/jquery.min.js"></script>

14
gui/vendor.php Normal file
View File

@ -0,0 +1,14 @@
<?php
header('Content-Type: image/png');
$docroot = realpath(__DIR__);
$vendor_name = preg_replace( '/([^a-z0-9\.\-\(\)\s]+)/i', '', $_GET['name'] );
$vendor_img = $docroot.'/img/vendors/'.$vendor_name.'.png';
if( file_exists($vendor_img) ){
echo file_get_contents($docroot.'/img/vendors/'.$vendor_name.'.png');
} else {
echo file_get_contents($docroot.'/img/vendors/unknown.png');
}