mirror of
https://github.com/Doodle3D/doodle3d-client.git
synced 2024-12-04 05:54:55 +01:00
Add dropdown menu to settings window for log level selection with appropriate warnings.
This commit is contained in:
parent
09fcdbea31
commit
c2f5f890c7
@ -34,7 +34,8 @@ function SettingsWindow() {
|
|||||||
var _networkPanel = new NetworkPanel();
|
var _networkPanel = new NetworkPanel();
|
||||||
var _networkAPI = new NetworkAPI();
|
var _networkAPI = new NetworkAPI();
|
||||||
|
|
||||||
var _restoreStateField
|
var _restoreStateField;
|
||||||
|
var _initialLogLevel;
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
@ -123,6 +124,7 @@ function SettingsWindow() {
|
|||||||
_form.loadAllSettings(function(loadedSettings){
|
_form.loadAllSettings(function(loadedSettings){
|
||||||
console.log("Settings:loaded settings: ",loadedSettings);
|
console.log("Settings:loaded settings: ",loadedSettings);
|
||||||
settings = loadedSettings;
|
settings = loadedSettings;
|
||||||
|
_initialLogLevel = loadedSettings['system.log.level'];
|
||||||
_form.fillForm(settings);
|
_form.fillForm(settings);
|
||||||
$(document).trigger(SettingsWindow.SETTINGS_LOADED);
|
$(document).trigger(SettingsWindow.SETTINGS_LOADED);
|
||||||
if(complete) complete();
|
if(complete) complete();
|
||||||
@ -180,6 +182,23 @@ function SettingsWindow() {
|
|||||||
this.openFileManager = function() {
|
this.openFileManager = function() {
|
||||||
location.href = "filemanager/"+location.search;
|
location.href = "filemanager/"+location.search;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.logLevelChanged = function(elem) {
|
||||||
|
var showHideAnimDuration = 100;
|
||||||
|
if (_initialLogLevel != elem.value) {
|
||||||
|
$('#logging-restart-warning').show(showHideAnimDuration);
|
||||||
|
} else {
|
||||||
|
$('#logging-restart-warning').hide(showHideAnimDuration);
|
||||||
|
}
|
||||||
|
|
||||||
|
switch (elem.value) {
|
||||||
|
case "info": case "verbose": case "bulk":
|
||||||
|
$('#logging-verbose-warning').show(showHideAnimDuration);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
$('#logging-verbose-warning').hide(showHideAnimDuration);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*************************
|
/*************************
|
||||||
|
@ -3,6 +3,16 @@
|
|||||||
SETTINGS POPUP
|
SETTINGS POPUP
|
||||||
|
|
||||||
*/
|
*/
|
||||||
|
.warn-box {
|
||||||
|
color: #bb0;
|
||||||
|
border: 1px solid #bb0;
|
||||||
|
width: 99%;
|
||||||
|
border-radius: 5px;
|
||||||
|
margin: 7px 0;
|
||||||
|
padding: 2px;
|
||||||
|
display: none;
|
||||||
|
}
|
||||||
|
|
||||||
#popupSettings {
|
#popupSettings {
|
||||||
top: 0;
|
top: 0;
|
||||||
left: 0;
|
left: 0;
|
||||||
|
@ -22,7 +22,7 @@
|
|||||||
</li>
|
</li>
|
||||||
<li data-id="btnsPrevNext" data-button="Next" data-options="tipLocation:right;tipAdjustmentY:-25">
|
<li data-id="btnsPrevNext" data-button="Next" data-options="tipLocation:right;tipAdjustmentY:-25">
|
||||||
<h2>View saved doodles</h2>
|
<h2>View saved doodles</h2>
|
||||||
<p>Use the buttons '<' and '>' to flip through all the saved doodles on your Wi-Fi box.</p>
|
<p>Use the buttons '<' and '>' to flip through all the saved doodles on your Wi-Fi box.</p>
|
||||||
</li>
|
</li>
|
||||||
<li data-id="btnOops" data-button="Next" data-options="tipLocation:right">
|
<li data-id="btnOops" data-button="Next" data-options="tipLocation:right">
|
||||||
<h2>Oops</h2>
|
<h2>Oops</h2>
|
||||||
|
@ -179,11 +179,27 @@
|
|||||||
<input type="button" onclick="settingsWindow.downloadGcode()" name="downloadGcode" value="Download GCODE" class="button" id="downloadGcode"/>
|
<input type="button" onclick="settingsWindow.downloadGcode()" name="downloadGcode" value="Download GCODE" class="button" id="downloadGcode"/>
|
||||||
<input type="button" onclick="settingsWindow.downloadSvg()" name="downloadSvg" value="Download SVG" class="button" id="downloadSvg"/>
|
<input type="button" onclick="settingsWindow.downloadSvg()" name="downloadSvg" value="Download SVG" class="button" id="downloadSvg"/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset id="debugPanel">
|
<fieldset id="debugPanel">
|
||||||
<legend>Debug</legend>
|
<legend>Debug</legend>
|
||||||
<input type="button" onclick="settingsWindow.downloadlogs()" name="downloadlogs" value="Download logs" class="button" id="downloadlogs"
|
<label for="logLevel">Log level:</label>
|
||||||
/>
|
<select id="logLevel" name="system.log.level" onchange="settingsWindow.logLevelChanged(this)">
|
||||||
|
<option value="" disabled="disabled" selected="selected">Please choose a log level</option>
|
||||||
|
<option value="quiet">Quiet</option>
|
||||||
|
<option value="error">Error</option>
|
||||||
|
<option value="warning">Warning</option>
|
||||||
|
<option value="info">Info</option>
|
||||||
|
<option value="verbose">Verbose</option>
|
||||||
|
<option value="bulk">Bulk</option>
|
||||||
|
</select><br/>
|
||||||
|
<div id="logging-restart-warning" class="warn-box">
|
||||||
|
Restart the wifibox for a new log level to take effect.
|
||||||
|
</div>
|
||||||
|
<div id="logging-verbose-warning" class="warn-box">
|
||||||
|
<em>Be careful</em>: when setting a log level higher than info, the Wifibox may quickly run out of memory, causing crashes and other unwanted behaviour.
|
||||||
|
</div>
|
||||||
|
<br/>
|
||||||
|
<input type="button" onclick="settingsWindow.downloadlogs()" name="downloadlogs" value="Download logs" class="button" id="downloadlogs"/>
|
||||||
</fieldset>
|
</fieldset>
|
||||||
|
|
||||||
<fieldset id="restorePanel">
|
<fieldset id="restorePanel">
|
||||||
|
Loading…
Reference in New Issue
Block a user