Add audio parameter to player playlist and auto-mark deployment status
- api.py: include 'audio' (on/off) field in playlist JSON served to players, derived from the muted toggle in the manage playlist page - players.py: include 'audio' field in legacy player playlist builder - api.py: auto-flip deployment_status pending/deploying -> deployed when a player sends feedback (player is confirmed running) - players_list.html: poll deployment status for pending/failed badges so the players list live-updates once a player starts sending feedback - .dockerignore: exclude runtime data/ volume dir from build context
This commit is contained in:
@@ -279,9 +279,13 @@
|
||||
var POLL_INTERVAL = 5000; // 5 seconds
|
||||
var polling = false;
|
||||
|
||||
// Initial check: are there any "Deploying..." badges?
|
||||
var deployingBadges = document.querySelectorAll('.deploy-badge.deploying');
|
||||
if (deployingBadges.length > 0) {
|
||||
// Initial check: any badge that isn't yet "Deployed" yet (deploying,
|
||||
// pending, or failed). We keep polling so that players which send
|
||||
// feedback auto-transition from "pending" to "deployed".
|
||||
var activeBadges = document.querySelectorAll(
|
||||
'.deploy-badge.deploying, .deploy-badge.pending, .deploy-badge.failed'
|
||||
);
|
||||
if (activeBadges.length > 0) {
|
||||
polling = true;
|
||||
schedulePoll();
|
||||
}
|
||||
@@ -296,7 +300,7 @@
|
||||
fetch('{{ url_for("players.deployment_status") }}')
|
||||
.then(function(r) { return r.json(); })
|
||||
.then(function(data) {
|
||||
var anyDeploying = false;
|
||||
var anyActive = false;
|
||||
|
||||
for (var playerId in data) {
|
||||
if (!data.hasOwnProperty(playerId)) continue;
|
||||
@@ -314,19 +318,25 @@
|
||||
if (ds === 'deployed') {
|
||||
cell.innerHTML = '<span class="deploy-badge deployed" title="' + escapeHtml(msg) + '">\u2705 Deployed<span class="deploy-timestamp">' + ts + '</span></span>';
|
||||
} else if (ds === 'failed') {
|
||||
// Terminal state - no need to keep polling for this one
|
||||
cell.innerHTML = '<span class="deploy-badge failed deploy-tooltip" title="' + escapeHtml(msg) + '">\u274c Failed<span class="deploy-timestamp">' + ts + '</span></span>';
|
||||
} else if (ds === 'deploying') {
|
||||
anyDeploying = true;
|
||||
anyActive = true;
|
||||
if (!cell.querySelector('.deploying')) {
|
||||
cell.innerHTML = '<span class="deploy-badge deploying"><span class="spinner"></span>Deploying...</span>';
|
||||
}
|
||||
} else {
|
||||
// No deployment or not started (pending, null, etc.)
|
||||
// Don't set anyDeploying = false here — we only care about active deployments
|
||||
// pending / null - deployment not confirmed yet.
|
||||
// Keep polling: the player may start sending feedback,
|
||||
// which flips the status to "deployed" on the server.
|
||||
anyActive = true;
|
||||
if (!cell.querySelector('.pending')) {
|
||||
cell.innerHTML = '<span class="deploy-badge pending" title="Awaiting deployment">\u23f3 Pending</span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (anyDeploying) {
|
||||
if (anyActive) {
|
||||
schedulePoll();
|
||||
} else {
|
||||
polling = false;
|
||||
|
||||
Reference in New Issue
Block a user