634 |
23 May 05 |
nicklas |
1 |
<%-- $Id$ |
634 |
23 May 05 |
nicklas |
2 |
------------------------------------------------------------------ |
3675 |
16 Aug 07 |
jari |
Copyright (C) 2005 Nicklas Nordborg |
5425 |
23 Sep 10 |
nicklas |
Copyright (C) 2006 Jari Häkkinen, Nicklas Nordborg, Martin Svensson |
634 |
23 May 05 |
nicklas |
5 |
|
2304 |
22 May 06 |
jari |
6 |
This file is part of BASE - BioArray Software Environment. |
2304 |
22 May 06 |
jari |
7 |
Available at http://base.thep.lu.se/ |
634 |
23 May 05 |
nicklas |
8 |
|
634 |
23 May 05 |
nicklas |
9 |
BASE is free software; you can redistribute it and/or |
634 |
23 May 05 |
nicklas |
10 |
modify it under the terms of the GNU General Public License |
4476 |
05 Sep 08 |
jari |
11 |
as published by the Free Software Foundation; either version 3 |
634 |
23 May 05 |
nicklas |
12 |
of the License, or (at your option) any later version. |
634 |
23 May 05 |
nicklas |
13 |
|
634 |
23 May 05 |
nicklas |
14 |
BASE is distributed in the hope that it will be useful, |
634 |
23 May 05 |
nicklas |
15 |
but WITHOUT ANY WARRANTY; without even the implied warranty of |
634 |
23 May 05 |
nicklas |
16 |
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
634 |
23 May 05 |
nicklas |
17 |
GNU General Public License for more details. |
634 |
23 May 05 |
nicklas |
18 |
|
634 |
23 May 05 |
nicklas |
19 |
You should have received a copy of the GNU General Public License |
4510 |
11 Sep 08 |
jari |
20 |
along with BASE. If not, see <http://www.gnu.org/licenses/>. |
634 |
23 May 05 |
nicklas |
21 |
------------------------------------------------------------------ |
634 |
23 May 05 |
nicklas |
22 |
|
634 |
23 May 05 |
nicklas |
23 |
@author Nicklas |
634 |
23 May 05 |
nicklas |
24 |
@version 2.0 |
634 |
23 May 05 |
nicklas |
25 |
--%> |
5426 |
24 Sep 10 |
nicklas |
26 |
<%@ page pageEncoding="UTF-8" session="false" |
634 |
23 May 05 |
nicklas |
27 |
import="net.sf.basedb.core.SessionControl" |
634 |
23 May 05 |
nicklas |
28 |
import="net.sf.basedb.core.DbControl" |
634 |
23 May 05 |
nicklas |
29 |
import="net.sf.basedb.core.Client" |
634 |
23 May 05 |
nicklas |
30 |
import="net.sf.basedb.core.User" |
695 |
31 May 05 |
nicklas |
31 |
import="net.sf.basedb.core.ClientDefaultSetting" |
634 |
23 May 05 |
nicklas |
32 |
import="net.sf.basedb.core.Permission" |
634 |
23 May 05 |
nicklas |
33 |
import="net.sf.basedb.clients.web.util.HTML" |
2753 |
20 Oct 06 |
nicklas |
34 |
import="net.sf.basedb.util.Values" |
634 |
23 May 05 |
nicklas |
35 |
import="net.sf.basedb.clients.web.Base" |
634 |
23 May 05 |
nicklas |
36 |
%> |
634 |
23 May 05 |
nicklas |
37 |
<%@ taglib prefix="base" uri="/WEB-INF/base.tld" %> |
634 |
23 May 05 |
nicklas |
38 |
<%@ taglib prefix="t" uri="/WEB-INF/tab.tld" %> |
634 |
23 May 05 |
nicklas |
39 |
|
634 |
23 May 05 |
nicklas |
40 |
<% |
634 |
23 May 05 |
nicklas |
41 |
final SessionControl sc = Base.getExistingSessionControl(pageContext, true); |
634 |
23 May 05 |
nicklas |
42 |
final String ID = sc.getId(); |
634 |
23 May 05 |
nicklas |
43 |
final float scale = Base.getScale(sc); |
7954 |
12 May 21 |
nicklas |
44 |
final DbControl dc = sc.newDbControl(":Server configuration"); |
634 |
23 May 05 |
nicklas |
45 |
|
634 |
23 May 05 |
nicklas |
46 |
try |
634 |
23 May 05 |
nicklas |
47 |
{ |
634 |
23 May 05 |
nicklas |
48 |
final Client server = Client.getById(dc, sc.getClientId()); |
6217 |
14 Dec 12 |
nicklas |
49 |
server.checkPermission(Permission.WRITE); |
695 |
31 May 05 |
nicklas |
50 |
final ClientDefaultSetting adminName = server.getDefaultSetting("server.admin.name"); |
695 |
31 May 05 |
nicklas |
51 |
final ClientDefaultSetting adminEmail = server.getDefaultSetting("server.admin.email"); |
695 |
31 May 05 |
nicklas |
52 |
final ClientDefaultSetting about = server.getDefaultSetting("server.about"); |
695 |
31 May 05 |
nicklas |
53 |
final ClientDefaultSetting getAccount = server.getDefaultSetting("server.get.account"); |
695 |
31 May 05 |
nicklas |
54 |
final ClientDefaultSetting forgottenPassword = server.getDefaultSetting("server.forgotten.password"); |
6070 |
21 Jun 12 |
nicklas |
55 |
final ClientDefaultSetting transferRateUpload = server.getDefaultSetting("server.transferRate"); |
6070 |
21 Jun 12 |
nicklas |
56 |
final ClientDefaultSetting transferRateDownload = server.getDefaultSetting("server.transferRate.download"); |
1960 |
10 Feb 06 |
martin |
57 |
final ClientDefaultSetting reportbuglink = server.getDefaultSetting("server.links.reportbug"); |
1960 |
10 Feb 06 |
martin |
58 |
final ClientDefaultSetting helplink = server.getDefaultSetting("server.links.help"); |
1960 |
10 Feb 06 |
martin |
59 |
final ClientDefaultSetting faqlink = server.getDefaultSetting("server.links.faq"); |
634 |
23 May 05 |
nicklas |
60 |
%> |
634 |
23 May 05 |
nicklas |
61 |
<base:page type="popup" title="Server configuration"> |
6169 |
15 Oct 12 |
nicklas |
62 |
<base:head scripts="tabcontrol-2.js,~configure.js" styles="tabcontrol.css" /> |
634 |
23 May 05 |
nicklas |
63 |
<base:body > |
5905 |
12 Dec 11 |
nicklas |
64 |
<h1>Server configuration <base:help tabcontrol="settings" /></h1> |
6162 |
10 Oct 12 |
nicklas |
65 |
<form name="server" action="submit_server.jsp" method="post"> |
634 |
23 May 05 |
nicklas |
66 |
<input type="hidden" name="ID" value="<%=ID%>"> |
634 |
23 May 05 |
nicklas |
67 |
<input type="hidden" name="cmd" value="SaveSettings"> |
634 |
23 May 05 |
nicklas |
68 |
|
5905 |
12 Dec 11 |
nicklas |
69 |
<t:tabcontrol id="settings" |
5905 |
12 Dec 11 |
nicklas |
70 |
subclass="content dialogtabcontrol" |
2456 |
30 Jun 06 |
nicklas |
71 |
position="bottom"> |
6169 |
15 Oct 12 |
nicklas |
72 |
<t:tab id="filetransfer" title="File transfer" helpid="serverconfig.filetransfer"> |
5905 |
12 Dec 11 |
nicklas |
73 |
<div> |
5905 |
12 Dec 11 |
nicklas |
74 |
<table class="fullform bottomborder"> |
5905 |
12 Dec 11 |
nicklas |
75 |
<tr> |
6070 |
21 Jun 12 |
nicklas |
76 |
<th>Max upload rate</th> |
695 |
31 May 05 |
nicklas |
77 |
<td> |
695 |
31 May 05 |
nicklas |
78 |
<% |
6070 |
21 Jun 12 |
nicklas |
79 |
long bytes = Values.getLong(transferRateUpload.getValue()); |
695 |
31 May 05 |
nicklas |
80 |
String fBytes = ""; |
695 |
31 May 05 |
nicklas |
81 |
if (bytes > 0) |
695 |
31 May 05 |
nicklas |
82 |
{ |
695 |
31 May 05 |
nicklas |
83 |
fBytes = Values.formatBytes(bytes); |
695 |
31 May 05 |
nicklas |
84 |
} |
695 |
31 May 05 |
nicklas |
85 |
else |
695 |
31 May 05 |
nicklas |
86 |
{ |
695 |
31 May 05 |
nicklas |
87 |
fBytes = "unlimited"; |
695 |
31 May 05 |
nicklas |
88 |
} |
695 |
31 May 05 |
nicklas |
89 |
%> |
6217 |
14 Dec 12 |
nicklas |
90 |
<input class="text" <%=bytes==0 ? " disabled" : ""%> |
6070 |
21 Jun 12 |
nicklas |
91 |
type="text" name="transfer_rate_upload" value="<%=fBytes%>" size="16" maxlength="16"> per second<br> |
5905 |
12 Dec 11 |
nicklas |
92 |
|
5905 |
12 Dec 11 |
nicklas |
93 |
</td> |
5905 |
12 Dec 11 |
nicklas |
94 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
95 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
96 |
<th class="subprompt"></th> |
5905 |
12 Dec 11 |
nicklas |
97 |
<td> |
6070 |
21 Jun 12 |
nicklas |
98 |
<input type="checkbox" value="1" name="unlimited_upload" <%=bytes==0 ? " checked" : ""%> |
6169 |
15 Oct 12 |
nicklas |
99 |
id="unlimited.upload" data-rate-field="transfer_rate_upload" |
6169 |
15 Oct 12 |
nicklas |
100 |
title="Unlimited transfer rate"> |
6070 |
21 Jun 12 |
nicklas |
101 |
<label for="unlimited.upload">Unlimited</label> |
695 |
31 May 05 |
nicklas |
102 |
</td> |
695 |
31 May 05 |
nicklas |
103 |
</tr> |
6070 |
21 Jun 12 |
nicklas |
104 |
<tr> |
6070 |
21 Jun 12 |
nicklas |
105 |
<th>Max download rate</th> |
6070 |
21 Jun 12 |
nicklas |
106 |
<td> |
6070 |
21 Jun 12 |
nicklas |
107 |
<% |
6070 |
21 Jun 12 |
nicklas |
108 |
bytes = Values.getLong(transferRateDownload.getValue()); |
6070 |
21 Jun 12 |
nicklas |
109 |
fBytes = ""; |
6070 |
21 Jun 12 |
nicklas |
110 |
if (bytes > 0) |
6070 |
21 Jun 12 |
nicklas |
111 |
{ |
6070 |
21 Jun 12 |
nicklas |
112 |
fBytes = Values.formatBytes(bytes); |
6070 |
21 Jun 12 |
nicklas |
113 |
} |
6070 |
21 Jun 12 |
nicklas |
114 |
else |
6070 |
21 Jun 12 |
nicklas |
115 |
{ |
6070 |
21 Jun 12 |
nicklas |
116 |
fBytes = "unlimited"; |
6070 |
21 Jun 12 |
nicklas |
117 |
} |
6070 |
21 Jun 12 |
nicklas |
118 |
%> |
6217 |
14 Dec 12 |
nicklas |
119 |
<input class="text" <%=bytes==0 ? " disabled" : ""%> |
6070 |
21 Jun 12 |
nicklas |
120 |
type="text" name="transfer_rate_download" value="<%=fBytes%>" size="16" maxlength="16"> per second<br> |
6070 |
21 Jun 12 |
nicklas |
121 |
|
6070 |
21 Jun 12 |
nicklas |
122 |
</td> |
6070 |
21 Jun 12 |
nicklas |
123 |
</tr> |
6070 |
21 Jun 12 |
nicklas |
124 |
<tr> |
6070 |
21 Jun 12 |
nicklas |
125 |
<th class="subprompt"></th> |
6070 |
21 Jun 12 |
nicklas |
126 |
<td> |
6070 |
21 Jun 12 |
nicklas |
127 |
<input type="checkbox" value="1" name="unlimited_download" <%=bytes==0 ? " checked" : ""%> |
6169 |
15 Oct 12 |
nicklas |
128 |
id="unlimited.download" data-rate-field="transfer_rate_download" |
6169 |
15 Oct 12 |
nicklas |
129 |
title="Unlimited transfer rate"> |
6070 |
21 Jun 12 |
nicklas |
130 |
<label for="unlimited.download">Unlimited</label> |
6070 |
21 Jun 12 |
nicklas |
131 |
</td> |
6070 |
21 Jun 12 |
nicklas |
132 |
</tr> |
6070 |
21 Jun 12 |
nicklas |
133 |
|
5905 |
12 Dec 11 |
nicklas |
134 |
</table> |
5905 |
12 Dec 11 |
nicklas |
135 |
</div> |
5905 |
12 Dec 11 |
nicklas |
136 |
|
5905 |
12 Dec 11 |
nicklas |
137 |
|
5905 |
12 Dec 11 |
nicklas |
138 |
<div class="padded"> |
695 |
31 May 05 |
nicklas |
139 |
The transfer rate is specified in bytes per second. |
695 |
31 May 05 |
nicklas |
140 |
You can use the following units (case-insensitive): |
695 |
31 May 05 |
nicklas |
141 |
<ul> |
1840 |
25 Jan 06 |
nicklas |
142 |
<li><b>GB</b> or <b>G</b> for gigabyte values (<code>1.5 GB</code>) |
1840 |
25 Jan 06 |
nicklas |
143 |
<li><b>MB</b> or <b>M</b> for megabyte values (<code>10M</code>) |
1840 |
25 Jan 06 |
nicklas |
144 |
<li><b>kB</b> or <b>k</b> for kilobyte values (<code>800k</code>) |
1840 |
25 Jan 06 |
nicklas |
145 |
<li><b>bytes</b> or <b>B</b> for byte values (<code>50 bytes</code>) |
695 |
31 May 05 |
nicklas |
146 |
</ul> |
5905 |
12 Dec 11 |
nicklas |
147 |
</div> |
695 |
31 May 05 |
nicklas |
148 |
|
5905 |
12 Dec 11 |
nicklas |
149 |
|
695 |
31 May 05 |
nicklas |
150 |
</t:tab> |
6169 |
15 Oct 12 |
nicklas |
151 |
<t:tab id="about" title="About" helpid="serverconfig.about"> |
5905 |
12 Dec 11 |
nicklas |
152 |
<table class="fullform input100"> |
634 |
23 May 05 |
nicklas |
153 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
154 |
<th>Administrator name</th> |
634 |
23 May 05 |
nicklas |
155 |
<td> |
6217 |
14 Dec 12 |
nicklas |
156 |
<input class="text" type="text" name="name" value="<%=HTML.encodeTags(adminName.getValue())%>" maxlength="<%=User.MAX_NAME_LENGTH%>"> |
634 |
23 May 05 |
nicklas |
157 |
</td> |
5905 |
12 Dec 11 |
nicklas |
158 |
<td></td> |
634 |
23 May 05 |
nicklas |
159 |
</tr> |
634 |
23 May 05 |
nicklas |
160 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
161 |
<th>Administrator email</th> |
634 |
23 May 05 |
nicklas |
162 |
<td> |
6217 |
14 Dec 12 |
nicklas |
163 |
<input class="text" type="text" name="email" value="<%=HTML.encodeTags(adminEmail.getValue())%>" maxlength="<%=User.MAX_EMAIL_LENGTH%>"> |
634 |
23 May 05 |
nicklas |
164 |
</td> |
5905 |
12 Dec 11 |
nicklas |
165 |
<td></td> |
634 |
23 May 05 |
nicklas |
166 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
167 |
<tr class="dynamic"> |
5905 |
12 Dec 11 |
nicklas |
168 |
<th>About</th> |
634 |
23 May 05 |
nicklas |
169 |
<td> |
6217 |
14 Dec 12 |
nicklas |
170 |
<textarea class="text" rows="10" name="about" id="aboutMsg"><%=HTML.encodeTags(about.getValue())%></textarea> |
5905 |
12 Dec 11 |
nicklas |
171 |
</td> |
5905 |
12 Dec 11 |
nicklas |
172 |
<td style="width: 20px;"> |
6169 |
15 Oct 12 |
nicklas |
173 |
<base:zoom textarea="aboutMsg" title="About" /> |
634 |
23 May 05 |
nicklas |
174 |
</td> |
634 |
23 May 05 |
nicklas |
175 |
</tr> |
634 |
23 May 05 |
nicklas |
176 |
</table> |
634 |
23 May 05 |
nicklas |
177 |
</t:tab> |
6169 |
15 Oct 12 |
nicklas |
178 |
<t:tab id="account" title="Get account" helpid="serverconfig.getaccount"> |
5905 |
12 Dec 11 |
nicklas |
179 |
<table class="fullform input100 smaller"> |
5905 |
12 Dec 11 |
nicklas |
180 |
<tr class="dynamic"> |
5905 |
12 Dec 11 |
nicklas |
181 |
<th>Message</th> |
634 |
23 May 05 |
nicklas |
182 |
<td> |
6217 |
14 Dec 12 |
nicklas |
183 |
<textarea class="text" rows="16" name="account" id="accountMsg"><%=HTML.encodeTags(getAccount.getValue())%></textarea> |
634 |
23 May 05 |
nicklas |
184 |
</td> |
5905 |
12 Dec 11 |
nicklas |
185 |
<td style="width: 20px;"> |
6169 |
15 Oct 12 |
nicklas |
186 |
<base:zoom textarea="accountMsg" title="Get account - message" /> |
5905 |
12 Dec 11 |
nicklas |
187 |
</td> |
634 |
23 May 05 |
nicklas |
188 |
</tr> |
634 |
23 May 05 |
nicklas |
189 |
</table> |
634 |
23 May 05 |
nicklas |
190 |
</t:tab> |
634 |
23 May 05 |
nicklas |
191 |
|
6169 |
15 Oct 12 |
nicklas |
192 |
<t:tab id="password" title="Forgotten password" helpid="serverconfig.password"> |
5905 |
12 Dec 11 |
nicklas |
193 |
<table class="fullform input100 smaller"> |
5905 |
12 Dec 11 |
nicklas |
194 |
<tr class="dynamic"> |
5905 |
12 Dec 11 |
nicklas |
195 |
<th>Message</th> |
634 |
23 May 05 |
nicklas |
196 |
<td> |
6217 |
14 Dec 12 |
nicklas |
197 |
<textarea class="text" rows="16" name="password" id="passwordMsg"><%=HTML.encodeTags(forgottenPassword.getValue())%></textarea> |
5905 |
12 Dec 11 |
nicklas |
198 |
</td> |
5905 |
12 Dec 11 |
nicklas |
199 |
<td style="width: 20px;"> |
6169 |
15 Oct 12 |
nicklas |
200 |
<base:zoom textarea="passwordMsg" title="Forgotten password - message" /> |
634 |
23 May 05 |
nicklas |
201 |
</td> |
634 |
23 May 05 |
nicklas |
202 |
</tr> |
634 |
23 May 05 |
nicklas |
203 |
</table> |
634 |
23 May 05 |
nicklas |
204 |
</t:tab> |
1960 |
10 Feb 06 |
martin |
205 |
|
6169 |
15 Oct 12 |
nicklas |
206 |
<t:tab id="links" title="Links" helpid="serverconfig.links"> |
5905 |
12 Dec 11 |
nicklas |
207 |
<table class="fullform input100 smaller"> |
1960 |
10 Feb 06 |
martin |
208 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
209 |
<th>Help</th> |
1960 |
10 Feb 06 |
martin |
210 |
<td> |
6217 |
14 Dec 12 |
nicklas |
211 |
<input class="text" type="text" name="help" |
5905 |
12 Dec 11 |
nicklas |
212 |
value="<%=HTML.encodeTags(helplink.getValue())%>" |
6140 |
20 Sep 12 |
nicklas |
213 |
maxlength="<%=ClientDefaultSetting.MAX_VALUE_LENGTH%>"> |
1960 |
10 Feb 06 |
martin |
214 |
</td> |
2440 |
28 Jun 06 |
nicklas |
215 |
</tr> |
1960 |
10 Feb 06 |
martin |
216 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
217 |
<th>FAQ</th> |
1960 |
10 Feb 06 |
martin |
218 |
<td> |
6217 |
14 Dec 12 |
nicklas |
219 |
<input class="text" type="text" name="faq" |
5905 |
12 Dec 11 |
nicklas |
220 |
value="<%=HTML.encodeTags(faqlink.getValue())%>" |
6140 |
20 Sep 12 |
nicklas |
221 |
maxlength="<%=ClientDefaultSetting.MAX_VALUE_LENGTH%>"> |
1960 |
10 Feb 06 |
martin |
222 |
</td> |
2440 |
28 Jun 06 |
nicklas |
223 |
</tr> |
1960 |
10 Feb 06 |
martin |
224 |
<tr> |
5905 |
12 Dec 11 |
nicklas |
225 |
<th>Report a bug</th> |
1960 |
10 Feb 06 |
martin |
226 |
<td> |
6217 |
14 Dec 12 |
nicklas |
227 |
<input class="text" type="text" name="reportbug" |
5905 |
12 Dec 11 |
nicklas |
228 |
value="<%=HTML.encodeTags(reportbuglink.getValue())%>" |
6140 |
20 Sep 12 |
nicklas |
229 |
maxlength="<%=ClientDefaultSetting.MAX_VALUE_LENGTH%>"> |
1960 |
10 Feb 06 |
martin |
230 |
</td> |
5905 |
12 Dec 11 |
nicklas |
231 |
</tr> |
5905 |
12 Dec 11 |
nicklas |
232 |
<tr class="dynamic"> |
5905 |
12 Dec 11 |
nicklas |
233 |
<th></th> |
5905 |
12 Dec 11 |
nicklas |
234 |
<td></td> |
5905 |
12 Dec 11 |
nicklas |
235 |
</tr> |
1960 |
10 Feb 06 |
martin |
236 |
</table> |
1960 |
10 Feb 06 |
martin |
237 |
</t:tab> |
634 |
23 May 05 |
nicklas |
238 |
</t:tabcontrol> |
634 |
23 May 05 |
nicklas |
239 |
|
634 |
23 May 05 |
nicklas |
240 |
</form> |
5905 |
12 Dec 11 |
nicklas |
241 |
|
5905 |
12 Dec 11 |
nicklas |
242 |
<base:buttongroup subclass="dialogbuttons"> |
6169 |
15 Oct 12 |
nicklas |
243 |
<base:button id="btnSave" title="Ok" /> |
6169 |
15 Oct 12 |
nicklas |
244 |
<base:button id="close" title="Cancel" /> |
5905 |
12 Dec 11 |
nicklas |
245 |
</base:buttongroup> |
634 |
23 May 05 |
nicklas |
246 |
</base:body> |
634 |
23 May 05 |
nicklas |
247 |
</base:page> |
634 |
23 May 05 |
nicklas |
248 |
<% |
634 |
23 May 05 |
nicklas |
249 |
} |
634 |
23 May 05 |
nicklas |
250 |
finally |
634 |
23 May 05 |
nicklas |
251 |
{ |
634 |
23 May 05 |
nicklas |
252 |
if (dc != null) dc.close(); |
634 |
23 May 05 |
nicklas |
253 |
} |
634 |
23 May 05 |
nicklas |
254 |
%> |
634 |
23 May 05 |
nicklas |
255 |
|