Ignore:
Timestamp:
Dec 23, 2019, 12:31:52 AM (5 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/Modules/Network/Network.php

    r859 r865  
    193193        'ShowOnline' => array('Type' => 'Boolean', 'Caption' => 'Ukázat online', 'Default' => '0'),
    194194        'IconName' => array('Type' => 'String', 'Caption' => 'Jméno ikony', 'Default' => '0'),
    195       ),
     195        'Devices' => array('Type' => 'TNetworkDeviceListType', 'Caption' => 'Síťová zařízení', 'Default' => ''),
     196      ),
     197    ));
     198    $this->System->FormManager->RegisterFormType('TNetworkDeviceListType', array(
     199      'Type' => 'ManyToOne',
     200      'Table' => 'NetworkDevice',
     201      'Id' => 'Id',
     202      'Ref' => 'Type',
     203      'Filter' => '1',
    196204    ));
    197205    $this->System->FormManager->RegisterClass('NetworkDeviceLog', array(
     
    748756    $this->Database->query('DELETE FROM `NetworkInterfaceLatency` WHERE `Interface`='.$Id);
    749757  }
    750  
     758
    751759  function ImportNetworkLog($Parameters)
    752760  {
    753761    global $Config;
    754    
     762
    755763    $DbResult = $this->System->Database->select('NetworkDeviceLog', 'Time',
    756764      '1 ORDER BY Time DESC LIMIT 1');
     
    762770
    763771    $RemoteDb = new Database();
    764     $RemoteDb->Connect($Config['NetworkLog']['Host'], $Config['NetworkLog']['User'], 
     772    $RemoteDb->Connect($Config['NetworkLog']['Host'], $Config['NetworkLog']['User'],
    765773      $Config['NetworkLog']['Password'], $Config['NetworkLog']['Database']);
    766774    $DbResult = $RemoteDb->select('SystemEvents', '*', '`ReceivedAt`>"'. TimeToMysqlDate($StartTime).'"'.$WhereTime.' ORDER BY `Time` DESC');
     
    768776    {
    769777      $DbResult2 = $this->System->Database->select('NetworkInterface', 'Device, CONCAT(CONCAT_WS("-", `NetworkDevice`.`Name`, NULLIF(`NetworkInterface`.`Name`, "")), ".") AS `Name` ', '`Name` LIKE "'.$DbRow['FromHost'].'"');
    770       if ($DbResult2->num_rows > 0)             
     778      if ($DbResult2->num_rows > 0)
    771779      {
    772780        $DbRow2 = $DbResult2->fetch_assoc();
    773781        $DeviceID = $DbRow2['Device'];
    774         $this->System->Database->insert('NetworkDeviceLog', array('Time' => $DbRow['ReceivedAt'], 
     782        $this->System->Database->insert('NetworkDeviceLog', array('Time' => $DbRow['ReceivedAt'],
    775783          'Device' => $DeviceId, 'Message' => $DbRow['Message'], 'Tags' => $DbRow['SysLogTag']));
    776784      } else echo('Host '.$DbRow['Host'].' not paired with network device.'."\n");
Note: See TracChangeset for help on using the changeset viewer.