#144 starting on Global settings

This commit is contained in:
UKDTOM 2020-09-06 23:55:16 +02:00
parent f955e5b2be
commit 87554a3623
4 changed files with 84 additions and 0 deletions

View file

@ -94,6 +94,9 @@
},
"Reset":{
"NavTitle": "Factory Reset"
},
"Settings":{
"NavTitle": "Global Settings"
}
}
},
@ -165,6 +168,17 @@
"PlexPoCredits": "And many thanks to the authors/developers and staff at Plex. We are eternally grateful for your dedication, talent and hard work! And to our friends at POEditor.com, who provide a free translation site because we are an Open-Source project.",
"WikiDevelopers": "Wiki was made by:",
"Wikitrumpy81": "Andy (aka trumpy81), a Plex community member (trumpy81 on GitHub)"
},
"GlobalSettings": {
"Title": "Global Settings",
"Description": "Here you configure the global settings, that influence all modules",
"TimeOut": "Timeout when requesting info from PMS in sec",
"LogLevelFile": "What file log level to use (Change only if asked by the devs)",
"LogLevelConsole": "Console log level (Only used when developing)",
"LogSize": "Size of logfile, before rollover",
"RestartNeeded": "When changing this setting, a restart is needed"
}
}
}

View file

@ -0,0 +1,58 @@
<template>
<b-container fluid>
<div class="col-lg-10 col-md-12 col-xs-12">
<h2>{{ $t("Modules.GlobalSettings.Title") }}<br>
<small>{{ $t("Modules.GlobalSettings.Description") }}</small>
</h2>
<b-input-group id="TimeOutGrp" :prepend="$t('Modules.GlobalSettings.TimeOut')" class="mt-3">
<b-form-input id="TimeOut" name="TimeOut" type="text" class="form-control" v-model="TimeOut" :disabled=false :maxlength=2 @change="setTimeOut()"></b-form-input>
</b-input-group>
<b-input-group id="LogLevelGrp" :prepend="$t('Modules.GlobalSettings.LogLevelFile')" class="mt-3">
<b-tooltip target="LogLevelGrp" triggers="hover">
{{ $t('Modules.GlobalSettings.RestartNeeded') }}
</b-tooltip>
<b-form-select id="LogLevel" name="LogLevel" type="text" class="form-control" v-model="LogLevel" :disabled=false :maxlength=2 v-on:change="setLogLevel" :options="logLevels"></b-form-select>
</b-input-group>
</div>
</b-container>
</template>
<script>
const log = require("electron-log");
import {wtutils, wtconfig, dialog} from '../wtutils';
import i18n from '../i18n';
log, wtutils, dialog, i18n
export default {
data() {
return {
TimeOut: wtconfig.get('PMS.TimeOut'),
LogLevel: wtconfig.get('Log.fileLevel')
}
},
methods: {
setTimeOut: function(){
wtconfig.set('PMS.TimeOut', this.TimeOut)
},
setLogLevel: function(value){
console.log('Ged value: ' + JSON.stringify( value))
log.info(`Log file level set to ${value}`)
wtconfig.set('Log.fileLevel', value)
}
},
computed: {
logLevels: function() {
const options = ['debug', 'error', 'info', 'verbose']
return options
}
}
}
</script>

View file

@ -53,6 +53,11 @@ import i18n from '../../i18n'
title: i18n.t("Common.Menu.Sidebar.Language.NavTitle"),
icon: 'fas fa-language'
},
{
href: '/settings',
title: i18n.t("Common.Menu.Sidebar.Settings.NavTitle"),
icon: 'fa fa-cog'
},
{
href: { path: '/about' },
title: i18n.t("Common.Menu.Sidebar.About.NavTitle"),

View file

@ -4,6 +4,7 @@ import Login from '../components/Login.vue'
import Home from '../components/Home.vue'
import Export from '../components/modules/ExportTools/Export'
import Language from '../components/Language.vue'
import GlobalSettings from '../components/GlobalSettings.vue'
import About from '../components/About'
import Store from '../store/index.js'
import ExportSettings from '../components/modules/ExportTools/Settings/settings'
@ -50,6 +51,12 @@ Vue.use(VueRouter)
component: Language,
meta: {requiresAuth: true}
},
{
path: '/settings',
name: "settings",
component: GlobalSettings,
meta: {requiresAuth: true}
},
{
path: '/about',
name: "about",