Device OLT Anpassungen

- Service Ports können nun Live gesynct werden
This commit is contained in:
Daniel Spitzer
2025-06-23 22:25:22 +02:00
parent bfbf9a1c12
commit 5ef2f39582
3 changed files with 129 additions and 4 deletions

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;

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)
{