Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
aura-engine
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lars Kruse
aura-engine
Commits
f424e8fa
Commit
f424e8fa
authored
5 years ago
by
David Trattnig
Browse files
Options
Downloads
Patches
Plain Diff
Basic rendering of tracks.
parent
0a506deb
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
contrib/aura-player/README.md
+6
-1
6 additions, 1 deletion
contrib/aura-player/README.md
contrib/aura-player/src/App.svelte
+16
-29
16 additions, 29 deletions
contrib/aura-player/src/App.svelte
contrib/aura-player/src/TrackService.svelte
+7
-4
7 additions, 4 deletions
contrib/aura-player/src/TrackService.svelte
with
29 additions
and
34 deletions
contrib/aura-player/README.md
+
6
−
1
View file @
f424e8fa
...
@@ -17,4 +17,9 @@ Provided components:
...
@@ -17,4 +17,9 @@ Provided components:
## Run
## Run
npm start
npm start
\ No newline at end of file
## Resources
*
Svelte Docs - https://svelte.dev/docs
\ No newline at end of file
This diff is collapsed.
Click to expand it.
contrib/aura-player/src/App.svelte
+
16
−
29
View file @
f424e8fa
<script>
<script>
import
TrackService
from
'
./TrackService.svelte
'
;
import
TrackService
from
'
./TrackService.svelte
'
;
let
query
=
"
trackservice
/3
"
;
let
query
Trackservice
=
"
trackservice
"
;
let
result
;
let
result
;
async
function
get
Result
(
)
{
async
function
get
Data
(
query
)
{
// FIXME Configure DataURL and Port
// FIXME Configure DataURL and Port
let
response
=
await
fetch
(
`http://localhost:3333/api/v1/
${
query
}
`
);
let
response
=
await
fetch
(
`http://localhost:3333/api/v1/
${
query
}
`
);
let
text
=
await
response
.
text
();
let
data
=
await
response
.
json
();
let
data
=
text
;
return
data
;
}
function
submitHandler
()
{
if
(
response
.
ok
)
{
result
=
getResult
();
return
data
;
query
=
""
;
}
else
{
throw
new
Error
(
data
)
}
}
}
submitHandler
();
result
=
getData
(
queryTrackservice
);
</script>
</script>
<div
class=
"container mt-5"
>
<div
class=
"container mt-5"
>
...
@@ -26,30 +27,16 @@
...
@@ -26,30 +27,16 @@
<div
class=
"col-md-8 text-center"
>
<div
class=
"col-md-8 text-center"
>
<h1
class=
"display-4"
>
Track Service
</h1>
<h1
class=
"display-4"
>
Track Service
</h1>
{
#if
result
===
undefined
}
<p></p>
{
:
else
}
{
#await
result
}
{
#await
result
}
<div
class=
"spinner-border mt-5"
role=
"status"
>
<div
class=
"spinner-border mt-5"
role=
"status"
>
<span
class=
"sr-only"
>
Loading...
</span>
<span
class=
"sr-only"
>
Loading...
</span>
</div>
</div>
{
:then
value
}
{
:then
value
}
<TrackService
data=
{
value
}
/>
<TrackService
data=
{
value
}
/>
{
:catch
error
}
{
:catch
error
}
<p
style=
"color:red"
>
{
error
.
message
}
</p>
<TrackService
data=
{
error
.
message
}
/>
{
/await
}
{
/await
}
{
/if
}
</div>
</div>
<div
class=
"col-md"
></div>
<div
class=
"col-md"
></div>
</div>
</div>
...
...
This diff is collapsed.
Click to expand it.
contrib/aura-player/src/TrackService.svelte
+
7
−
4
View file @
f424e8fa
...
@@ -3,8 +3,11 @@ import { fly } from 'svelte/transition';
...
@@ -3,8 +3,11 @@ import { fly } from 'svelte/transition';
export
let
data
;
export
let
data
;
</script>
</script>
<div
class=
"card mt-5"
transition:fly=
"
{
{
y
:
150
,
duration
:
300
}
}
"
>
<div
class=
"card-body"
>
{
#each
data
as
track
}
<h5
class=
"card-title"
>
{
data
}
</h5>
<div
class=
"card mt-5"
transition:fly=
"
{
{
y
:
150
,
duration
:
500
}
}
"
>
<div
class=
"card-body"
>
<h5
class=
"card-title"
><b>
{
track
.
track_start
}
</b>
:
{
track
.
artist
}
-
{
track
.
title
}
(
{
track
.
duration
}
)
</h5>
</div>
</div>
</div>
</div>
{
/each
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment