1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML
4.0//EN'
>
5 For use with Tomato Firmware only.
6 No part of this file may be used without permission.
10 <meta http-equiv='content-type' content='text/html;charset=utf-
8'
>
11 <meta name='robots' content='noindex,nofollow'
>
12 <title>[<%
ident(); %>] Tools: System Commands
</title>
13 <link rel='stylesheet' type='text/css' href='tomato.css'
>
14 <link rel='stylesheet' type='text/css' href='color.css'
>
15 <script type='text/javascript' src='tomato.js'
></script>
19 <style type='text/css'
>
27 <script type='text/javascript' src='debug.js'
></script>
28 <script type='text/javascript'
>
30 // <% nvram(''); %> // http_id
38 var ref
= new TomatoRefresh('update.cgi', '', 0, 'tools-shell_refresh');
40 ref
.refresh = function(text
)
47 function verifyFields(focused
, quiet
)
52 function escapeText(s
)
55 return '&#' + c
.charCodeAt(0) + ';';
57 return s
.replace(/[&"'<>]/g, esc
).replace(/\n/g, ' <br>').replace(/ /g
, ' ');
62 E('execb').disabled
= x
;
63 E('_f_cmd').disabled
= x
;
64 E('wait').style
.visibility
= x
? 'visible' : 'hidden';
68 function updateResult()
70 E('result').innerHTML
= '<tt>' + escapeText(cmdresult
) + '</tt>';
77 // Opera 8 sometimes sends 2 clicks
82 cmd
.onCompleted = function(text
, xml
) {
86 cmd
.onError = function(x
) {
87 cmdresult
= 'ERROR: ' + x
;
91 var s
= E('_f_cmd').value
;
92 cmd
.post('shell.cgi', 'action=execute&command=' + escapeCGI(s
.replace(/\r/g, '')));
93 cookie
.set('shellcmd', escape(s
));
99 if ((s
= cookie
.get('shellcmd')) != null) E('_f_cmd').value
= unescape(s
);
101 if (((s
= cookie
.get('tools_shell_notes_vis')) != null) && (s
== '1')) {
102 toggleVisibility("notes");
106 function toggleVisibility(whichone
) {
107 if (E('sesdiv_' + whichone
).style
.display
== '') {
108 E('sesdiv_' + whichone
).style
.display
= 'none';
109 E('sesdiv_' + whichone
+ '_showhide').innerHTML
= '(Click here to show)';
110 cookie
.set('status_overview_' + whichone
+ '_vis', 0);
112 E('sesdiv_' + whichone
).style
.display
='';
113 E('sesdiv_' + whichone
+ '_showhide').innerHTML
= '(Click here to hide)';
114 cookie
.set('status_overview_' + whichone
+ '_vis', 1);
122 <body onload='init()'
>
123 <form action='javascript:{}'
>
124 <table id='container' cellspacing=
0>
125 <tr><td colspan=
2 id='header'
>
126 <div class='title'
>Tomato
</div>
127 <div class='version'
>Version <%
version(); %></div>
129 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
131 <div id='ident'
><%
ident(); %></div>
135 <div class='section-title'
>Execute System Commands
</div>
136 <div class='section'
>
137 <script type='text/javascript'
>
138 createFieldTable('', [
139 { title
: 'Command', name
: 'f_cmd', type
: 'textarea', wrap
: 'off', value
: '' }
142 <div style='float:left'
><input type='button' value='Execute' onclick='execute()' id='execb'
></div>
143 <script type='text/javascript'
>genStdRefresh(1,1,'ref.toggle()');</script>
146 <div class='section-title'
>Notes
<small><i><a href='javascript:toggleVisibility(
"notes");'
><span id='sesdiv_notes_showhide'
>(Click here to show)
</span></a></i></small></div>
147 <div class='section' id='sesdiv_notes' style='display:none'
>
149 <li><b>TIP
</b> - Use the command
"nvram export --set" or
"nvram export --set | grep qos" to cut and paste configuration
154 <div style=
"visibility:hidden;text-align:right" id=
"wait">Please wait...
<img src='spin.gif'
style=
"vertical-align:top"></div>
155 <pre id='result'
></pre>
160 <tr><td id='footer' colspan=
2> </td></tr>