summaryrefslogtreecommitdiff
path: root/httemplate/misc
diff options
context:
space:
mode:
authorlevinse <levinse>2011-02-05 06:32:36 +0000
committerlevinse <levinse>2011-02-05 06:32:36 +0000
commit3a4bf42c4385863ea83423b279b39ff6e650f79d (patch)
treed08a3d02cf75ac490af3de30d10ab3263690005d /httemplate/misc
parent95bea5564bc06ae02aa351bc1da43308e0f777d9 (diff)
torrus, add router UI, RT10574
Diffstat (limited to 'httemplate/misc')
-rw-r--r--httemplate/misc/nms-add_router.html17
-rw-r--r--httemplate/misc/process/nms-add_iface.html3
-rw-r--r--httemplate/misc/process/nms-add_router.html13
3 files changed, 30 insertions, 3 deletions
diff --git a/httemplate/misc/nms-add_router.html b/httemplate/misc/nms-add_router.html
new file mode 100644
index 000000000..35ef7bf72
--- /dev/null
+++ b/httemplate/misc/nms-add_router.html
@@ -0,0 +1,17 @@
+<% header('Add Router') %>
+
+<FORM NAME="nms-add_iface" ACTION="<% popurl(1) %>process/nms-add_router.html" METHOD=POST>
+Router Hostname/IP
+<% include('/elements/input-text.html',
+ 'field' => 'host',
+ )
+%>
+<BR>
+<INPUT TYPE="submit" NAME="submit" ID="submit_nms-add_router" VALUE="Add Router">
+</FORM>
+
+<%init>
+
+# XXX: access rights, disable/enable submit button, something's wrong with style
+
+</%init>
diff --git a/httemplate/misc/process/nms-add_iface.html b/httemplate/misc/process/nms-add_iface.html
index ffc70d9cc..04d6095d0 100644
--- a/httemplate/misc/process/nms-add_iface.html
+++ b/httemplate/misc/process/nms-add_iface.html
@@ -13,9 +13,6 @@ die 'invalid iface' unless $iface =~ /^[0-9A-Za-z_\-.\\\/ ]+$/;
my $serviceid = $cgi->param('serviceid');
die 'invalid serviceid' unless $serviceid =~ /^[0-9A-Za-z_\-.\\\/ ]+$/;
-my $conf = new FS::Conf;
-my $system = $conf->config('network_monitoring_system');
-
my $nms = new FS::NetworkMonitoringSystem;
$nms->add_interface($host,$iface,$serviceid);
diff --git a/httemplate/misc/process/nms-add_router.html b/httemplate/misc/process/nms-add_router.html
new file mode 100644
index 000000000..bc437d2b3
--- /dev/null
+++ b/httemplate/misc/process/nms-add_router.html
@@ -0,0 +1,13 @@
+<% header('Router added') %>
+</BODY></HTML>
+<%init>
+
+# XXX: access rights
+
+my $host = $cgi->param('host');
+die 'invalid host' unless $host =~ /^[0-9.a-zA-Z\-]+$/;
+
+my $nms = new FS::NetworkMonitoringSystem;
+$nms->add_router($host);
+
+</%init>