mirror of
https://github.com/advplyr/audiobookshelf.git
synced 2026-07-09 10:51:37 +00:00
added server title change option
This commit is contained in:
parent
32ab726fe9
commit
c7cfe69dea
3 changed files with 23 additions and 1 deletions
|
|
@ -7,7 +7,7 @@
|
|||
</nuxt-link>
|
||||
|
||||
<nuxt-link to="/">
|
||||
<h1 class="text-xl mr-6 hidden lg:block hover:underline">Bookfire</h1>
|
||||
<h1 class="text-xl mr-6 hidden lg:block hover:underline">{{ serverTitle }}</h1>
|
||||
</nuxt-link>
|
||||
|
||||
<ui-libraries-dropdown class="mr-2" />
|
||||
|
|
@ -220,6 +220,9 @@ export default {
|
|||
}
|
||||
|
||||
return options
|
||||
},
|
||||
serverTitle() {
|
||||
return this.$store.state.serverSettings?.title || 'Bookfire'
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
|
|
|
|||
|
|
@ -3,6 +3,14 @@
|
|||
<app-settings-content :header-text="$strings.HeaderServerStyling || 'Server Styling'">
|
||||
<div class="w-full max-w-3xl">
|
||||
<div class="pt-4">
|
||||
<h2 class="font-semibold">Server Title</h2>
|
||||
<p class="text-sm text-gray-400 mt-1">Customize the name of your server.</p>
|
||||
<div class="mt-4">
|
||||
<input type="text" v-model="title" class="w-full bg-primary/20 border border-gray-600 rounded px-3 py-2" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="pt-8">
|
||||
<h2 class="font-semibold">Theme Colors</h2>
|
||||
<p class="text-sm text-gray-400 mt-1">Customize the appearance of your server by adjusting these colors.</p>
|
||||
</div>
|
||||
|
|
@ -118,6 +126,7 @@ export default {
|
|||
data() {
|
||||
return {
|
||||
saving: false,
|
||||
title: '',
|
||||
colors: {
|
||||
primary: '#1e293b',
|
||||
primaryDark: '#0f172a',
|
||||
|
|
@ -143,6 +152,7 @@ export default {
|
|||
this.saving = true
|
||||
try {
|
||||
await this.$store.dispatch('updateServerSettings', {
|
||||
title: this.title,
|
||||
styling: this.colors
|
||||
})
|
||||
this.$toast.success('Server styling updated')
|
||||
|
|
@ -159,6 +169,8 @@ export default {
|
|||
if (serverStyling) {
|
||||
this.colors = { ...this.colors, ...serverStyling }
|
||||
}
|
||||
// Load saved title
|
||||
this.title = this.$store.state.serverSettings?.title || 'Bookfire'
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
@ -9,6 +9,9 @@ class ServerSettings {
|
|||
this.id = 'server-settings'
|
||||
this.tokenSecret = null
|
||||
|
||||
// Server Title
|
||||
this.title = 'Bookfire'
|
||||
|
||||
// Styling
|
||||
this.styling = {
|
||||
primary: '#1e293b',
|
||||
|
|
@ -100,6 +103,9 @@ class ServerSettings {
|
|||
construct(settings) {
|
||||
this.tokenSecret = settings.tokenSecret
|
||||
|
||||
// Server Title
|
||||
this.title = settings.title || 'Bookfire'
|
||||
|
||||
// Styling
|
||||
if (settings.styling) {
|
||||
this.styling = {
|
||||
|
|
@ -224,6 +230,7 @@ class ServerSettings {
|
|||
return {
|
||||
id: this.id,
|
||||
tokenSecret: this.tokenSecret, // Do not return to client
|
||||
title: this.title,
|
||||
styling: { ...this.styling },
|
||||
scannerFindCovers: this.scannerFindCovers,
|
||||
scannerCoverProvider: this.scannerCoverProvider,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue