Ignore:
Timestamp:
Jan 8, 2010, 8:20:18 PM (15 years ago)
Author:
george
Message:
  • Opraveno: Zobrazování hodinových period u dostupnosti zařízení.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/network/dostupnost.php

    r269 r271  
    77  var $FullTitle = 'Dostupnost aktivních prvků sítě';
    88  var $ShortTitle = 'Dostupnost sítě';
     9  var $PeriodCount = 12;
    910  var $Period = array(
    1011    array('Column' => 'Hour', 'Title' => 'Hodina', 'Period' => 1),
     
    4748      {
    4849        $Output .= '<th>'.$Period['Title'].' [%]</th>';
    49         $Join .= ' LEFT JOIN (SELECT NetworkInterfaceStat.NetworkInterface, (SUM(NetworkInterfaceStat. PingCount) / '.$Period['Period'].' / 60 * 100) AS Percent FROM NetworkInterfaceStat WHERE (Time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL '.$Period['Period'].' HOUR)) AND (Time < DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY NetworkInterface) AS Period'.$Period['Column'].' ON Period'.$Period['Column'].'.NetworkInterface = NetworkInterface.Id';
     50        $Join .= ' LEFT JOIN (SELECT NetworkInterfaceStat.NetworkInterface, (SUM(NetworkInterfaceStat. PingCount) / '.$Period['Period'].' / 60 * 100) AS Percent FROM NetworkInterfaceStat WHERE (Time > DATE_SUB(NOW(), INTERVAL '.($Period['Period'] + 1).' HOUR)) AND (Time < DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY NetworkInterface) AS Period'.$Period['Column'].' ON Period'.$Period['Column'].'.NetworkInterface = NetworkInterface.Id';
    5051        $Columns .= ', Period'.$Period['Column'].'.Percent AS '.$Period['Column'];
    5152      }
     
    5455      if(array_key_exists($_GET['Period'], $this->Period))
    5556      {
    56         for($I = 0; $I < 10; $I++)
     57        for($I = 0; $I < $this->PeriodCount; $I++)
    5758        {
    5859          $Period = $this->Period[$_GET['Period']];
    5960          $Output .= '<th>-'.$I.' [%]</th>';
    60           $Join .= ' LEFT JOIN (SELECT NetworkInterfaceStat.NetworkInterface, (SUM(NetworkInterfaceStat. PingCount) / '.$Period['Period'].' / 60 * 100) AS Percent FROM NetworkInterfaceStat WHERE (Time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL '.($Period['Period'] * ($I + 1)).' HOUR)) AND (Time < DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL '.($Period['Period'] * $I + 1).' HOUR)) GROUP BY NetworkInterface) AS Period'.$I.' ON Period'.$I.'.NetworkInterface = NetworkInterface.Id';
     61          $Join .= ' LEFT JOIN (SELECT NetworkInterfaceStat.NetworkInterface, (SUM(NetworkInterfaceStat. PingCount) / '.$Period['Period'].' / 60 * 100) AS Percent FROM NetworkInterfaceStat WHERE (Time > DATE_SUB(NOW(), INTERVAL '.($Period['Period'] * ($I + 1) + 1).' HOUR)) AND (Time < DATE_SUB(NOW(), INTERVAL '.($Period['Period'] * $I + 1).' HOUR)) GROUP BY NetworkInterface) AS Period'.$I.' ON Period'.$I.'.NetworkInterface = NetworkInterface.Id';
    6162          $Columns .= ', Period'.$I.'.Percent AS Period'.$I.'Column';
    6263        }
     
    8081        if(array_key_exists($_GET['Period'], $this->Period))
    8182        {
    82           for($I = 0; $I < 10; $I++)
     83          for($I = 0; $I < $this->PeriodCount; $I++)
    8384          {
    8485            $Output .= '<td style="text-align: center;">'.sprintf('%01.2f', $Interface['Period'.$I.'Column']).'</td>';
Note: See TracChangeset for help on using the changeset viewer.