2 Quite a bit of false laziness with edit/elements/part_export/broadband_snmp.html
5 <INPUT TYPE="hidden" NAME="options" VALUE="snmp_community,snmp_version,snmp_timeout">
6 <& /elements/tr-select.html,
7 label => 'SNMP version',
8 field => 'snmp_version',
9 options => [ '1', '2c' ],
10 curr_value => $part_export->option('version')
12 <& /elements/tr-input-text.html,
14 field => 'snmp_community',
15 curr_value => $part_export->option('community') || $opt{'export_info'}->{'options'}->{'snmp_community'}->{'default'},
17 <& /elements/tr-input-text.html,
18 label => 'Timeout (seconds)',
19 field => 'snmp_timeout',
20 curr_value => $part_export->option('timeout') || $opt{'export_info'}->{'options'}->{'snmp_timeout'}->{'default'},
23 <script type="text/javascript">
24 function open_select_mib_get(obj) {
25 nd(1); // if there's already one open, close it
26 var rownum = obj.rownum;
27 var curr_oid = obj.form.elements['snmp_oid' + rownum].value || '';
28 var url = '<%$fsurl%>misc/select-mib-popup.html?' +
29 'callback=receive_mib_get;' +
31 ';curr_value=' + curr_oid;
33 OLiframeContent(url, 550, 450, '<% $popup_name %>', 0, 'auto'),
34 CAPTION, 'Select MIB object', STICKY, AUTOSTATUSCAP,
35 MIDX, 0, MIDY, 0, DRAGGABLE, CLOSECLICK,
36 BGCOLOR, '#333399', CGCOLOR, '#333399',
40 function receive_mib_get(obj, rownum) {
41 var oidfield = document.getElementById('snmp_oid'+rownum);
42 oidfield.value = obj.fullname;
47 <table bgcolor="#cccccc" border=0 cellspacing=3>
48 <TR><TH>Object ID</TH></TR>
49 <TR id="broadband_snmp_get_template">
51 <INPUT NAME="oid" ID="oid" SIZE="54">
52 <INPUT TYPE="button" VALUE="..." ID="openselector" onclick="open_select_mib_get(this)">
55 <& /elements/auto-table.html,
56 template_row => 'broadband_snmp_get_template',
57 fieldorder => ['oid'],
61 <INPUT TYPE="hidden" NAME="multi_options" VALUE="snmp_oid">
66 my $part_export = $opt{part_export} || FS::part_export->new;
68 my @oids = split("\n", $part_export->option('snmp_oid'));
72 my @thisrow = (shift(@oids));
73 push @data, \@thisrow if grep length($_), @thisrow;
76 my $popup_name = 'popup-'.time."-$$-".rand() * 2**32;