Added a total vlan response in api

This commit is contained in:
laf
2014-10-01 20:53:15 +01:00
parent b8a2b7c291
commit d2f727cfcb

View File

@@ -468,7 +468,8 @@ function get_vlans() {
}
if ($device) {
$vlans = dbFetchRows("SELECT vlan_vlan,vlan_domain,vlan_name,vlan_type,vlan_mtu FROM vlans WHERE `device_id` = ?", array($device_id));
$output = array("status" => "ok", "vlans" => array($vlans));
$total_vlans = count($vlans);
$output = array("status" => "ok", "count" => $total_vlans, "vlans" => array($vlans));
} else {
$code = 404;
$output = array("status" => "error", "Device $hostname not found");