Add alvinn mini settings

Signed-off-by: Justin Georgi <justin.georgi@gmail.com>
This commit is contained in:
2024-03-11 21:10:06 -07:00
parent 76a0cba2af
commit 6e35fcb141
9 changed files with 87 additions and 7 deletions

View File

@@ -12,9 +12,12 @@
<f7-list-item title="Light" :checked="themeSettings.darkMode.toString() == 'false'" radio name="darkmode" radio-icon="end" @change="setDarkMode(false)" ></f7-list-item>
<f7-list-item title="Dark" :checked="themeSettings.darkMode.toString() == 'true'" radio name="darkmode" radio-icon="end" @change="setDarkMode(true)" ></f7-list-item>
</f7-list>
<f7-button @click="saveAllSettings">Save</f7-button>
<f7-block-title @click="toggleSettingsView" medium>Advanced Settings</f7-block-title>
<f7-block-title @click="toggleSettingsView" medium><f7-icon :f7="showAdvanced ? 'chevron_down' : 'chevron_right'" /> Advanced Settings </f7-block-title>
<div ref="advancedSettings" class="settings-container">
<div style="display:flex; justify-content:space-between; width: 100%; margin-bottom: 10px;">
<span style="margin-left: 16px;">Use mini ALVINN<f7-icon size="16" style="padding-left: 5px;" f7="question_diamond_fill" tooltip="faster, less accurate: recommended for slower devices" /></span>
<f7-toggle v-model:checked="otherSettings.mini" style="margin-right: 16px;" />
</div>
<div style="display:flex; justify-content:space-between; width: 100%">
<span style="margin-left: 16px;">Use external server</span>
<f7-toggle v-model:checked="serverSettings.use" style="margin-right: 16px;" />
@@ -29,6 +32,7 @@
<f7-list-item v-if="Object.keys(otherIp).length == 0" title="No previous server settings"></f7-list-item>
</f7-list>
</div>
<f7-button fill @click="saveAllSettings">SAVE</f7-button>
</div>
</f7-block>
</f7-page>
@@ -49,6 +53,9 @@
data () {
return {
showAdvanced: false,
otherSettings: {
mini: false
},
serverSettings: {
use: false,
address: '10.170.64.22',
@@ -77,6 +84,8 @@
if (!this.serverSettings.previous) this.serverSettings.previous = {}
var loadThemeSettings = localStorage.getItem('themeSettings')
if (loadThemeSettings) this.themeSettings = JSON.parse(loadThemeSettings)
var loadOtherSettings = localStorage.getItem('otherSettings')
if (loadOtherSettings) this.otherSettings = JSON.parse(loadOtherSettings)
},
methods: {
saveAllSettings () {
@@ -88,6 +97,7 @@
}
localStorage.setItem('serverSettings',JSON.stringify(this.serverSettings))
localStorage.setItem('themeSettings',JSON.stringify(this.themeSettings))
localStorage.setItem('otherSettings',JSON.stringify(this.otherSettings))
saved()
} catch {
failed()