Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
dashboard
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
Container registry
Model registry
Operate
Environments
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
AURA
dashboard
Commits
6feb5948
Commit
6feb5948
authored
4 years ago
by
jackie / Andrea Ida Malkah Klaura
Browse files
Options
Downloads
Patches
Plain Diff
add text based show selector to fix
#28
parent
4154c1e3
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
src/components/EmissionManager.vue
+2
-0
2 additions, 0 deletions
src/components/EmissionManager.vue
src/components/FileManager.vue
+6
-2
6 additions, 2 deletions
src/components/FileManager.vue
src/components/ShowSelector.vue
+95
-1
95 additions, 1 deletion
src/components/ShowSelector.vue
with
103 additions
and
3 deletions
src/components/EmissionManager.vue
+
2
−
0
View file @
6feb5948
<
template
>
<b-container>
<show-selector
ref=
"showSelector"
title=
"Emissions"
:callback=
"showHasSwitched"
/>
...
...
@@ -179,6 +180,7 @@ export default {
this
.
$store
.
dispatch
(
'
shows/fetchShows
'
,
{
callback
:
()
=>
{
this
.
showHasSwitched
()
this
.
$refs
.
showSelector
.
updateInputSelector
()
}
})
},
...
...
This diff is collapsed.
Click to expand it.
src/components/FileManager.vue
+
6
−
2
View file @
6feb5948
<
template
>
<b-container>
<show-selector
ref=
"showSelector"
title=
"Files & playlists"
:callback=
"showHasSwitched"
/>
...
...
@@ -63,7 +64,10 @@ export default {
// loaded.
created
()
{
this
.
$store
.
dispatch
(
'
shows/fetchShows
'
,
{
callback
:
()
=>
{
this
.
showHasSwitched
()
}
callback
:
()
=>
{
this
.
showHasSwitched
()
this
.
$refs
.
showSelector
.
updateInputSelector
()
}
})
},
...
...
@@ -74,7 +78,7 @@ export default {
// This switches the UI elements to reflect another show and fetches all
// relevent data from the tank API.
showHasSwitched
()
{
this
.
$log
.
debug
(
'
show has switched to
'
)
this
.
$log
.
debug
(
'
show has switched to
'
,
this
.
selectedShow
.
name
)
this
.
$store
.
dispatch
(
'
files/fetchFiles
'
,
{
slug
:
this
.
selectedShow
.
slug
})
...
...
This diff is collapsed.
Click to expand it.
src/components/ShowSelector.vue
+
95
−
1
View file @
6feb5948
<
template
>
<b-row>
<b-col>
<b-col
cols=
"3"
>
<h3>
{{
title
}}
</h3>
</b-col>
<b-col
align=
"right"
>
<b-input-group
prepend=
"Select show:"
>
<b-form-input
v-model=
"inputSelector"
list=
"list-of-shows"
autocomplete=
"off"
@
keypress=
"keypressed"
/>
<b-input-group-append>
<b-button
variant=
"success"
:disabled=
"disabledOk"
@
click=
"confirmSelector"
>
<b-icon-check
/>
</b-button>
<b-button
variant=
"danger"
:disabled=
"disabledReset"
@
click=
"resetSelector"
>
<b-icon-x
/>
</b-button>
</b-input-group-append>
</b-input-group>
<datalist
id=
"list-of-shows"
>
<option
v-for=
"show in shows"
:key=
"show.id"
>
{{
show
.
name
}}
(ID:
{{
show
.
id
}}
)
</option>
</datalist>
</b-col>
<b-col
cols=
"3"
align=
"right"
>
<b-dropdown
id=
"ddshows"
text=
"Sendereihe auswählen"
...
...
@@ -23,13 +60,25 @@
<
script
>
import
{
mapGetters
}
from
'
vuex
'
import
{
BIconCheck
,
BIconX
}
from
'
bootstrap-vue
'
export
default
{
components
:
{
BIconCheck
,
BIconX
,
},
props
:
{
title
:
{
type
:
String
,
default
:
'
Unlabeled component title
'
},
callback
:
{
type
:
Function
,
default
:
null
}
},
data
()
{
return
{
inputSelector
:
''
,
}
},
computed
:
{
loaded
()
{
return
{
...
...
@@ -37,6 +86,14 @@ export default {
}
},
disabledOk
()
{
return
!
this
.
isValidSelector
()
},
disabledReset
()
{
return
this
.
inputSelector
.
length
>
0
?
false
:
true
},
...
mapGetters
({
shows
:
'
shows/shows
'
,
selectedShow
:
'
shows/selectedShow
'
,
...
...
@@ -46,8 +103,45 @@ export default {
methods
:
{
switchShow
:
function
(
index
)
{
this
.
$store
.
commit
(
'
shows/switchShow
'
,
index
)
this
.
updateInputSelector
()
if
(
this
.
callback
)
{
this
.
callback
()
}
},
updateInputSelector
()
{
this
.
inputSelector
=
this
.
selectedShow
.
name
+
'
(ID:
'
+
this
.
selectedShow
.
id
+
'
)
'
},
isValidSelector
()
{
let
pattern
=
/^.*
\(
ID:
\d
+
\)
$/
if
(
pattern
.
test
(
this
.
inputSelector
))
{
if
(
this
.
shows
.
findIndex
(
s
=>
s
.
id
==
this
.
getSelectorId
())
>=
0
)
{
return
true
}
}
return
false
},
getSelectorId
()
{
let
s
=
this
.
inputSelector
.
split
(
'
(ID:
'
)
return
s
[
s
.
length
-
1
].
slice
(
0
,
-
1
)
},
keypressed
(
k
)
{
if
(
k
.
key
===
'
Enter
'
)
{
if
(
this
.
isValidSelector
())
{
this
.
switchShow
(
this
.
shows
.
findIndex
(
s
=>
s
.
id
==
this
.
getSelectorId
()))
}
}
},
confirmSelector
()
{
this
.
keypressed
({
key
:
'
Enter
'
})
},
resetSelector
()
{
this
.
inputSelector
=
''
},
}
}
</
script
>
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