Disable user display if access control is disabled

Also show something more human friendly if the active user for a print
job is the "_api" user of the global api key.
This commit is contained in:
Gina Häußge committed 2018-04-27 11:53:49 +02:00
1 parent b2996f10ff
commit 3ebb36f877
2 files changed
+10

No files matched your search

@@ -170,6 +170,14 @@ $(function() {
self.userString = ko.pureComputed(function() {
var user = self.user();
if (!CONFIG_ACCESS_CONTROL || user === "_dummy") {
return "";
}
if (user === "_api") {
user = "API client";
}
var file = self.filename();
return (user ? user : (file ? "-" : ""));
});
@@ -1,7 +1,9 @@
<span title="{{ _('Current printer state') }}">{{ _('State') }}</span>: <strong data-bind="text: stateString"></strong><br>
<hr>
<span title="{{ _('Name of file currently selected for printing') }}">{{ _('File') }}</span>: <strong data-bind="text: filedisplay, attr: {title: filepath}"></strong>&nbsp;<strong data-bind="visible: sd">(SD)</strong><br>
<!-- ko if: userString -->
<span title="{{ _('User who selected this file for printing') }}">{{ _('User') }}</span>: <strong data-bind="text: userString"></strong><br>
<!-- /ko -->
<span title="{{ _('Current timelapse configuration') }}">{{ _('Timelapse') }}</span>: <strong data-bind="text: timelapseString"></strong><br>
<!-- ko foreach: filament -->
<span data-bind="text: 'Filament (' + name() + '): ', title: 'Filament usage for ' + name()"></span><strong data-bind="text: formatFilament(data())"></strong><br>