updated player deploy and config
This commit is contained in:
@@ -315,6 +315,67 @@
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<!-- ── Web Link Card ─────────────────────────────────────────────────── -->
|
||||
<div class="card" style="margin-top: 20px;">
|
||||
<h2 style="margin-bottom: 15px; font-size: 18px; display: flex; align-items: center; gap: 0.5rem;">
|
||||
🌐 Add Web Page Link
|
||||
</h2>
|
||||
<p style="color: #6c757d; font-size: 13px; margin-bottom: 16px;">
|
||||
Add a website URL to display on the player (e.g. a dashboard, live feed, or any public web page).
|
||||
</p>
|
||||
|
||||
<form id="weblink-form" method="POST" action="{{ request.script_root }}/content/add-weblink">
|
||||
<div style="display: grid; grid-template-columns: 1fr 1fr; gap: 16px;">
|
||||
|
||||
<!-- URL -->
|
||||
<div class="form-group" style="grid-column: 1 / -1;">
|
||||
<label for="wl-url">Web Page URL <span style="color:#e53e3e;">*</span></label>
|
||||
<input type="url" id="wl-url" name="url" class="form-control"
|
||||
placeholder="https://example.com" required>
|
||||
<small style="color:#6c757d; font-size:11px;">Must start with http:// or https://</small>
|
||||
</div>
|
||||
|
||||
<!-- Description -->
|
||||
<div class="form-group">
|
||||
<label for="wl-description">Label / Description</label>
|
||||
<input type="text" id="wl-description" name="description" class="form-control"
|
||||
placeholder="e.g. Live Dashboard">
|
||||
<small style="color:#6c757d; font-size:11px;">Optional — shown in the media library</small>
|
||||
</div>
|
||||
|
||||
<!-- Duration -->
|
||||
<div class="form-group">
|
||||
<label for="wl-duration">Display Duration (seconds)</label>
|
||||
<input type="number" id="wl-duration" name="duration" class="form-control"
|
||||
value="30" min="5" max="3600">
|
||||
<small style="color:#6c757d; font-size:11px;">How long to show the page per loop</small>
|
||||
</div>
|
||||
|
||||
<!-- Playlist -->
|
||||
<div class="form-group" style="grid-column: 1 / -1;">
|
||||
<label for="wl-playlist">Add to Playlist (Optional)</label>
|
||||
<select id="wl-playlist" name="playlist_id" class="form-control">
|
||||
<option value="">-- Media Library Only --</option>
|
||||
{% for playlist in playlists %}
|
||||
<option value="{{ playlist.id }}">
|
||||
{{ playlist.name }} ({{ playlist.orientation }}) — {{ playlist.content_count }} items
|
||||
</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div style="display:flex; align-items:center; gap:12px; margin-top:8px;">
|
||||
<button type="submit" class="btn-upload" id="wl-submit-btn"
|
||||
style="display:inline-flex; align-items:center; gap:0.5rem; padding:10px 24px;">
|
||||
🌐 Add Web Link
|
||||
</button>
|
||||
<span id="wl-status" style="font-size:13px; display:none;"></span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
<script>
|
||||
@@ -509,6 +570,43 @@
|
||||
uploadBtn.disabled = true;
|
||||
uploadBtn.innerHTML = '⏳ Uploading...';
|
||||
});
|
||||
// ── Web Link form — AJAX submit ────────────────────────────────────────
|
||||
const wlForm = document.getElementById('weblink-form');
|
||||
const wlBtn = document.getElementById('wl-submit-btn');
|
||||
const wlStatus = document.getElementById('wl-status');
|
||||
|
||||
wlForm.addEventListener('submit', async (e) => {
|
||||
e.preventDefault();
|
||||
wlBtn.disabled = true;
|
||||
wlBtn.textContent = '⏳ Adding…';
|
||||
wlStatus.style.display = 'none';
|
||||
|
||||
try {
|
||||
const resp = await fetch(wlForm.action, {
|
||||
method: 'POST',
|
||||
headers: { 'X-Requested-With': 'XMLHttpRequest' },
|
||||
body: new FormData(wlForm),
|
||||
});
|
||||
const data = await resp.json();
|
||||
|
||||
if (data.success) {
|
||||
wlStatus.style.color = '#38a169';
|
||||
wlStatus.textContent = '✓ ' + data.message;
|
||||
wlForm.reset();
|
||||
document.getElementById('wl-duration').value = 30;
|
||||
} else {
|
||||
wlStatus.style.color = '#e53e3e';
|
||||
wlStatus.textContent = '✗ ' + (data.error || 'Failed to add web link.');
|
||||
}
|
||||
} catch (err) {
|
||||
wlStatus.style.color = '#e53e3e';
|
||||
wlStatus.textContent = '✗ Network error — please try again.';
|
||||
}
|
||||
|
||||
wlStatus.style.display = 'inline';
|
||||
wlBtn.disabled = false;
|
||||
wlBtn.innerHTML = '🌐 Add Web Link';
|
||||
});
|
||||
</script>
|
||||
|
||||
{% endblock %}
|
||||
|
||||
Reference in New Issue
Block a user