本文整理汇总了PHP中Dashboard::getTimes方法的典型用法代码示例。如果您正苦于以下问题:PHP Dashboard::getTimes方法的具体用法?PHP Dashboard::getTimes怎么用?PHP Dashboard::getTimes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Dashboard
的用法示例。
在下文中一共展示了Dashboard::getTimes方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: 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
}
示例2: isset
<?php
require_once 'Dashboard.php';
$times = isset($times) ? $times : Dashboard::getTimes();
if (!isset($time)) {
$time = !empty($_GET['time']) ? $_GET['time'] : '1h';
}
if (!isset($hide_deploys)) {
$hide_deploys = !empty($_GET['hide_deploys']) ? $_GET['hide_deploys'] : false;
}
$show_deploys = !$hide_deploys;
if (isset($graphs)) {
if (Dashboard::hasGraphitePie($graphs)) {
$page_js_imports = array_merge(isset($page_js_imports) ? $page_js_imports : array(), array("/assets/js/flot/jquery.flot.js", "/assets/js/flot/jquery.flot.pie.js", "/assets/js/flot.js", "/assets/js/graphite_percentage.js"));
}
if (Dashboard::hasGraphitePercentage($graphs)) {
$page_js_imports = array_merge(isset($page_js_imports) ? $page_js_imports : array(), array("/assets/js/d3-2.9.1.min.js", "/assets/js/graphite_percentage.js", "/assets/js/graphite_bar_percentage.js"));
}
$has_graphite_with_html_legend = false;
foreach ((array) $graphs as $section) {
foreach ((array) $section as $graph) {
if (isset($graph['type']) && $graph['type'] == 'graphite' && isset($graph['show_html_legend']) && $graph['show_html_legend'] == true) {
$has_graphite_with_html_legend = true;
}
}
}
if ($has_graphite_with_html_legend) {
$page_js_imports = array_merge(isset($page_js_imports) ? $page_js_imports : array(), array("/assets/js/zeroclipboard-0.7/ZeroClipboard.js", "/assets/js/copyurl.js"));
$page_css_imports = array_merge(isset($page_css_imports) ? $page_css_imports : array(), array("/assets/css/copyurl.css"));
}
}
示例3:
<?php
require_once 'phplib/Dashboard.php';
$times = Dashboard::getTimes();
$time = !empty($_GET['time']) ? $_GET['time'] : "1h";
?>
<!DOCTYPE html>
<html>
<head>
<title>Example PgBouncer Dashboard</title>
<link rel="stylesheet" type="text/css" href="assets/css/screen.css">
<script src="assets/js/jquery-1.6.2.min.js"></script>
<script src="assets/js/dashboard.js"></script>
</head>
<body id="postgresql" class="dashboard">
<div id="status"></div>
<?php
$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);
?>