mirror of
https://github.com/WebTools-NG/WebTools-NG
synced 2024-11-23 11:33:14 +00:00
added https to fetchPlexServers
This commit is contained in:
parent
6847a3acb5
commit
cb7f1d972c
4 changed files with 41 additions and 11 deletions
|
@ -20,12 +20,12 @@
|
||||||
<div class="select is-dark">
|
<div class="select is-dark">
|
||||||
|
|
||||||
<b-select v-bind:placeholder="$t('Common.SelServer')"
|
<b-select v-bind:placeholder="$t('Common.SelServer')"
|
||||||
|
v-model="selectedOption"
|
||||||
@input="selected">
|
@input="selected">
|
||||||
<option
|
<option
|
||||||
v-for="option in pserver"
|
v-for="option in pserver"
|
||||||
:value="option"
|
:value="option"
|
||||||
:key="option.clientIdentifier"
|
:key="option.clientIdentifier">
|
||||||
v-on:change="onchange()">
|
|
||||||
{{ option.name }}
|
{{ option.name }}
|
||||||
</option>
|
</option>
|
||||||
</b-select>
|
</b-select>
|
||||||
|
@ -52,11 +52,18 @@
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import store from '../../store';
|
import store from '../../store';
|
||||||
|
import { et } from "../modules/ExportTools/et";
|
||||||
|
|
||||||
const log = require('electron-log');
|
const log = require('electron-log');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
data(){
|
||||||
|
return {
|
||||||
|
selectedOption: []
|
||||||
|
}
|
||||||
|
},
|
||||||
methods: {
|
methods: {
|
||||||
fetchServers(){
|
fetchServers(){
|
||||||
log.info("fetching servers")
|
log.info("fetching servers")
|
||||||
|
@ -66,9 +73,10 @@ export default {
|
||||||
log.info("active2 called")
|
log.info("active2 called")
|
||||||
this.active = e;
|
this.active = e;
|
||||||
},
|
},
|
||||||
selected: function (selected) {
|
selected: function () {
|
||||||
this.selected = selected;
|
log.info('HEADER: selected server: ' + this.selectedOption.name)
|
||||||
this.$store.commit("UPDATE_SELECTED_SERVER", selected);
|
et.checkServerConnect(this.selectedOption)
|
||||||
|
this.$store.commit("UPDATE_SELECTED_SERVER", this.selectedOption);
|
||||||
|
|
||||||
},
|
},
|
||||||
onChange(event) {
|
onChange(event) {
|
||||||
|
|
|
@ -1,6 +1,7 @@
|
||||||
var def = JSON.parse(JSON.stringify(require('./definitions.json')));
|
var def = JSON.parse(JSON.stringify(require('./definitions.json')));
|
||||||
const log = require('electron-log');
|
const log = require('electron-log');
|
||||||
import {wtconfig, wtutils} from '../../../wtutils'
|
import {wtconfig, wtutils} from '../../../wtutils'
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
const et = new class ET {
|
const et = new class ET {
|
||||||
constructor() {
|
constructor() {
|
||||||
|
@ -50,6 +51,25 @@ const et = new class ET {
|
||||||
getFieldKey(libType, fieldName) {
|
getFieldKey(libType, fieldName) {
|
||||||
return def[libType]['fields'][fieldName]['key']
|
return def[libType]['fields'][fieldName]['key']
|
||||||
}
|
}
|
||||||
|
|
||||||
|
checkServerConnect(server) {
|
||||||
|
log.info("NUGGA : ET : checkServerConnect called")
|
||||||
|
server.connections.forEach((val) => {
|
||||||
|
log.info(val.uri)
|
||||||
|
let baseurl = val.uri
|
||||||
|
|
||||||
|
axios.get(baseurl + '/identity')
|
||||||
|
.then(response => {
|
||||||
|
log.info(response)
|
||||||
|
}).catch(error => {
|
||||||
|
log.error(error)
|
||||||
|
})
|
||||||
|
}
|
||||||
|
)
|
||||||
|
let serverAdress = []
|
||||||
|
|
||||||
|
return serverAdress
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
const excel = new class Excel {
|
const excel = new class Excel {
|
||||||
|
|
0
src/components/modules/General/plextv.js
Normal file
0
src/components/modules/General/plextv.js
Normal file
|
@ -44,11 +44,12 @@ const actions = {
|
||||||
{
|
{
|
||||||
'X-Plex-Client-Identifier' : 'WebTools-NG',
|
'X-Plex-Client-Identifier' : 'WebTools-NG',
|
||||||
'X-Plex-Token': getters.getAuthToken,
|
'X-Plex-Token': getters.getAuthToken,
|
||||||
'Accept' : 'application/json',
|
'Accept' : 'application/json'
|
||||||
'includeHttps' : '1',
|
|
||||||
'includeRelay': '0',
|
|
||||||
|
|
||||||
},
|
},
|
||||||
|
params: {
|
||||||
|
'includeHttps' : '1',
|
||||||
|
'includeRelay': '0'
|
||||||
|
}
|
||||||
})
|
})
|
||||||
.then((response) => {
|
.then((response) => {
|
||||||
let result=[];
|
let result=[];
|
||||||
|
@ -133,7 +134,8 @@ const getters = {
|
||||||
if (req.local == true) {
|
if (req.local == true) {
|
||||||
result = req.address + ":" + req.port
|
result = req.address + ":" + req.port
|
||||||
}
|
}
|
||||||
})
|
}
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue