summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--FS/FS/NetworkMonitoringSystem/Torrus_Internal.pm11
-rw-r--r--FS/FS/torrus_srvderive_component.pm6
-rw-r--r--torrus/perllib/Torrus/Renderer/HTML.pm14
3 files changed, 27 insertions, 4 deletions
diff --git a/FS/FS/NetworkMonitoringSystem/Torrus_Internal.pm b/FS/FS/NetworkMonitoringSystem/Torrus_Internal.pm
index b55d0aaf7..1cc5d2af5 100644
--- a/FS/FS/NetworkMonitoringSystem/Torrus_Internal.pm
+++ b/FS/FS/NetworkMonitoringSystem/Torrus_Internal.pm
@@ -7,8 +7,9 @@ use IO::File;
use File::Slurp qw(slurp);
use Date::Format;
use XML::Simple;
+use FS::Record qw(qsearch qsearchs dbh);
use FS::svc_port;
-use FS::Record qw(qsearch dbh);
+use FS::torrus_srvderive_component;
use Torrus::ConfigTree;
#$DEBUG = 0;
@@ -94,6 +95,14 @@ sub find_svc {
return $svc_port[0];
}
+sub find_torrus_srvderive_component {
+ my $self = shift;
+ my $serviceid = shift;
+ return '' unless $serviceid =~ /^[0-9A-Za-z_\-.\\\/ ]+$/;
+
+ qsearchs('torrus_srvderive_component', { 'serviceid' => $serviceid });
+}
+
sub report {
my $self = shift;
diff --git a/FS/FS/torrus_srvderive_component.pm b/FS/FS/torrus_srvderive_component.pm
index 046b6748b..b244d064e 100644
--- a/FS/FS/torrus_srvderive_component.pm
+++ b/FS/FS/torrus_srvderive_component.pm
@@ -3,6 +3,7 @@ package FS::torrus_srvderive_component;
use strict;
use base qw( FS::Record );
use FS::Record qw( qsearch qsearchs );
+use FS::torrus_srvderive;
=head1 NAME
@@ -113,6 +114,11 @@ sub check {
$self->SUPER::check;
}
+sub torrus_srvderive {
+ my $self = shift;
+ qsearchs('torrus_srvderive', { 'derivenum' => $self->derivenum } );
+}
+
=back
=head1 BUGS
diff --git a/torrus/perllib/Torrus/Renderer/HTML.pm b/torrus/perllib/Torrus/Renderer/HTML.pm
index 875033a9c..df0c65b30 100644
--- a/torrus/perllib/Torrus/Renderer/HTML.pm
+++ b/torrus/perllib/Torrus/Renderer/HTML.pm
@@ -14,7 +14,7 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
-# $Id: HTML.pm,v 1.12 2011-02-27 19:14:47 ivan Exp $
+# $Id: HTML.pm,v 1.13 2011-02-27 19:20:37 ivan Exp $
# Stanislav Sinyagin <ssinyagin@yahoo.com>
package Torrus::Renderer::HTML;
@@ -144,8 +144,16 @@ sub render_html
"/view/svc_port.cgi?". $svc_port->svcnum;
return "<A HREF='$url'>View Service</A>";
} else {
- return 'Monitored as '. $serviceids->{$iface}.
- '; customer service not yet provisioned';
+ my $component =
+ $nms->find_torrus_srvderive_component($serviceids->{$iface});
+
+ if ($component) {
+ return $serviceids->{$iface}. ' combined into '.
+ $component->torrus_srvderive->serviceid;
+ } else {
+ return 'Monitored as '. $serviceids->{$iface}.
+ '; not yet provisioned or combined';
+ }
}
} else {