From a9656e1fa4bcec5bcbbfe5ca29671d6701014ce8 Mon Sep 17 00:00:00 2001 From: Kristian Lyngstol Date: Sun, 13 Mar 2016 17:07:28 +0000 Subject: NMS: Support resetting switch position to buest-guess Simply type "reset" in the gui (including quotes) and it'll guess based on name. --- web/nms.gathering.org/api/private/switch-add | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'web/nms.gathering.org/api/private/switch-add') 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'}; -- cgit v1.2.3