aboutsummaryrefslogtreecommitdiffstats
path: root/web/api/write
diff options
context:
space:
mode:
authorroot <root@gondul.tg23.gathering.org>2023-04-06 15:56:23 +0200
committerroot <root@gondul.tg23.gathering.org>2023-04-06 15:56:23 +0200
commitca8a57176f1106fa5dade25174b61c1596ac1820 (patch)
tree36656421c90fd94af0b26abd4ecb6aa03ba0a31c /web/api/write
parent73712230cccb52757abdf3b3197b441ee301638a (diff)
fix network add with tags
Diffstat (limited to 'web/api/write')
-rwxr-xr-xweb/api/write/networks3
1 files changed, 3 insertions, 0 deletions
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 {