Devices:
OLT ONT Implementation Devices Snmp Version Devicetypes: Olt Flag
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user