Skip to content

Commit

Permalink
init runtime.public ;; cleared up misc errors
Browse files Browse the repository at this point in the history
  • Loading branch information
wommy committed Oct 7, 2024
1 parent 7d9fb27 commit c840d37
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 14 deletions.
4 changes: 2 additions & 2 deletions client/components/app/ConfigSideNav.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@

<div class="w-44 h-12 px-4 border-t bg-bg border-black border-opacity-20 fixed left-0 flex flex-col justify-center" :class="wrapperClass" :style="{ bottom: streamLibraryItem ? '160px' : '0px' }">
<div class="flex items-center justify-between">
<button type="button" class="underline font-mono text-sm" @click="clickChangelog">v{{ $config.version }}</button>
<button type="button" class="underline font-mono text-sm" @click="clickChangelog">v{{ $config.public.version }}</button>

<p class="text-xs text-gray-300 italic">{{ Source }}</p>
</div>
<a v-if="hasUpdate" :href="githubTagUrl" target="_blank" class="text-warning text-xs">Latest: {{ $config.version }}</a>
<a v-if="hasUpdate" :href="githubTagUrl" target="_blank" class="text-warning text-xs">Latest: {{ $config.public.version }}</a>
</div>
</div>
</template>
Expand Down
2 changes: 1 addition & 1 deletion client/components/app/SideRail.vue
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@
</div>

<div class="w-full h-12 px-1 py-2 border-t border-black/20 bg-bg absolute left-0" :style="{ bottom: streamLibraryItem ? '224px' : '65px' }">
<p class="underline font-mono text-xs text-center text-gray-300 leading-3 mb-1" @click="clickChangelog">v{{ $config.version }}</p>
<p class="underline font-mono text-xs text-center text-gray-300 leading-3 mb-1" @click="clickChangelog">v{{ $config.public.version }}</p>
<a v-if="hasUpdate" :href="githubTagUrl" target="_blank" class="text-warning text-xxs text-center block leading-3">Update</a>
<p v-else class="text-xxs text-gray-400 leading-3 text-center italic">{{ Source }}</p>
</div>
Expand Down
2 changes: 1 addition & 1 deletion client/components/covers/AuthorImage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ export default {
if (!this.imagePath) return null
if (process.env.NODE_ENV !== 'production') {
// Testing
return `http://localhost:3333${this.$config.routerBasePath}/api/authors/${this.authorId}/image?token=${this.userToken}&ts=${this.updatedAt}`
return `http://localhost:3333${this.$config.public.routerBasePath}/api/authors/${this.authorId}/image?token=${this.userToken}&ts=${this.updatedAt}`
}
return `/api/authors/${this.authorId}/image?token=${this.userToken}&ts=${this.updatedAt}`
}
Expand Down
4 changes: 2 additions & 2 deletions client/components/modals/player/QueueItemRow.vue
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export default {
return this.item.coverPath
},
coverUrl() {
if (!this.coverPath) return `${this.$config.routerBasePath}/book_placeholder.jpg`
if (!this.coverPath) return `${this.$config.public.routerBasePath}/book_placeholder.jpg`
return this.$store.getters['globals/getLibraryItemCoverSrcById'](this.libraryItemId)
},
bookCoverAspectRatio() {
Expand Down Expand Up @@ -99,4 +99,4 @@ export default {
.queue-item-row-content {
max-width: calc(100% - 48px - 128px);
}
</style>
</style>
2 changes: 1 addition & 1 deletion client/components/modals/rssfeed/OpenCloseModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ export default {
slug: this.newFeedSlug,
metadataDetails: this.metadataDetails
}
if (this.$isDev) payload.serverAddress = `http://localhost:3333${this.$config.routerBasePath}`
if (this.$isDev) payload.serverAddress = `http://localhost:3333${this.$config.public.routerBasePath}`
console.log('Payload', payload)
this.$axios
Expand Down
8 changes: 5 additions & 3 deletions client/nuxt.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ export default defineNuxtConfig({
},
telemetry: false,

publicRuntimeConfig: {
version: pkg.version,
routerBasePath: process.env.ROUTER_BASE_PATH || ''
runtimeConfig: {
public: {
version: pkg.version,
routerBasePath: process.env.ROUTER_BASE_PATH || ''
}
},

// Global page headers: https://go.nuxtjs.dev/config-head
Expand Down
2 changes: 1 addition & 1 deletion client/pages/audiobook/_id/chapters.vue
Original file line number Diff line number Diff line change
Expand Up @@ -415,7 +415,7 @@ export default {
const audioEl = this.audioEl || document.createElement('audio')
var src = audioTrack.contentUrl + `?token=${this.userToken}`
if (this.$isDev) {
src = `http://localhost:3333${this.$config.routerBasePath}${src}`
src = `http://localhost:3333${this.$config.public.routerBasePath}${src}`
}
audioEl.src = src
Expand Down
2 changes: 1 addition & 1 deletion client/pages/config/rss-feeds.vue
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default {
return this.$strings.LabelUnknown
},
coverUrl(feed) {
if (!feed.coverPath) return `${this.$config.routerBasePath}/Logo.png`
if (!feed.coverPath) return `${this.$config.public.routerBasePath}/Logo.png`
return `${feed.feedUrl}/cover`
},
async loadFeeds() {
Expand Down
2 changes: 1 addition & 1 deletion client/pages/share/_slug.vue
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export default {
return this.mediaItemShare.playbackSession
},
coverUrl() {
if (!this.playbackSession.coverPath) return `${this.$config.routerBasePath}/book_placeholder.jpg`
if (!this.playbackSession.coverPath) return `${this.$config.public.routerBasePath}/book_placeholder.jpg`
if (process.env.NODE_ENV === 'development') {
return `http://localhost:3333/public/share/${this.mediaItemShare.slug}/cover`
}
Expand Down
2 changes: 1 addition & 1 deletion client/plugins/init.client.js
Original file line number Diff line number Diff line change
Expand Up @@ -181,5 +181,5 @@ export default ({ app, store }, inject) => {
inject('eventBus', new Vue())
inject('isDev', process.env.NODE_ENV !== 'production')

store.commit('setRouterBasePath', app.$config.routerBasePath)
store.commit('setRouterBasePath', app.$config.public.routerBasePath)
}

0 comments on commit c840d37

Please sign in to comment.