Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
AURA
dashboard-clock
Commits
e91907b1
Commit
e91907b1
authored
Aug 28, 2020
by
david
Browse files
Adaptation to API.
#1
parent
14b8535f
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/StudioClock.svelte
View file @
e91907b1
...
...
@@ -3,7 +3,7 @@
<script>
import
{
onMount
}
from
'
svelte
'
;
export
let
css
=
""
;
export
let
api
=
"
http://localhost:
3333
/api/v1
"
;
export
let
api
=
"
http://localhost:
8008
/api/v1
"
;
export
let
name
=
"
Studio Clock
"
;
export
let
logo
=
"
https://gitlab.servus.at/aura/meta/-/raw/master/images/aura-logo.png
"
;
export
let
logosize
=
"
100px
"
;
...
...
@@ -75,13 +75,13 @@
loadExternalCss
(
rootElement
,
css
);
/* Set currently loaded data */
if
(
currentTrack
==
null
&&
info
!=
null
&&
info
.
track
!=
null
)
{
if
(
currentTrack
==
null
&&
info
!=
null
&&
info
.
current_
track
!=
null
)
{
currentTrack
=
info
;
let
t
=
time
-
Date
.
parse
(
info
.
track_start
);
let
t
=
time
-
Date
.
parse
(
info
.
current_track
.
track_start
);
t
=
parseInt
(
t
/
1000
);
timeLeft
=
info
.
track
.
duration
-
t
-
3
;
/* FIXME improve timings in coordination with scheduler/trackservice/LQS */
timeLeft
=
info
.
current_track
.
track_
duration
-
t
-
3
;
/* FIXME improve timings in coordination with scheduler/trackservice/LQS */
console
.
log
(
"
Current Data
"
,
info
);
}
return
""
;
...
...
@@ -90,9 +90,9 @@
function
displayTitle
(
track
)
{
if
(
track
!=
null
)
{
let
artist
=
""
;
if
(
track
.
artist
!=
""
)
artist
=
track
.
artist
+
"
-
"
;
return
artist
+
track
.
title
;
if
(
track
.
track_
artist
!=
""
)
artist
=
track
.
track_
artist
+
"
-
"
;
return
artist
+
track
.
track_
title
;
}
return
""
;
}
...
...
@@ -112,12 +112,12 @@
return
""
;
}
function
displayShowName
(
s
how
)
{
function
displayShowName
(
s
chedule
)
{
let
name
=
""
if
(
s
how
==
null
||
show
.
name
==
null
)
{
if
(
s
chedule
==
null
||
schedule
.
show
_
name
==
null
)
{
name
=
'
<span class="error">
'
+
noScheduleMessage
+
'
</span>
'
;
}
else
{
name
=
show
.
name
;
name
=
schedule
.
show
_
name
;
}
return
name
;
}
...
...
@@ -153,7 +153,7 @@
}
function
isActive
(
entry
,
currentTrack
)
{
if
(
currentTrack
!=
null
&&
entry
.
id
==
currentTrack
.
id
)
{
if
(
currentTrack
!=
null
&&
entry
.
track_num
==
currentTrack
.
track_num
)
{
// Scroll to current playlist entry
location
.
hash
=
"
#current-playlist-entry
"
;
return
true
;
...
...
@@ -339,9 +339,9 @@
stroke
:
rgb
(
180
,
0
,
0
);
}
.second-counterweight
{
/*
stroke-width: 3;
*/
}
/*
.second-counterweight {
stroke-width: 3;
}
*/
footer
{
width
:
100%
;
...
...
@@ -429,19 +429,19 @@
{:then value}
{initComponent(value)}
{#if value.current
.show
}
{#if value.current
_schedule
}
<div
id=
"current-schedule"
>
<h1
class=
"schedule-title"
>
{@html displayShowName(value.current
.show
)} {displayShowSchedule(value.current)}
</h1>
<h1
class=
"schedule-title"
>
{@html displayShowName(value.current
_schedule
)} {displayShowSchedule(value.current
_schedule
)}
</h1>
<!-- <div class="schedule-details">
<b>Type:</b> {value.current
.show.typ
e}, <b>Host:</b> {value.current
.show.host
}</div>-->
<b>Type:</b> {value.current
_schedul
e}, <b>Host:</b> {value.current
_schedule
}</div>-->
</div>
<div
id=
"playlist"
>
{#if value.current
.
playlist}
{#if value.current
_
playlist}
<ol>
{#each value.current
.
playlist.entries as entry, index}
{#if isActive(entry, value.track)}
{#each value.current
_
playlist.entries as entry, index}
{#if isActive(entry, value.
current_
track)}
<li
id=
"current-playlist-entry"
class=
"playlist-entry is-active"
>
<!-- <span class="play-icon">▶</span> -->
...
...
@@ -471,7 +471,7 @@
{/if}
</div>
<div
id=
"next-schedule"
>
<h3
class=
"schedule-title"
>
Next: {@html displayShowName(value.next
.show
)} {displayShowSchedule(value)}
</h3>
<h3
class=
"schedule-title"
>
Next: {@html displayShowName(value.next
_schedule
)} {displayShowSchedule(value)}
</h3>
</div>
{/if}
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment