💄 (settings): add text for path

- add text to the config file list,
to show the path to the configs
- set y position for the left side of the main tab -5px,
to be in aligment of the right buttons
This commit is contained in:
thelastWallE 2021-10-31 12:51:24 +01:00
parent ef05c3e271
commit 12da59d178
4 changed files with 10 additions and 2 deletions

View File

@ -551,7 +551,10 @@ class KlipperPlugin(
@Permissions.PLUGIN_KLIPPER_CONFIG.require(403)
def list_configs(self):
files = cfgUtils.list_cfg_files(self, "")
return flask.jsonify(files = files, max_upload_size = MAX_UPLOAD_SIZE)
path = os.path.expanduser(
self._settings.get(["configuration", "configpath"])
)
return flask.jsonify(files = files, path = path, max_upload_size = MAX_UPLOAD_SIZE)
# check syntax of a given data
@octoprint.plugin.BlueprintPlugin.route("/config/check", methods=["POST"])

View File

@ -97,6 +97,7 @@ ul#klipper-settings {
#tab_plugin_klipper_main #left-side {
flex: 3 1;
padding-right: 10px;
padding-top: 5px;
}
#tab_plugin_klipper_main .span8 label {

View File

@ -30,6 +30,7 @@ $(function () {
});
self.markedForFileRemove = ko.observableArray([]);
self.PathToConfigs = ko.observable("");
$(document).on('shown.bs.modal','#klipper_editor', function () {
self.klipperEditorViewModel.onShown();
@ -84,6 +85,7 @@ $(function () {
OctoPrint.plugins.klipper.listCfg().done(function (response) {
self.klipperViewModel.consoleMessage("debug", "listCfgFiles done");
self.configs.updateItems(response.files);
self.PathToConfigs("Path: "+ response.path);
self.configs.resetPage();
});
};

View File

@ -262,7 +262,9 @@
<i class="icon-refresh"></i> {{ _('Refresh Files') }}
</button>
<button class="btn btn-small"
data-bind="click: removeMarkedFiles, enable: markedForFileRemove().length > 0">{{ _('Delete selected') }}</button>
data-bind="click: removeMarkedFiles, enable: markedForFileRemove().length > 0">{{ _('Delete selected') }}
</button>
<p class="klipper-inline" data-bind="text: PathToConfigs" title="{{ _('Path to the config files.')}}"></p>
</div>
<div class="pull-right">
<div class="btn-group">