Merge branch 'spidev' into 'master'

Device OLT Anpassungen

See merge request fronk/thetool!1477
This commit is contained in:
Daniel Spitzer
2025-06-23 20:25:42 +00:00
3 changed files with 129 additions and 4 deletions
+21
View File
@@ -337,6 +337,12 @@ class DeviceController extends mfBaseController
case "changeoltsplitter":
$this->changeoltSplitter($id, $portid, $ports);
break;
case "deviceoltserviceporttimestamp":
$this->deviceoltserviceporttimestamp($ip);
break;
case "deviceoltserviceportrefresh":
$this->deviceoltserviceportrefresh($ip);
break;
default:
$return = false;
}
@@ -423,6 +429,21 @@ class DeviceController extends mfBaseController
exit;
}
private function deviceoltserviceporttimestamp($ip)
{
$deviceoltserviceporttimestamp = DeviceModel::deviceoltserviceporttimestamp($ip);
echo json_encode($deviceoltserviceporttimestamp);
exit;
}
private function deviceoltserviceportrefresh($ip)
{
$deviceoltserviceportrefresh = DeviceModel::deviceoltserviceportrefresh($ip);
echo json_encode($deviceoltserviceportrefresh);
exit;
}
private function getontInfoMac($ip, $portid, $ont)
{
$r = $this->request;
+54
View File
@@ -337,6 +337,60 @@ class DeviceModel
endif;
return json_decode($response);
}
public static function deviceoltserviceporttimestamp($ip)
{
$url = TT_MBI_API_URL . TT_MBI_API_VERSION . '/deviceoltserviceporttimestamp/' . $ip;
$response = "";
if (TT_MBI_API_ENABLE) :
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer ' . TT_MBI_API_KEY),
));
$response = curl_exec($curl);
curl_close($curl);
endif;
return json_decode($response);
}
public static function deviceoltserviceportrefresh($ip)
{
$url = TT_MBI_API_URL . TT_MBI_API_VERSION . '/deviceoltserviceportrefresh/' . $ip;
$response = "";
if (TT_MBI_API_ENABLE) :
$curl = curl_init();
curl_setopt_array($curl, array(
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_SSL_VERIFYHOST => false,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'Authorization: Bearer ' . TT_MBI_API_KEY),
));
$response = curl_exec($curl);
curl_close($curl);
endif;
return json_decode($response);
}
public static function changeoltSplitter($id, $portid, $ports)
{