Changeset 6072


Ignore:
Timestamp:
Jul 30, 2012, 2:56:10 PM (11 years ago)
Author:
Nicklas Nordborg
Message:

Fixes #1704: Implement support for limiting download speed in the web client

Updated documentation and fixed an issue which made it impossible to have an unlimited download rate and a limited upload rate at the same time.

Location:
trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc/src/docbook/admin/installation.xml

    r5895 r6072  
    12651265            <variablelist>
    12661266              <varlistentry>
    1267                 <term><guilabel>Max transfer rate</guilabel></term>
     1267                <term><guilabel>Max upload rate</guilabel></term>
    12681268                <listitem>
    12691269                  <para>
     
    12771277              </varlistentry>
    12781278              <varlistentry>
     1279                <term><guilabel>Max download rate</guilabel></term>
     1280                <listitem>
     1281                  <para>
     1282                    This is a limit of how many bytes of data that should be
     1283                    transferred per second when downloading files from BASE. Prefixes
     1284                    like k, M or G can be used for larger values. The limit is per ongoing
     1285                    download and the default value is unlimited.
     1286                  </para>
     1287                </listitem>
     1288              </varlistentry>
     1289              <varlistentry>
    12791290                <term><guilabel>Unlimited</guilabel></term>
    12801291                <listitem>
    12811292                  <para>
    1282                     Check this to not limit the transfer rate. In this case, the
    1283                     Internet connection of the server is the limit.
     1293                    Check one or both to not limit the upload/download transfer rate.
     1294                    In this case, the Internet connection of the server is the limit.
    12841295                  </para>
    12851296                </listitem>
  • trunk/www/admin/server/configure.jsp

    r6070 r6072  
    147147          %>
    148148          <input class="<%=theClazz%><%=writePermission ? "\"" : " disabled\" disabled readonly"%>
     149            <%=bytes==0 ? " disabled" : ""%>
    149150            type="text" name="transfer_rate_upload" value="<%=fBytes%>" size="16" maxlength="16"> per second<br>
    150151         
     
    178179          %>
    179180          <input class="<%=theClazz%><%=writePermission ? "\"" : " disabled\" disabled readonly"%>
     181            <%=bytes==0 ? " disabled" : ""%>
    180182            type="text" name="transfer_rate_download" value="<%=fBytes%>" size="16" maxlength="16"> per second<br>
    181183         
  • trunk/www/admin/server/submit_server.jsp

    r6070 r6072  
    5656
    5757    // File transfer tab
    58     Long bytes = new Long(0);
    5958    ClientDefaultSetting transferRateUpload = server.getDefaultSetting("server.transferRate");
    6059    boolean unlimitedUpload = Values.getBoolean(request.getParameter("unlimited_upload"));
     
    6261    if (!unlimitedUpload && rateUpload != null)
    6362    {
    64       bytes = Values.parseBytes(rateUpload, null);
     63      Long bytes = Values.parseBytes(rateUpload, null);
    6564      if (bytes == null)
    6665      {
    6766        throw new WebException("popup", "Invalid byte value", "The value {1} is not a valid value.", rateUpload);
    6867      }
     68      rateUpload = bytes.toString();
    6969    }
    70     transferRateUpload.setValue(bytes.toString());
     70    transferRateUpload.setValue(rateUpload == null ? "0" : rateUpload);
    7171
    7272    ClientDefaultSetting transferRateDownload = server.getDefaultSetting("server.transferRate.download");
     
    7575    if (!unlimitedDownload && rateDownload != null)
    7676    {
    77       bytes = Values.parseBytes(rateDownload, null);
     77      Long bytes = Values.parseBytes(rateDownload, null);
    7878      if (bytes == null)
    7979      {
    8080        throw new WebException("popup", "Invalid byte value", "The value {1} is not a valid value.", rateDownload);
    8181      }
     82      rateDownload = bytes.toString();
    8283    }
    83     transferRateDownload.setValue(bytes.toString());
     84    transferRateDownload.setValue(rateDownload == null ? "0" : rateDownload);
    8485
    8586   
Note: See TracChangeset for help on using the changeset viewer.