diff --git a/Layout/default/Device/Detail.php b/Layout/default/Device/Detail.php
index 615838989..9c2e704c6 100644
--- a/Layout/default/Device/Detail.php
+++ b/Layout/default/Device/Detail.php
@@ -12,6 +12,132 @@
border-radius: 3px;
}
+ .sp-table-border {
+ border: 1px solid #bfbfbf;
+ border-radius: 10px;
+ display: inline-block;
+ }
+
+ .sp-table-border > tbody {
+ padding: 10px;
+ display: table-cell;
+ }
+
+ .sp-table-border > thead td {
+ padding: 10px 0px 0px 0px;
+ font-weight: bold;
+ text-align: center;
+ font-size: 20px;
+ }
+
+ .sp-port-lines {
+ width: 50px;
+ border-bottom: 1px solid #bfbfbf;
+ padding-top: 22px;
+ }
+
+ #olt-splitter td {
+ height: 30px;
+ width: 150px;
+ border: 1px solid #bfbfbf;
+ margin-top: 15px;
+ display: block;
+ border-radius: 5px;
+ }
+
+ #olt-splitter-table thead {
+ padding: 10px 0px 0px 0px;
+ font-weight: bold;
+ font-size: 20px;
+
+ }
+
+ #olt-splitter-table thead td {
+ padding-top: 12px;
+ text-align: center;
+ }
+
+ .sp-splitter-count {
+ padding: 3px 10px 3px 10px;
+ width: 50px;
+ }
+
+ .sp-splitter-count-left {
+ padding: 3px 0px 3px 10px;
+ width: 50px;
+ }
+
+ .sp-splitter-count-right {
+ padding: 3px 10px 3px 0px;
+ width: 50px;
+ text-align: right;
+ }
+
+ .sp-splitter-count-edit {
+ -ms-user-select: None;
+ -moz-user-select: None;
+ -webkit-user-select: None;
+ user-select: None;
+ cursor: pointer;
+ }
+
+ .sp-splitter-count-show {
+ width: 46px;
+ display: inline-block;
+ text-align: center;
+ cursor: pointer;
+ text-decoration: underline;
+ padding-top: 2px;
+ -ms-user-select: None;
+ -moz-user-select: None;
+ -webkit-user-select: None;
+ user-select: None;
+ }
+
+ .sp-white-border {
+ border-color: #fff !important;
+ }
+
+ .sp-ont-text {
+ padding: 0px 5px 0px 5px;
+ }
+
+ .fa-circle-check {
+ color: #07ad2b;
+ }
+
+ .fa-circle-xmark {
+ color: #ff0000;
+ }
+
+ .fa-rotate-right {
+ color: #0d6efd;
+ cursor: pointer;
+
+ }
+
+ .ont-refresh-span, .ontdetail-refresh-span {
+ display: inline-block;
+ width: 20px;
+ margin-right: 50px;
+ min-height: 1px;
+ color: #0d6efd;
+ }
+
+ .text-decoration-underline {
+ text-decoration: underline;
+ cursor: pointer;
+ }
+
+ .condensed-ont th {
+ padding: 6px 0.85rem 6px 0.85rem !important;
+ }
+
+ .condensed-ont td {
+ padding: 6px 0.85rem 6px 0.85rem !important;
+ }
+
+
@@ -48,8 +174,9 @@ if ($devices->power != "0.0") {
} else {
$power = $devices->devicetype->power;
}
-
+//var_dump($customer);
?>
+
+ devicetype->olt && TT_MBI_API_ENABLE) :
+ ?>
+
+
+
+
+
+
+
+
OLT/ONT Informationen
+
+
+
+
+
+
+
+
+
+
+
+
+
+ | Port-ID |
+ Kdnr. |
+ Kunde |
+ Stat. |
+ Serial |
+
+
+
+
+ |
+ |
+ |
+ |
+ |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
Allgemein
+
+
+
+
+ | Status |
+ N/A
+ |
+
+
+ | Kdnr./Kunde |
+ N/A
+ |
+
+
+ | ONT Typ |
+ N/A
+ |
+
+
+ | Seriennummer |
+ N/A
+ |
+
+
+ | Lineprofile / Srvprofile |
+ N/A
+ / N/A |
+
+
+ | Version/Software Version |
+ N/A
+ / N/A |
+
+
+
+
+
+
+ | RX-Pegel OLT |
+ N/A
+ dBm
+ |
+
+
+ | RX/TX ONT |
+ N/A
+ dBm / N/A dBm
+ |
+
+
+ | Leitungslänge |
+ N/A
+ Meter
+ |
+
+
+ | Uptime |
+ N/A
+ |
+
+
+ | Zuletzt Up |
+ N/A
+ |
+
+
+ | Zuletzt Down |
+
+
+
+ N/A
+ |
+
+
+ | Letzter Dying Gasp |
+ N/A
+ |
+
+
+
+
+
+
CPE Port
+
+
+
+ | Port ID |
+ Port Status |
+ Port Typ |
+ Speed |
+ Duplex |
+
+
+
+
+ |
+ |
+ |
+ |
+ |
+
+
+
+
Service Ports
+
+
+
+ | Vlan CPE |
+ Vlan NNI |
+ Status |
+ Downstream |
+ Upstream |
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
devicetype->devicemanufactor->config_backup > count()):
$year = date("Y", time());
@@ -311,12 +664,526 @@ if ($devices->power != "0.0") {
diff --git a/Layout/default/Device/Form.php b/Layout/default/Device/Form.php
index f1d6c80da..59e7a7530 100644
--- a/Layout/default/Device/Form.php
+++ b/Layout/default/Device/Form.php
@@ -157,6 +157,18 @@ if (isset($_GET['returnto']) && $_GET['returnto'] == "device-detail") {
value="= $device->mac ?>">
+ devicetype->olt) : ?>
+
+
+
+
diff --git a/application/Api/v1/DeviceApicontroller.php b/application/Api/v1/DeviceApicontroller.php
index 2e49ba47d..fb1bae3f5 100644
--- a/application/Api/v1/DeviceApicontroller.php
+++ b/application/Api/v1/DeviceApicontroller.php
@@ -16,8 +16,10 @@ class DeviceApicontroller extends mfBaseApicontroller
$deviceReturn[$key]['id'] = $device->id;
$deviceReturn[$key]['name'] = $device->name;
$deviceReturn[$key]['ip'] = $device->ip;
+ $deviceReturn[$key]['snmp_version'] = $device->snmp_version;
$deviceReturn[$key]['serial'] = $device->serial;
$deviceReturn[$key]['manufactor'] = $device->devicetype->devicemanufactor->name;
+
}
return mfResponse::Ok($deviceReturn);
diff --git a/application/Device/DeviceController.php b/application/Device/DeviceController.php
index 436c3dc81..cbd143567 100644
--- a/application/Device/DeviceController.php
+++ b/application/Device/DeviceController.php
@@ -43,8 +43,16 @@ class DeviceController extends mfBaseController
$this->layout()->setTemplate("Device/Detail");
$devicesconfig = DeviceModel::getconifg($id);
$devices = DeviceModel::getOne($id);
+
+ if ($devices->devicetype->olt == "1") {
+ $customer = DeviceModel::getOltCustomer($device->ip);
+ } else {
+ $customer = [];
+ }
+
$this->layout()->set("devicesconfig", $devicesconfig);
$this->layout()->set("devices", $devices);
+ $this->layout()->set("customer", $customer);
}
@@ -122,6 +130,11 @@ class DeviceController extends mfBaseController
$data['ip'] = $r->ip;
$data['mac'] = $r->mac;
$data['serial'] = $r->serial;
+ if ($r->snmp_version) {
+ $data['snmp_version'] = $r->snmp_version;
+ } else {
+ $data['snmp_version'] = NULL;
+ }
if (empty(trim($r->price))) {
$data['price'] = "0.00";
} else {
@@ -212,14 +225,17 @@ class DeviceController extends mfBaseController
protected function apiAction()
{
if (!$this->me->is(["Admin"])) {
- $this->redirect("Dashboard");
+ $return = false;
}
$do = $this->request->do;
$format = $this->request->format;
$filename = $this->request->filename;
$id = $this->request->id;
$ip = $this->request->ip;
-
+ $portid = $this->request->portid;
+ $ports = $this->request->ports;
+ $adv = $this->request->adv;
+ $ont = $this->request->ont;
$data = [];
switch ($do) {
@@ -229,6 +245,15 @@ class DeviceController extends mfBaseController
case "createconfig":
$return = $this->createConfig($ip);
break;
+ case "getoltinfo":
+ $return = $this->getoltInfo($ip, $portid, $adv);
+ break;
+ case "getontinfo":
+ $return = $this->getontInfo($ip, $portid, $ont);
+ break;
+ case "changeoltsplitter":
+ $return = $this->changeoltSplitter($id, $portid, $ports);
+ break;
default:
$return = false;
}
@@ -279,4 +304,29 @@ class DeviceController extends mfBaseController
return $this->redirect($returnUrl, $returnAction, $returnVariables, $returnAnker);
}
+ private function changeoltSplitter($id, $portid, $ports)
+ {
+ $changeOltSplitter = DeviceModel::changeoltSplitter($id, $portid, $ports);
+ echo json_encode($changeOltSplitter);
+ exit;
+ }
+
+ private function getoltInfo($ip, $portid, $adv)
+ {
+ $r = $this->request;
+ $id = $r->id;
+ $getOltInfo = DeviceModel::getoltInfo($ip, $portid, $adv);
+ echo json_encode($getOltInfo);
+ exit;
+ }
+
+ private function getontInfo($ip, $portid, $ont)
+ {
+ $r = $this->request;
+ $id = $r->id;
+ $getOntInfo = DeviceModel::getontInfo($ip, $portid, $ont);
+ echo json_encode($getOntInfo);
+ exit;
+ }
+
}
\ No newline at end of file
diff --git a/application/Device/DeviceModel.php b/application/Device/DeviceModel.php
index e2bc076a1..967ebed09 100644
--- a/application/Device/DeviceModel.php
+++ b/application/Device/DeviceModel.php
@@ -17,6 +17,7 @@ class DeviceModel
public $addr_city = null;
public $gps_long = null;
public $create_by = null;
+ public $snmp_version = null;
public $edit_by = null;
public $create = null;
public $edit = null;
@@ -137,6 +138,49 @@ class DeviceModel
return $where;
}
+ public static function getOltCustomer($ip)
+ {
+ $items = [];
+ $db = FronkDB::singleton();
+// $sql = "SELECT Patching.id,lastname,firstname,customer_number,company,device_name,device_port FROM `Patching`
+//LEFT JOIN OrderProduct ON (Patching.termination_id=OrderProduct.termination_id)
+//LEFT JOIN `Order` ON (`Order`.id=OrderProduct.order_id)
+//LEFT JOIN Address ON Address.id=`Order`.owner_id
+//WHERE Patching.`device_name` LIKE '".$ip."%'";
+// $res = $db->query($sql);
+// if ($db->num_rows($res)) {
+// while ($data = $db->fetch_array($res)) {
+// $devicePort = str_replace($ip, "", $data['device_name']);
+// $devicePort=trim($devicePort);
+// $devicePort=ltrim($devicePort,"/");
+// $devicePort=ltrim($devicePort,"-");
+// $devicePort=$devicePort."/".$data['device_port'];
+// $devicePort=str_replace("/","-",$devicePort);
+// $devicePort=rtrim($devicePort,"-");
+// $items[$devicePort] = $data;
+//
+//
+// }
+// }
+ $sql = "Select Patching.id,lastname,firstname,customer_number,company,device_name,device_port,value_string FROM Workflowvalue
+LEFT JOIN Termination ON Termination.id=Workflowvalue.object_id
+LEFT JOIN Patching ON Termination.id = Patching.termination_id
+LEFT JOIN OrderProduct ON (Patching.termination_id=OrderProduct.termination_id)
+LEFT JOIN `Order` ON (`Order`.id=OrderProduct.order_id)
+LEFT JOIN Address ON Address.id=`Order`.owner_id
+WHERE `item_id` = '55'";
+ $res = $db->query($sql);
+ if ($db->num_rows($res)) {
+ while ($data = $db->fetch_array($res)) {
+ $ontSn=$data['value_string'];
+ $ontSn= str_replace("HWTC","48575443",$ontSn);
+
+ $items[$ontSn] = $data;
+ }
+ }
+ return $items;
+ }
+
public static function getconifg($id)
{
$response = "";
@@ -215,4 +259,92 @@ class DeviceModel
endif;
return json_decode($response);
}
+
+ public static function getoltInfo($ip, $portid = '', $adv = '')
+ {
+ if ($portid) {
+ $portid = "/" . $portid;
+ }
+ if ($adv) {
+ $adv = "/" . $adv;
+ }
+ $url = TT_MBI_API_URL . TT_MBI_API_VERSION . '/deviceoltinfo/' . $ip . $portid . $adv;
+ $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 getontInfo($ip, $portid = '', $ont = '')
+ {
+ $portid = "/" . $portid;
+ $ont = "/ont/" . $ont;
+ $url = TT_MBI_API_URL . TT_MBI_API_VERSION . '/deviceoltinfo/' . $ip . $portid . $ont;
+
+ $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)
+ {
+
+ $url = TT_MBI_API_URL . TT_MBI_API_VERSION . '/deviceoltsetsplitter/' . $id . "/" . $portid . "/" . $ports;
+ $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_TIMEOUT => 0,
+ CURLOPT_SSL_VERIFYHOST => false,
+ CURLOPT_SSL_VERIFYPEER => false,
+ CURLOPT_FOLLOWLOCATION => true,
+ CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
+ CURLOPT_CUSTOMREQUEST => 'POST',
+ CURLOPT_HTTPHEADER => array(
+ 'Authorization: Bearer ' . TT_MBI_API_KEY),
+ ));
+ $response = curl_exec($curl);
+ curl_close($curl);
+ endif;
+ return json_decode($response);
+ }
}
\ No newline at end of file
diff --git a/application/Devicetype/DevicetypeController.php b/application/Devicetype/DevicetypeController.php
index 3fbe660d6..170cf65e3 100644
--- a/application/Devicetype/DevicetypeController.php
+++ b/application/Devicetype/DevicetypeController.php
@@ -81,11 +81,17 @@ class DevicetypeController extends mfBaseController
$power = $r->power;
}
+
+ if ($r->olt) {
+ $olt = "1";
+ }
+
$data = [];
$data['name'] = trim($r->name);
$data['devicemanufactor_id'] = $r->devicemanufactor_id;
$data['price'] = $price;
$data['power'] = $power;
+ $data['olt'] = $olt;
if (!$data['name']) {
$this->layout()->setFlash("Name darf nicht leer sein", "error");
diff --git a/application/Devicetype/DevicetypeModel.php b/application/Devicetype/DevicetypeModel.php
index dfa849cbf..829fef08d 100644
--- a/application/Devicetype/DevicetypeModel.php
+++ b/application/Devicetype/DevicetypeModel.php
@@ -5,6 +5,7 @@ class DevicetypeModel
public $name = null;
public $power = null;
public $price = null;
+ public $olt = null;
public $devicemanufactor_id = null;