init runtime.public ;; cleared up misc errors

This commit is contained in:
wommy 2024-09-24 02:59:35 -04:00
parent 2baf50da12
commit e77609ed57
10 changed files with 17 additions and 18 deletions

View File

@ -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="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"> <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> <p class="text-xs text-gray-300 italic">{{ Source }}</p>
</div> </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>
</div> </div>
</template> </template>

View File

@ -116,7 +116,7 @@
</div> </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' }"> <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> <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> <p v-else class="text-xxs text-gray-400 leading-3 text-center italic">{{ Source }}</p>
</div> </div>

View File

@ -55,8 +55,7 @@ export default {
return this._author.updatedAt return this._author.updatedAt
}, },
imgSrc() { imgSrc() {
if (!this.imagePath) return null return this.imagePath ? `${this.$config.public.routerBasePath}/api/authors/${this.authorId}/image?token=${this.userToken}&ts=${this.updatedAt}` : null
return `${this.$config.routerBasePath}/api/authors/${this.authorId}/image?token=${this.userToken}&ts=${this.updatedAt}`
} }
}, },
methods: { methods: {

View File

@ -112,11 +112,10 @@ export default {
return this.$store.state.user.user return this.$store.state.user.user
}, },
demoShareUrl() { demoShareUrl() {
return `${window.origin}${this.$config.routerBasePath}/share/${this.newShareSlug}` return `${window.origin}${this.$config.public.routerBasePath}/share/${this.newShareSlug}`
}, },
currentShareUrl() { currentShareUrl() {
if (!this.currentShare) return '' return this.currentShare ? `${window.origin}${this.$config.public.routerBasePath}/share/${this.currentShare.slug}` : ''
return `${window.origin}${this.$config.routerBasePath}/share/${this.currentShare.slug}`
}, },
currentShareTimeRemaining() { currentShareTimeRemaining() {
if (!this.currentShare) return 'Error' if (!this.currentShare) return 'Error'

View File

@ -55,7 +55,7 @@ export default {
return this.item.coverPath return this.item.coverPath
}, },
coverUrl() { 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) return this.$store.getters['globals/getLibraryItemCoverSrcById'](this.libraryItemId)
}, },
bookCoverAspectRatio() { bookCoverAspectRatio() {

View File

@ -358,7 +358,7 @@ export default {
transports: ['websocket'], transports: ['websocket'],
upgrade: false, upgrade: false,
reconnection: true, reconnection: true,
path: `${this.$config.routerBasePath}/socket.io` path: `${this.$config.public.routerBasePath}/socket.io`
}) })
this.$root.socket = this.socket this.$root.socket = this.socket
console.log('Socket initialized') console.log('Socket initialized')

View File

@ -15,9 +15,11 @@ export default defineNuxtConfig({
}, },
telemetry: false, telemetry: false,
publicRuntimeConfig: { runtimeConfig: {
public: {
version: pkg.version, version: pkg.version,
routerBasePath routerBasePath
}
}, },
// Global page headers: https://go.nuxtjs.dev/config-head // Global page headers: https://go.nuxtjs.dev/config-head

View File

@ -125,7 +125,7 @@ export default {
return this.$strings.LabelUnknown return this.$strings.LabelUnknown
}, },
coverUrl(feed) { 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` return `${feed.feedUrl}/cover`
}, },
async loadFeeds() { async loadFeeds() {

View File

@ -60,8 +60,7 @@ export default {
return this.mediaItemShare.playbackSession return this.mediaItemShare.playbackSession
}, },
coverUrl() { coverUrl() {
if (!this.playbackSession.coverPath) return `${this.$config.routerBasePath}/book_placeholder.jpg` return `${this.$config.public.routerBasePath}/${this.playbackSession.coverPath ? `public/share/${this.mediaItemShare.slug}/cover` : `book_placeholder.jpg`}`
return `${this.$config.routerBasePath}/public/share/${this.mediaItemShare.slug}/cover`
}, },
audioTracks() { audioTracks() {
return (this.playbackSession.audioTracks || []).map((track) => { return (this.playbackSession.audioTracks || []).map((track) => {

View File

@ -181,5 +181,5 @@ export default ({ app, store }, inject) => {
inject('eventBus', new Vue()) inject('eventBus', new Vue())
inject('isDev', process.env.NODE_ENV !== 'production') inject('isDev', process.env.NODE_ENV !== 'production')
store.commit('setRouterBasePath', app.$config.routerBasePath) store.commit('setRouterBasePath', app.$config.public.routerBasePath)
} }