add log path entry to config

This commit is contained in:
Schnello 2019-03-13 12:52:14 +01:00 committed by Alice Grey
parent a3a4202b00
commit 0141b5e130
2 changed files with 8 additions and 1 deletions

View File

@ -73,6 +73,7 @@ class KlipperPlugin(
),
configuration = dict(
path="~/printer.cfg",
logpath="/tmp/klippy.log",
reload_command="RESTART"
)
)
@ -290,7 +291,7 @@ class KlipperPlugin(
def on_api_command(self, command, data):
if command == "listLogFiles":
files = []
for f in glob.glob("/tmp/*.log*"):
for f in glob.glob(self._settings.get(["configuration", "logpath"]) + "*"):
filesize = os.path.getsize(f)
files.append(dict(
name=os.path.basename(f) + " ({:.1f} KB)".format(filesize / 1000.0),

View File

@ -26,6 +26,12 @@
<input type="text" class="input-block-level" data-bind="value: settings.settings.plugins.klipper.configuration.path">
</div>
</div>
<div class="control-group">
<label class="control-label">{{ _('Klipper Log Path') }}</label>
<div class="controls">
<input type="text" class="input-block-level" data-bind="value: settings.settings.plugins.klipper.configuration.logpath">
</div>
</div>
<div class="control-group">
<label class="control-label">{{ _('Configuration Reload Command') }}</label>
<div class="controls">