Commit 6e94609b authored by 's avatar
Browse files

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) ...@@ -120,14 +120,13 @@ $form["time"] = new FormElement( // select - option (more selects)
# #
@$gmseconds = gmmktime( @$seconds = mktime(
$form["time"]->selectedvals[hours], $form["time"]->selectedvals[hours],
$form["time"]->selectedvals[minutes], $form["time"]->selectedvals[minutes],
0, 0,
$form["time"]->selectedvals[mon], $form["time"]->selectedvals[mon],
$form["time"]->selectedvals[mday], $form["time"]->selectedvals[mday],
$form["time"]->selectedvals[year], $form["time"]->selectedvals[year]
0
); );
# }}} # }}}
...@@ -297,7 +296,8 @@ $form["time"] = new FormElement( // select - option (more selects) ...@@ -297,7 +296,8 @@ $form["time"] = new FormElement( // select - option (more selects)
<div class="steps"> <div class="steps">
<form method="get" action="index.php"> <form method="get" action="index.php">
<div class="step"> <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 <?php
$name = $form["subject"]->name; $name = $form["subject"]->name;
foreach($form["subject"]->elementvals as $key => $val) { foreach($form["subject"]->elementvals as $key => $val) {
...@@ -524,17 +524,23 @@ $height = ($form["graph_size"]->isChecked("large") ? "300" : ($form["graph_size" ...@@ -524,17 +524,23 @@ $height = ($form["graph_size"]->isChecked("large") ? "300" : ($form["graph_size"
$widthpx = ($width + 97) . "px"; $widthpx = ($width + 97) . "px";
$heightpx = ($height + 93) . "px"; $heightpx = ($height + 93) . "px";
$h0 = 0;
$h1 = 0;
foreach($form["subject"]->elementvals as $key0 => $val0) { foreach($form["subject"]->elementvals as $key0 => $val0) {
$checked0 = $form["subject"]->isChecked($key0); $checked0 = $form["subject"]->isChecked($key0);
$host0rrddsid = $val0["rrddsid"]["value"]; // key0 $host0rrddsid = $val0["rrddsid"]["value"]; // key0
$host0name = $val0["hostname"]["value"]; $host0name = $val0["hostname"]["value"];
$h0++;
$h1 = 0;
if($checked0) if($checked0)
foreach($form["subject"]->elementvals as $key1 => $val1) { foreach($form["subject"]->elementvals as $key1 => $val1) {
$checked1 = $form["subject"]->isChecked($key1); $checked1 = $form["subject"]->isChecked($key1);
$host1rrddsid = $val1["rrddsid"]["value"]; // key1 $host1rrddsid = $val1["rrddsid"]["value"]; // key1
$host1name = $val1["hostname"]["value"]; $host1name = $val1["hostname"]["value"];
$h1++;
if($h1 <= $h0) continue;
if($checked1) { if($checked1) {
if($host1rrddsid == $host0rrddsid) break; //if($host1rrddsid == $host0rrddsid) break;
switch($form["time_type"]->selectedvals) { switch($form["time_type"]->selectedvals) {
case "predefined": case "predefined":
...@@ -573,16 +579,16 @@ EOD; ...@@ -573,16 +579,16 @@ EOD;
$aquery = arr2query(array( $aquery = arr2query(array(
"host0rrddsid" => $host0rrddsid, "host0rrddsid" => $host0rrddsid,
"host1rrddsid" => $host1rrddsid, "host1rrddsid" => $host1rrddsid,
"start" => $gmseconds, "start" => $seconds,
"end" => ($gmseconds + time_to_sec($form["time_length_number"]->selectedvals, $form["time_length_unit"]->selectedvals)), "end" => ($seconds + time_to_sec($form["time_length_number"]->selectedvals, $form["time_length_unit"]->selectedvals)),
"width" => 500, "width" => 500,
"height" => 300 "height" => 300
)); ));
$iquery = arr2query(array( $iquery = arr2query(array(
"host0rrddsid" => $host0rrddsid, "host0rrddsid" => $host0rrddsid,
"host1rrddsid" => $host1rrddsid, "host1rrddsid" => $host1rrddsid,
"start" => $gmseconds, "start" => $seconds,
"end" => ($gmseconds + time_to_sec($form["time_length_number"]->selectedvals, $form["time_length_unit"]->selectedvals)), "end" => ($seconds + time_to_sec($form["time_length_number"]->selectedvals, $form["time_length_unit"]->selectedvals)),
"width" => $width, "width" => $width,
"height" => $height "height" => $height
)); ));
...@@ -602,16 +608,16 @@ EOD; ...@@ -602,16 +608,16 @@ EOD;
$aquery = arr2query(array( $aquery = arr2query(array(
"host0rrddsid" => $host0rrddsid, "host0rrddsid" => $host0rrddsid,
"host1rrddsid" => $host1rrddsid, "host1rrddsid" => $host1rrddsid,
"start" => ($gmseconds - time_to_sec($form["time_length_number"]->selectedvals, $form["time_length_unit"]->selectedvals)), "start" => ($seconds - time_to_sec($form["time_length_number"]->selectedvals, $form["time_length_unit"]->selectedvals)),
"end" => $gmseconds, "end" => $seconds,
"width" => 500, "width" => 500,
"height" => 300 "height" => 300
)); ));
$iquery = arr2query(array( $iquery = arr2query(array(
"host0rrddsid" => $host0rrddsid, "host0rrddsid" => $host0rrddsid,
"host1rrddsid" => $host1rrddsid, "host1rrddsid" => $host1rrddsid,
"start" => ($gmseconds - time_to_sec($form["time_length_number"]->selectedvals, $form["time_length_unit"]->selectedvals)), "start" => ($seconds - time_to_sec($form["time_length_number"]->selectedvals, $form["time_length_unit"]->selectedvals)),
"end" => $gmseconds, "end" => $seconds,
"width" => $width, "width" => $width,
"height" => $height "height" => $height
)); ));
...@@ -783,7 +789,8 @@ EOD; ...@@ -783,7 +789,8 @@ EOD;
<option value="60000">every 1 minute</option> <option value="60000">every 1 minute</option>
</select> </select>
<?php <?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">* 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> <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 = { ...@@ -92,7 +92,7 @@ var packetlossTop = {
var label = arr[2]; var label = arr[2];
var value = arr[3]; var value = arr[3];
if(id == "ts") { if(id == "ts" || id == "starttime") {
packetlossTop.uptodate = (value > packetlossTop.last_ts); packetlossTop.uptodate = (value > packetlossTop.last_ts);
packetlossTop.last_ts = value; packetlossTop.last_ts = value;
d = new Date(); d = new Date();
......
...@@ -79,8 +79,8 @@ class Graph { ...@@ -79,8 +79,8 @@ class Graph {
else { else {
$datestart = getdate($this->start); $datestart = getdate($this->start);
$dateend = getdate($this->end); $dateend = getdate($this->end);
$datestartstr = gmdate('H:i d/m/Y', $datestart[0]); $datestartstr = date('H:i d/m/Y', $datestart[0]);
$dateendstr = gmdate('H:i d/m/Y', $dateend[0]); $dateendstr = date('H:i d/m/Y', $dateend[0]);
$this->title = "User Defined: from $datestartstr to $dateendstr"; $this->title = "User Defined: from $datestartstr to $dateendstr";
} }
$this->__setup_command_packetloss(); $this->__setup_command_packetloss();
...@@ -95,8 +95,8 @@ class Graph { ...@@ -95,8 +95,8 @@ class Graph {
else { else {
$datestart = getdate($this->start); $datestart = getdate($this->start);
$dateend = getdate($this->end); $dateend = getdate($this->end);
$datestartstr = gmdate('H:i d/m/Y', $datestart[0]); $datestartstr = date('H:i d/m/Y', $datestart[0]);
$dateendstr = gmdate('H:i d/m/Y', $dateend[0]); $dateendstr = date('H:i d/m/Y', $dateend[0]);
$this->title = "User Defined: from $datestartstr to $dateendstr"; $this->title = "User Defined: from $datestartstr to $dateendstr";
} }
$this->__setup_command_packetcount(); $this->__setup_command_packetcount();
...@@ -125,7 +125,7 @@ class Graph { ...@@ -125,7 +125,7 @@ class Graph {
$flow1 = $host1rrddsid.$host0rrddsid; $flow1 = $host1rrddsid.$host0rrddsid;
$this->command = <<<EOC $this->command = <<<EOC
TZ=":GMT" "$this->rrdtool" graph "$this->output" $@ \ "$this->rrdtool" graph "$this->output" $@ \
--width="$this->width" \ --width="$this->width" \
--height="$this->height" \ --height="$this->height" \
--end="$this->end" \ --end="$this->end" \
...@@ -166,7 +166,7 @@ EOC; ...@@ -166,7 +166,7 @@ EOC;
$flow1 = $host1rrddsid.$host0rrddsid; $flow1 = $host1rrddsid.$host0rrddsid;
$this->command = <<<EOC $this->command = <<<EOC
TZ=":GMT" "$this->rrdtool" graph "$this->output" $@ \ "$this->rrdtool" graph "$this->output" $@ \
--width="$this->width" \ --width="$this->width" \
--height="$this->height" \ --height="$this->height" \
--end="$this->end" \ --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