mirror of
https://github.com/WebTools-NG/WebTools-NG
synced 2024-11-22 02:53:05 +00:00
#13 added radio buttons to pick media. added section fetch on server select
This commit is contained in:
parent
d8588d60f0
commit
d7609fe08b
4 changed files with 61 additions and 7 deletions
|
@ -28,7 +28,7 @@
|
|||
|
||||
<div class="select is-dark">
|
||||
<b-select v-bind:placeholder="$t('Common.SelServer')"
|
||||
@input="assignTag">
|
||||
@input="selected">
|
||||
<option
|
||||
v-for="option in pserver"
|
||||
:value="option"
|
||||
|
@ -56,9 +56,11 @@ export default {
|
|||
console.log("fetching servers")
|
||||
this.$store.dispatch('fetchPlexServers', store.getters.getAuthToken);
|
||||
},
|
||||
assignTag: function (selected) {
|
||||
selected: function (selected) {
|
||||
this.selected = selected;
|
||||
this.$store.commit("UPDATE_SELECTED_SERVER", selected);
|
||||
this.$store.dispatch('fetchSections');
|
||||
|
||||
},
|
||||
onChange(event) {
|
||||
console.log(event.target.selected);
|
||||
|
|
|
@ -3,7 +3,46 @@
|
|||
<h1 class="title is-3">{{ $t("Modules.ET.Name") }}</h1>
|
||||
<h2 class="subtitle">{{ $t("Modules.ET.Description") }}</h2>
|
||||
<br>
|
||||
|
||||
<h1 class="title is-3">0. Select Media Type</h1>
|
||||
<div class="block">
|
||||
<b-radio v-model="radio" type="is-dark"
|
||||
name="name"
|
||||
native-value="movies">
|
||||
Movies
|
||||
</b-radio>
|
||||
<b-radio v-model="radio"
|
||||
name="name"
|
||||
native-value="tvseries"
|
||||
disabled>
|
||||
TV Series
|
||||
</b-radio>
|
||||
<b-radio v-model="radio"
|
||||
name="name"
|
||||
native-value="music"
|
||||
disabled>
|
||||
Music
|
||||
</b-radio>
|
||||
<b-radio v-model="radio"
|
||||
name="name"
|
||||
native-value="photos"
|
||||
disabled>
|
||||
Photos
|
||||
</b-radio>
|
||||
<b-radio v-model="radio"
|
||||
name="name"
|
||||
native-value="othervideos"
|
||||
disabled>
|
||||
Other Videos
|
||||
</b-radio>
|
||||
</div>
|
||||
<p class="content">
|
||||
<b>Selection:</b>
|
||||
{{ radio }}
|
||||
</p>
|
||||
|
||||
|
||||
<hr>
|
||||
<h1 class="title is-3">1. Select lib</h1>
|
||||
<div class="select is-dark">
|
||||
<b-select v-bind:placeholder="$t('Modules.ET.SelectSelection')"
|
||||
|
@ -34,12 +73,16 @@
|
|||
<script>
|
||||
export default {
|
||||
name: 'export',
|
||||
created(){
|
||||
data() {
|
||||
return {
|
||||
radio: 'movies'
|
||||
}
|
||||
},
|
||||
created(){
|
||||
console.log("ET Created")
|
||||
this.$store.dispatch('fetchSections');
|
||||
}, computed: {
|
||||
pmsSections: function(){
|
||||
|
||||
return this.$store.getters.getPmsSections
|
||||
}
|
||||
}, methods: {
|
||||
|
@ -49,7 +92,7 @@ export default {
|
|||
},
|
||||
getMedia(){
|
||||
console.log("getMedia Called")
|
||||
this.$store.dispatch('getMedia');
|
||||
this.$store.dispatch('getMediaMovies');
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -46,20 +46,26 @@ const actions = {
|
|||
// `error.request` is an instance of XMLHttpRequest in the browser and an instance of
|
||||
// http.ClientRequest in node.js
|
||||
console.log(error.request);
|
||||
console.log("Unable to fetch sections")
|
||||
|
||||
} else {
|
||||
// Something happened in setting up the request that triggered an Error
|
||||
console.log('Error', error.message);
|
||||
console.log("fetchSection is error 2")
|
||||
|
||||
}
|
||||
}
|
||||
)
|
||||
},
|
||||
getMedia({ getters }) {
|
||||
getMediaMovies({ getters }) {
|
||||
|
||||
var key = getters.getSelectedSection
|
||||
var baseURL = getters.getSlectedServerAddress
|
||||
|
||||
axios({
|
||||
method: 'get',
|
||||
url: `http://127.0.0.1:32400/library/sections/${key}/all`,
|
||||
baseURL: `http://${baseURL}`,
|
||||
url: `/library/sections/${key}/all`,
|
||||
responseType: 'json',
|
||||
headers: {
|
||||
'Accept': "application/json",
|
||||
|
|
|
@ -55,6 +55,9 @@ const actions = {
|
|||
|
||||
console.log(result)
|
||||
commit('UPDATE_PLEX_SERVERS', result)
|
||||
this.$store.dispatch('fetchSections')
|
||||
|
||||
|
||||
})
|
||||
.catch(function (error) {
|
||||
if (error.response) {
|
||||
|
|
Loading…
Reference in a new issue