Adds option for custom background image and footer

This commit is contained in:
Alicia Sykes
2021-05-04 19:43:42 +01:00
parent 2831391ad4
commit b44707ab3c
5 changed files with 27 additions and 7 deletions

View File

@@ -2,7 +2,7 @@
<div id="dashy" data-theme="dark">
<Header :pageInfo="getPageInfo(pageInfo)" />
<router-view />
<Footer v-if="showFooter" />
<Footer v-if="showFooter" :text="getFooterText()" />
</div>
</template>
<script>
@@ -36,6 +36,12 @@ export default {
}
return defaults;
},
getFooterText() {
if (this.pageInfo && this.pageInfo.footerText) {
return this.pageInfo.footerText;
}
return '';
},
},
};
</script>

View File

@@ -1,5 +1,8 @@
<template>
<footer>
<!-- User Footer -->
<footer v-if="text && text !== ''">{{text}}</footer>
<!-- Default Footer -->
<footer v-else>
Developed by <a :href="authorUrl">{{authorName}}</a>.
Licensed under <a :href="licenseUrl">{{license}}</a>
{{ showCopyright? '©': '' }} {{date}}.
@@ -18,6 +21,7 @@ export default {
date: { type: String, default: `${new Date().getFullYear()}` },
showCopyright: { type: Boolean, default: true },
repoUrl: { type: String, default: 'https://github.com/lissy93/panel' },
text: String,
},
};
</script>

View File

@@ -6,6 +6,7 @@ module.exports = {
{ title: 'Home', path: '/' },
{ title: 'Source', path: 'https://github.com/Lissy93/dashy' },
],
footerText: '',
},
appConfig: {},
iconSize: 'medium',

View File

@@ -1,5 +1,5 @@
<template>
<div class="home">
<div class="home" :style="getBackgroundImage()">
<!-- Search bar, layout options and settings -->
<SettingsContainer ref="filterComp"
@user-is-searchin="searching"
@@ -164,6 +164,12 @@ export default {
return itemsFound;
}
},
getBackgroundImage() {
if (this.appConfig && this.appConfig.backgroundImg) {
return `background: url('${this.appConfig.backgroundImg}');background-size:cover;`;
}
return '';
},
},
mounted() {
this.initiateFontAwesome();