dnscrypto-proxy: Update to release 1.3.0
[tomato.git] / release / src / router / www / admin-snmp.asp
blob1b31ee41f8b2154e37c6b367cd8fb9027342bb2b
1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN'>
2 <!--
3 Tomato GUI
4 Copyright (C) 2007-2011 Shibby
5 http://openlinksys.info
6 For use with Tomato Firmware only.
7 No part of this file may be used without permission.
8 -->
9 <html>
10 <head>
11 <meta http-equiv='content-type' content='text/html;charset=utf-8'>
12 <meta name='robots' content='noindex,nofollow'>
13 <title>[<% ident(); %>] Admin: SNMP</title>
14 <link rel='stylesheet' type='text/css' href='tomato.css'>
15 <link rel='stylesheet' type='text/css' href='<% nv('web_css'); %>.css'>
16 <script type='text/javascript' src='tomato.js'></script>
17 <style type='text/css'>
18 textarea {
19 width: 98%;
20 height: 15em;
22 </style>
23 <script type='text/javascript'>
24 // <% nvram("snmp_enable,snmp_port,snmp_remote,snmp_remote_sip,snmp_location,snmp_contact,snmp_ro"); %>
26 function verifyFields(focused, quiet)
28 var ok = 1;
30 var a = E('_f_snmp_enable').checked;
32 E('_snmp_port').disabled = !a;
33 E('_f_snmp_remote').disabled = !a;
34 E('_snmp_remote_sip').disabled = !a;
35 E('_snmp_location').disabled = !a;
36 E('_snmp_contact').disabled = !a;
37 E('_snmp_ro').disabled = !a;
38 E('_snmp_remote_sip').disabled = (!a || !E('_f_snmp_remote').checked);
40 return ok;
43 function save()
45 if (verifyFields(null, 0)==0) return;
46 var fom = E('_fom');
47 fom.snmp_enable.value = E('_f_snmp_enable').checked ? 1 : 0;
48 fom.snmp_remote.value = E('_f_snmp_remote').checked ? 1 : 0;
50 if (fom.snmp_enable.value == 0) {
51 fom._service.value = 'snmp-stop';
53 else {
54 fom._service.value = 'snmp-restart,firewall-restart';
56 form.submit('_fom', 1);
59 function init()
62 </script>
63 </head>
65 <body onLoad="init()">
66 <table id='container' cellspacing=0>
67 <tr><td colspan=2 id='header'>
68 <div class='title'>Tomato</div>
69 <div class='version'>Version <% version(); %></div>
70 </td></tr>
71 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
72 <td id='content'>
73 <div id='ident'><% ident(); %></div>
74 <div class='section-title'>SNMP Settings</div>
75 <div class='section' id='config-section'>
76 <form id='_fom' method='post' action='tomato.cgi'>
77 <input type='hidden' name='_nextpage' value='admin-snmp.asp'>
78 <input type='hidden' name='_service' value='snmp-restart,firewall-restart'>
79 <input type='hidden' name='snmp_enable'>
80 <input type='hidden' name='snmp_remote'>
82 <script type='text/javascript'>
83 createFieldTable('', [
84 { title: 'Enable SNMP', name: 'f_snmp_enable', type: 'checkbox', value: nvram.snmp_enable == '1' },
85 { title: 'Port', indent: 2, name: 'snmp_port', type: 'text', maxlen: 5, size: 7, value: fixPort(nvram.snmp_port, 161) },
86 { title: 'Remote', indent: 2, name: 'f_snmp_remote', type: 'checkbox', value: nvram.snmp_remote == '1' },
87 { title: 'Allowed Remote<br>IP Address', indent: 3, name: 'snmp_remote_sip', type: 'text', maxlen: 512, size: 64, value: nvram.snmp_remote_sip,
88 suffix: '<br><small>(optional; ex: "1.1.1.1", "1.1.1.0/24", "1.1.1.1 - 2.2.2.2" or "me.example.com")</small>' },
90 { title: 'Location', indent: 2, name: 'snmp_location', type: 'text', maxlen: 20, size: 25, value: nvram.snmp_location },
91 { title: 'Contact', indent: 2, name: 'snmp_contact', type: 'text', maxlen: 20, size: 25, value: nvram.snmp_contact },
92 { title: 'RO Community', indent: 2, name: 'snmp_ro', type: 'text', maxlen: 20, size: 25, value: nvram.snmp_ro }
93 ]);
94 </script>
95 </div>
96 </form>
97 </div>
98 </td></tr>
99 <tr><td id='footer' colspan=2>
100 <form>
101 <span id='footer-msg'></span>
102 <input type='button' value='Save' id='save-button' onclick='save()'>
103 <input type='button' value='Cancel' id='cancel-button' onclick='javascript:reloadPage();'>
104 </form>
105 </div>
106 </td></tr>
107 </table>
108 <script type='text/javascript'>verifyFields(null, 1);</script>
109 </body>
110 </html>