Changeset 865


Ignore:
Timestamp:
Dec 23, 2019, 12:31:52 AM (5 years ago)
Author:
chronos
Message:
Location:
trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Application/Version.php

    r862 r865  
    11<?php
    22
    3 $Revision = 862; // Subversion revision
     3$Revision = 865; // Subversion revision
    44$DatabaseRevision = 862; // SQL structure revision
    5 $ReleaseTime = strtotime('2019-10-04');
     5$ReleaseTime = strtotime('2019-12-23');
  • trunk/Modules/Map/Map.php

    r864 r865  
    277277        'Name' => array('Type' => 'String', 'Caption' => 'Jméno', 'Default' => ''),
    278278        'Pos' => array('Type' => 'MapPosition', 'Caption' => 'Poloha', 'Default' => '0;0'),
     279        'Subjects' => array('Type' => 'TSubjectListMapPosition', 'Caption' => 'Subjekty', 'Default' => ''),
     280        'NetworkDevices' => array('Type' => 'TNetworkDeviceListMapPosition', 'Caption' => 'Síťová zařízení', 'Default' => ''),
    279281      ),
    280282      'ItemActions' => array(
     
    292294      'Filter' => '1',
    293295    ));
     296    $this->System->FormManager->RegisterFormType('TSubjectListMapPosition', array(
     297      'Type' => 'ManyToOne',
     298      'Table' => 'Subject',
     299      'Id' => 'Id',
     300      'Ref' => 'MapPosition',
     301      'Filter' => '1',
     302    ));
     303    $this->System->FormManager->RegisterFormType('TNetworkDeviceListMapPosition', array(
     304      'Type' => 'ManyToOne',
     305      'Table' => 'NetworkDevice',
     306      'Id' => 'Id',
     307      'Ref' => 'MapPosition',
     308      'Filter' => '1',
     309    ));
    294310  }
    295311
  • 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.