added zabbix sync and view for Device

This commit is contained in:
Luca Haid
2024-11-05 20:42:16 +01:00
parent bea341f869
commit eb9a1a3995
6 changed files with 118 additions and 63 deletions

View File

@@ -49,6 +49,8 @@ class DeviceController extends mfBaseController
"DEVICE_MANUFACTURERS" => $deviceManufacturers,
"DEVICE_TYPES" => $deviceTypes,
"DEVICES" => $this->getDevices(),
"ZABBIX_URL" => ZABBIX_URL,
"GRAFANA_URL" => GRAFANA_URL,
];
$this->layout()->set("vueViewName", "Device");
@@ -398,7 +400,7 @@ class DeviceController extends mfBaseController
$locationText = "";
$locationUrl = "";
if (trim($device->pop->name)) {
if (isset($device->pop) && trim($device->pop->name)) {
$locationText = $device->pop->name;
$locationUrl = self::getUrl("Pop", "Detail", ["id" => $device->pop->id]);
} else if (trim($device->addr_street)) {
@@ -431,6 +433,8 @@ class DeviceController extends mfBaseController
"ip" => $device->ip,
"mac" => $device->mac,
"serial" => $device->serial,
"zabbix_online" => $device->zabbix_online,
"zabbix_host_id" => $device->zabbix_host_id,
"price" => $device->price != "0.00" ? $device->price : $device->devicetype->price,
"power" => $device->power != "0.00" ? intval($device->power) : intval($device->devicetype->power),
"backup" => $backup,