diff options
author | root <root@frank.tg14.gathering.org> | 2014-04-14 14:56:20 +0200 |
---|---|---|
committer | root <root@frank.tg14.gathering.org> | 2014-04-14 14:56:20 +0200 |
commit | c5ba8af9c78d7f6078500cb6928ab95b7672c7df (patch) | |
tree | 3c8d502d7479e748d05551d58a8a71d0bd32faed | |
parent | 3524b892e959fccdf9c66b0ae51e7ae95b9d6a9c (diff) |
Shorten switch names in ping map.
-rwxr-xr-x | web/nms.gathering.org/switches-json.pl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/web/nms.gathering.org/switches-json.pl b/web/nms.gathering.org/switches-json.pl index 8d3d88a..5ade700 100755 --- a/web/nms.gathering.org/switches-json.pl +++ b/web/nms.gathering.org/switches-json.pl @@ -16,8 +16,10 @@ my %json = (); while (my $ref = $q->fetchrow_hashref()) { $ref->{'placement'} =~ /\((-?\d+),(-?\d+)\),\((-?\d+),(-?\d+)\)/; my ($x1, $y1, $x2, $y2) = ($1, $2, $3, $4); + my $sysname = $ref->{'sysname'}; + $sysname =~ s/\..*$//; $json{$ref->{'switch'}} = { - sysname => $ref->{'sysname'}, + sysname => $sysname, x => $x2, y => $y2, width => $x1 - $x2, |