mirror of
https://github.com/billz/raspap-webgui.git
synced 2023-10-10 13:37:24 +02:00
Add unconfigured client state to dashboard.php
Add tun device as client_udev_prototypes.json
This commit is contained in:
parent
43043d48e4
commit
5b9d4ca814
@ -300,6 +300,11 @@ $('#ovpn-confirm-activate').on('shown.bs.modal', function (e) {
|
|||||||
$('.btn-activate', this).data('recordId', data.recordId);
|
$('.btn-activate', this).data('recordId', data.recordId);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Add the following code if you want the name of the file appear on select
|
||||||
|
$(".custom-file-input").on("change", function() {
|
||||||
|
var fileName = $(this).val().split("\\").pop();
|
||||||
|
$(this).siblings(".custom-file-label").addClass("selected").html(fileName);
|
||||||
|
});
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Sets the wirelss channel select options based on hw_mode and country_code.
|
Sets the wirelss channel select options based on hw_mode and country_code.
|
||||||
|
@ -51,6 +51,13 @@
|
|||||||
"comment": "ethernet access provided by tethering from phone via USB",
|
"comment": "ethernet access provided by tethering from phone via USB",
|
||||||
"name_prefix": "phone",
|
"name_prefix": "phone",
|
||||||
"udev_rule": "SUBSYSTEM==\"net\", ACTION==\"add\", SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"$IDVENDOR$\", ATTRS{idProduct}==\"$IDPRODUCT$\", NAME=\"$DEVNAME$\" "
|
"udev_rule": "SUBSYSTEM==\"net\", ACTION==\"add\", SUBSYSTEMS==\"usb\", ATTRS{idVendor}==\"$IDVENDOR$\", ATTRS{idProduct}==\"$IDPRODUCT$\", NAME=\"$DEVNAME$\" "
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"type": "tun",
|
||||||
|
"type_info": "tunnel device",
|
||||||
|
"clientid": -1,
|
||||||
|
"comment": "tunneling device used by OpenVPN",
|
||||||
|
"name_prefix": "tun",
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
@ -173,7 +173,8 @@ function DisplayDashboard(&$extraFooterScripts)
|
|||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
$client_title = "No information for client available";
|
$client_title = "No information for client available";
|
||||||
$type_name = "No Client";
|
$type_name = "Not configured";
|
||||||
|
$ifaceStatus = "warn";
|
||||||
}
|
}
|
||||||
|
|
||||||
echo renderTemplate(
|
echo renderTemplate(
|
||||||
|
@ -198,9 +198,10 @@ function findCurrentClientIndex($clients)
|
|||||||
$ncl=$clients["clients"];
|
$ncl=$clients["clients"];
|
||||||
if($ncl > 0) {
|
if($ncl > 0) {
|
||||||
$ty=-1;
|
$ty=-1;
|
||||||
foreach($clients["device"] as $i => $dev) {
|
foreach($clients["device"] as $i => $dev) {
|
||||||
if(($id=array_search($dev["type"], $_SESSION["net-device-types"])) > $ty && !$dev["isAP"]) {
|
$id=array_search($dev["type"],$_SESSION["net-device-types"]);
|
||||||
$ty=$id;
|
if($id >=0 && $_SESSION["udevrules"]["network_devices"][$id]["clientid"] > $ty && !$dev["isAP"]) {
|
||||||
|
$ty=$id;
|
||||||
$devid=$i;
|
$devid=$i;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
<div class="col">
|
<div class="col">
|
||||||
<button class="btn btn-light btn-icon-split btn-sm service-status float-right">
|
<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>
|
<span class="icon"><i class="fas fa-circle service-status-<?php echo $ifaceStatus ?>"></i></span>
|
||||||
<span class="text service-status"><?php echo $type_name .' '. _($ifaceStatus) ?></span>
|
<span class="text service-status"><?php echo $type_name . ($ifaceStatus!="warn") echo ' '. _($ifaceStatus) ?></span>
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div><!-- /.row -->
|
</div><!-- /.row -->
|
||||||
@ -66,7 +66,7 @@
|
|||||||
<div class="info-item"><?php echo _("Device"); ?></div><div><?php $valEcho($clientinfo,"vendor")." ".$valEcho($clientinfo,"model"); ?></div>
|
<div class="info-item"><?php echo _("Device"); ?></div><div><?php $valEcho($clientinfo,"vendor")." ".$valEcho($clientinfo,"model"); ?></div>
|
||||||
<div class="info-item"><?php echo _("IP Address"); ?></div><div><?php echo $valEcho($clientinfo,"ipaddress"); ?></div>
|
<div class="info-item"><?php echo _("IP Address"); ?></div><div><?php echo $valEcho($clientinfo,"ipaddress"); ?></div>
|
||||||
<?php else : // NO CLIENT ?>
|
<?php else : // NO CLIENT ?>
|
||||||
<div class="info-item"><?php echo _("No Client device found"); ?></div>
|
<div class="info-item"><?php echo _("No Client foudn or client is not unconfigured yet"); ?></div>
|
||||||
<?php endif; ?>
|
<?php endif; ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md mt-2 d-flex justify-content-center">
|
<div class="col-md mt-2 d-flex justify-content-center">
|
||||||
@ -139,7 +139,7 @@
|
|||||||
<?php if (!RASPI_MONITOR_ENABLED) : ?>
|
<?php if (!RASPI_MONITOR_ENABLED) : ?>
|
||||||
<?php if ($ifaceStatus == "down") : ?>
|
<?php if ($ifaceStatus == "down") : ?>
|
||||||
<input type="submit" class="btn btn-success" value="<?php echo _("Start").' '.$type_name ?>" name="ifup_wlan0" data-toggle="modal" data-target="#switchClientModal"/>
|
<input type="submit" class="btn btn-success" value="<?php echo _("Start").' '.$type_name ?>" name="ifup_wlan0" data-toggle="modal" data-target="#switchClientModal"/>
|
||||||
<?php else : ?>
|
<?php elseif ($ifaceStatus == "up") : ?>
|
||||||
<input type="submit" class="btn btn-warning" value="<?php echo _("Stop").' '.$type_name ?>" name="ifdown_wlan0" data-toggle="modal" data-target="#switchClientModal"/>
|
<input type="submit" class="btn btn-warning" value="<?php echo _("Stop").' '.$type_name ?>" name="ifdown_wlan0" data-toggle="modal" data-target="#switchClientModal"/>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
<?php endif ?>
|
<?php endif ?>
|
||||||
|
@ -135,12 +135,12 @@
|
|||||||
if(!empty($devname)) $devname=$devname[0];
|
if(!empty($devname)) $devname=$devname[0];
|
||||||
}
|
}
|
||||||
if(empty($devname)) $devname="";
|
if(empty($devname)) $devname="";
|
||||||
$isStatic = $isStatic || $dev["type"] === "ppp";
|
$isStatic = $isStatic || in_array($dev["type"],array("ppp","tun"));
|
||||||
$txtdisabled=$isStatic ? "disabled":"";
|
$txtdisabled=$isStatic ? "disabled":"";
|
||||||
echo '<td><select '.$txtdisabled.' class="selectpicker" id="int-new-type-'.$dev["name"].'">';
|
echo '<td><select '.$txtdisabled.' class="selectpicker" id="int-new-type-'.$dev["name"].'">';
|
||||||
foreach($_SESSION["net-device-types"] as $i => $type) {
|
foreach($_SESSION["net-device-types"] as $i => $type) {
|
||||||
$txt=$_SESSION["net-device-types-info"][$i];
|
$txt=$_SESSION["net-device-types-info"][$i];
|
||||||
$txtdisabled = $type == "ppp" ? "disabled":"";
|
$txtdisabled = in_array($type,array("ppp","tun")) ? "disabled":"";
|
||||||
if(preg_match("/^".$_SESSION["net-device-name-prefix"][$i]."[0-9]*$/",$dev["name"])===1) echo '<option '.$txtdisabled.' selected value="'.$type.'">'.$txt.'</option>';
|
if(preg_match("/^".$_SESSION["net-device-name-prefix"][$i]."[0-9]*$/",$dev["name"])===1) echo '<option '.$txtdisabled.' selected value="'.$type.'">'.$txt.'</option>';
|
||||||
else echo '<option '.$txtdisabled.' value="'.$type.'">'.$txt.'</option>';
|
else echo '<option '.$txtdisabled.' value="'.$type.'">'.$txt.'</option>';
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user