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

@ -14,12 +14,13 @@
- Instant search by name, domain and tags - just start typing - Instant search by name, domain and tags - just start typing
- Full keyboard shortcuts for navigation, searching and launching - Full keyboard shortcuts for navigation, searching and launching
- Multiple color themes, with easy method for adding more themes - Multiple color themes, with easy method for adding more
- Customizable layout options and item sizes - Customizable layout options, and item sizes
- Preferences stored in local storage and applied on load
- Quickly preview a website, by holding down the Alt key while clicking, to open it in a resizable pop-up modal - Quickly preview a website, by holding down the Alt key while clicking, to open it in a resizable pop-up modal
- Many options for icons, including full Font-Awesome support and the ability to auto-fetch icon from URLs favicon - Many options for icons, including full Font-Awesome support and the ability to auto-fetch icon from URLs favicon
- Additional info for each item visible on hover (including opening method icon and description as a tooltip) - Additional info for each item visible on hover (including opening method icon and description as a tooltip)
- Option for full-screen background image, custom nav-bar links, and custom footer
- Preferences stored in local storage and applied on load
- Easy YAML-based configuration - Easy YAML-based configuration
- Small bundle size and a fully responsive UI makes the app easy to use on any device - Small bundle size and a fully responsive UI makes the app easy to use on any device
- Plus lots more... - Plus lots more...
@ -81,11 +82,13 @@ All fields are optional, unless otherwise stated.
- `navLinks` - Array: Links to display in the nav bar, an array or objects containing a title and link: - `navLinks` - Array: Links to display in the nav bar, an array or objects containing a title and link:
- `title` - String: Text to display - `title` - String: Text to display
- `path` - String: URL or relative link - `path` - String: URL or relative link
- `footerText` - String: Text to display in the footer
**`appConfig`** _(optional)_ **`appConfig`** _(optional)_
- `backgroundImg` - String: Path to an optional full-screen app background image. This can be either remote (http) or local (/). Note that this will slow down initial load
- `enableFontAwesome` - Boolean: Where `true` is enabled, if left blank font-awesome will be enabled only if required by 1 or more icons - `enableFontAwesome` - Boolean: Where `true` is enabled, if left blank font-awesome will be enabled only if required by 1 or more icons
- `fontAwesomeKey` - String: If you have a font-awesome key, then you can use it here and make use of premium icons. It is a 10-digit alpha-numeric string from you're FA kit URL (e.g. `13014ae648`) - `fontAwesomeKey` - String: If you have a font-awesome key, then you can use it here and make use of premium icons. It is a 10-digit alpha-numeric string from you're FA kit URL (e.g. `13014ae648`)
- `theme`- String: The default theme for first load - `theme`- String: The default theme for first load (you can change this later from the UI)
- `cssThemes` - String[]: An array of custom theme names which can be used in the theme switcher dropdown - _See **theming** below_ - `cssThemes` - String[]: An array of custom theme names which can be used in the theme switcher dropdown - _See **theming** below_
- `externalStyleSheet` - String or String[] - Either a URL to an external stylesheet or an array or URLs, which can be applied as themes within the UI - `externalStyleSheet` - String or String[] - Either a URL to an external stylesheet or an array or URLs, which can be applied as themes within the UI

View File

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

View File

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

View File

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

View File

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