[smokeping-users] Zooming bug in 2.3.3?

Bernard Li bernard at vanhpc.org
Thu Mar 13 18:56:56 CET 2008


Hi Tobias:

On 3/13/08, Tobias Oetiker <tobi at oetiker.ch> wrote:

>  try this:
>
>  Index: Smokeping.pm
>  ===================================================================
>  --- Smokeping.pm        (revision 947)
>  +++ Smokeping.pm        (working copy)
>  @@ -939,8 +939,10 @@
>         /^(\d+)$/ && do { my $value = $1; $value = time if $value > 2**32; return $value};
>          /^\s*(\d{4})-(\d{1,2})-(\d{1,2})(?:\s+(\d{1,2}):(\d{2})(?::(\d{2}))?)?\s*$/  &&
>              return POSIX::mktime($6||0,$5||0,$4||0,$3,$2-1,$1-1900,0,0,-1);
>  -        /([ -:a-z0-9]+)/ && return $1;
>  +        /^now$/ && return time;
>  +        /([ -:a-z0-9]+)/ && return $1;
>      };
>  +    return time;
>   }
>
>   sub get_detail ($$$$;$){
>  @@ -1063,6 +1065,8 @@
>              $imghref =$cfg->{General}{imgurl}."/__navcache/".$serial;
>          }
>
>  +       $q->param('epoch_start',parse_datetime($q->param('start')));
>  +       $q->param('epoch_end',parse_datetime($q->param('end')));
>          @tasks = (["Navigator Graph".$name, parse_datetime($q->param('start')),parse_datetime($q->param('end'))]);
>          my ($graphret,$xs,$ys) = RRDs::graph
>            ("dummy",
>  @@ -1337,12 +1341,11 @@
>   #           $page .= qq|<div class="zoom" style="cursor: crosshair;">|;
>             $page .= qq|<IMG id="zoom" BORDER="0" width="$xs{''}" height="$ys{''}" SRC="${imghref}_${end}_${start}.png">| ;
>   #           $page .= "</div>";
>  -
>  -           $page .= $q->start_form(-method=>'GET', -id=>'range_form')
>  -              . "<p>Time range: "
>  -              . $q->hidden(-name=>'epoch_start',-id=>'epoch_start',-default=>$start)
>  +           $page .= $q->start_form(-method=>'POST', -id=>'range_form')
>  +              . "<p>Time range: "
>  +              . $q->hidden(-name=>'epoch_start',-id=>'epoch_start')
>                . $q->hidden(-name=>'hierarchy',-id=>'hierarchy')
>  -              . $q->hidden(-name=>'epoch_end',-id=>'epoch_end',-default=>time())
>  +              . $q->hidden(-name=>'epoch_end',-id=>'epoch_end')
>                . $q->hidden(-name=>'target',-id=>'target' )
>                . $q->hidden(-name=>'displaymode',-default=>$mode )
>                . $q->textfield(-name=>'start',-default=>$startstr)

Any chance you can post this as an attachment and/or put it up on a
website -- it is possible gmail garbled the patch:

# patch -p0 --dry-run < Smokeping.pm.patch
patching file Smokeping.pm
Hunk #1 FAILED at 939.
Hunk #2 FAILED at 1065.
Hunk #3 FAILED at 1341.
3 out of 3 hunks FAILED -- saving rejects to file Smokeping.pm.rej

Thanks,

Bernard



More information about the smokeping-users mailing list