1 <!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML
4.0//EN'
>
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.
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>
20 <style type='text/css'
>
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;
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
)
78 nfsg
.resetNewEditor = function() {
81 f
= fields
.getAll(this.newEditor
);
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();
113 var data
= nfsg
.getAllData();
117 if (data
.length
!= 0) exports
+= data
[0].join('<');
118 for (i
= 1; i
< data
.length
; ++i
) {
119 exports
+= '>' + data
[i
].join('<');
123 fom
.nfs_enable
.value
= E('_f_nfs_enable').checked
? 1 : 0;
124 fom
.nfs_exports
.value
= exports
;
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>
141 <tr id='body'
><td id='navi'
><script type='text/javascript'
>navi()</script></td>
143 <div id='ident'
><%
ident(); %></div>
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' }
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>
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>.
175 <div class='section-title'
>NFS Client
</div>
176 <div class='section'
>
179 <li>If you want to mount an NFS share from other NFS Server, you can use the mount.nfs tool via telnet/ssh.
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();'
>
193 <script type='text/javascript'
>verifyFields(null, 1);</script>