BWM and static ARP optimizations
[tomato.git] / release / src / router / www / admin-jffs2.asp
blob11a55608656f25a00e693f46d55bb3c50f406906
1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0//EN'>
2 <!--
3 Tomato GUI
4 Copyright (C) 2006-2010 Jonathan Zarate
5 http://www.polarcloud.com/tomato/
7 For use with Tomato Firmware only.
8 No part of this file may be used without permission.
9 -->
10 <html>
11 <head>
12 <meta http-equiv='content-type' content='text/html;charset=utf-8'>
13 <meta name='robots' content='noindex,nofollow'>
14 <title>[<% ident(); %>] Admin: JFFS</title>
15 <link rel='stylesheet' type='text/css' href='tomato.css'>
16 <link rel='stylesheet' type='text/css' href='color.css'>
17 <script type='text/javascript' src='tomato.js'></script>
19 <!-- / / / -->
21 <script type='text/javascript' src='debug.js'></script>
23 <script type='text/javascript'>
25 // <% nvram("jffs2_on,jffs2_exec,t_fix1"); %>
27 fmtwait = (nvram.t_fix1 == 'RT-N16' ? 120 : 60);
29 function verifyFields(focused, quiet)
31 var b = !E('_f_jffs2_on').checked;
32 E('format').disabled = b;
33 E('_jffs2_exec').disabled = b;
34 return 1;
37 function formatClicked()
39 if (!verifyFields(null, 0)) return;
40 if (!confirm("Format the JFFS partition?")) return;
41 save(1);
44 function formatClock()
46 if (ftime == 0) {
47 E('fclock').innerHTML = 'a few more seconds';
49 else {
50 E('fclock').innerHTML = ((ftime > 0) ? 'about ' : '') + ftime + ' second' + ((ftime == 1) ? '' : 's');
52 if (--ftime >= 0) setTimeout(formatClock, 1000);
55 function save(format)
57 if (!verifyFields(null, 0)) return;
59 E('format').disabled = 1;
60 if (format) E('fmsg').style.visibility = 'visible';
62 var fom = E('_fom');
63 var on = E('_f_jffs2_on').checked ? 1 : 0;
64 fom.jffs2_on.value = on;
65 if (format) {
66 fom.jffs2_format.value = 1;
67 fom._commit.value = 0;
68 fom._nextwait.value = fmtwait;
70 else {
71 fom.jffs2_format.value = 0;
72 fom._commit.value = 1;
73 fom._nextwait.value = on ? 15 : 3;
75 form.submit(fom, 1);
77 if (format) {
78 ftime = fmtwait;
79 formatClock();
83 function submit_complete()
85 reloadPage();
87 </script>
89 </head>
90 <body>
91 <form id='_fom' method='post' action='tomato.cgi'>
92 <table id='container' cellspacing=0>
93 <tr><td colspan=2 id='header'>
94 <div class='title'>Tomato</div>
95 <div class='version'>Version <% version(); %></div>
96 </td></tr>
97 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
98 <td id='content'>
99 <div id='ident'><% ident(); %></div>
101 <!-- / / / -->
103 <input type='hidden' name='_nextpage' value='admin-jffs2.asp'>
104 <input type='hidden' name='_nextwait' value='10'>
105 <input type='hidden' name='_service' value='jffs2-restart'>
106 <input type='hidden' name='_commit' value='1'>
108 <input type='hidden' name='jffs2_on'>
109 <input type='hidden' name='jffs2_format' value='0'>
111 <div class='section-title'>JFFS</div>
112 <div class='section'>
113 <script type='text/javascript'>
114 // <% statfs("/jffs", "jffs2"); %>
116 jfon = (nvram.jffs2_on == 1);
117 createFieldTable('', [
118 { title: 'Enable', name: 'f_jffs2_on', type: 'checkbox', value: jfon },
119 { title: 'Execute When Mounted', name: 'jffs2_exec', type: 'text', maxlen: 64, size: 34, value: nvram.jffs2_exec },
120 null,
121 { title: 'Total / Free Size', text: (((jffs2.mnt) || (jffs2.size > 0)) ? scaleSize(jffs2.size) : '') + ((jffs2.mnt) ? ' / ' + scaleSize(jffs2.free) : ' (not mounted)') },
122 null,
123 { title: '', custom: '<input type="button" value="Format / Erase..." onclick="formatClicked()" id="format"><br><br>' +
124 '<span style="background:#b55;color:#fff;padding:1px 8px;visibility:hidden" id="fmsg">Please wait for <span id="fclock">about 60 seconds</span>...</span>' }
126 </script>
127 </div>
129 <script type='text/javascript'>show_notice1('<% notice("jffs"); %>');</script>
131 <!-- / / / -->
133 </td></tr>
134 <tr><td id='footer' colspan=2>
135 <span id='footer-msg'></span>
136 <input type='button' value='Save' id='save-button' onclick='save()'>
137 <input type='button' value='Cancel' id='cancel-button' onclick='javascript:reloadPage();'>
138 </td></tr>
139 </table>
140 </form>
141 <script type='text/javascript'>verifyFields(null, 1);</script>
142 </body>
143 </html>