Skip to content

Commit

Permalink
Add support for infoBackground with a base url for proxy/cache
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsOnlyBinary committed Dec 7, 2020
1 parent e7ef764 commit 19527ee
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ const data = new Vue({
iframeSnippet: '',
saving: false,
networkType: 'default',
baseBackgroundUrl: 'http://127.0.0.1:8088/image-cache/x1000/',
};
},
});
Expand Down
28 changes: 28 additions & 0 deletions src/components/StartupScreen.vue
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,16 @@
>
</div>
</div>
<div class="input-column">
<label for="welcome-background">Background URL</label>
<input
id="welcome-background"
v-model="startupBackground"
type="text"
@change="update"
@keyup="update"
>
</div>
</div>
<!--
<div v-for="field in ZNCfields" :key="field">
Expand Down Expand Up @@ -119,6 +129,23 @@ function infoContent(defaultVal) {
};
}
function infoBackground(defaultVal) {
return {
get() {
const baseBackgroundUrl = this.localData.baseBackgroundUrl;
const startupOptions = this.localData.config.startupOptions;
return startupOptions.infoBackground === undefined ?
defaultVal :
startupOptions.infoBackground.replace(new RegExp(`^${baseBackgroundUrl}`), '');
},
set(newVal) {
const baseBackgroundUrl = this.localData.baseBackgroundUrl;
const startupOptions = this.localData.config.startupOptions;
this.$set(startupOptions, 'infoBackground', baseBackgroundUrl + newVal);
},
};
}
export default {
name: 'StartupScreen',
props: ['localData'],
Expand All @@ -129,6 +156,7 @@ export default {
startupShowChannel: startupOption('showChannel', true),
startupShowNick: startupOption('showNick', true),
startupShowPassword: startupOption('showPassword', true),
startupBackground: infoBackground(''),
},
methods: {
update() {
Expand Down

0 comments on commit 19527ee

Please sign in to comment.