本文整理汇总了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>";
}
示例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
}
示例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);
}
示例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>