Commit 6e94609b authored by 's avatar

Switched from UTC to localtime.

Changet graph generation order (more logical).


git-svn-id: file:///home/svn/mapi/trunk@1344 8d5bb341-7cf1-0310-8cf6-ba355fef3186
parent dbcee098
......@@ -120,14 +120,13 @@ $form["time"] = new FormElement( // select - option (more selects)
#
@$gmseconds = gmmktime(
@$seconds = mktime(
$form["time"]->selectedvals[hours],
$form["time"]->selectedvals[minutes],
0,
$form["time"]->selectedvals[mon],
$form["time"]->selectedvals[mday],
$form["time"]->selectedvals[year],
0
$form["time"]->selectedvals[year]
);
# }}}
......@@ -297,7 +296,8 @@ $form["time"] = new FormElement( // select - option (more selects)
<div class="steps">
<form method="get" action="index.php">
<div class="step">
<h2>Step 1: Select monitored links:</h2>
<h2>Step 1: Select monitoring stations:</h2>
<div class="note">At least two monitoring stations must be checked.</div>
<?php
$name = $form["subject"]->name;
foreach($form["subject"]->elementvals as $key => $val) {
......@@ -524,17 +524,23 @@ $height = ($form["graph_size"]->isChecked("large") ? "300" : ($form["graph_size"
$widthpx = ($width + 97) . "px";
$heightpx = ($height + 93) . "px";
$h0 = 0;
$h1 = 0;
foreach($form["subject"]->elementvals as $key0 => $val0) {
$checked0 = $form["subject"]->isChecked($key0);
$host0rrddsid = $val0["rrddsid"]["value"]; // key0
$host0name = $val0["hostname"]["value"];
$h0++;
$h1 = 0;
if($checked0)
foreach($form["subject"]->elementvals as $key1 => $val1) {
$checked1 = $form["subject"]->isChecked($key1);
$host1rrddsid = $val1["rrddsid"]["value"]; // key1
$host1name = $val1["hostname"]["value"];
$h1++;
if($h1 <= $h0) continue;
if($checked1) {
if($host1rrddsid == $host0rrddsid) break;
//if($host1rrddsid == $host0rrddsid) break;
switch($form["time_type"]->selectedvals) {
case "predefined":
......@@ -573,16 +579,16 @@ EOD;
$aquery = arr2query(array(
"host0rrddsid" => $host0rrddsid,
"host1rrddsid" => $host1rrddsid,
"start" => $gmseconds,
"end" => ($gmseconds + time_to_sec($form["time_length_number"]->selectedvals, $form["time_length_unit"]->selectedvals)),
"start" => $seconds,
"end" => ($seconds + time_to_sec($form["time_length_number"]->selectedvals, $form["time_length_unit"]->selectedvals)),
"width" => 500,
"height" => 300
));
$iquery = arr2query(array(
"host0rrddsid" => $host0rrddsid,
"host1rrddsid" => $host1rrddsid,
"start" => $gmseconds,
"end" => ($gmseconds + time_to_sec($form["time_length_number"]->selectedvals, $form["time_length_unit"]->selectedvals)),
"start" => $seconds,
"end" => ($seconds + time_to_sec($form["time_length_number"]->selectedvals, $form["time_length_unit"]->selectedvals)),
"width" => $width,
"height" => $height
));
......@@ -602,16 +608,16 @@ EOD;
$aquery = arr2query(array(
"host0rrddsid" => $host0rrddsid,
"host1rrddsid" => $host1rrddsid,
"start" => ($gmseconds - time_to_sec($form["time_length_number"]->selectedvals, $form["time_length_unit"]->selectedvals)),
"end" => $gmseconds,
"start" => ($seconds - time_to_sec($form["time_length_number"]->selectedvals, $form["time_length_unit"]->selectedvals)),
"end" => $seconds,
"width" => 500,
"height" => 300
));
$iquery = arr2query(array(
"host0rrddsid" => $host0rrddsid,
"host1rrddsid" => $host1rrddsid,
"start" => ($gmseconds - time_to_sec($form["time_length_number"]->selectedvals, $form["time_length_unit"]->selectedvals)),
"end" => $gmseconds,
"start" => ($seconds - time_to_sec($form["time_length_number"]->selectedvals, $form["time_length_unit"]->selectedvals)),
"end" => $seconds,
"width" => $width,
"height" => $height
));
......@@ -783,7 +789,8 @@ EOD;
<option value="60000">every 1 minute</option>
</select>
<?php
echo "<span>".$packetlossTop->miscarr["ts"]["label"].": <span id=\"ts\">".date("H:i d F Y", $packetlossTop->miscarr["ts"]["value"])."</span></span>";
echo "<div>".$packetlossTop->miscarr["starttime"]["label"].": <span id=\"starttime\">".date("H:i d F Y", $packetlossTop->miscarr["starttime"]["value"])."</span></div>";
echo "<div>".$packetlossTop->miscarr["ts"]["label"].": <span id=\"ts\">".date("H:i d F Y", $packetlossTop->miscarr["ts"]["value"])."</span></div>";
?>
<span class="note line">* or ".": Data are up-to-date (timesamp has changed since last refresh, service is running).</span>
<span class="note line">?: Data are NOT up-to-date (timestamp has NOT changed since last refresh, service probably NOT running).</span>
......
......@@ -92,7 +92,7 @@ var packetlossTop = {
var label = arr[2];
var value = arr[3];
if(id == "ts") {
if(id == "ts" || id == "starttime") {
packetlossTop.uptodate = (value > packetlossTop.last_ts);
packetlossTop.last_ts = value;
d = new Date();
......
......@@ -79,8 +79,8 @@ class Graph {
else {
$datestart = getdate($this->start);
$dateend = getdate($this->end);
$datestartstr = gmdate('H:i d/m/Y', $datestart[0]);
$dateendstr = gmdate('H:i d/m/Y', $dateend[0]);
$datestartstr = date('H:i d/m/Y', $datestart[0]);
$dateendstr = date('H:i d/m/Y', $dateend[0]);
$this->title = "User Defined: from $datestartstr to $dateendstr";
}
$this->__setup_command_packetloss();
......@@ -95,8 +95,8 @@ class Graph {
else {
$datestart = getdate($this->start);
$dateend = getdate($this->end);
$datestartstr = gmdate('H:i d/m/Y', $datestart[0]);
$dateendstr = gmdate('H:i d/m/Y', $dateend[0]);
$datestartstr = date('H:i d/m/Y', $datestart[0]);
$dateendstr = date('H:i d/m/Y', $dateend[0]);
$this->title = "User Defined: from $datestartstr to $dateendstr";
}
$this->__setup_command_packetcount();
......@@ -125,7 +125,7 @@ class Graph {
$flow1 = $host1rrddsid.$host0rrddsid;
$this->command = <<<EOC
TZ=":GMT" "$this->rrdtool" graph "$this->output" $@ \
"$this->rrdtool" graph "$this->output" $@ \
--width="$this->width" \
--height="$this->height" \
--end="$this->end" \
......@@ -166,7 +166,7 @@ EOC;
$flow1 = $host1rrddsid.$host0rrddsid;
$this->command = <<<EOC
TZ=":GMT" "$this->rrdtool" graph "$this->output" $@ \
"$this->rrdtool" graph "$this->output" $@ \
--width="$this->width" \
--height="$this->height" \
--end="$this->end" \
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment