Tomato 1.28
[tomato.git] / release / src / router / www / admin-jffs2.asp
blob2e07da4c3cf7065931d0a097ef7372eadc3a5cd0
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: JFFS2</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"); %>
27 function verifyFields(focused, quiet)
29 var b = !E('_f_jffs2_on').checked;
30 E('format').disabled = b;
31 E('_jffs2_exec').disabled = b;
32 return 1;
35 function formatClicked()
37 if (!verifyFields(null, 0)) return;
38 if (!confirm("Format the JFFS2 partition?")) return;
39 save(1);
42 function formatClock()
44 if (ftime == 0) {
45 E('fclock').innerHTML = 'a few seconds';
47 else {
48 E('fclock').innerHTML = ((ftime > 0) ? 'about ' : '') + ftime + ' second' + ((ftime == 1) ? '' : 's');
50 if (--ftime >= 0) setTimeout(formatClock, 1000);
53 function save(format)
55 if (!verifyFields(null, 0)) return;
57 E('format').disabled = 1;
58 if (format) E('fmsg').style.visibility = 'visible';
60 var fom = E('_fom');
61 var on = E('_f_jffs2_on').checked ? 1 : 0;
62 fom.jffs2_on.value = on;
63 if (format) {
64 fom.jffs2_format.value = 1;
65 fom._commit.value = 0;
66 fom._nextwait.value = 60;
68 else {
69 fom.jffs2_format.value = 0;
70 fom._commit.value = 1;
71 fom._nextwait.value = on ? 15 : 3;
73 form.submit(fom, 1);
75 if (format) {
76 ftime = 60;
77 formatClock();
81 function submit_complete()
83 reloadPage();
85 </script>
87 </head>
88 <body>
89 <form id='_fom' method='post' action='tomato.cgi'>
90 <table id='container' cellspacing=0>
91 <tr><td colspan=2 id='header'>
92 <div class='title'>Tomato</div>
93 <div class='version'>Version <% version(); %></div>
94 </td></tr>
95 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
96 <td id='content'>
97 <div id='ident'><% ident(); %></div>
99 <!-- / / / -->
101 <input type='hidden' name='_nextpage' value='admin-jffs2.asp'>
102 <input type='hidden' name='_nextwait' value='10'>
103 <input type='hidden' name='_service' value='jffs2-restart'>
104 <input type='hidden' name='_commit' value='1'>
106 <input type='hidden' name='jffs2_on'>
107 <input type='hidden' name='jffs2_format' value='0'>
109 <div class='section-title'>JFFS2</div>
110 <div class='section'>
111 <script type='text/javascript'>
112 // <% statfs("/jffs", "jffs2"); %>
114 jfon = (nvram.jffs2_on == 1);
115 createFieldTable('', [
116 { title: 'Enable', name: 'f_jffs2_on', type: 'checkbox', value: jfon },
117 { title: 'Execute When Mounted', name: 'jffs2_exec', type: 'text', maxlen: 64, size: 34, value: nvram.jffs2_exec },
118 null,
119 { title: 'Total / Free Size', text: ((jfon) && (jffs2.size)) ? (scaleSize(jffs2.size) + ' / ' + scaleSize(jffs2.free)) : '(not mounted)' },
120 null,
121 { title: '', custom: '<input type="button" value="Format / Erase..." onclick="formatClicked()" id="format"><br>' +
122 '<span style="background:#b55;color:#fff;padding:1px 8px;visibility:hidden" id="fmsg">Please wait for <span id="fclock">about 60 seconds</span>...</span>' }
124 </script>
125 </div>
127 <script type='text/javascript'>show_notice1('<% notice("jffs2"); %>');</script>
129 <!-- / / / -->
131 </td></tr>
132 <tr><td id='footer' colspan=2>
133 <span id='footer-msg'></span>
134 <input type='button' value='Save' id='save-button' onclick='save()'>
135 <input type='button' value='Cancel' id='cancel-button' onclick='javascript:reloadPage();'>
136 </td></tr>
137 </table>
138 </form>
139 <script type='text/javascript'>verifyFields(null, 1);</script>
140 </body>
141 </html>