parent
05b5926101
commit
58c26ca9ae
|
@ -129,7 +129,8 @@ class KlipperPlugin(
|
||||||
logpath="/tmp/klippy.log",
|
logpath="/tmp/klippy.log",
|
||||||
reload_command="RESTART",
|
reload_command="RESTART",
|
||||||
navbar=True,
|
navbar=True,
|
||||||
parse_check=False
|
parse_check=False,
|
||||||
|
fontsize=9
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -374,7 +375,7 @@ class KlipperPlugin(
|
||||||
if "FIRMWARE_VERSION" in printerInfo:
|
if "FIRMWARE_VERSION" in printerInfo:
|
||||||
self.log_info("Firmware version: {}".format(
|
self.log_info("Firmware version: {}".format(
|
||||||
printerInfo["FIRMWARE_VERSION"]))
|
printerInfo["FIRMWARE_VERSION"]))
|
||||||
elif "// probe" in line:
|
elif "// probe" in line or "// Failed to verify BLTouch" in line:
|
||||||
msg = line.strip('/')
|
msg = line.strip('/')
|
||||||
self.log_info(msg)
|
self.log_info(msg)
|
||||||
write_parsing_response_buffer()
|
write_parsing_response_buffer()
|
||||||
|
@ -452,9 +453,9 @@ class KlipperPlugin(
|
||||||
self._settings.set(["config"], data["config"])
|
self._settings.set(["config"], data["config"])
|
||||||
# self.send_message("reload", "config", "", data["config"])
|
# self.send_message("reload", "config", "", data["config"])
|
||||||
# send the configdata to frontend to update ace editor
|
# send the configdata to frontend to update ace editor
|
||||||
if sys.version_info[0] < 3:
|
if sys.version_info[0] < 3:
|
||||||
data["config"] = data["config"].decode('utf-8')
|
data["config"] = data["config"].decode('utf-8')
|
||||||
return flask.jsonify(data=data["config"])
|
return flask.jsonify(data=data["config"])
|
||||||
elif command == "checkConfig":
|
elif command == "checkConfig":
|
||||||
if "config" in data:
|
if "config" in data:
|
||||||
if not self.validate_configfile(data["config"]):
|
if not self.validate_configfile(data["config"]):
|
||||||
|
|
|
@ -104,7 +104,15 @@ div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content
|
||||||
|
|
||||||
div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content div#conf.tab-pane.active div.control-group div.conf-editor {
|
div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content div#conf.tab-pane.active div.control-group div.conf-editor {
|
||||||
height: 100%;
|
height: 100%;
|
||||||
overflow: auto;
|
width: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content div#conf.tab-pane.active div.control-group div.conf-editor div#plugin-klipper-config {
|
||||||
|
position: absolute;
|
||||||
|
top: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
left: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content div#conf.tab-pane.active div.control-group button.btn.btn-small {
|
div#settings_plugin_klipper.tab-pane.active form.form-horizontal div.tab-content div#conf.tab-pane.active div.control-group button.btn.btn-small {
|
||||||
|
|
|
@ -107,6 +107,28 @@ $(function() {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
self.minusFontsize = function () {
|
||||||
|
self.settings.settings.plugins.klipper.configuration.fontsize(self.settings.settings.plugins.klipper.configuration.fontsize() - 1);
|
||||||
|
if (self.settings.settings.plugins.klipper.configuration.fontsize() < 9) {
|
||||||
|
self.settings.settings.plugins.klipper.configuration.fontsize(9);
|
||||||
|
}
|
||||||
|
if (editor) {
|
||||||
|
editor.setFontSize(self.settings.settings.plugins.klipper.configuration.fontsize());
|
||||||
|
editor.resize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
self.plusFontsize = function () {
|
||||||
|
self.settings.settings.plugins.klipper.configuration.fontsize(self.settings.settings.plugins.klipper.configuration.fontsize() + 1);
|
||||||
|
if (self.settings.settings.plugins.klipper.configuration.fontsize() > 20) {
|
||||||
|
self.settings.settings.plugins.klipper.configuration.fontsize(20);
|
||||||
|
}
|
||||||
|
if (editor) {
|
||||||
|
editor.setFontSize(self.settings.settings.plugins.klipper.configuration.fontsize());
|
||||||
|
editor.resize();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
self.loadLastSession = function () {
|
self.loadLastSession = function () {
|
||||||
if (self.settings.settings.plugins.klipper.configuration.old_config() != "") {
|
if (self.settings.settings.plugins.klipper.configuration.old_config() != "") {
|
||||||
self.klipperViewModel.consoleMessage("info","lastSession:" + self.settings.settings.plugins.klipper.configuration.old_config())
|
self.klipperViewModel.consoleMessage("info","lastSession:" + self.settings.settings.plugins.klipper.configuration.old_config())
|
||||||
|
@ -156,6 +178,8 @@ $(function() {
|
||||||
obKlipperConfig = config.withSilence();
|
obKlipperConfig = config.withSilence();
|
||||||
if (editor) {
|
if (editor) {
|
||||||
editor.setValue(obKlipperConfig());
|
editor.setValue(obKlipperConfig());
|
||||||
|
editor.setFontSize(self.settings.settings.plugins.klipper.configuration.fontsize());
|
||||||
|
editor.resize();
|
||||||
editor.clearSelection();
|
editor.clearSelection();
|
||||||
}
|
}
|
||||||
return obKlipperConfig;
|
return obKlipperConfig;
|
||||||
|
@ -166,13 +190,16 @@ $(function() {
|
||||||
editor.setTheme("ace/theme/monokai");
|
editor.setTheme("ace/theme/monokai");
|
||||||
editor.session.setMode("ace/mode/klipper_config");
|
editor.session.setMode("ace/mode/klipper_config");
|
||||||
editor.setOptions({
|
editor.setOptions({
|
||||||
autoScrollEditorIntoView: true,
|
hScrollBarAlwaysVisible: true,
|
||||||
maxLines: "Infinity"
|
vScrollBarAlwaysVisible: true,
|
||||||
|
autoScrollEditorIntoView: true,
|
||||||
|
//maxLines: "Infinity"
|
||||||
})
|
})
|
||||||
|
|
||||||
editor.session.on('change', function(delta) {
|
editor.session.on('change', function(delta) {
|
||||||
if (obKlipperConfig) {
|
if (obKlipperConfig) {
|
||||||
obKlipperConfig.silentUpdate(editor.getValue());
|
obKlipperConfig.silentUpdate(editor.getValue());
|
||||||
|
editor.resize();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -196,7 +196,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<a href='#' data-bind='click: addProbePoint' class="fa fa-plus-circle"></a> {{ _('Add Point') }}
|
<a href='#' data-bind="click: addProbePoint" class="fa fa-plus-circle"></a> {{ _('Add Point') }}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -206,14 +206,17 @@
|
||||||
<script src="plugin/klipper/static/js/lib/ace/ace.min.js" type="text/javascript" charset="utf-8"></script>
|
<script src="plugin/klipper/static/js/lib/ace/ace.min.js" type="text/javascript" charset="utf-8"></script>
|
||||||
<script src="plugin/klipper/static/js/lib/ace/theme-monokai.min.js" type="text/javascript" charset="utf-8"></script>
|
<script src="plugin/klipper/static/js/lib/ace/theme-monokai.min.js" type="text/javascript" charset="utf-8"></script>
|
||||||
<script src="plugin/klipper/static/js/lib/ace/mode-klipper_config.js" type="text/javascript"></script>
|
<script src="plugin/klipper/static/js/lib/ace/mode-klipper_config.js" type="text/javascript"></script>
|
||||||
<button class="btn btn-small" data-bind='click: loadLastSession'
|
<button class="btn btn-small" data-bind="click: loadLastSession"
|
||||||
title="Reloads the last changes">
|
title="Reloads the last changes">
|
||||||
<i class="fas fa-redo"></i> {{ _('Reload last changes') }}
|
<i class="fas fa-redo"></i> {{ _('Reload last changes') }}
|
||||||
</button>
|
</button>
|
||||||
<button class="btn btn-small" data-bind='click: reloadFromFile'>
|
<button class="btn btn-small" data-bind='click: reloadFromFile'>
|
||||||
<i class="fas fa-upload"></i></a> {{ _('Reload from file') }}
|
<i class="fas fa-upload"></i> {{ _('Reload from file') }}
|
||||||
</button>
|
</button>
|
||||||
<label class="inline"><input class="inline-checkbox" type="checkbox" data-bind="checked: settings.settings.plugins.klipper.configuration.parse_check"> {{ _('Check parsing on save') }}</label>
|
<label class="inline"><input class="inline-checkbox" type="checkbox" data-bind="checked: settings.settings.plugins.klipper.configuration.parse_check"> {{ _('Check parsing on save') }}</label>
|
||||||
|
|
||||||
|
<a href='#' data-bind="click: minusFontsize" class="fas fa-search-minus"></a>
|
||||||
|
<a href='#' data-bind="click: plusFontsize" class="fas fa-search-plus"></a>
|
||||||
<div class="conf-editor">
|
<div class="conf-editor">
|
||||||
<input id="hdnLoadKlipperConfig" type="hidden" data-bind="value: configBound(settings.settings.plugins.klipper.config)" />
|
<input id="hdnLoadKlipperConfig" type="hidden" data-bind="value: configBound(settings.settings.plugins.klipper.config)" />
|
||||||
<div id="plugin-klipper-config"></div>
|
<div id="plugin-klipper-config"></div>
|
||||||
|
|
Loading…
Reference in New Issue