當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Dashboard::displayTime方法代碼示例

本文整理匯總了PHP中Dashboard::displayTime方法的典型用法代碼示例。如果您正苦於以下問題:PHP Dashboard::displayTime方法的具體用法?PHP Dashboard::displayTime怎麽用?PHP Dashboard::displayTime使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Dashboard的用法示例。


在下文中一共展示了Dashboard::displayTime方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: getDashboardTitleHTML

 public function getDashboardTitleHTML($title, $time = null, $until = null)
 {
     $time_html = '';
     $id = preg_replace("/[^a-z0-9]/", "", strtolower($title));
     if (!empty($time)) {
         $time_html = "(" . Dashboard::displayTime($time);
         if (!empty($until)) {
             $time_html .= " - " . Dashboard::displayTime($until);
         }
         $time_html .= ")";
     }
     return "<h2 id=\"{$id}\" class=\"section-title\"><a href=\"#{$id}\">{$title}</a> {$time_html}</h2>";
 }
開發者ID:igorette,項目名稱:dashboard,代碼行數:13,代碼來源:GraphFactory.php

示例2: render

    public static function render($name, $graphs, $selects = array(), $currentValues = array())
    {
        // Necessary to do unshift-with-a-key
        $selects = array_reverse($selects, true);
        $selects['time'] = Dashboard::getTimes();
        $selects = array_reverse($selects, true);
        // Default
        $currentValues['time'] = '1h';
        foreach ($selects as $name => $select) {
            if (!empty($_GET[$name])) {
                $currentValues[$name] = $_GET[$name];
            } else {
                if (!isset($currentValues[$name])) {
                    $currentValues[$name] = null;
                }
            }
        }
        ?>
        <!DOCTYPE html>
        <html>
        <head>
        <title><?php 
        echo $name;
        ?>
</title>
        <link rel="stylesheet" type="text/css" href="css/screen.css">
        <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.6.4/jquery.min.js"></script>
        <script src="js/dashboard.js"></script>
        </head>
        <body id="deploy" class="dashboard">
        <div id="status"></div>
        <form id="controls" action="<?php 
        echo $_SERVER['PHP_SELF'];
        ?>
">
        <?php 
        foreach ($selects as $name => $select) {
            echo "<select name=\"{$name}\">";
            foreach ($select as $key => $value) {
                echo "<option value=\"{$key}\"";
                if ($key == $currentValues[$name]) {
                    echo "selected";
                }
                echo ">{$value}</option>";
            }
            echo "</select>";
        }
        ?>
        </form>
        <?php 
        foreach ($graphs as $section => $items) {
            echo "<div class=\"graphgroup\">";
            echo "<h1>" . htmlentities($section) . " (" . Dashboard::displayTime($currentValues['time']) . ")</h1>\n";
            foreach ($items as $item) {
                $item->setTime($currentValues['time']);
                echo $item->getDashboardHTML();
            }
            echo "</div>";
        }
        ?>
        </body>
        </html>
        <?php 
    }
開發者ID:adrexia,項目名稱:deploynaut,代碼行數:64,代碼來源:Dashboard.php

示例3: getPageURLForHostnameAndCluster

 public function getPageURLForHostnameAndCluster($hostname, $cluster)
 {
     $p = array();
     $p['r'] = Dashboard::displayTime($this->time);
     $p['h'] = $hostname;
     $p['c'] = $cluster;
     return $this->url . '?' . http_build_query($p);
 }
開發者ID:igorette,項目名稱:dashboard,代碼行數:8,代碼來源:Ganglia.php

示例4: array

$tabs = Dashboard::$DB_TABS;
$tab_url = Dashboard::getTabUrl(__FILE__);
include 'phplib/template_tabs.php';
?>

<form id="controls" action="<?php 
echo $_SERVER['PHP_SELF'];
?>
">
    <?php 
echo Controls::buildTimeControl($time, $times);
?>
</form>

<div class='section'>
<?php 
$activity_arr = array('pgb_v2_avg_querytime', 'pgb_v2_avg_req', 'pgb_v2_cl_active', 'pgb_v2_cl_waiting', 'pgb_v2_sv_active', 'pgb_v2_sv_idle', 'pgb_v2_sv_used');
foreach ($pgbouncer_cluster_arr as &$cluster) {
    echo "<h2>{$cluster["name"]} pgBouncer pool status (" . Dashboard::displayTime($time) . ")</h2>";
    foreach ($activity_arr as &$activity) {
        $g = new Graph_Ganglia($time);
        $g->addMetric("{$cluster["name"]}", "{$cluster["machines"]}", "{$activity}");
        echo $g->getDashboardHTML('medium', GraphConstants::THREE_GRAPH_WIDTH);
    }
}
?>
    
</div>
</body>
</html>
開發者ID:igorette,項目名稱:dashboard,代碼行數:30,代碼來源:example_pgbouncer.php


注:本文中的Dashboard::displayTime方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。