mirror of
https://github.com/WebTools-NG/WebTools-NG
synced 2024-11-22 02:53:05 +00:00
parent
222af53ac1
commit
b37e58eff6
8 changed files with 40 additions and 39 deletions
|
@ -3,8 +3,8 @@
|
|||
"version": "0.1.0",
|
||||
"private": true,
|
||||
"scripts": {
|
||||
"serve": "vue-cli-service serve",
|
||||
"build": "vue-cli-service build",
|
||||
"serve": "vue-cli-service electron:serve",
|
||||
"build": "vue-cli-service electron:build",
|
||||
"lint": "vue-cli-service lint",
|
||||
"electron:build": "vue-cli-service electron:build",
|
||||
"electron:serve": "vue-cli-service electron:serve",
|
||||
|
|
|
@ -36,8 +36,7 @@ export default {
|
|||
Header,
|
||||
}, methods: {
|
||||
setCollapsed(value){
|
||||
console.log("This is a call")
|
||||
console.log(value)
|
||||
|
||||
this.isCollapsed = value
|
||||
},
|
||||
|
||||
|
|
|
@ -23,7 +23,7 @@ function createWindow () {
|
|||
if (process.env.WEBPACK_DEV_SERVER_URL) {
|
||||
// Load the url of the dev server if in development mode
|
||||
win.loadURL(process.env.WEBPACK_DEV_SERVER_URL)
|
||||
if (!process.env.IS_TEST) win.webContents.openDevTools()
|
||||
if (!process.env.IS_TEST) win.webContents.openDevTools({'mode': 'undocked'})
|
||||
} else {
|
||||
createProtocol('app')
|
||||
// Load the index.html when not in development
|
||||
|
|
|
@ -49,17 +49,18 @@
|
|||
|
||||
<script>
|
||||
import store from '../../store';
|
||||
const log = require('electron-log');
|
||||
|
||||
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
fetchServers(){
|
||||
console.log("fetching servers")
|
||||
log.info("fetching servers")
|
||||
this.$store.dispatch('fetchPlexServers', store.getters.getAuthToken);
|
||||
},
|
||||
active2(e) {
|
||||
console.log("active2 called")
|
||||
log.info("active2 called")
|
||||
this.active = e;
|
||||
},
|
||||
selected: function (selected) {
|
||||
|
@ -68,14 +69,14 @@ export default {
|
|||
|
||||
},
|
||||
onChange(event) {
|
||||
console.log(event.target.selected);
|
||||
log.info(event.target.selected);
|
||||
},
|
||||
getAvatar(){
|
||||
return this.$store.getters.getAvatar
|
||||
}
|
||||
},
|
||||
created(){
|
||||
console.log("menu created")
|
||||
log.info("menu created")
|
||||
this.$store.dispatch('fetchPlexServers');
|
||||
},
|
||||
computed: {
|
||||
|
|
|
@ -7,6 +7,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
const log = require('electron-log');
|
||||
import '@fortawesome/fontawesome-free/css/all.css'
|
||||
|
||||
|
||||
|
@ -86,8 +87,7 @@ import '@fortawesome/fontawesome-free/css/all.css'
|
|||
},methods: {
|
||||
onToggleCollapse(collapsed) {
|
||||
this.$emit("e-iscollapsed", collapsed);
|
||||
console.log(collapsed)
|
||||
|
||||
log.info(collapsed)
|
||||
},
|
||||
},
|
||||
}
|
||||
|
|
|
@ -75,6 +75,7 @@
|
|||
</template>
|
||||
|
||||
<script>
|
||||
const log = require('electron-log');
|
||||
export default {
|
||||
name: 'export',
|
||||
data() {
|
||||
|
@ -82,30 +83,30 @@ export default {
|
|||
radio: 'movie',
|
||||
}
|
||||
},
|
||||
created(){
|
||||
console.log("ET Created")
|
||||
created(){
|
||||
log.info('ET Created')
|
||||
this.fetchSelection()
|
||||
}, computed: {
|
||||
pmsSections: function(){
|
||||
let sections = this.$store.getters.getPmsSections
|
||||
let result=[];
|
||||
if(Array.isArray(sections) && sections.length){
|
||||
console.log("doing a forEach")
|
||||
log.debug("doing a forEach")
|
||||
sections.forEach((req) => {
|
||||
if (req.type == this.radio) {
|
||||
console.log("pushing data to results")
|
||||
log.debug("pushing data to results")
|
||||
result.push(req);
|
||||
}
|
||||
})
|
||||
} else {
|
||||
console.log("No data found")
|
||||
log.info("No data found")
|
||||
result.push["No Section found"]
|
||||
}
|
||||
return result
|
||||
}
|
||||
}, methods: {
|
||||
selectSelection: function (selected) {
|
||||
console.log(selected)
|
||||
log.debug(selected)
|
||||
this.$store.commit("UPDATE_SELECTEDSECTION", selected);
|
||||
},
|
||||
getMedia(){
|
||||
|
@ -113,14 +114,14 @@ export default {
|
|||
this.$store.dispatch('getMediaMovies');
|
||||
},
|
||||
fetchSelection(){
|
||||
console.log("fetchSelection")
|
||||
log.debug("fetchSelection")
|
||||
let serverCheck = this.$store.getters.getSelectedServer
|
||||
if(serverCheck !== "none"){
|
||||
|
||||
console.log("serverCheck is not null, running fetchSections ")
|
||||
log.debug("serverCheck is not null, running fetchSections ")
|
||||
this.$store.dispatch('fetchSections')
|
||||
} else {
|
||||
console.log("serverCheck is none")
|
||||
log.debug("serverCheck is none")
|
||||
this.$buefy.toast.open({
|
||||
duration: 3000,
|
||||
message: `No server selected`,
|
||||
|
|
32
src/main.js
32
src/main.js
|
@ -14,31 +14,27 @@ import '@fortawesome/fontawesome-free/css/all.css'
|
|||
import i18n from './i18n'
|
||||
|
||||
|
||||
|
||||
|
||||
Vue.use(VueRouter);
|
||||
Vue.use(Vuex);
|
||||
|
||||
Vue.use(VueSidebarMenu)
|
||||
Vue.use(Buefy);
|
||||
|
||||
let isElectron = require("is-electron");
|
||||
|
||||
if(isElectron()){
|
||||
const log = require('electron-log');
|
||||
log.transports.file.level = 'verbose';
|
||||
log.transports.console.level = 'verbose';
|
||||
var name = require('electron').remote.app.getName();
|
||||
log.transports.file.fileName = name
|
||||
console.log = log.log;
|
||||
var version = require('electron').remote.app.getVersion();
|
||||
log.info('Starting ' + name + ' Version:' + version);
|
||||
log.info("Electron aww yeahhh !");
|
||||
}else{
|
||||
console.log("Running in native Vue as a normal browser");
|
||||
}
|
||||
|
||||
|
||||
// let isElectron = require("is-electron");
|
||||
|
||||
// Logging
|
||||
|
||||
const log = require('electron-log');
|
||||
log.transports.file.level = 'info';
|
||||
log.transports.console.level = 'verbose';
|
||||
var name = require('electron').remote.app.getName();
|
||||
log.transports.file.fileName = name
|
||||
console.log = log.log;
|
||||
var version = require('electron').remote.app.getVersion();
|
||||
log.info('*********************************')
|
||||
log.info('Starting ' + name + ' Version:' + version);
|
||||
|
||||
Vue.config.productionTip = false
|
||||
|
||||
|
@ -46,5 +42,5 @@ new Vue({
|
|||
render: h => h(App),
|
||||
router: router,
|
||||
i18n,
|
||||
store: store
|
||||
store: store
|
||||
}).$mount('#app')
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
import axios from 'axios';
|
||||
import router from '../../router'
|
||||
|
||||
const log = require('electron-log');
|
||||
|
||||
const state = {
|
||||
plexServers: [],
|
||||
|
@ -47,9 +48,12 @@ const actions = {
|
|||
})
|
||||
.then((response) => {
|
||||
let result=[];
|
||||
console.log("response from fetchPlexServers", response)
|
||||
log.info('Response from fetchPlexServers recieved')
|
||||
log.verbose(response)
|
||||
// console.log("response from fetchPlexServers", response)
|
||||
response.data.forEach((req) => {
|
||||
if (req.owned == true && req.product == "Plex Media Server") {
|
||||
log.debug(req)
|
||||
result.push(req);
|
||||
}
|
||||
})
|
||||
|
|
Loading…
Reference in a new issue