当前位置: 首页>>代码示例>>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;未经允许,请勿转载。