From a2a69f909cad813d7164bae805e87f5874a9fdae Mon Sep 17 00:00:00 2001 From: Mark Wells Date: Thu, 29 Nov 2012 22:03:29 -0800 Subject: broadband_snmp export: better MIB selection --- .../edit/elements/part_export/broadband_snmp.html | 100 +++++++++++++++++++++ httemplate/edit/elements/part_export/foot.html | 6 ++ httemplate/edit/elements/part_export/head.html | 19 ++++ 3 files changed, 125 insertions(+) create mode 100644 httemplate/edit/elements/part_export/broadband_snmp.html create mode 100644 httemplate/edit/elements/part_export/foot.html create mode 100644 httemplate/edit/elements/part_export/head.html (limited to 'httemplate/edit/elements') diff --git a/httemplate/edit/elements/part_export/broadband_snmp.html b/httemplate/edit/elements/part_export/broadband_snmp.html new file mode 100644 index 000000000..8df0b8e02 --- /dev/null +++ b/httemplate/edit/elements/part_export/broadband_snmp.html @@ -0,0 +1,100 @@ +<%doc> + +<& head.html, %opt &> + +<& /elements/tr-select.html, + label => 'SNMP version', + field => 'version', + options => [ '', 'v1', 'v2c' ], + labels => { v1 => '1', v2c => '2c' }, + curr_value => $part_export->option('version') &> +<& /elements/tr-input-text.html, + label => 'Community', + field => 'community', + curr_value => $part_export->option('community'), +&> +<& /elements/tr-checkbox.html, + label => 'Send IP address changes to new address', + field => 'ip_addr_change_to_new', + value => 1, + curr_value => $part_export->option('ip_addr_change_to_new'), +&> +<& /elements/tr-input-text.html, + label => 'Timeout (seconds)', + field => 'timeout', + curr_value => $part_export->option('timeout'), +&> + + + + + + + + + + + + + + + + +<& /elements/auto-table.html, + template_row => 'mytemplate', + fieldorder => ['action', 'oid', 'value'], + data => \@data, +&> + +<& foot.html, %opt &> +<%init> +my %opt = @_; +my $part_export = $opt{part_export} || FS::part_export->new; + +my @actions = split("\n", $part_export->option('action')); +my @oids = split("\n", $part_export->option('oid')); +my @values = split("\n", $part_export->option('value')); + +my @data; +while (@actions or @oids or @values) { + my @thisrow = (shift(@actions), shift(@oids), shift(@values)); + push @data, \@thisrow if grep length($_), @thisrow; +} + +my $popup_name = 'popup-'.time."-$$-".rand() * 2**32; + diff --git a/httemplate/edit/elements/part_export/foot.html b/httemplate/edit/elements/part_export/foot.html new file mode 100644 index 000000000..9cb8073ce --- /dev/null +++ b/httemplate/edit/elements/part_export/foot.html @@ -0,0 +1,6 @@ +
ActionObjectTypeValue
+ + + + + + + +
+ + +<%init> +my %opt = @_; + diff --git a/httemplate/edit/elements/part_export/head.html b/httemplate/edit/elements/part_export/head.html new file mode 100644 index 000000000..cb0ab894a --- /dev/null +++ b/httemplate/edit/elements/part_export/head.html @@ -0,0 +1,19 @@ +% if ( $export_info->{no_machine} ) { + + +% } else { +% # clone this from edit/part_export.cgi if this case ever gets used +% } + +<% ntable('cccccc', 2) %> + + <% emt('Description') %> + <% $notes %> + +<%init> +my %opt = @_; +my $layer = $opt{layer}; +my $part_export = $opt{part_export}; +my $export_info = $opt{export_info}; +my $notes = $opt{notes} || $export_info->{notes}; + -- cgit v1.2.1