Change upload size unit to MB in config dialog

This commit is contained in:
Bartek Fabiszewski 2020-06-05 11:39:39 +02:00
parent fb29f45f47
commit bb5c142390
2 changed files with 5 additions and 3 deletions

View File

@ -55,7 +55,8 @@ export default class ConfigDialogModel extends ViewModel {
strokeOpacity: config.strokeOpacity,
strokeWeight: config.strokeWeight,
units: config.units,
uploadMaxSize: config.uploadMaxSize
uploadMaxSize: config.uploadMaxSize,
uploadMaxSizeMB: config.uploadMaxSize / 1024 / 1024
});
this.model.onCancel = () => this.onCancel();
this.model.onSave = () => this.onSave();
@ -83,6 +84,7 @@ export default class ConfigDialogModel extends ViewModel {
this.model.layerUrl = layer ? layer.url : '';
this.toggleEditVisible();
});
this.onChanged('uploadMaxSizeMB', (value) => { this.model.uploadMaxSize = value * 1024 * 1024;})
this.onChanged('layers', (list) => this.layerSelect.setOptions(list));
this.onChanged('requireAuth', (value) => {
this.setPublicTracksActivity(value);
@ -244,7 +246,7 @@ export default class ConfigDialogModel extends ViewModel {
<option value="3"${this.model.passStrength === 3 ? ' selected' : ''}>paSsword1#</option>
</select></label>
<label><b>${$._('uploadmaxsize')}</b>
<input type="number" data-bind="uploadMaxSize" min="0" value="${this.model.uploadMaxSize}" required></label>
<input type="number" data-bind="uploadMaxSizeMB" min="0.1" step="0.1" value="${this.model.uploadMaxSizeMB}" required></label>
<label><b>${$._('requireauth')}</b>
<input type="checkbox" data-bind="requireAuth"${this.model.requireAuth ? ' checked' : ''}></label>
<label><b>${$._('publictracks')}</b>

View File

@ -161,7 +161,7 @@ $lang["colorstart"] = "Start marker color";
$lang["colorstop"] = "Stop marker color";
$lang["colorextra"] = "Extra marker color";
$lang["colorhilite"] = "Hilite marker color";
$lang["uploadmaxsize"] = "Maximum upload size (B)";
$lang["uploadmaxsize"] = "Maximum upload size (MB)";
$lang["ollayers"] = "OpenLayers layer";
$lang["layername"] = "Layer name";
$lang["layerurl"] = "Layer URL";