Changeset 102


Ignore:
Timestamp:
Aug 3, 2008, 6:48:38 PM (16 years ago)
Author:
george
Message:
  • Upraveno: Vystředění stránky dostupnost sítě.
Location:
devel/www
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • devel/www/network/dostupnost.php

    r101 r102  
    1111    $Output = '<div style="font-size: small;">Dostupnost zařízení se kontroluje jednou za minutu. Hodnoty u delších intervalů nemusí odpovídat skutečnosti, protože záznam byl spuštěn až v průběhu těchto intervalu.
    1212Všechny prvky sítě jsou kontrolovány z směrovačů, tj. pokud vypadne některé blízké zařízení, všechny další zařízení propojené přes něj jsou také nedostupné.</div>';
    13     $Output .= '<table width="100%"><tr><td valign="top"></td><td valign="top">';
     13    $Output .= '<div align="center">';
    1414
    1515    // Zařízení
    16     $Output .= '<strong>Zařízení:</strong><table style="font-size: small;" cellspacing="0" cellpadding="3" border="1">';
     16    $Output .= '<br /><table style="font-size: small;" cellspacing="0" cellpadding="3" border="1">';
    1717    $Output .= '<tr><th>Jméno</th><th>Hodina [%]</th><th>Den [%]</th><th>Týden [%]</th><th>Měsíc [%]</th><th>Year [%]</th></tr>';
    1818    $DbResult = $this->Database->query('SELECT hosts.name, PeriodHour.Percent as Hour, PeriodDay.Percent as Day, PeriodWeek.Percent as Week, PeriodMonth.Percent as Month, PeriodYear.Percent as Year FROM hosts LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 1 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 1 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodHour ON PeriodHour.host_id=hosts.id LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodDay ON PeriodDay.host_id=hosts.id LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 7 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 * 7 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodWeek ON PeriodWeek.host_id=hosts.id LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 30 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 * 30 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodMonth ON PeriodMonth.host_id=hosts.id LEFT JOIN (SELECT stat_hosts.host_id, (SUM(stat_hosts.count) / 24 / 365 / 60 * 100) as Percent FROM stat_hosts WHERE (time > DATE_SUB(DATE_SUB(NOW(), INTERVAL 1 HOUR), INTERVAL 24 * 365 HOUR)) AND (time< DATE_SUB(NOW(), INTERVAL 1 HOUR)) GROUP BY host_id) as PeriodYear ON PeriodYear.host_id=hosts.id WHERE hosts.used=1 AND hosts.show_online=0');
     
    2020    while($Row = $DbResult->fetch_array())
    2121    {
    22       $Output .= '<tr><td>'.$Row['name'].'</td><td>'.sprintf("%01.2f", $Row['Hour']).'</td><td>'.sprintf("%01.2f", $Row['Day']).'</td><td>'.sprintf("%01.2f", $Row['Week']).'</td><td>'.sprintf("%01.2f", $Row['Month']).'</td><td>'.sprintf("%01.2f", $Row['Year']).'</td></tr>';
     22      $Output .= '<tr><td>'.$Row['name'].'</td><td style="text-align: right;">'.sprintf("%01.2f", $Row['Hour']).'</td><td style="text-align: right;">'.sprintf("%01.2f", $Row['Day']).'</td><td style="text-align: right;">'.sprintf("%01.2f", $Row['Week']).'</td><td style="text-align: right;">'.sprintf("%01.2f", $Row['Month']).'</td><td style="text-align: right;">'.sprintf("%01.2f", $Row['Year']).'</td></tr>';
    2323    }
    24     $Output .= '</table>';
    25     $Output .= '</td></tr></table>';
     24    $Output .= '</table></div>';
    2625    return($Output);
    2726  }
  • devel/www/page.php

    r100 r102  
    166166    $Output = $this->ShowHeader($this->FullTitle, $this->ShortTitle).$Output;
    167167    $Output .= $this->ShowFooter();
    168     echo($this->FormatOutput($Output));
    169     //echo($Output);
     168    //echo($this->FormatOutput($Output));
     169    echo($Output);
    170170  }
    171171
  • devel/www/temp/transform.php

    r101 r102  
    147147
    148148    $this->SubjectOpenTime();
     149
     150    // Import chat messages history
     151    //$this->Database->query('TRUNCATE TABLE ChatHistory');
     152    //$this->Database->query('INSERT INTO ChatHistory (SELECT id as Id, nick as Nick, text as Text, time as Time, color as Color, roomname as RoomName, roomtype as RoomType, "" as Host FROM `sunrisechat_history`)');
    149153    return($Output);
    150154  }
Note: See TracChangeset for help on using the changeset viewer.