diff options
author | Tom Pansino <2768420+tpansino@users.noreply.github.com> | 2020-09-01 23:47:59 -0700 |
---|---|---|
committer | Tom Pansino <2768420+tpansino@users.noreply.github.com> | 2020-09-01 23:47:59 -0700 |
commit | fbe9338fd3a78141110530055c9b90a5958f845f (patch) | |
tree | 28903d9875cd07df41dd4c35eb8d7487a6bfbae6 /src | |
parent | 7e5ad02248551770613339957640f38d50ce670f (diff) | |
parent | 83665e4f48e8db29d74a2e84b8befb6076c08665 (diff) | |
download | homer-fbe9338fd3a78141110530055c9b90a5958f845f.tar.gz homer-fbe9338fd3a78141110530055c9b90a5958f845f.tar.zst homer-fbe9338fd3a78141110530055c9b90a5958f845f.zip |
Merge remote-tracking branch 'upstream/master' into feature/custom-card-colors
Diffstat (limited to 'src')
-rw-r--r-- | src/App.vue | 14 | ||||
-rw-r--r-- | src/components/Navbar.vue | 3 |
2 files changed, 14 insertions, 3 deletions
diff --git a/src/App.vue b/src/App.vue index d7054a7..03760fd 100644 --- a/src/App.vue +++ b/src/App.vue | |||
@@ -14,7 +14,7 @@ | |||
14 | <div v-cloak class="container"> | 14 | <div v-cloak class="container"> |
15 | <div class="logo"> | 15 | <div class="logo"> |
16 | <img v-if="config.logo" :src="config.logo" alt="dashboard logo" /> | 16 | <img v-if="config.logo" :src="config.logo" alt="dashboard logo" /> |
17 | <i v-if="config.icon" :class="['fa-fw', config.icon]"></i> | 17 | <i v-if="config.icon" :class="config.icon"></i> |
18 | </div> | 18 | </div> |
19 | <div class="dashboard-title"> | 19 | <div class="dashboard-title"> |
20 | <span class="headline">{{ config.subtitle }}</span> | 20 | <span class="headline">{{ config.subtitle }}</span> |
@@ -160,6 +160,13 @@ export default { | |||
160 | this.config = merge(defaults, config); | 160 | this.config = merge(defaults, config); |
161 | this.services = this.config.services; | 161 | this.services = this.config.services; |
162 | document.title = `${this.config.title} | ${this.config.subtitle}`; | 162 | document.title = `${this.config.title} | ${this.config.subtitle}`; |
163 | if (this.config.stylesheet) { | ||
164 | let stylesheet = ''; | ||
165 | for (const file of this.config.stylesheet) { | ||
166 | stylesheet += `@import "${file}";`; | ||
167 | } | ||
168 | this.createStylesheet(stylesheet); | ||
169 | } | ||
163 | }, | 170 | }, |
164 | methods: { | 171 | methods: { |
165 | getConfig: function (path = "assets/config.yml") { | 172 | getConfig: function (path = "assets/config.yml") { |
@@ -235,6 +242,11 @@ export default { | |||
235 | }, | 242 | }, |
236 | }; | 243 | }; |
237 | }, | 244 | }, |
245 | createStylesheet: function(css) { | ||
246 | let style = document.createElement('style'); | ||
247 | style.appendChild(document.createTextNode(css)); | ||
248 | document.head.appendChild(style); | ||
249 | }, | ||
238 | }, | 250 | }, |
239 | }; | 251 | }; |
240 | </script> | 252 | </script> |
diff --git a/src/components/Navbar.vue b/src/components/Navbar.vue index c688a3a..ae84166 100644 --- a/src/components/Navbar.vue +++ b/src/components/Navbar.vue | |||
@@ -28,8 +28,7 @@ | |||
28 | > | 28 | > |
29 | <i | 29 | <i |
30 | v-if="link.icon" | 30 | v-if="link.icon" |
31 | style="margin-right: 6px;" | 31 | :class="['fa-fw', link.icon, { 'mr-2': link.name }]" |
32 | :class="['fa-fw', link.icon]" | ||
33 | ></i> | 32 | ></i> |
34 | {{ link.name }} | 33 | {{ link.name }} |
35 | </a> | 34 | </a> |