fix logo & fallbackimages reload

This commit is contained in:
lesion 2022-11-29 23:03:36 +01:00
parent aafafe8eaa
commit 0088f0d25c
No known key found for this signature in database
GPG key ID: 352918250B012177
2 changed files with 8 additions and 6 deletions

View file

@ -16,6 +16,7 @@ v-container
:label="$t('admin.hide_calendar')")
v-card-title {{$t('admin.default_images')}}
v-card-subtitle(v-html="$t('admin.default_images_help')")
v-card-text
v-row
v-col(cols='4')
@ -109,12 +110,13 @@ import { mdiDeleteForever, mdiRestore, mdiPlus, mdiChevronUp } from '@mdi/js'
export default {
name: 'Theme',
data () {
const t = new Date().getMilliseconds()
return {
mdiDeleteForever, mdiRestore, mdiPlus, mdiChevronUp,
valid: false,
logoKey: 0,
fallbackImageKey: 0,
headerImageKey: 0,
logoKey: t,
fallbackImageKey: t,
headerImageKey: t,
link: { href: '', label: '' },
linkModal: false
// menu: [false, false, false, false]

View file

@ -120,7 +120,7 @@ module.exports = {
router.use('/fallbackimage.png', (req, res, next) => {
const fallbackImagePath = settingsController.settings.fallback_image || './static/noimg.svg'
return express.static(fallbackImagePath, { maxAge: '1d' })(req, res, next)
return express.static(fallbackImagePath)(req, res, next)
})
router.use('/headerimage.png', (req, res, next) => {
@ -130,12 +130,12 @@ module.exports = {
router.use('/logo.png', (req, res, next) => {
const logoPath = settingsController.settings.logo || './static/gancio'
return express.static(logoPath + '.png', {maxAge: '1d'})(req, res, next)
return express.static(logoPath + '.png')(req, res, next)
})
router.use('/favicon.ico', (req, res, next) => {
const faviconPath = res.locals.settings.logo ? res.locals.settings.logo + '.png' : './assets/favicon.ico'
return express.static(faviconPath, {maxAge: '1d'})(req, res, next)
return express.static(faviconPath)(req, res, next)
})
return router