Add proxy settings.

This commit is contained in:
NBTX
2019-08-28 02:24:49 +01:00
parent 38f6f4ef2e
commit 85d51b2362
2 changed files with 42 additions and 6 deletions

View File

@@ -5,8 +5,8 @@
<li> <li>
<h3 class="title">Background</h3> <h3 class="title">Background</h3>
<div class="backgrounds"> <div class="backgrounds">
<span v-for="theme in themes" :key="theme.class" @click="applyTheme(theme.class)"> <span :key="theme.class" @click="applyTheme(theme.class)" v-for="theme in themes">
<swatch :color="theme.color" :name="theme.name" :class="{ vibrant: theme.vibrant }" :active="settings.THEME_CLASS === theme.class"></swatch> <swatch :active="settings.THEME_CLASS === theme.class" :class="{ vibrant: theme.vibrant }" :color="theme.color" :name="theme.name"></swatch>
</span> </span>
</div> </div>
</li> </li>
@@ -15,22 +15,47 @@
<li> <li>
<h3 class="title">Color</h3> <h3 class="title">Color</h3>
<div class="colors"> <div class="colors">
<span v-for="entry in colors" :key="entry.color" @click.prevent="setActiveColor(entry.color, entry.vibrant)"> <span :key="entry.color" @click.prevent="setActiveColor(entry.color, entry.vibrant)" v-for="entry in colors">
<swatch :color="entry.color" :name="entry.name" :class="{ vibrant: entry.vibrant }" :active="settings.THEME_COLOR === entry.color.toUpperCase()" /> <swatch :active="settings.THEME_COLOR === entry.color.toUpperCase()" :class="{ vibrant: entry.vibrant }" :color="entry.color" :name="entry.name" />
</span> </span>
</div> </div>
<p> <p>
<input id="disableFrameColors" type="checkbox" :checked="!settings.DISABLE_FRAME_COLORS" @change="toggleSetting('DISABLE_FRAME_COLORS')"> <input :checked="!settings.DISABLE_FRAME_COLORS" @change="toggleSetting('DISABLE_FRAME_COLORS')" id="disableFrameColors" type="checkbox">
<label for="disableFrameColors">Enable multi-colored frames</label> <label for="disableFrameColors">Enable multi-colored frames</label>
</p> </p>
</li> </li>
</ul> </ul>
</pw-section> </pw-section>
<pw-section class="blue" label="Proxy">
<ul>
<li>
<p>
<input :checked="settings.PROXY_ENABLED" @change="toggleSetting('PROXY_ENABLED')"
id="enableProxy"
type="checkbox">
<label for="enableProxy">Enable proxy</label>
</p>
</li>
</ul>
<ul>
<li>
<label for="url">URL</label>
<input id="url" type="url" v-model="url">
</li>
<li>
<label for="key">Key</label>
<input id="key" type="password" v-model="url">
</li>
</ul>
</pw-section>
</div> </div>
</template> </template>
<script> <script>
import section from "../components/section"; import section from "../components/section";
import swatch from "../components/settings/swatch"; import swatch from "../components/settings/swatch";
export default { export default {
data() { data() {
return { return {
@@ -87,6 +112,8 @@
THEME_CLASS: this.$store.state.postwoman.settings.THEME_CLASS || '', THEME_CLASS: this.$store.state.postwoman.settings.THEME_CLASS || '',
THEME_COLOR: '', THEME_COLOR: '',
THEME_COLOR_VIBRANT: true, THEME_COLOR_VIBRANT: true,
PROXY_ENABLED: this.$store.state.postwoman.settings.PROXY_ENABLED || false,
DISABLE_FRAME_COLORS: this.$store.state.postwoman.settings.DISABLE_FRAME_COLORS || false DISABLE_FRAME_COLORS: this.$store.state.postwoman.settings.DISABLE_FRAME_COLORS || false
} }
} }

View File

@@ -24,7 +24,16 @@ export const SETTINGS_KEYS = [
* to emphasise the different sections. * to emphasise the different sections.
* This setting allows that to be turned off. * This setting allows that to be turned off.
*/ */
"DISABLE_FRAME_COLORS" "DISABLE_FRAME_COLORS",
/**
* Whether or not requests should be proxied.
*/
"PROXY_ENABLED",
"PROXY_URL",
"PROXY_AUTH"
]; ];
export const state = () => ({ export const state = () => ({