Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions web/i18n/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,9 @@
"Preview": {
"other": "Vorschau"
},
"Auto Render Preview": {
"other": "Vorschau automatisch rendern"
},
"Last Rendered:": {
"other": "Zuletzt gerendert:"
},
Expand Down
3 changes: 3 additions & 0 deletions web/i18n/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -722,6 +722,9 @@
"Preview": {
"other": "Preview"
},
"Auto Render Preview": {
"other": "Auto Render Preview"
},
"Last Rendered:": {
"other": "Last Rendered:"
},
Expand Down
10 changes: 10 additions & 0 deletions web/templates/manager/configapp.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,12 @@ <h1>{{ t .Localizer "Configuring" }} {{ .App.Iname }} ({{ .App.Name }})</h1>
height="64">
<div class="skeleton-loader"></div>
</div>
<div style="text-align:center; margin:8px 0;">
<label style="cursor:pointer; user-select:none; font-size:0.9em;">
Comment on lines +60 to +61
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

To improve maintainability and adhere to the best practice of separating concerns, it's better to avoid using inline styles. Please move these styles into a dedicated CSS class within your stylesheet (e.g., configapp-simple.css).

You could define classes like these:

.auto-render-preview {
  text-align: center;
  margin: 8px 0;
}

.auto-render-preview-label {
  cursor: pointer;
  user-select: none;
  font-size: 0.9em;
}
Suggested change
<div style="text-align:center; margin:8px 0;">
<label style="cursor:pointer; user-select:none; font-size:0.9em;">
<div class="auto-render-preview">
<label class="auto-render-preview-label">

<input type="checkbox" id="autoRefreshPreview" checked>
{{ t .Localizer "Auto Render Preview" }}
</label>
</div>
{{ if .AppMetadata }}
<div class="app-metadata">
{{ if .AppMetadata.Summary }}
Expand Down Expand Up @@ -733,6 +739,10 @@ <h3 style="color: var(--danger-text);">{{ t .Localizer "Unpin App" }}</h3>

if (configContentPre) configContentPre.textContent = JSON.stringify(config, null, 2);

// Skip rendering if auto-refresh is disabled
const autoRefresh = document.getElementById("autoRefreshPreview");
if (autoRefresh && !autoRefresh.checked) return;

// Trigger backend preview (POST to update ephemeral, then GET with config param)
previewApp('{{ .Device.ID }}', '{{ .App.Iname }}', config, null, null)
.then(() => {
Expand Down
Loading