From ca8a57176f1106fa5dade25174b61c1596ac1820 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 6 Apr 2023 15:56:23 +0200 Subject: fix network add with tags --- web/api/write/networks | 3 +++ 1 file changed, 3 insertions(+) (limited to 'web/api/write') diff --git a/web/api/write/networks b/web/api/write/networks index 8a95af7..a4a8868 100755 --- a/web/api/write/networks +++ b/web/api/write/networks @@ -55,6 +55,9 @@ foreach my $tmp2 (@tmp) { if ($template{'gw6'} eq 'DEFAULT' and $template{'subnet6'} ne 'DEFAULT') { $template{'gw6'} = "host(inet $template{'subnet6'} + 1)"; } + if (defined($network{'tags'})) { + $template{'tags'} = "'[". join(",", map { "\"".$_."\"" } @{$network{'tags'}})."]'"; + } $nms::web::dbh->do("INSERT INTO NETWORKS (name, subnet4, subnet6, router, gw4, gw6, vlan, tags) VALUES ($template{'name'}, $template{'subnet4'}, $template{'subnet6'}, $template{'router'}, $template{'gw4'}, $template{'gw6'}, $template{'vlan'}, $template{'tags'});"); push @added, $network{'name'}; } else { -- cgit v1.2.3