diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/App.vue | 18 | ||||
-rw-r--r-- | src/assets/app.scss | 3 | ||||
-rw-r--r-- | src/assets/defaults.yml | 2 | ||||
-rw-r--r-- | src/components/DynamicTheme.vue | 8 | ||||
-rw-r--r-- | src/components/Message.vue | 6 |
5 files changed, 30 insertions, 7 deletions
diff --git a/src/App.vue b/src/App.vue index b13b98f..d7054a7 100644 --- a/src/App.vue +++ b/src/App.vue | |||
@@ -150,7 +150,13 @@ export default { | |||
150 | }, | 150 | }, |
151 | created: async function () { | 151 | created: async function () { |
152 | const defaults = jsyaml.load(defaultConfig); | 152 | const defaults = jsyaml.load(defaultConfig); |
153 | let config = await this.getConfig(); | 153 | let config; |
154 | try { | ||
155 | config = await this.getConfig(); | ||
156 | } catch (error) { | ||
157 | console.log(error); | ||
158 | config = this.handleErrors("⚠️ Error loading configuration", error); | ||
159 | } | ||
154 | this.config = merge(defaults, config); | 160 | this.config = merge(defaults, config); |
155 | this.services = this.config.services; | 161 | this.services = this.config.services; |
156 | document.title = `${this.config.title} | ${this.config.subtitle}`; | 162 | document.title = `${this.config.title} | ${this.config.subtitle}`; |
@@ -158,8 +164,13 @@ export default { | |||
158 | methods: { | 164 | methods: { |
159 | getConfig: function (path = "assets/config.yml") { | 165 | getConfig: function (path = "assets/config.yml") { |
160 | return fetch(path).then((response) => { | 166 | return fetch(path).then((response) => { |
167 | if (response.redirected) { | ||
168 | // This allows to work with authentication proxies. | ||
169 | window.location.href = response.url; | ||
170 | return; | ||
171 | } | ||
161 | if (!response.ok) { | 172 | if (!response.ok) { |
162 | throw Error(response.statusText); | 173 | throw Error(`${response.statusText}: ${response.body}`); |
163 | } | 174 | } |
164 | 175 | ||
165 | const that = this; | 176 | const that = this; |
@@ -173,9 +184,6 @@ export default { | |||
173 | return that.getConfig(config.externalConfig); | 184 | return that.getConfig(config.externalConfig); |
174 | } | 185 | } |
175 | return config; | 186 | return config; |
176 | }) | ||
177 | .catch((error) => { | ||
178 | return this.handleErrors("⚠️ Error loading configuration", error); | ||
179 | }); | 187 | }); |
180 | }); | 188 | }); |
181 | }, | 189 | }, |
diff --git a/src/assets/app.scss b/src/assets/app.scss index ab067e6..4585874 100644 --- a/src/assets/app.scss +++ b/src/assets/app.scss | |||
@@ -24,6 +24,9 @@ body { | |||
24 | #app { | 24 | #app { |
25 | min-height: 100%; | 25 | min-height: 100%; |
26 | background-color: var(--background); | 26 | background-color: var(--background); |
27 | background-image: var(--background-image); | ||
28 | background-size: cover; | ||
29 | background-position: center; | ||
27 | color: var(--text); | 30 | color: var(--text); |
28 | transition: background-color cubic-bezier(0.165, 0.84, 0.44, 1) 300ms; | 31 | transition: background-color cubic-bezier(0.165, 0.84, 0.44, 1) 300ms; |
29 | 32 | ||
diff --git a/src/assets/defaults.yml b/src/assets/defaults.yml index 99f5ed5..f011346 100644 --- a/src/assets/defaults.yml +++ b/src/assets/defaults.yml | |||
@@ -24,6 +24,7 @@ colors: | |||
24 | text-subtitle: "#424242" | 24 | text-subtitle: "#424242" |
25 | card-shadow: rgba(0, 0, 0, 0.1) | 25 | card-shadow: rgba(0, 0, 0, 0.1) |
26 | link-hover: "#363636" | 26 | link-hover: "#363636" |
27 | background-image: "" | ||
27 | dark: | 28 | dark: |
28 | highlight-primary: "#3367d6" | 29 | highlight-primary: "#3367d6" |
29 | highlight-secondary: "#4285f4" | 30 | highlight-secondary: "#4285f4" |
@@ -36,6 +37,7 @@ colors: | |||
36 | text-subtitle: "#f5f5f5" | 37 | text-subtitle: "#f5f5f5" |
37 | card-shadow: rgba(0, 0, 0, 0.4) | 38 | card-shadow: rgba(0, 0, 0, 0.4) |
38 | link-hover: "#ffdd57" | 39 | link-hover: "#ffdd57" |
40 | background-image: "" | ||
39 | 41 | ||
40 | message: ~ | 42 | message: ~ |
41 | links: [] | 43 | links: [] |
diff --git a/src/components/DynamicTheme.vue b/src/components/DynamicTheme.vue index cf9963b..2ccb47b 100644 --- a/src/components/DynamicTheme.vue +++ b/src/components/DynamicTheme.vue | |||
@@ -25,7 +25,13 @@ export default { | |||
25 | getVars: function (theme) { | 25 | getVars: function (theme) { |
26 | let vars = []; | 26 | let vars = []; |
27 | for (const themeVars in theme) { | 27 | for (const themeVars in theme) { |
28 | vars.push(`--${themeVars}: ${theme[themeVars]}`); | 28 | let value = `${theme[themeVars]}`; |
29 | if (!value) { | ||
30 | value = "inital"; | ||
31 | } else if (themeVars == "background-image") { | ||
32 | value = `url(${theme[themeVars]})`; | ||
33 | } | ||
34 | vars.push(`--${themeVars}: ${value}`); | ||
29 | } | 35 | } |
30 | return vars.join(";"); | 36 | return vars.join(";"); |
31 | }, | 37 | }, |
diff --git a/src/components/Message.vue b/src/components/Message.vue index 2c3df40..d007d3e 100644 --- a/src/components/Message.vue +++ b/src/components/Message.vue | |||
@@ -3,7 +3,11 @@ | |||
3 | <div v-if="message.title" class="message-header"> | 3 | <div v-if="message.title" class="message-header"> |
4 | <p>{{ message.title }}</p> | 4 | <p>{{ message.title }}</p> |
5 | </div> | 5 | </div> |
6 | <div v-if="message.content" class="message-body" v-html="message.content"></div> | 6 | <div |
7 | v-if="message.content" | ||
8 | class="message-body" | ||
9 | v-html="message.content" | ||
10 | ></div> | ||
7 | </article> | 11 | </article> |
8 | </template> | 12 | </template> |
9 | 13 | ||