Trim firmware card verbosity; Gitea repo URL becomes text+Edit once set
Build and push server image / build-and-push (push) Successful in 35s
Build and push server image / build-and-push (push) Successful in 35s
Dropped the paragraph explaining the release workflow builds the binaries -- not something the web UI needs to narrate. The repo URL field now shows as plain text with an Edit button once a value is saved, instead of always being an open input.
This commit is contained in:
@@ -116,11 +116,12 @@
|
|||||||
<input type="file" id="firmware-file" accept=".bin">
|
<input type="file" id="firmware-file" accept=".bin">
|
||||||
<button type="button" class="secondary" id="firmware-upload">Upload firmware</button>
|
<button type="button" class="secondary" id="firmware-upload">Upload firmware</button>
|
||||||
|
|
||||||
<p class="sub" style="margin-top: 16px;">Or check a Gitea repo's releases
|
<div id="firmware-repo-display" style="margin-top: 16px; {% if not cfg.firmware_update_repo_url %}display: none;{% endif %}">
|
||||||
automatically -- built by <code>.gitea/workflows/firmware-release-build.yml</code>,
|
<p class="sub">Gitea repo: <code id="firmware-repo-text">{{ cfg.firmware_update_repo_url }}</code>
|
||||||
one binary per board. The board above is learned from the frame
|
<button type="button" class="secondary" id="firmware-repo-edit-btn">Edit</button>
|
||||||
itself, never picked by hand.</p>
|
</p>
|
||||||
<label>Gitea repo URL
|
</div>
|
||||||
|
<label id="firmware-repo-edit" style="{% if cfg.firmware_update_repo_url %}display: none;{% endif %}">Gitea repo URL
|
||||||
<input type="text" id="firmware_update_repo_url" placeholder="https://git.example.com/owner/repo"
|
<input type="text" id="firmware_update_repo_url" placeholder="https://git.example.com/owner/repo"
|
||||||
value="{{ cfg.firmware_update_repo_url }}">
|
value="{{ cfg.firmware_update_repo_url }}">
|
||||||
</label>
|
</label>
|
||||||
@@ -213,10 +214,23 @@
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
function showRepoDisplayMode(url) {
|
||||||
|
document.getElementById('firmware-repo-text').textContent = url;
|
||||||
|
document.getElementById('firmware-repo-display').style.display = url ? 'block' : 'none';
|
||||||
|
document.getElementById('firmware-repo-edit').style.display = url ? 'none' : 'block';
|
||||||
|
}
|
||||||
|
|
||||||
|
document.getElementById('firmware-repo-edit-btn').addEventListener('click', () => {
|
||||||
|
document.getElementById('firmware-repo-display').style.display = 'none';
|
||||||
|
document.getElementById('firmware-repo-edit').style.display = 'block';
|
||||||
|
document.getElementById('firmware_update_repo_url').focus();
|
||||||
|
});
|
||||||
|
|
||||||
document.getElementById('firmware-settings-save').addEventListener('click', async () => {
|
document.getElementById('firmware-settings-save').addEventListener('click', async () => {
|
||||||
try {
|
try {
|
||||||
await saveConfig();
|
await saveConfig();
|
||||||
showStatus(true, 'Saved.');
|
showStatus(true, 'Saved.');
|
||||||
|
showRepoDisplayMode(document.getElementById('firmware_update_repo_url').value.trim());
|
||||||
loadFirmwareCheck();
|
loadFirmwareCheck();
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showStatus(false, e.message);
|
showStatus(false, e.message);
|
||||||
|
|||||||
Reference in New Issue
Block a user