Migrate UI cleanup phase 4 from MIPS into ARM
[tomato.git] / release / src-rt-6.x.4708 / router / www / admin-nfs.asp
blob0399ec4f1c3526c37f5385d1b06f0c4608ebfe67
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 <meta name="viewport" content="width=device-width">
14 <title>[<% ident(); %>] Admin: NFS Server</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 <!-- / / / -->
20 <style type='text/css'>
21 #nfsg-grid {
22 width: 100%;
24 #nfsg-grid .co1 {
25 width: 15%;
27 #nfsg-grid .co2 {
28 width: 20%;
30 #nfsg-grid .co3 {
31 width: 10%;
33 #nfsg-grid .co4 {
34 width: 7%;
36 #nfsg-grid .co5 {
37 width: 13%;
39 #nfsg-grid .co6 {
40 width: 35%;
44 </style>
46 <script type='text/javascript' src='debug.js'></script>
48 <script type='text/javascript'>
50 // <% nvram("nfs_enable,nfs_exports"); %>
52 var access = [['rw', 'Read/Write'], ['ro', 'Read only']];
53 var sync = [['sync', 'Yes'], ['async', 'No']];
54 var subtree = [['subtree_check', 'Yes'], ['no_subtree_check', 'No']];
56 var nfsg = new TomatoGrid();
58 nfsg.exist = function(f, v)
60 var data = this.getAllData();
61 for (var i = 0; i < data.length; ++i) {
62 if (data[i][f] == v) return true;
64 return false;
67 nfsg.dataToView = function(data) {
68 return [data[0], data[1], data[2],data[3], data[4], data[5]];
71 nfsg.verifyFields = function(row, quiet)
73 var ok = 1;
75 return ok;
78 nfsg.resetNewEditor = function() {
79 var f;
81 f = fields.getAll(this.newEditor);
82 ferror.clearAll(f);
83 f[0].value = '';
84 f[1].value = '';
85 f[2].selectedIndex = 0;
86 f[3].selectedIndex = 0;
87 f[4].selectedIndex = 1;
88 f[5].value = 'no_root_squash';
91 nfsg.setup = function()
93 this.init('nfsg-grid', '', 50, [
94 { type: 'text', maxlen: 50 },
95 { type: 'text', maxlen: 30 },
96 { type: 'select', options: access },
97 { type: 'select', options: sync },
98 { type: 'select', options: subtree },
99 { type: 'text', maxlen: 50 }
101 this.headerSet(['Directory', 'IP Address/Subnet', 'Access', 'Sync', 'Subtree Check', 'Other Options']);
102 var s = nvram.nfs_exports.split('>');
103 for (var i = 0; i < s.length; ++i) {
104 var t = s[i].split('<');
105 if (t.length == 6) this.insertData(-1, t);
107 this.showNewEditor();
108 this.resetNewEditor();
111 function save()
113 var data = nfsg.getAllData();
114 var exports = '';
115 var i;
117 if (data.length != 0) exports += data[0].join('<');
118 for (i = 1; i < data.length; ++i) {
119 exports += '>' + data[i].join('<');
122 var fom = E('_fom');
123 fom.nfs_enable.value = E('_f_nfs_enable').checked ? 1 : 0;
124 fom.nfs_exports.value = exports;
125 form.submit(fom, 1);
128 function init()
130 nfsg.recolor();
132 </script>
133 </head>
134 <body onload='init()'>
135 <form id='_fom' method='post' action='tomato.cgi'>
136 <table id='container' cellspacing=0>
137 <tr><td colspan=2 id='header'>
138 <div class='title'>Tomato</div>
139 <div class='version'>Version <% version(); %></div>
140 </td></tr>
141 <tr id='body'><td id='navi'><script type='text/javascript'>navi()</script></td>
142 <td id='content'>
143 <div id='ident'><% ident(); %></div>
145 <!-- / / / -->
147 <input type='hidden' name='_nextpage' value='admin-nfs.asp'>
148 <input type='hidden' name='_service' value='nfs-start'>
150 <input type='hidden' name='nfs_enable'>
151 <input type='hidden' name='nfs_exports'>
153 <div class='section-title'>NFS Server</div>
154 <div class='section'>
155 <script type='text/javascript'>
156 createFieldTable('', [
157 { title: 'Enable NFS Server', name: 'f_nfs_enable', type: 'checkbox', value: nvram.nfs_enable != '0' }
159 </script>
160 <br>
162 <div class='section-title'>Exports</div>
163 <div class='section'>
164 <table class='tomato-grid' cellspacing=1 id='nfsg-grid'></table>
165 <script type='text/javascript'>nfsg.setup();</script>
166 <br>
167 <ul>
168 <li>You can find more information on proper NFS configuration at the following website: <a href="http://nfs.sourceforge.net/nfs-howto/" target="_blanc"><b>http://nfs.sourceforge.net</b></a>.
169 </ul>
170 <br>
171 </div>
173 </div>
175 <div class='section-title'>NFS Client</div>
176 <div class='section'>
177 <br>
178 <ul>
179 <li>If you want to mount an NFS share from other NFS Server, you can use the mount.nfs tool via telnet/ssh.
180 </ul>
181 </div>
183 <!-- / / / -->
185 </td></tr>
186 <tr><td id='footer' colspan=2>
187 <span id='footer-msg'></span>
188 <input type='button' value='Save' id='save-button' onclick='save()'>
189 <input type='button' value='Cancel' id='cancel-button' onclick='reloadPage();'>
190 </td></tr>
191 </table>
192 </form>
193 <script type='text/javascript'>verifyFields(null, 1);</script>
194 </body>
195 </html>