mirror of
https://github.com/screentinker/screentinker.git
synced 2026-08-13 13:53:12 -06:00
Label BrightSign players as BrightSign, not "Web Player"
A BrightSign runs the same web player, so client_type is 'player' and the device
detail view fell through to a hardcoded "Web Player" — indistinguishable from a
browser tab on someone's desk, for a dedicated signage appliance.
Keyed on the platform the player now reports ('brightsign', from the
?platform=brightsign the host puts on the URL), with a user-agent fallback for
panels paired before that existed — those registered as "Chrome 120" with a
BrightSign user agent.
Only en carries the new string; other locales fall back to en, which reads
correctly since the label is a brand name.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Uaeo9MvzKoyXuN6ZsbhtkL
This commit is contained in:
parent
b15b17f5dd
commit
ad18914736
|
|
@ -472,6 +472,7 @@ export default {
|
||||||
'device.info.size_free': '{size} free',
|
'device.info.size_free': '{size} free',
|
||||||
'device.info.player_type': 'Player Type',
|
'device.info.player_type': 'Player Type',
|
||||||
'device.info.web_player': 'Web Player',
|
'device.info.web_player': 'Web Player',
|
||||||
|
'device.info.brightsign_player': 'BrightSign',
|
||||||
'device.info.wifi': 'WiFi',
|
'device.info.wifi': 'WiFi',
|
||||||
'device.info.uptime': 'Uptime',
|
'device.info.uptime': 'Uptime',
|
||||||
'device.info.android_version': 'Android Version',
|
'device.info.android_version': 'Android Version',
|
||||||
|
|
|
||||||
|
|
@ -83,6 +83,17 @@ function renderDeviceClock(device) {
|
||||||
return `${tz}${local ? `<div style="font-size:11px;color:var(--text-muted)">${t('device.clock.reported', { time: local })}</div>` : ''}${warn}`;
|
return `${tz}${local ? `<div style="font-size:11px;color:var(--text-muted)">${t('device.clock.reported', { time: local })}</div>` : ''}${warn}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// A BrightSign runs the same web player, so client_type is 'player' and it would otherwise read as
|
||||||
|
// "Web Player" — indistinguishable from a browser tab on someone's desk. The player reports
|
||||||
|
// platform 'brightsign' (autorun.brs puts ?platform=brightsign on the URL); the user-agent check
|
||||||
|
// covers panels paired before that existed, which registered as "Chrome 120" with a BrightSign UA.
|
||||||
|
function isBrightSignDevice(device) {
|
||||||
|
if (!device) return false;
|
||||||
|
const platform = String(device.platform || '').toLowerCase();
|
||||||
|
if (platform.includes('brightsign')) return true;
|
||||||
|
return String(device.user_agent || '').toLowerCase().includes('brightsign');
|
||||||
|
}
|
||||||
|
|
||||||
export function render(container, deviceId) {
|
export function render(container, deviceId) {
|
||||||
container.innerHTML = `
|
container.innerHTML = `
|
||||||
<div class="device-detail">
|
<div class="device-detail">
|
||||||
|
|
@ -341,7 +352,7 @@ async function loadDevice(deviceId, activeTab = null) {
|
||||||
` : `
|
` : `
|
||||||
<div class="info-card">
|
<div class="info-card">
|
||||||
<div class="info-card-label">${t('device.info.player_type')}</div>
|
<div class="info-card-label">${t('device.info.player_type')}</div>
|
||||||
<div class="info-card-value small">${t('device.info.web_player')}</div>
|
<div class="info-card-value small">${isBrightSignDevice(device) ? t('device.info.brightsign_player') : t('device.info.web_player')}</div>
|
||||||
</div>
|
</div>
|
||||||
`}
|
`}
|
||||||
${device.android_version && !device.android_version.startsWith('Web/') ? `
|
${device.android_version && !device.android_version.startsWith('Web/') ? `
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue