Skip to content

Commit

Permalink
Make logo configurable
Browse files Browse the repository at this point in the history
This patch allows users to configure a logo each for the different
display states.
  • Loading branch information
lkiesow committed Feb 1, 2024
1 parent 7c2aea7 commit bf32a1a
Show file tree
Hide file tree
Showing 5 changed files with 101 additions and 2 deletions.
2 changes: 1 addition & 1 deletion assets/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
</head>
<body>

<img id=logo src=assets/virtuos-logo.png />
<img id=logo />
<div id=text></div>

</body>
Expand Down
7 changes: 7 additions & 0 deletions assets/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,16 @@ function updateTimer() {
.then(capturing => {
console.debug('capturing', capturing)
const active = capturing ? config.capturing : config.idle;

// Update text
document.getElementById('text').innerText = active.text;

// Update colors
const body = document.getElementsByTagName('body')[0];
body.style.backgroundColor = active.background;
body.style.color = active.color;

// Update logo
document.getElementById('logo').src = active.image.replace(/\s/g, '');
})
}
Binary file removed assets/virtuos-logo.png
Binary file not shown.
1 change: 1 addition & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ type DisplayConfig struct {
Text string `json:"text"`
Color string `json:"color"`
Background string `json:"background"`
Image string `json:"image"`
}

type Config struct {
Expand Down
93 changes: 92 additions & 1 deletion opencast-ca-display.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,107 @@ opencast:
# Capture agent to show the status for
agent: test

# display configuration
# Display configuration
# Each state configuration contains four fields:
# - text: The text to display in that state
# - color: The text color
# - background: The background color
# - image: A logo to display. This can be a URL or a base64 encoded image
display:
capturing:
text: Aufzeichnung läuft
color: white
background: '#ac0634'
image: >
data:image/png;base64,
iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAABKVBMVEX////b
///3//+s//+s//OsjG2sITSsBjSsVUSsyqG8///f//+s/9SscVisLDSs//Dz
///O///A///+//+s/+3D//+slnesCTSs5rm1//+s/87i//+s98fm//+sEDSs
WETH//+salLp///w//+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Wv4ayl9JAoSEucsCLPeO97HFzbgdH2G0339T/6
2ckdmwZhW27DD/x7xdIHUX5o+4OchqLO8SMz6jupINrLY1QdZJwn8y6viSQD
4yC82zNlOJogcuEEgoi/+av94EDPGSvJQYv2D/ihTRFZfMDsJA9S9j9kVvwg
/eD9ZZoDH4Plsvr12wkUtUvZdEocT3yHxgdxfqsWlOafqNWiz3K/5u/9C81W
FpUnumvJ6te607X1TbOU4+qvyGt5T2y8INRo07Qd7btz9nlkneSrZrR3xBok
3mer5jkY+yB7m/dPkj7IDzse91dOO6p8MlrFP6NDmtsLtR8f5Fe8HHwsi/ry
aX9UnNMXfyfJwdifwIRMCDLpQ9J1Js+/rSn/arrF1htNMWvFH7wq9KoYH2Q5
eN2O5jlQ18b6lTHlUidUnEoWY+ir1wP/shsfhJXkD9T8F6LhZ1F7qquOpHu5
HrhVPXVWTkn97VSgt/62FZZY0/33iOhe/l+Lb5X8k000WMtkiZpKH0S9QSaT
OeiRdiQV+jtsszv4S0ehWoGoej5se96jOgMAAAAAAAAAAAAAAAAAAAAAuBD/
AO9hftIMDgN8AAAAAElFTkSuQmCC
idle:
text: Keine Aufzeichnung
color: black
background: white
image: >
data:image/png;base64,
iVBORw0KGgoAAAANSUhEUgAAAMgAAADICAMAAACahl6sAAAC2VBMVEWsBjS5
LVOxFUDLY4DgobLv0Nn57/L////+/Pz04OXpvsrZjqPCSWq4KlHQc4zjrLvy
2N/47PDfobOyGELVgpncl6q9OV7BRGevEDz57PDgo7TARGasBzWtCzjObYju
zdb//f389vjmtsPEUHDjrr23KVDlsb+uDTq2JU2sCDbblan79PbMaIT89/j0
3+W/P2Ly2uHdnK7Xip+1IUrx2N/HV3bCSmyzHkfKYX7sx9Houcb35+z35+uv
Ej3w1d3blKjls8G6MVfYjKHETm/QcoznuMXMZoK9Ol66L1bDTG3UgJf03uT7
8vW0H0n25Onbk6fXh52zGkW+PGD78/XMZ4PrxM/clandmay0IUrksb/GVnXp
vMnz3ePXiZ7w0dr68vS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OFsh7xlrihvWKMRERzQ+
GGukDuhJ27uRn3p+izXdtqk4t1i+05KhNr1ciHtrbOIAb2TztuHZwUf/OSIj
bK88oK7dti/ul3z266pm60yaf9sZes/rfda70pFqPTsNaV/XElL7e5Q2/FSa
f4+spFz+r0VResjN9mzc3jXalThjwh+ybVHjPl+Xy+X60+fO9CjG+Gv5fn9N
bdf+Ja02rbN0Tm63v7bb1/63qhYAAAAAAAAAAAAAAAAAAAAAAAAAAIDY8w9T
Gxe/25sMhQAAAABJRU5ErkJggg==
# IP address and port to bind to
listen: 127.0.0.1:8080

0 comments on commit bf32a1a

Please sign in to comment.