✨ feat: add show editor buttons
This commit is contained in:
parent
c3c03fb3f8
commit
86096b8da0
|
@ -47,6 +47,15 @@ $(function () {
|
|||
});
|
||||
};
|
||||
|
||||
self.showEditorDialog = function () {
|
||||
if (!self.hasRight("CONFIG")) return;
|
||||
var editorDialog = $("#klipper_editor");
|
||||
editorDialog.modal({
|
||||
show: "true",
|
||||
backdrop: "static",
|
||||
});
|
||||
}
|
||||
|
||||
self.showLevelingDialog = function () {
|
||||
var dialog = $("#klipper_leveling_dialog");
|
||||
dialog.modal({
|
||||
|
|
|
@ -238,6 +238,16 @@ $(function () {
|
|||
});
|
||||
};
|
||||
|
||||
self.showEditor = function () {
|
||||
if (!self.klipperViewModel.hasRight("CONFIG")) return;
|
||||
|
||||
var editorDialog = $("#klipper_editor");
|
||||
editorDialog.modal({
|
||||
show: "true",
|
||||
backdrop: "static",
|
||||
});
|
||||
};
|
||||
|
||||
self.addMacro = function () {
|
||||
self.settings.settings.plugins.klipper.macros.push({
|
||||
name: "Macro",
|
||||
|
|
|
@ -235,6 +235,9 @@
|
|||
<button class="btn btn-small" data-bind="click: newFile" title="{{ _('Add new File') }}">
|
||||
<i class="far fa-file"></i> {{ _('New File') }}
|
||||
</button>
|
||||
<button class="btn btn-small" data-bind="click: showEditor" title="{{ _('Open last config') }}">
|
||||
<i class="fas fa-file-code"></i> {{ _('Show Editor') }}
|
||||
</button>
|
||||
<button class="btn btn-small" data-bind="click: listCfgFiles" title="{{ _('Refresh file list') }}">
|
||||
<i class="icon-refresh"></i> {{ _('Refresh Files') }}
|
||||
</button>
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
<label for="connection_printers" data-bind="css: {disabled: !connectionState.isErrorOrClosed()}, enable: connectionState.isErrorOrClosed() && loginState.isUser()">{{ _('Printer Profile') }}</label>
|
||||
<select id="connection_printers" data-bind="options: connectionState.printerOptions, optionsText: 'name', optionsValue: 'id', value: connectionState.selectedPrinter, css: {disabled: !connectionState.isErrorOrClosed()}, enable: connectionState.isErrorOrClosed() && loginState.isUser()"></select>
|
||||
<button class="btn btn-block" data-bind="click: connectionState.connect, text: connectionState.buttonText(), enable: loginState.isUser()">{{ _('Connect') }}</button>
|
||||
<button class="btn btn-block" data-bind="visible: $root.loginState.hasPermissionKo($root.access.permissions.PLUGIN_KLIPPER_CONFIG), click: function() {openOctoKlipperSettings('klipper-config');}">{{ _('Open Klipper config') }}</button>
|
||||
<button class="btn btn-block" title="{{ _('Open Editor') }}" data-bind="visible: $root.loginState.hasPermissionKo($root.access.permissions.PLUGIN_KLIPPER_CONFIG), click: showEditorDialog">{{ _('Open Editor') }}</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- ko if: settings.settings.plugins.klipper.configuration.shortStatus_sidebar -->
|
||||
|
|
|
@ -22,10 +22,15 @@
|
|||
<i class="fa icon-black fa-info-circle"></i> {{ _("Get Status") }}
|
||||
</button>
|
||||
<button class="btn btn-block btn-small"
|
||||
data-bind="visible: $root.loginState.hasPermissionKo($root.access.permissions.PLUGIN_KLIPPER_CONFIG), click: function() {openOctoKlipperSettings('klipper-config');}"
|
||||
title="{{ _('Open the Klipper configuration file') }}">
|
||||
data-bind="visible: $root.loginState.hasPermissionKo($root.access.permissions.PLUGIN_KLIPPER_CONFIG), click: openOctoKlipperSettings('klipper-basic')"
|
||||
title="{{ _('Open the OctoKlipper Settings') }}">
|
||||
{{ _("Open OctoKlipper Settings") }}
|
||||
</button>
|
||||
<button class="btn btn-block btn-small"
|
||||
data-bind="visible: $root.loginState.hasPermissionKo($root.access.permissions.PLUGIN_KLIPPER_CONFIG), click: showEditorDialog"
|
||||
title="{{ _('Show the Editor') }}">
|
||||
<i class="fa icon-black fa-file-code-o"></i>
|
||||
{{ _("Open Klipper config") }}
|
||||
{{ _("Show Editor") }}
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Reference in New Issue