diff options
author | Kristian Lyngstol <kly@kly.no> | 2016-03-13 17:07:28 +0000 |
---|---|---|
committer | Kristian Lyngstol <kly@kly.no> | 2016-03-13 17:07:28 +0000 |
commit | a9656e1fa4bcec5bcbbfe5ca29671d6701014ce8 (patch) | |
tree | 5207f3cee75212aa821a6a6c6ebb6cfcd449ad1d | |
parent | 1f7663c55e74c7c74990f40fcc78feb49658f932 (diff) |
NMS: Support resetting switch position to buest-guess
Simply type "reset" in the gui (including quotes) and it'll guess based on
name.
-rwxr-xr-x | web/nms.gathering.org/api/private/switch-add | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/web/nms.gathering.org/api/private/switch-add b/web/nms.gathering.org/api/private/switch-add index e177b5e..92479f0 100755 --- a/web/nms.gathering.org/api/private/switch-add +++ b/web/nms.gathering.org/api/private/switch-add @@ -82,7 +82,12 @@ foreach my $tmp2 (@tmp) { push @added, $switch{'sysname'}; } else { if (defined($switch{'placement'})) { - my %placement = %{convertplace($switch{'placement'})}; + my %placement; + if ($switch{'placement'} eq "reset") { + %placement = guess_placement($switch{'sysname'}); + } else { + %placement = %{convertplace($switch{'placement'})}; + } my ($x1,$x2,$y1,$y2); $x1 = $placement{'x1'}; $y1 = $placement{'y1'}; |