mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-26 19:21:39 +00:00
added a new settings page for sso
This commit is contained in:
parent
d2395a5896
commit
2cd622cb89
4 changed files with 274 additions and 1 deletions
|
|
@ -32,6 +32,10 @@ export const getters = {
|
|||
if (!state.serverSettings) return null
|
||||
return state.serverSettings[key]
|
||||
},
|
||||
getSSOSetting: state => key => {
|
||||
if (!state.SSOSettings) return null
|
||||
return state.getSSOSettings[key]
|
||||
},
|
||||
getBookCoverAspectRatio: state => {
|
||||
if (!state.serverSettings || !state.serverSettings.coverAspectRatio) return 1.6
|
||||
return state.serverSettings.coverAspectRatio === 0 ? 1.6 : 1
|
||||
|
|
@ -59,6 +63,22 @@ export const actions = {
|
|||
return false
|
||||
})
|
||||
},
|
||||
updateSSOSettings({ commit }, payload) {
|
||||
var updatePayload = {
|
||||
...payload
|
||||
}
|
||||
return this.$axios.$patch('/api/SSOSettings', updatePayload).then((result) => {
|
||||
if (result.success) {
|
||||
commit('setSSOSettings', result.SSOSettings)
|
||||
return true
|
||||
} else {
|
||||
return false
|
||||
}
|
||||
}).catch((error) => {
|
||||
console.error('Failed to update server settings', error)
|
||||
return false
|
||||
})
|
||||
},
|
||||
checkForUpdate({ commit }) {
|
||||
return checkForUpdate()
|
||||
.then((res) => {
|
||||
|
|
@ -104,7 +124,11 @@ export const mutations = {
|
|||
},
|
||||
setServerSettings(state, settings) {
|
||||
if (!settings) return
|
||||
state.serverSettings = settings
|
||||
state.SSOSettings = settings
|
||||
},
|
||||
setSSOSettings(state, settings) {
|
||||
if (!settings) return
|
||||
state.SSOSettings = settings
|
||||
},
|
||||
setStreamAudiobook(state, audiobook) {
|
||||
state.playOnLoad = true
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue