views: Beautify
This commit is contained in:
parent
b5411c26fc
commit
f6556f6e3d
|
@ -11,7 +11,7 @@ class KlipperPlugin(
|
|||
octoprint.plugin.SettingsPlugin,
|
||||
octoprint.plugin.AssetPlugin):
|
||||
|
||||
_parsingReturn = False
|
||||
_parsingResponse = False
|
||||
_message = ""
|
||||
|
||||
#-- Startupt Plugin
|
||||
|
@ -69,11 +69,11 @@ class KlipperPlugin(
|
|||
|
||||
def on_parse_gcode(self, comm, line, *args, **kwargs):
|
||||
if "//" in line:
|
||||
self._parsingReturn = True
|
||||
self._message = self._message + line.strip('/')
|
||||
self._parsingResponse = True
|
||||
self._message = self._message + line.strip('/') + "<br/>"
|
||||
else:
|
||||
if self._parsingReturn:
|
||||
self._parsingReturn = False
|
||||
if self._parsingResponse:
|
||||
self._parsingResponse = False
|
||||
self.logInfo(self._message)
|
||||
self._message = ""
|
||||
if "!!" in line:
|
||||
|
@ -88,7 +88,7 @@ class KlipperPlugin(
|
|||
self._plugin_manager.send_plugin_message(
|
||||
self._identifier,
|
||||
dict(
|
||||
time=datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
|
||||
time=datetime.datetime.now().strftime("%H:%M:%S"),
|
||||
type="info", message=message)
|
||||
)
|
||||
|
||||
|
@ -96,7 +96,7 @@ class KlipperPlugin(
|
|||
self._plugin_manager.send_plugin_message(
|
||||
self._identifier,
|
||||
dict(
|
||||
time=datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S"),
|
||||
time=datetime.datetime.now().strftime("%H:%M:%S"),
|
||||
type="error",
|
||||
message=error)
|
||||
)
|
||||
|
|
|
@ -1,9 +1,3 @@
|
|||
#tab_plugin_klipper iframe {
|
||||
width: 100%;
|
||||
height: 600px;
|
||||
border: 1px solid #808080;
|
||||
}
|
||||
|
||||
.plugin_klipper_log {
|
||||
padding: 0.5em;
|
||||
overflow-y: scroll;
|
||||
|
@ -14,9 +8,13 @@
|
|||
}
|
||||
|
||||
.plugin_klipper_log .log-item {
|
||||
margin: 0 auto 0.5em auto;
|
||||
margin: 0 auto 0 auto;
|
||||
}
|
||||
|
||||
.plugin_klipper_log .error {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.clear-btn {
|
||||
margin-top: 6px;
|
||||
}
|
|
@ -9,7 +9,7 @@
|
|||
<div class="controls">
|
||||
<div class="input-append">
|
||||
<input type="text" class="input-block-level span2" data-bind="value: heaterIndex">
|
||||
<span class="add-on">number</span>
|
||||
<span class="add-on">index</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -25,7 +25,7 @@
|
|||
<label class="control-label">The result of the tuning cycle is reported in the terminal.</label>
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<button class="btn btn-block" data-bind="click: startTuning" data-dismiss="modal">Start Tuning</button>
|
||||
<button class="btn btn-block" data-bind="click: startTuning" data-dismiss="modal"><i class="icon-fire"></i> Start Tuning</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<button class="btn btn-block" data-bind="click: connectionState.connect, text: connectionState.buttonText(), enable: loginState.isUser()">{{ _('Connect') }}</button>
|
||||
<hr>
|
||||
<div>
|
||||
<label>Macros</label>
|
||||
<label><i class="icon-list-alt"></i> Macros</label>
|
||||
<div data-bind="foreach: settings.settings.plugins.klipper.macros">
|
||||
<!-- ko if: sidebar -->
|
||||
<button class="btn btn-block" data-bind="text: name, click: $parent.executeMacro, enable: $parent.isActive()"></button>
|
||||
|
|
|
@ -1,32 +1,33 @@
|
|||
<div class="row-fluid">
|
||||
<div class="span8">
|
||||
<label>Messages</label>
|
||||
<label><i class="icon-tasks"></i> Messages</label>
|
||||
<div class="plugin_klipper_log" data-bind="foreach: logMessages">
|
||||
<div class="log-item"><i data-bind="text: time"></i> <span data-bind="text: msg, css: type"></span></div>
|
||||
<div class="log-item"><i data-bind="text: time"></i>: <span data-bind="html: msg, css: type"></span></div>
|
||||
</div>
|
||||
<a href="#" data-bind="click: onClearLog" class="fa fa-trash" alt="Clear"></a>
|
||||
|
||||
<button class="btn btn-mini pull-right clear-btn" data-bind="click: onClearLog, enable: isActive()"><i class="fa fa-trash"></i> Clear</button>
|
||||
</div>
|
||||
<div class="span4">
|
||||
<div class="control-group">
|
||||
<div class="controls">
|
||||
<label class="control-label"> </label>
|
||||
<button class="btn btn-block" data-bind="click: onGetStatus, enable: isActive()">Status</button>
|
||||
<button class="btn btn-block" data-bind="click: onGetStatus, enable: isActive()"><i class="fa icon-black fa-info-circle"></i> Status</button>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<hr>
|
||||
<label class="control-label">Restart</label>
|
||||
<button class="btn btn-block" data-bind="click: onRestartHost, enable: isActive()"><i class="fa fa-repeat"></i> Host</button>
|
||||
<button class="btn btn-block" data-bind="click: onRestartFirmware, enable: isActive()"><i class="fa fa-repeat"></i> MCU</button>
|
||||
<label class="control-label"><i class="icon-refresh"></i> Restart</label>
|
||||
<button class="btn btn-block" data-bind="click: onRestartHost, enable: isActive()">Host</button>
|
||||
<button class="btn btn-block" data-bind="click: onRestartFirmware, enable: isActive()">MCU</button>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<hr>
|
||||
<label class="control-label">Tools</label>
|
||||
<label class="control-label"><i class="icon-wrench"></i> Tools</label>
|
||||
<button class="btn btn-block" data-bind="click: showLevelingDialog, enable: isActive()">Assisted Bed Leveling</button>
|
||||
<button class="btn btn-block" data-bind="click: showPidTuningDialog, enable: isActive()">PID Tuning</button>
|
||||
</div>
|
||||
<div class="controls">
|
||||
<hr>
|
||||
<label class="control-label">Macros</label>
|
||||
<label class="control-label"><i class="icon-list-alt"></i> Macros</label>
|
||||
<div data-bind="foreach: settings.settings.plugins.klipper.macros">
|
||||
<!-- ko if: tab -->
|
||||
<button class="btn btn-block" data-bind="text: name, click: $parent.executeMacro, enable: $parent.isActive()"></button>
|
||||
|
|
Loading…
Reference in New Issue