add log path entry to config
This commit is contained in:
parent
a3a4202b00
commit
0141b5e130
|
@ -73,6 +73,7 @@ class KlipperPlugin(
|
||||||
),
|
),
|
||||||
configuration = dict(
|
configuration = dict(
|
||||||
path="~/printer.cfg",
|
path="~/printer.cfg",
|
||||||
|
logpath="/tmp/klippy.log",
|
||||||
reload_command="RESTART"
|
reload_command="RESTART"
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
@ -290,7 +291,7 @@ class KlipperPlugin(
|
||||||
def on_api_command(self, command, data):
|
def on_api_command(self, command, data):
|
||||||
if command == "listLogFiles":
|
if command == "listLogFiles":
|
||||||
files = []
|
files = []
|
||||||
for f in glob.glob("/tmp/*.log*"):
|
for f in glob.glob(self._settings.get(["configuration", "logpath"]) + "*"):
|
||||||
filesize = os.path.getsize(f)
|
filesize = os.path.getsize(f)
|
||||||
files.append(dict(
|
files.append(dict(
|
||||||
name=os.path.basename(f) + " ({:.1f} KB)".format(filesize / 1000.0),
|
name=os.path.basename(f) + " ({:.1f} KB)".format(filesize / 1000.0),
|
||||||
|
|
|
@ -26,6 +26,12 @@
|
||||||
<input type="text" class="input-block-level" data-bind="value: settings.settings.plugins.klipper.configuration.path">
|
<input type="text" class="input-block-level" data-bind="value: settings.settings.plugins.klipper.configuration.path">
|
||||||
</div>
|
</div>
|
||||||
</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">
|
<div class="control-group">
|
||||||
<label class="control-label">{{ _('Configuration Reload Command') }}</label>
|
<label class="control-label">{{ _('Configuration Reload Command') }}</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
|
|
Loading…
Reference in New Issue