Ignore:
Timestamp:
Mar 16, 2016, 10:01:02 PM (9 years ago)
Author:
chronos
Message:
  • Added: UpDown history for network ports.
File:
1 edited

Legend:

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

    r817 r818  
    244244      'Items' => array(
    245245        'Name' => array('Type' => 'String', 'Caption' => 'Jméno', 'Default' => ''),
     246        'Protocol' => array('Type' => 'TNetworkProtocol', 'Caption' => 'Protokol', 'Default' => '0'),
    246247        'Number' => array('Type' => 'Integer', 'Caption' => 'Číslo', 'Default' => ''),
    247248        'Interface' => array('Type' => 'TNetworkInterface', 'Caption' => 'Rozhraní', 'Default' => ''),
     
    249250        'Online' => array('Type' => 'TOnlineState', 'Caption' => 'Běží', 'Default' => '0', 'ReadOnly' => true),
    250251        'LastOnline' => array('Type' => 'DateTime', 'Caption' => 'Naposledy běželo', 'Default' => '', 'ReadOnly' => true),
     252        'UpDown' => array('Type' => 'TNetworkPortUpDown', 'Caption' => 'Změny stavu', 'Default' => ''),
    251253      ),
    252254    ));
     
    490492      ),
    491493    ));
     494    $this->System->FormManager->RegisterClass('NetworkInterfaceUpDown', array(
     495      'Title' => 'Změny stavu rozhraní',
     496      'Table' => 'NetworkInterfaceUpDown',
     497      'DefaultSortColumn' => 'Time',
     498      'DefaultSortOrder' => 1,
     499      'Items' => array(
     500        'Time' => array('Type' => 'DateTime', 'Caption' => 'Čas', 'Default' => '', 'ReadOnly' => true),
     501        'Interface' => array('Type' => 'TNetworkInterface', 'Caption' => 'Rozhraní', 'Default' => '', 'ReadOnly' => true),
     502        'State' => array('Type' => 'TOnlineState', 'Caption' => 'Stav', 'Default' => '', 'ReadOnly' => true),
     503        'Duration' => array('Type' => 'TimeDiff', 'Caption' => 'Trvání', 'Default' => '', 'ReadOnly' => true),
     504      ),
     505    ));
     506    $this->System->FormManager->RegisterClass('NetworkPortUpDown', array(
     507      'Title' => 'Změny stavu portů',
     508      'Table' => 'NetworkPortUpDown',
     509      'DefaultSortColumn' => 'Time',
     510      'DefaultSortOrder' => 1,
     511      'Items' => array(
     512        'Time' => array('Type' => 'DateTime', 'Caption' => 'Čas', 'Default' => '', 'ReadOnly' => true),
     513        'Port' => array('Type' => 'TNetworkPort', 'Caption' => 'Port', 'Default' => '', 'ReadOnly' => true),
     514        'State' => array('Type' => 'TOnlineState', 'Caption' => 'Stav', 'Default' => '', 'ReadOnly' => true),
     515        'Duration' => array('Type' => 'TimeDiff', 'Caption' => 'Trvání', 'Default' => '', 'ReadOnly' => true),
     516      ),
     517    ));
     518    $this->System->FormManager->RegisterFormType('TNetworkProtocol', array(
     519      'Type' => 'Enumeration',
     520      'States' => array('TCP', 'UDP'),
     521    ));
    492522    $this->System->FormManager->RegisterFormType('TNetworkDevice', array(
    493523      'Type' => 'Reference',
     
    513543      'Filter' => '1',
    514544    ));
     545    $this->System->FormManager->RegisterFormType('TNetworkPort', array(
     546      'Type' => 'Reference',
     547      'Table' => 'NetworkPort',
     548      'View' => '(SELECT `NetworkPort`.*, CONCAT(CONCAT_WS("-", `NetworkDevice`.`Name`, NULLIF(`NetworkInterface`.`Name`, "")), ":", `NetworkPort`.`Number`) AS `PortName` FROM `NetworkPort` '.
     549      'LEFT JOIN `NetworkInterface` ON `NetworkInterface`.`Id` = `NetworkPort`.`Interface` '.
     550      'LEFT JOIN `NetworkDevice` ON `NetworkDevice`.`Id` = `NetworkInterface`.`Device`) AS `T`',
     551      'Id' => 'Id',
     552      'Name' => 'PortName',
     553      'Filter' => '1',
     554    ));
    515555    $this->System->FormManager->RegisterFormType('TNetworkInterfaceType', array(
    516556      'Type' => 'Reference',
     
    597637      'Filter' => '1',
    598638    ));
    599 
     639    $this->System->FormManager->RegisterFormType('TNetworkPortUpDown', array(
     640      'Type' => 'ManyToOne',
     641      'Table' => 'NetworkPortUpDown',
     642      'Id' => 'Id',
     643      'Ref' => 'Port',
     644      'Filter' => '1',
     645    ));
     646   
    600647    $this->System->ModuleManager->Modules['IS']->RegisterDashboardItem('Network',
    601648      array('ModuleNetwork', 'ShowDashboardItem'));
Note: See TracChangeset for help on using the changeset viewer.