X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Felements%2Fselect-torrus_serviceid.html;h=e13a6e80d1b1a44dffa64de48a94b342624fac8d;hp=a8cfca8b8528c75545c0b7f8c8f3407f6472065f;hb=949a80c148a8bbeeeec54c5a0be5d73b292423a5;hpb=69b3b149f2a83cf280022388b1cd37e62990c721 diff --git a/httemplate/elements/select-torrus_serviceid.html b/httemplate/elements/select-torrus_serviceid.html index a8cfca8b8..e13a6e80d 100644 --- a/httemplate/elements/select-torrus_serviceid.html +++ b/httemplate/elements/select-torrus_serviceid.html @@ -4,8 +4,10 @@ % } -% foreach my $serviceid ( keys %serviceid ) { - +% foreach my $serviceid ( @serviceids ) { + % } @@ -14,15 +16,9 @@ my %opt = @_; -#is this going to get too slow or will the index make it okay? -my $sth = dbh->prepare("SELECT DISTINCT(serviceid) FROM srvexport") - or die dbh->errstr; -$sth->execute or die $sth->errstr; -my %serviceid = (); -while ( my $row = $sth->fetchrow_arrayref ) { - my $serviceid = $row->[0]; - $serviceid =~ s/_(IN|OUT)$//; - $serviceid{$serviceid}=1; -} +my $value = $opt{'curr_value'} || $opt{'value'}; + +my $nms = new FS::NetworkMonitoringSystem; +my @serviceids = $nms->torrus_serviceids;