added server title change option

This commit is contained in:
zipben 2025-06-09 09:49:14 +00:00
parent 32ab726fe9
commit c7cfe69dea
3 changed files with 23 additions and 1 deletions

View file

@ -7,7 +7,7 @@
</nuxt-link> </nuxt-link>
<nuxt-link to="/"> <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> </nuxt-link>
<ui-libraries-dropdown class="mr-2" /> <ui-libraries-dropdown class="mr-2" />
@ -220,6 +220,9 @@ export default {
} }
return options return options
},
serverTitle() {
return this.$store.state.serverSettings?.title || 'Bookfire'
} }
}, },
methods: { methods: {

View file

@ -3,6 +3,14 @@
<app-settings-content :header-text="$strings.HeaderServerStyling || 'Server Styling'"> <app-settings-content :header-text="$strings.HeaderServerStyling || 'Server Styling'">
<div class="w-full max-w-3xl"> <div class="w-full max-w-3xl">
<div class="pt-4"> <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> <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> <p class="text-sm text-gray-400 mt-1">Customize the appearance of your server by adjusting these colors.</p>
</div> </div>
@ -118,6 +126,7 @@ export default {
data() { data() {
return { return {
saving: false, saving: false,
title: '',
colors: { colors: {
primary: '#1e293b', primary: '#1e293b',
primaryDark: '#0f172a', primaryDark: '#0f172a',
@ -143,6 +152,7 @@ export default {
this.saving = true this.saving = true
try { try {
await this.$store.dispatch('updateServerSettings', { await this.$store.dispatch('updateServerSettings', {
title: this.title,
styling: this.colors styling: this.colors
}) })
this.$toast.success('Server styling updated') this.$toast.success('Server styling updated')
@ -159,6 +169,8 @@ export default {
if (serverStyling) { if (serverStyling) {
this.colors = { ...this.colors, ...serverStyling } this.colors = { ...this.colors, ...serverStyling }
} }
// Load saved title
this.title = this.$store.state.serverSettings?.title || 'Bookfire'
} }
} }
</script> </script>

View file

@ -9,6 +9,9 @@ class ServerSettings {
this.id = 'server-settings' this.id = 'server-settings'
this.tokenSecret = null this.tokenSecret = null
// Server Title
this.title = 'Bookfire'
// Styling // Styling
this.styling = { this.styling = {
primary: '#1e293b', primary: '#1e293b',
@ -100,6 +103,9 @@ class ServerSettings {
construct(settings) { construct(settings) {
this.tokenSecret = settings.tokenSecret this.tokenSecret = settings.tokenSecret
// Server Title
this.title = settings.title || 'Bookfire'
// Styling // Styling
if (settings.styling) { if (settings.styling) {
this.styling = { this.styling = {
@ -224,6 +230,7 @@ class ServerSettings {
return { return {
id: this.id, id: this.id,
tokenSecret: this.tokenSecret, // Do not return to client tokenSecret: this.tokenSecret, // Do not return to client
title: this.title,
styling: { ...this.styling }, styling: { ...this.styling },
scannerFindCovers: this.scannerFindCovers, scannerFindCovers: this.scannerFindCovers,
scannerCoverProvider: this.scannerCoverProvider, scannerCoverProvider: this.scannerCoverProvider,