show multi channel settings only when is active
This commit is contained in:
parent
3c58745d37
commit
e237563e74
@ -20,13 +20,17 @@
|
|||||||
<b-nav-item to="/configure" exact-active-class="active-menu-item">
|
<b-nav-item to="/configure" exact-active-class="active-menu-item">
|
||||||
Configure
|
Configure
|
||||||
</b-nav-item>
|
</b-nav-item>
|
||||||
<b-nav-text> </b-nav-text>
|
<b-nav-text v-if="multiChannel">
|
||||||
<b-nav-item-dropdown :text="configGui[configID].channel" right>
|
|
||||||
|
</b-nav-text>
|
||||||
|
<b-nav-item-dropdown v-if="multiChannel" :text="configGui[configID].channel" right>
|
||||||
<b-dropdown-item v-for="(channel, index) in configGui" :key="channel.key" @click="selectChannel(index)">
|
<b-dropdown-item v-for="(channel, index) in configGui" :key="channel.key" @click="selectChannel(index)">
|
||||||
{{ channel.channel }}
|
{{ channel.channel }}
|
||||||
</b-dropdown-item>
|
</b-dropdown-item>
|
||||||
</b-nav-item-dropdown>
|
</b-nav-item-dropdown>
|
||||||
<b-nav-text> </b-nav-text>
|
<b-nav-text v-if="multiChannel">
|
||||||
|
|
||||||
|
</b-nav-text>
|
||||||
<b-nav-item to="/" @click="logout()">
|
<b-nav-item to="/" @click="logout()">
|
||||||
Logout
|
Logout
|
||||||
</b-nav-item>
|
</b-nav-item>
|
||||||
@ -42,7 +46,7 @@ export default {
|
|||||||
name: 'Menu',
|
name: 'Menu',
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState('config', ['configID', 'configGui'])
|
...mapState('config', ['configID', 'configGui', 'multiChannel'])
|
||||||
},
|
},
|
||||||
|
|
||||||
methods: {
|
methods: {
|
||||||
|
@ -15,7 +15,7 @@
|
|||||||
>
|
>
|
||||||
<div style="width: 100%; height: 43px;">
|
<div style="width: 100%; height: 43px;">
|
||||||
<div class="float-right">
|
<div class="float-right">
|
||||||
<b-button size="sm" variant="primary" class="m-md-2" @click="addChannel()">
|
<b-button v-if="multiChannel" size="sm" variant="primary" class="m-md-2" @click="addChannel()">
|
||||||
Add new Channel
|
Add new Channel
|
||||||
</b-button>
|
</b-button>
|
||||||
</div>
|
</div>
|
||||||
@ -56,7 +56,7 @@
|
|||||||
<b-button type="submit" variant="primary">
|
<b-button type="submit" variant="primary">
|
||||||
Save
|
Save
|
||||||
</b-button>
|
</b-button>
|
||||||
<b-button variant="danger" @click="deleteChannel()">
|
<b-button v-if="multiChannel && configGui[configID].id > 1" variant="danger" @click="deleteChannel()">
|
||||||
Delete
|
Delete
|
||||||
</b-button>
|
</b-button>
|
||||||
</b-button-group>
|
</b-button-group>
|
||||||
@ -255,7 +255,7 @@ export default {
|
|||||||
},
|
},
|
||||||
|
|
||||||
computed: {
|
computed: {
|
||||||
...mapState('config', ['configID', 'netChoices']),
|
...mapState('config', ['configID', 'netChoices', 'multiChannel']),
|
||||||
configGui: {
|
configGui: {
|
||||||
get () {
|
get () {
|
||||||
return this.$store.state.config.configGui
|
return this.$store.state.config.configGui
|
||||||
|
@ -11,7 +11,8 @@ export const state = () => ({
|
|||||||
configPlayout: {},
|
configPlayout: {},
|
||||||
currentUser: null,
|
currentUser: null,
|
||||||
configUser: null,
|
configUser: null,
|
||||||
timezone: 'UTC'
|
timezone: 'UTC',
|
||||||
|
multiChannel: false
|
||||||
})
|
})
|
||||||
|
|
||||||
export const mutations = {
|
export const mutations = {
|
||||||
@ -47,6 +48,9 @@ export const mutations = {
|
|||||||
},
|
},
|
||||||
UPDATE_TIMEZONE (state, zone) {
|
UPDATE_TIMEZONE (state, zone) {
|
||||||
state.timezone = zone
|
state.timezone = zone
|
||||||
|
},
|
||||||
|
UPDATE_MULTI_CHANNEL (state, bool) {
|
||||||
|
state.multiChannel = bool
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -62,10 +66,11 @@ export const actions = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async getTimezone ({ commit, state }) {
|
async getTimezone ({ commit, state }) {
|
||||||
const response = await this.$axios.get('api/player/stats/?stats=timezone')
|
const response = await this.$axios.get('api/player/stats/?stats=settings')
|
||||||
|
|
||||||
if (response.data) {
|
if (response.data) {
|
||||||
commit('UPDATE_TIMEZONE', response.data.timezone)
|
commit('UPDATE_TIMEZONE', response.data.timezone)
|
||||||
|
commit('UPDATE_MULTI_CHANNEL', response.data.multi_channel)
|
||||||
} else {
|
} else {
|
||||||
commit('UPDATE_TIMEZONE', this.$dayjs.tz.guess())
|
commit('UPDATE_TIMEZONE', this.$dayjs.tz.guess())
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user