Prettier, committed to prevent conflicts
This commit is contained in:
parent
284533742d
commit
99d3acaef5
|
@ -4,8 +4,7 @@ import config from '../config';
|
|||
import { Store } from 'vuex';
|
||||
import { StateInterface } from 'src/store';
|
||||
import { LocalStorage } from 'quasar';
|
||||
import {Notify} from 'quasar';
|
||||
import {Router} from 'src/router';
|
||||
import { Notify } from 'quasar';
|
||||
|
||||
declare module 'vue/types/vue' {
|
||||
interface Vue {
|
||||
|
@ -17,21 +16,22 @@ export const setBaseUrl = (url: string) => {
|
|||
LocalStorage.set('baseURL', url);
|
||||
axios.defaults.baseURL = url;
|
||||
Notify.create({
|
||||
message: "Serveraddresse gespeichert",
|
||||
position: "bottom",
|
||||
message: 'Serveraddresse gespeichert',
|
||||
position: 'bottom',
|
||||
caption: `${url}`,
|
||||
color: "positive"
|
||||
})
|
||||
setTimeout(() => {window.location.reload()}, 5000)
|
||||
|
||||
}
|
||||
color: 'positive'
|
||||
});
|
||||
setTimeout(() => {
|
||||
window.location.reload();
|
||||
}, 5000);
|
||||
};
|
||||
|
||||
export default boot<Store<StateInterface>>(({ Vue, store, router }) => {
|
||||
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
|
||||
Vue.prototype.$axios = axios;
|
||||
const baseURL = <string | undefined>LocalStorage.getItem('baseURL');
|
||||
if (baseURL){
|
||||
axios.defaults.baseURL = baseURL
|
||||
if (baseURL) {
|
||||
axios.defaults.baseURL = baseURL;
|
||||
} else {
|
||||
axios.defaults.baseURL = config.baseURL;
|
||||
}
|
||||
|
|
|
@ -35,24 +35,21 @@
|
|||
<q-btn label="Login" type="submit" color="primary" tabindex="3" />
|
||||
</div>
|
||||
</q-form>
|
||||
|
||||
</q-card-section>
|
||||
<div class="row justify-end">
|
||||
<q-btn flat round icon="mdi-menu-down" class="cordova-only" @click="openServerSettings"/>
|
||||
<q-btn flat round icon="mdi-menu-down" class="cordova-only" @click="openServerSettings" />
|
||||
</div>
|
||||
<q-slide-transition class="cordova-only">
|
||||
|
||||
<div v-show="visible">
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<q-form ref="ServerSettingsForm" @submit="changeUrl" class="q-gutter-md">
|
||||
<div class="text-h6">Servereinstellung</div>
|
||||
<q-input filled label="Server" dense v-model="server" />
|
||||
<q-btn size="xs" dense color="primary" label="Speichern" type="submit" />
|
||||
</q-form>
|
||||
</q-card-section>
|
||||
|
||||
</div>
|
||||
<q-slide-transition class="cordova-only">
|
||||
<div v-show="visible">
|
||||
<q-separator />
|
||||
<q-card-section>
|
||||
<q-form ref="ServerSettingsForm" @submit="changeUrl" class="q-gutter-md">
|
||||
<div class="text-h6">Servereinstellung</div>
|
||||
<q-input filled label="Server" dense v-model="server" />
|
||||
<q-btn size="xs" dense color="primary" label="Speichern" type="submit" />
|
||||
</q-form>
|
||||
</q-card-section>
|
||||
</div>
|
||||
</q-slide-transition>
|
||||
</q-card>
|
||||
</q-page>
|
||||
|
@ -72,16 +69,16 @@ export default defineComponent({
|
|||
const userid = ref('');
|
||||
const password = ref('');
|
||||
const rules = [(val: string) => (val && val.length > 0) || 'Feld darf nicht leer sein!'];
|
||||
const server = ref<string|undefined>(root.$axios.defaults.baseURL)
|
||||
const server = ref<string | undefined>(root.$axios.defaults.baseURL);
|
||||
const visible = ref(false);
|
||||
|
||||
function openServerSettings() {
|
||||
visible.value = !visible.value
|
||||
visible.value = !visible.value;
|
||||
}
|
||||
|
||||
function changeUrl() {
|
||||
if (server.value) {
|
||||
setBaseUrl(server.value)
|
||||
setBaseUrl(server.value);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -147,7 +144,17 @@ export default defineComponent({
|
|||
});
|
||||
}
|
||||
|
||||
return { userid, password, doLogin, doReset, rules, server, changeUrl, visible, openServerSettings };
|
||||
return {
|
||||
userid,
|
||||
password,
|
||||
doLogin,
|
||||
doReset,
|
||||
rules,
|
||||
server,
|
||||
changeUrl,
|
||||
visible,
|
||||
openServerSettings
|
||||
};
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
|
Loading…
Reference in New Issue