Ignore:
Timestamp:
Apr 6, 2015, 11:08:10 PM (10 years ago)
Author:
chronos
Message:
File:
1 edited

Legend:

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

    r731 r736  
    186186        'Online' => array('Type' => 'TOnlineState', 'Caption' => 'Běží', 'Default' => '0', 'ReadOnly' => true),
    187187        'LastOnline' => array('Type' => 'DateTime', 'Caption' => 'Naposledy běželo', 'Default' => '', 'ReadOnly' => true),
    188         'Links1' => array('Type' => 'TNetworkLinkListInterface1', 'Caption' => 'Propojení 1', 'Default' => ''),
    189         'Links2' => array('Type' => 'TNetworkLinkListInterface2', 'Caption' => 'Propojení 2', 'Default' => ''),
     188        'Links' => array('Type' => 'TNetworkLinkListInterface', 'Caption' => 'Propojení', 'Default' => ''),
    190189        'UpDown' => array('Type' => 'TNetworkInterfaceUpDown', 'Caption' => 'Změny stavu', 'Default' => ''),
    191190        'Signal' => array('Type' => 'TNetworkSignalListInterface', 'Caption' => 'Signál', 'Default' => ''),
     
    193192
    194193      ),
    195     ));
     194    ));   
    196195    $this->System->FormManager->RegisterClass('NetworkInterfaceType', array(
    197196      'Title' => 'Typ síťového rozhraní',
     
    229228      'Table' => 'NetworkLink',
    230229      'Items' => array(
    231         'Type' => array('Type' => 'Integer', 'Caption' => 'Typ', 'Default' => '1'),
     230        'Type' => array('Type' => 'TNetworkLinkType', 'Caption' => 'Typ', 'Default' => '1'),
    232231        'Interface1' => array('Type' => 'TNetworkInterface', 'Caption' => 'Rozhraní 1', 'Default' => ''),
    233232        'Interface2' => array('Type' => 'TNetworkInterface', 'Caption' => 'Rozhraní 2', 'Default' => ''),
     233      ),
     234    ));
     235    $this->System->FormManager->RegisterClass('NetworkLinkUnion', array(
     236      'Title' => 'Síťové propojení',
     237        'BaseTable' => 'NetworkLink',
     238      'SQL' => '(SELECT `Id`, `Type`, `Interface1` AS `Interface`, `Interface2` AS `InterfaceOther` FROM `NetworkLink`) '.
     239                'UNION (SELECT `Id`, `Type`, `Interface2` AS `Interface`, `Interface1` AS `InterfaceOther` FROM `NetworkLink`)',
     240      'Items' => array(
     241        'Type' => array('Type' => 'TNetworkLinkType', 'Caption' => 'Typ', 'Default' => '1', 'ReadOnly' => true),
     242        'Interface' => array('Type' => 'TNetworkInterface', 'Caption' => 'Rozhraní 1', 'Default' => '', 'ReadOnly' => true),
     243                'InterfaceOther' => array('Type' => 'TNetworkInterface', 'Caption' => 'Rozhraní 2', 'Default' => '', 'ReadOnly' => true),
     244      ),
     245    ));
     246   
     247    $this->System->FormManager->RegisterClass('NetworkLinkType', array(
     248      'Title' => 'Typ síťového propojení',
     249      'Table' => 'NetworkLinkType',
     250      'Items' => array(
     251        'Name' => array('Type' => 'String', 'Caption' => 'Název', 'Default' => ''),
    234252      ),
    235253    ));
     
    369387        'Type' => 'Reference',
    370388        'Table' => 'NetworkInterface',
    371         'View' => '(SELECT NetworkInterface.*, CONCAT(NetworkDevice.Name, "-", NetworkInterface.Name) AS DeviceName FROM NetworkInterface '.
     389        'View' => '(SELECT NetworkInterface.*, CONCAT_WS("-", NetworkDevice.Name, NULLIF(NetworkInterface.Name, "")) AS DeviceName FROM NetworkInterface '.
    372390        'LEFT JOIN NetworkDevice ON NetworkDevice.Id = NetworkInterface.Device) AS T',
    373391        'Id' => 'Id',
     
    396414      'Filter' => '1',
    397415    ));
     416    $this->System->FormManager->RegisterFormType('TNetworkLinkType', array(
     417      'Type' => 'Reference',
     418        'Table' => 'NetworkLinkType',
     419        'Id' => 'Id',
     420        'Name' => 'Name',
     421        'Filter' => '1',
     422    ));   
    398423    $this->System->FormManager->RegisterFormType('TDeviceAPIType', array(
    399424      'Type' => 'Reference',
     
    417442      'Filter' => '1',
    418443    ));
     444    $this->System->FormManager->RegisterFormType('TNetworkLinkListInterface', array(
     445      'Type' => 'ManyToOne',
     446      'Table' => 'NetworkLinkUnion',
     447        'Id' => 'Id',
     448        'Ref' => 'Interface',
     449        'Filter' => '1',
     450    ));
     451    $this->System->FormManager->RegisterFormType('TNetworkLinkListInterface1', array(
     452        'Type' => 'ManyToOne',
     453        'Table' => 'NetworkLink',
     454        'Id' => 'Id',
     455        'Ref' => 'Interface1',
     456        'Filter' => '1',
     457    ));
     458    $this->System->FormManager->RegisterFormType('TNetworkLinkListInterface2', array(
     459        'Type' => 'ManyToOne',
     460        'Table' => 'NetworkLink',
     461        'Id' => 'Id',
     462        'Ref' => 'Interface2',
     463        'Filter' => '1',
     464    ));
     465    $this->System->FormManager->RegisterFormType('TNetworkInterfaceUpDown', array(
     466        'Type' => 'ManyToOne',
     467        'Table' => 'NetworkInterfaceUpDown',
     468        'Id' => 'Id',
     469        'Ref' => 'Interface',
     470        'Filter' => '1',
     471    ));
     472   
    419473  }
    420474
Note: See TracChangeset for help on using the changeset viewer.