aboutsummaryrefslogtreecommitdiffstats
path: root/web/nms.gathering.org/switches-json.pl
diff options
context:
space:
mode:
authorroot <root@frank.tg14.gathering.org>2014-04-14 02:17:04 +0200
committerroot <root@frank.tg14.gathering.org>2014-04-14 02:17:04 +0200
commit4e4763dded00347f0bc13757c3a9a7f0ed07e0b0 (patch)
treef01d01f3dbea85d869903e94bf2e5b692b8acfc7 /web/nms.gathering.org/switches-json.pl
parentae8098de011b9dafab5c590c4fd5fa5efe1c0fd7 (diff)
Make it possible to drag the switches around in ping.html.
Diffstat (limited to 'web/nms.gathering.org/switches-json.pl')
-rwxr-xr-xweb/nms.gathering.org/switches-json.pl4
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
};