diff options
author | root <root@frank.tg14.gathering.org> | 2014-04-14 02:17:04 +0200 |
---|---|---|
committer | root <root@frank.tg14.gathering.org> | 2014-04-14 02:17:04 +0200 |
commit | 4e4763dded00347f0bc13757c3a9a7f0ed07e0b0 (patch) | |
tree | f01d01f3dbea85d869903e94bf2e5b692b8acfc7 /web/nms.gathering.org/switches-json.pl | |
parent | ae8098de011b9dafab5c590c4fd5fa5efe1c0fd7 (diff) |
Make it possible to drag the switches around in ping.html.
Diffstat (limited to 'web/nms.gathering.org/switches-json.pl')
-rwxr-xr-x | web/nms.gathering.org/switches-json.pl | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/web/nms.gathering.org/switches-json.pl b/web/nms.gathering.org/switches-json.pl index 1dccfe2..8d3d88a 100755 --- a/web/nms.gathering.org/switches-json.pl +++ b/web/nms.gathering.org/switches-json.pl @@ -14,12 +14,12 @@ $q->execute(); my %json = (); while (my $ref = $q->fetchrow_hashref()) { - $ref->{'placement'} =~ /\((\d+),(\d+)\),\((\d+),(\d+)\)/; + $ref->{'placement'} =~ /\((-?\d+),(-?\d+)\),\((-?\d+),(-?\d+)\)/; my ($x1, $y1, $x2, $y2) = ($1, $2, $3, $4); $json{$ref->{'switch'}} = { sysname => $ref->{'sysname'}, x => $x2, - y => $y1, + y => $y2, width => $x1 - $x2, height => $y1 - $y2 }; |