Changeset 696 for trunk/Modules/NetworkConfigRouterOS
- Timestamp:
- Sep 23, 2014, 9:56:07 PM (10 years ago)
- Location:
- trunk/Modules/NetworkConfigRouterOS
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Modules/NetworkConfigRouterOS/Generators/NetwatchImport.php
r682 r696 57 57 { 58 58 // Online state changed 59 $System->Database->insert('NetworkInterfaceUpDown', array( 60 'Interface' => $Interface['Id'], 'State' => $Interface['NewOnline'], 61 'Time' => TimeToMysqlDateTime($StartTime))); 59 $System->Database->query('INSERT INTO `NetworkInterfaceUpDown` (`Interface`, 60 `State`, `Time`, `Duration`) VALUES ('.$Interface['Id'].', '.$Interface['NewOnline'].', "'. 61 TimeToMysqlDateTime($StartTime).'", IFNULL(TIMESTAMPDIFF(SECOND, '. 62 '(SELECT `Time` FROM `NetworkInterfaceUpDown` AS `TA` WHERE (`TA`.`Time` < "'.TimeToMysqlDateTime($StartTime).'") '. 63 'AND (`TA`.`Interface`='.$Interface['Id'].') ORDER BY `TA`.`Time` DESC LIMIT 1), "'.TimeToMysqlDateTime($StartTime).'"), 0))'); 64 echo($System->Database->LastQuery."\n"); 62 65 $System->Database->update('NetworkInterface', '`Id` = "'.$Interface['Id'].'"', 63 66 array('Online' => $Interface['NewOnline'])); -
trunk/Modules/NetworkConfigRouterOS/NetworkConfigRouterOS.php
r674 r696 37 37 'Interface' => array('Type' => 'TNetworkInterface', 'Caption' => 'Rozhraní', 'Default' => '', 'ReadOnly' => true), 38 38 'State' => array('Type' => 'TOnlineState', 'Caption' => 'Stav', 'Default' => '', 'ReadOnly' => true), 39 'Duration' => array('Type' => 'TimeDiff', 'Caption' => 'Trvání', 'Default' => '', 'ReadOnly' => true, 40 'SQL' => 'TIMESTAMPDIFF(SECOND, `Time`, '. 41 '(SELECT `Time` FROM `NetworkInterfaceUpDown` AS `TA` WHERE (`TA`.`Time` > `TX`.`Time`) '. 42 'AND (`TA`.`Interface`=`TX`.`Interface`) ORDER BY `TA`.`Time` LIMIT 1))'), 39 'Duration' => array('Type' => 'TimeDiff', 'Caption' => 'Trvání', 'Default' => '', 'ReadOnly' => true), 43 40 ), 44 41 ));
Note:
See TracChangeset
for help on using the changeset viewer.