mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-16 06:11:38 +00:00
129 lines
No EOL
4 KiB
Vue
129 lines
No EOL
4 KiB
Vue
<template>
|
|
<div>
|
|
<!-- <div class="h-0.5 bg-primary bg-opacity-50 w-full" /> -->
|
|
|
|
<div class="bg-bg rounded-md shadow-lg border border-white border-opacity-5 p-4 mb-8">
|
|
<div class="flex items-center mb-2">
|
|
<h1 class="text-xl">SSO Provider Settings</h1>
|
|
</div>
|
|
|
|
<div class="flex items-center py-2">
|
|
<p class="pl-4 text-lg">Issuer </p>
|
|
<ui-text-input v-model="oidc.issuer" :disabled="updatingSSOSettings" @input="updateSSOIssuer" />
|
|
</div>
|
|
|
|
<div class="flex items-center py-2">
|
|
<p class="pl-4 text-lg">Authorization URL </p>
|
|
<ui-text-input v-model="oidc.authorizationURL" :disabled="updatingSSOSettings" @input="updateAuthorizationURL" />
|
|
</div>
|
|
|
|
<div class="flex items-center py-2">
|
|
<p class="pl-4 text-lg">Token URL </p>
|
|
<ui-text-input v-model="oidc.tokenURL" :disabled="updatingSSOSettings" @input="updateSSOIssuer" />
|
|
</div>
|
|
|
|
<div class="flex items-center py-2">
|
|
<p class="pl-4 text-lg">User Info URL </p>
|
|
<ui-text-input v-model="oidc.userInfoURL" :disabled="updatingSSOSettings" @input="updateSSOIssuer" />
|
|
</div>
|
|
|
|
<div class="flex items-center py-2">
|
|
<p class="pl-4 text-lg">Client ID </p>
|
|
<ui-text-input v-model="oidc.clientID" :disabled="updatingSSOSettings" @input="updateSSOIssuer" />
|
|
</div>
|
|
|
|
<div class="flex items-center py-2">
|
|
<p class="pl-4 text-lg">Client Secret </p>
|
|
<ui-text-input type="password" v-model="oidc.clientSecret" :disabled="updatingSSOSettings" @input="updateSSOIssuer" />
|
|
</div>
|
|
|
|
<div class="flex items-center mb-2">
|
|
<h1 class="text-xl">User Settings</h1>
|
|
</div>
|
|
<div class="flex items-center mb-2">
|
|
<ui-btn @click="saveSSOSettings">Save</ui-btn>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
data() {
|
|
return {
|
|
oidc: {
|
|
issuer: "",
|
|
authorizationURL: "",
|
|
tokenURL: "",
|
|
userInfoURL: "",
|
|
clientID: "",
|
|
clientSecret: "",
|
|
},
|
|
|
|
updatingSSOSettings: false,
|
|
newSSOSettings: {}
|
|
}
|
|
},
|
|
watch: {
|
|
SSOSettings(newVal, oldVal) {
|
|
if (newVal && !oldVal) {
|
|
this.newSSOSettings = { ...this.SSOSettings }
|
|
this.initSSOSettings()
|
|
}
|
|
}
|
|
},
|
|
computed: {
|
|
SSOSettings() {
|
|
return this.$store.state.SSOSettings
|
|
},
|
|
},
|
|
methods: {
|
|
updateSSOIssuer(val) {
|
|
return
|
|
this.updateSSOSettings({
|
|
issuer: val
|
|
})
|
|
},
|
|
updateAuthorizationURL(val) {
|
|
return
|
|
this.updateSSOSettings({
|
|
authorizationURL: val
|
|
})
|
|
},
|
|
saveSSOSettings(payload) {
|
|
console.log(this)
|
|
this.updatingSSOSettings = true
|
|
this.$store
|
|
.dispatch('updateSSOSettings', payload)
|
|
.then((success) => {
|
|
console.log('Updated SSO Settings', success)
|
|
this.updatingSSOSettings = false
|
|
})
|
|
.catch((error) => {
|
|
console.error('Failed to update SSO settings', error)
|
|
this.updatingSSOSettings = false
|
|
})
|
|
},
|
|
initSSOSettings() {
|
|
this.newSSOSettings = this.SSOSettings ? { ...this.SSOSettings } : {}
|
|
|
|
|
|
this.oidc.issuer = this.newSSOSettings.issuer
|
|
this.oidc.authorizationURL = this.newSSOSettings.authorizationURL
|
|
this.oidc.tokenURL = this.newSSOSettings.tokenURL
|
|
this.oidc.userInfoURL = this.newSSOSettings.userInfoURL
|
|
this.oidc.clientID = this.newSSOSettings.clientID
|
|
this.oidc.clientSecret = this.newSSOSettings.clientSecret
|
|
this.updatingSSOSettings = this.newSSOSettings.updatingSSOSettings
|
|
|
|
// this.newSSOSettings.coverDestination === this.$constants.CoverDestination.AUDIOBOOK
|
|
// this.useSquareBookCovers = this.newSSOSettings.coverAspectRatio === this.$constants.BookCoverAspectRatio.SQUARE
|
|
// this.useAlternativeBookshelfView = this.newSSOSettings.bookshelfView === this.$constants.BookshelfView.TITLES
|
|
},
|
|
|
|
},
|
|
mounted() {
|
|
this.initSSOSettings()
|
|
}
|
|
}
|
|
</script> |