[Vue3] Increase warning level for better code quality and fixed issues found.

This commit is contained in:
Ferdinand Thiessen 2021-02-02 00:48:33 +01:00
parent 68fa8fa1a8
commit 34312cca96
28 changed files with 83 additions and 83 deletions

View File

@ -39,8 +39,8 @@ module.exports = {
// but leave only one uncommented! // but leave only one uncommented!
// See https://eslint.vuejs.org/rules/#available-rules // See https://eslint.vuejs.org/rules/#available-rules
// 'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention) // 'plugin:vue/vue3-essential', // Priority A: Essential (Error Prevention)
'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability) // 'plugin:vue/vue3-strongly-recommended', // Priority B: Strongly Recommended (Improving Readability)
// 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead) 'plugin:vue/vue3-recommended', // Priority C: Recommended (Minimizing Arbitrary Choices and Cognitive Overhead)
// https://github.com/prettier/eslint-config-prettier#installation // https://github.com/prettier/eslint-config-prettier#installation
// usage with Prettier, provided by 'eslint-config-prettier'. // usage with Prettier, provided by 'eslint-config-prettier'.

View File

@ -1,5 +1,5 @@
<template> <template>
<q-item clickable tag="a" target="self" :to="{ name: link }" v-if="isGranted"> <q-item v-if="isGranted" clickable tag="a" target="self" :to="{ name: link }">
<q-item-section v-if="icon" avatar> <q-item-section v-if="icon" avatar>
<q-icon :name="icon" /> <q-icon :name="icon" />
</q-item-section> </q-item-section>

View File

@ -1,5 +1,5 @@
<template> <template>
<q-btn flat dense :icon="icon" :to="{ name: link }" v-if="isGranted" /> <q-btn v-if="isGranted" flat dense :icon="icon" :to="{ name: link }" />
</template> </template>
<script lang="ts"> <script lang="ts">

View File

@ -5,11 +5,11 @@
:label="label" :label="label"
:value="getDateTime()" :value="getDateTime()"
:placeholder="placeholder" :placeholder="placeholder"
@input="dateTimeChanged"
:rules="customRules" :rules="customRules"
@input="dateTimeChanged"
> >
<template #append> <template #append>
<q-icon name="event" class="cursor-pointer" v-if="type == 'date' || type == 'datetime'"> <q-icon v-if="type == 'date' || type == 'datetime'" name="event" class="cursor-pointer">
<q-popup-proxy ref="qDateProxy" transition-show="scale" transition-hide="scale"> <q-popup-proxy ref="qDateProxy" transition-show="scale" transition-hide="scale">
<q-date :value="getDate()" mask="YYYY-MM-DD" @input="dateChanged"> <q-date :value="getDate()" mask="YYYY-MM-DD" @input="dateChanged">
<div class="row items-center justify-end"> <div class="row items-center justify-end">
@ -19,9 +19,9 @@
</q-popup-proxy> </q-popup-proxy>
</q-icon> </q-icon>
<q-icon <q-icon
v-if="type == 'time' || type == 'datetime'"
name="mdi-clock-outline" name="mdi-clock-outline"
class="cursor-pointer" class="cursor-pointer"
v-if="type == 'time' || type == 'datetime'"
> >
<q-popup-proxy ref="qTimeProxy" transition-show="scale" transition-hide="scale"> <q-popup-proxy ref="qTimeProxy" transition-show="scale" transition-hide="scale">
<q-time :value="getTime()" mask="HH:mm" @input="timeChanged"> <q-time :value="getTime()" mask="HH:mm" @input="timeChanged">

View File

@ -4,12 +4,12 @@
<q-toolbar> <q-toolbar>
<!-- Button um Navigationsleiset ein und auszublenden. Nötig bei Desktop? --> <!-- Button um Navigationsleiset ein und auszublenden. Nötig bei Desktop? -->
<q-btn <q-btn
v-if="!leftDrawerOpen"
dense dense
flat flat
round round
icon="menu" icon="menu"
@click="leftDrawerOpen = !leftDrawerOpen" @click="leftDrawerOpen = !leftDrawerOpen"
v-if="!leftDrawerOpen"
/> />
<q-toolbar-title> <q-toolbar-title>
@ -36,8 +36,8 @@
</q-header> </q-header>
<q-drawer <q-drawer
show-if-above
v-model="leftDrawerOpen" v-model="leftDrawerOpen"
show-if-above
side="left" side="left"
bordered bordered
:mini="leftDrawerMini" :mini="leftDrawerMini"

View File

@ -17,19 +17,19 @@
/> />
</div> </div>
<q-btn <q-btn
v-if="$route.name != 'about_out'"
flat flat
round round
dense dense
icon="mdi-information" icon="mdi-information"
v-if="$route.name != 'about_out'"
@click="$router.push({ name: 'about_out' })" @click="$router.push({ name: 'about_out' })"
/> />
<q-btn <q-btn
v-if="$route.name != 'login'"
flat flat
round round
dense dense
icon="mdi-login-variant" icon="mdi-login-variant"
v-if="$route.name != 'login'"
@click="$router.push({ name: 'login' })" @click="$router.push({ name: 'login' })"
/> />
</q-toolbar> </q-toolbar>

View File

@ -6,17 +6,17 @@
</q-toolbar> </q-toolbar>
<q-card-section> <q-card-section>
<q-form ref="LoginForm" @submit="doLogin" class="q-gutter-md"> <q-form ref="LoginForm" class="q-gutter-md" @submit="doLogin">
<q-input <q-input
filled
v-model="userid" v-model="userid"
filled
label="Benutzername oder E-Mail" label="Benutzername oder E-Mail"
:rules="rules" :rules="rules"
tabindex="1" tabindex="1"
/> />
<q-input <q-input
filled
v-model="password" v-model="password"
filled
type="password" type="password"
label="Password" label="Password"
:rules="rules" :rules="rules"
@ -26,9 +26,9 @@
<q-btn <q-btn
label="Passwort vergessen" label="Passwort vergessen"
type="a" type="a"
@click="doReset"
color="secondary" color="secondary"
tabindex="4" tabindex="4"
@click="doReset"
/> />
<q-btn label="Login" type="submit" color="primary" tabindex="3" /> <q-btn label="Login" type="submit" color="primary" tabindex="3" />
</div> </div>
@ -41,9 +41,9 @@
<div v-show="visible"> <div v-show="visible">
<q-separator /> <q-separator />
<q-card-section> <q-card-section>
<q-form ref="ServerSettingsForm" @submit="changeUrl" class="q-gutter-md"> <q-form ref="ServerSettingsForm" class="q-gutter-md" @submit="changeUrl">
<div class="text-h6">Servereinstellung</div> <div class="text-h6">Servereinstellung</div>
<q-input filled label="Server" dense v-model="server" /> <q-input v-model="server" filled label="Server" dense />
<q-btn size="xs" dense color="primary" label="Speichern" type="submit" /> <q-btn size="xs" dense color="primary" label="Speichern" type="submit" />
</q-form> </q-form>
</q-card-section> </q-card-section>

View File

@ -6,10 +6,10 @@
</q-toolbar> </q-toolbar>
<q-card-section> <q-card-section>
<q-form ref="ResetForm" @submit="doReset" class="q-gutter-md"> <q-form ref="ResetForm" class="q-gutter-md" @submit="doReset">
<q-input <q-input
filled
v-model="password" v-model="password"
filled
type="password" type="password"
label="Passwort" label="Passwort"
:rules="rules" :rules="rules"
@ -17,8 +17,8 @@
tabindex="1" tabindex="1"
/> />
<q-input <q-input
filled
v-model="password2" v-model="password2"
filled
type="password" type="password"
label="Passwort Wiederholung" label="Passwort Wiederholung"
:rules="rules" :rules="rules"

View File

@ -1,8 +1,8 @@
<template> <template>
<q-page <q-page
v-if="$route.name == 'about' || $route.name == 'about_out'"
padding padding
class="fit row justify-center content-center items-center" class="fit row justify-center content-center items-center"
v-if="$route.name == 'about' || $route.name == 'about_out'"
> >
<div class="fit row justify-center content-center items-center"> <div class="fit row justify-center content-center items-center">
<q-img <q-img
@ -23,8 +23,8 @@
</div> </div>
<q-separator /> <q-separator />
<div class="col-12 text-h6 q-pa-sm" v-if="$route.name == 'about'">Geladene Plugins:</div> <div v-if="$route.name == 'about'" class="col-12 text-h6 q-pa-sm">Geladene Plugins:</div>
<div class="col-12 q-pa-sm" v-if="$route.name == 'about'"> <div v-if="$route.name == 'about'" class="col-12 q-pa-sm">
<q-chip <q-chip
v-for="(plugin, index) in $flaschengeistPlugins.plugins" v-for="(plugin, index) in $flaschengeistPlugins.plugins"
:key="'plugin' + index" :key="'plugin' + index"

View File

@ -1,17 +1,17 @@
<template> <template>
<q-card> <q-card>
<BalanceHeader <BalanceHeader
@update:user="userUpdated"
:show-selector="showSelector" :show-selector="showSelector"
@update:user="userUpdated"
@open-history="openHistory" @open-history="openHistory"
/> />
<q-separator /> <q-separator />
<q-card-section class="row q-col-gutter-md" v-if="shortCuts"> <q-card-section v-if="shortCuts" class="row q-col-gutter-md">
<div :key="index" v-for="(shortcut, index) in shortCuts" class="col-4"> <div v-for="(shortcut, index) in shortCuts" :key="index" class="col-4">
<q-btn <q-btn
push
v-if="shortcut" v-if="shortcut"
push
color="primary" color="primary"
style="width: 100%" style="width: 100%"
:label="shortcut.toFixed(2).toString() + ' €'" :label="shortcut.toFixed(2).toString() + ' €'"
@ -42,7 +42,7 @@
label="Anschreiben" label="Anschreiben"
@click="changeBalance(amount * -1)" @click="changeBalance(amount * -1)"
><q-tooltip>Rechtsklick um Betrag als Verknüpfung hinzuzufügen</q-tooltip> ><q-tooltip>Rechtsklick um Betrag als Verknüpfung hinzuzufügen</q-tooltip>
<q-popup-proxy context-menu v-model="showAddShortcut"> <q-popup-proxy v-model="showAddShortcut" context-menu>
<q-btn label="neue Verknüpfung" @click="addShortcut"></q-btn> <q-btn label="neue Verknüpfung" @click="addShortcut"></q-btn>
</q-popup-proxy> </q-popup-proxy>
</q-btn> </q-btn>

View File

@ -2,7 +2,7 @@
<q-card-section class="fit row justify-left content-center items-center q-col-gutter-sm"> <q-card-section class="fit row justify-left content-center items-center q-col-gutter-sm">
<div class="text-h6 col-5"> <div class="text-h6 col-5">
Aktueller Stand: {{ balance.balance.toFixed(2) }} Aktueller Stand: {{ balance.balance.toFixed(2) }}
<q-badge color="negative" align="top" v-if="isLocked"> gesperrt </q-badge> <q-badge v-if="isLocked" color="negative" align="top"> gesperrt </q-badge>
</div> </div>
<div v-if="showSelector" class="col-6"> <div v-if="showSelector" class="col-6">
<UserSelector :user="user" @update:user="userUpdated" /> <UserSelector :user="user" @update:user="userUpdated" />

View File

@ -1,8 +1,8 @@
<template> <template>
<q-card> <q-card>
<BalanceHeader <BalanceHeader
@update:user="senderUpdated"
:show-selector="showSelector" :show-selector="showSelector"
@update:user="senderUpdated"
@open-history="openHistory" @open-history="openHistory"
/> />
<q-separator /> <q-separator />
@ -11,7 +11,7 @@
<q-input v-model.number="amount" type="number" filled label="Betrag" step="0.1" min="0" /> <q-input v-model.number="amount" type="number" filled label="Betrag" step="0.1" min="0" />
</div> </div>
<div class="col-sm-4 col-xs-6"> <div class="col-sm-4 col-xs-6">
<UserSelector :user="receiver" @update:user="receiverUpdated" label="Empfänger" /> <UserSelector :user="receiver" label="Empfänger" @update:user="receiverUpdated" />
</div> </div>
<div class="col-sm-4 col-xs-6"> <div class="col-sm-4 col-xs-6">
<q-btn <q-btn

View File

@ -10,7 +10,7 @@
<div class="text-caption">{{ timeStr }}</div> <div class="text-caption">{{ timeStr }}</div>
</div> </div>
<div class="col-5 q-px-sm text-center"> <div class="col-5 q-px-sm text-center">
<div class="text-subtitle1" v-if="isReversed">Storniert</div> <div v-if="isReversed" class="text-subtitle1">Storniert</div>
</div> </div>
<div class="col-2 q-pr-sm" style="text-align: right"> <div class="col-2 q-pr-sm" style="text-align: right">
<q-btn <q-btn
@ -45,7 +45,6 @@ export default defineComponent({
}, },
}, },
emits: { 'update:transaction': (t: FG.Transaction) => !!t }, emits: { 'update:transaction': (t: FG.Transaction) => !!t },
watch: { transaction: 'refreshText' },
setup(props, { emit }) { setup(props, { emit }) {
const now = ref(Date.now()); const now = ref(Date.now());
const ival = setInterval(() => (now.value = Date.now()), 1000); const ival = setInterval(() => (now.value = Date.now()), 1000);
@ -109,5 +108,6 @@ export default defineComponent({
return { timeStr, reverse, isNegative, text, refreshText, canReverse, isReversed }; return { timeStr, reverse, isNegative, text, refreshText, canReverse, isReversed };
}, },
watch: { transaction: 'refreshText' },
}); });
</script> </script>

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<q-tabs v-model="tab" v-if="$q.screen.gt.sm"> <q-tabs v-if="$q.screen.gt.sm" v-model="tab">
<q-tab <q-tab
v-for="(tabindex, index) in tabs" v-for="(tabindex, index) in tabs"
:key="'tab' + index" :key="'tab' + index"
@ -8,7 +8,7 @@
:label="tabindex.label" :label="tabindex.label"
/> />
</q-tabs> </q-tabs>
<div class="fit row justify-end" v-else> <div v-else class="fit row justify-end">
<q-btn <q-btn
flat flat
round round
@ -19,8 +19,8 @@
" "
/> />
</div> </div>
<q-drawer side="right" v-model="showDrawer" @click="showDrawer = !showDrawer" behavior="mobile"> <q-drawer v-model="showDrawer" side="right" behavior="mobile" @click="showDrawer = !showDrawer">
<q-list v-model="tab" v-if="!$q.screen.gt.sm && !show"> <q-list v-if="!$q.screen.gt.sm && !show" v-model="tab">
<q-item <q-item
v-for="(tabindex, index) in tabs" v-for="(tabindex, index) in tabs"
:key="'tab' + index" :key="'tab' + index"

View File

@ -8,14 +8,14 @@
<q-separator /> <q-separator />
<q-card-section> <q-card-section>
<q-table <q-table
v-model:pagination="pagination"
title="Buchungen" title="Buchungen"
:data="data" :data="data"
:columns="columns" :columns="columns"
row-key="id" row-key="id"
v-model:pagination="pagination"
:loading="loading" :loading="loading"
@request="onRequest"
binary-state-sort binary-state-sort
@request="onRequest"
> >
<template #top> <template #top>
<q-toggle v-model="showCancelled" label="Stornierte einblenden" /> <q-toggle v-model="showCancelled" label="Stornierte einblenden" />

View File

@ -7,12 +7,12 @@
<div class="text-h6">Veranstaltung erstellen</div> <div class="text-h6">Veranstaltung erstellen</div>
</q-card-section> </q-card-section>
<q-select <q-select
v-model="event.type"
filled filled
use-input use-input
label="Veranstaltungstyp" label="Veranstaltungstyp"
input-debounce="0" input-debounce="0"
class="col-xs-12 col-sm-6 q-pa-sm" class="col-xs-12 col-sm-6 q-pa-sm"
v-model="event.type"
:options="eventtypes" :options="eventtypes"
option-label="name" option-label="name"
option-value="name" option-value="name"
@ -21,18 +21,18 @@
:rules="[notEmpty]" :rules="[notEmpty]"
/> />
<IsoDateInput <IsoDateInput
class="col-xs-12 col-sm-6 q-pa-sm"
v-model="event.start" v-model="event.start"
class="col-xs-12 col-sm-6 q-pa-sm"
label="Veranstaltungsbeginn" label="Veranstaltungsbeginn"
:rules="[noValidDate, notEmpty]" :rules="[noValidDate, notEmpty]"
/> />
</q-card-section> </q-card-section>
<q-card-section class="fit justify-start content-center items-center"> <q-card-section class="fit justify-start content-center items-center">
<q-input <q-input
v-model="event.description"
class="col-xs-12 col-sm-6 q-pa-sm" class="col-xs-12 col-sm-6 q-pa-sm"
label="Beschreibung" label="Beschreibung"
type="textarea" type="textarea"
v-model="event.description"
filled filled
/> />
</q-card-section> </q-card-section>

View File

@ -6,7 +6,7 @@
<div class="text-h6">Editere Diensttyp {{ actualEvent.name }}</div> <div class="text-h6">Editere Diensttyp {{ actualEvent.name }}</div>
</q-card-section> </q-card-section>
<q-card-section> <q-card-section>
<q-input dense label="name" filled v-model="newEventName" /> <q-input v-model="newEventName" dense label="name" filled />
</q-card-section> </q-card-section>
<q-card-actions> <q-card-actions>
<q-btn flat color="danger" label="Abbrechen" @click="discardChanges()" /> <q-btn flat color="danger" label="Abbrechen" @click="discardChanges()" />
@ -20,7 +20,7 @@
<q-card-section> <q-card-section>
<q-table title="Veranstaltungstypen" :data="rows" row-key="jobid" :columns="columns"> <q-table title="Veranstaltungstypen" :data="rows" row-key="jobid" :columns="columns">
<template #top-right> <template #top-right>
<q-input dense v-model="newEventType" placeholder="Neuer Typ" /> <q-input v-model="newEventType" dense placeholder="Neuer Typ" />
<div></div> <div></div>
<q-btn color="primary" icon="mdi-plus" label="Hinzufügen" @click="addType" /> <q-btn color="primary" icon="mdi-plus" label="Hinzufügen" @click="addType" />

View File

@ -4,19 +4,19 @@
<IsoDateInput <IsoDateInput
class="col-xs-12 col-sm-6 q-pa-sm" class="col-xs-12 col-sm-6 q-pa-sm"
:value="job.start" :value="job.start"
@input="setStart"
label="Beginn" label="Beginn"
type="datetime" type="datetime"
:rules="[noValidDate, notEmpty]" :rules="[noValidDate, notEmpty]"
@input="setStart"
/> />
<IsoDateInput <IsoDateInput
ref="bla" ref="bla"
class="col-xs-12 col-sm-6 q-pa-sm" class="col-xs-12 col-sm-6 q-pa-sm"
:value="job.end" :value="job.end"
@input="setEnd"
label="Ende" label="Ende"
type="datetime" type="datetime"
:rules="[noValidDate, isAfterDate, notEmpty]" :rules="[noValidDate, isAfterDate, notEmpty]"
@input="setEnd"
/> />
</q-card-section> </q-card-section>
<q-card-section class="row fit justify-start content-center items-center"> <q-card-section class="row fit justify-start content-center items-center">
@ -29,12 +29,12 @@
class="col-xs-12 col-sm-6 q-pa-sm" class="col-xs-12 col-sm-6 q-pa-sm"
:value="job.type" :value="job.type"
:options="jobtypes" :options="jobtypes"
@input="setJobType"
option-label="name" option-label="name"
option-value="name" option-value="name"
map-options map-options
clearable clearable
:rules="[notEmpty]" :rules="[notEmpty]"
@input="setJobType"
/> />
<q-input <q-input
filled filled
@ -42,8 +42,8 @@
label="Dienstanzahl" label="Dienstanzahl"
type="number" type="number"
:value="job.required_services" :value="job.required_services"
@input="setRequired"
:rules="[notEmpty]" :rules="[notEmpty]"
@input="setRequired"
/> />
</q-card-section> </q-card-section>
<q-card-section class="fit row justify-start content-center items-center"> <q-card-section class="fit row justify-start content-center items-center">
@ -52,12 +52,12 @@
label="Beschreibung" label="Beschreibung"
type="textarea" type="textarea"
:value="job.comment" :value="job.comment"
@input="setComment"
filled filled
:rules="[notEmpty]" :rules="[notEmpty]"
@input="setComment"
/> />
</q-card-section> </q-card-section>
<q-btn label="Schicht löschen" color="negative" @click="removeJob" :disabled="jobCanDelete" /> <q-btn label="Schicht löschen" color="negative" :disabled="jobCanDelete" @click="removeJob" />
</q-card-section> </q-card-section>
</template> </template>

View File

@ -6,7 +6,7 @@
<div class="text-h6">Editere Diensttyp {{ actualJob.name }}</div> <div class="text-h6">Editere Diensttyp {{ actualJob.name }}</div>
</q-card-section> </q-card-section>
<q-card-section> <q-card-section>
<q-input dense label="name" filled v-model="newJobName" /> <q-input v-model="newJobName" dense label="name" filled />
</q-card-section> </q-card-section>
<q-card-actions> <q-card-actions>
<q-btn flat color="danger" label="Abbrechen" @click="discardChanges()" /> <q-btn flat color="danger" label="Abbrechen" @click="discardChanges()" />
@ -20,7 +20,7 @@
<q-card-section> <q-card-section>
<q-table title="Diensttypen" :data="rows" row-key="jobid" :columns="columns"> <q-table title="Diensttypen" :data="rows" row-key="jobid" :columns="columns">
<template #top-right> <template #top-right>
<q-input dense v-model="newJob" placeholder="Neuer Typ" /> <q-input v-model="newJob" dense placeholder="Neuer Typ" />
<div></div> <div></div>
<q-btn color="primary" icon="mdi-plus" label="Hinzufügen" @click="addType" /> <q-btn color="primary" icon="mdi-plus" label="Hinzufügen" @click="addType" />

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<q-page padding v-if="checkMain"> <q-page v-if="checkMain" padding>
<q-card> <q-card>
<q-card-section> <q-card-section>
<q-list v-for="(mainRoute, index) in mainRoutes" :key="'mainRoute' + index"> <q-list v-for="(mainRoute, index) in mainRoutes" :key="'mainRoute' + index">

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<q-tabs v-model="tab" v-if="$q.screen.gt.sm"> <q-tabs v-if="$q.screen.gt.sm" v-model="tab">
<q-tab <q-tab
v-for="(tabindex, index) in tabs" v-for="(tabindex, index) in tabs"
:key="'tab' + index" :key="'tab' + index"
@ -8,10 +8,10 @@
:label="tabindex.label" :label="tabindex.label"
/> />
</q-tabs> </q-tabs>
<div class="fit row justify-end" v-else> <div v-else class="fit row justify-end">
<q-btn flat round icon="mdi-menu" @click="showDrawer = !showDrawer" /> <q-btn flat round icon="mdi-menu" @click="showDrawer = !showDrawer" />
</div> </div>
<q-drawer side="right" v-model="showDrawer" @click="showDrawer = !showDrawer" behavior="mobile"> <q-drawer v-model="showDrawer" side="right" behavior="mobile" @click="showDrawer = !showDrawer">
<q-list v-model="tab"> <q-list v-model="tab">
<q-item <q-item
v-for="(tabindex, index) in tabs" v-for="(tabindex, index) in tabs"

View File

@ -4,7 +4,7 @@
<div class="col-xs-12 col-sm-6 text-center text-h6">Neues Mitglied</div> <div class="col-xs-12 col-sm-6 text-center text-h6">Neues Mitglied</div>
</q-card-section> </q-card-section>
<q-card-section> <q-card-section>
<MainUserSettings :user="user" @update:user="setUser" :new-user="true" /> <MainUserSettings :user="user" :new-user="true" @update:user="setUser" />
</q-card-section> </q-card-section>
</q-card> </q-card>
</template> </template>

View File

@ -2,12 +2,12 @@
<q-select <q-select
filled filled
:label="label" :label="label"
@input="updated"
:value="modelValue" :value="modelValue"
:options="users" :options="users"
option-label="display_name" option-label="display_name"
option-value="userid" option-value="userid"
map-options map-options
@input="updated"
/> />
</template> </template>

View File

@ -2,62 +2,62 @@
<q-form @submit="save" @reset="reset"> <q-form @submit="save" @reset="reset">
<q-card-section class="fit row justify-start content-center items-center"> <q-card-section class="fit row justify-start content-center items-center">
<q-input <q-input
v-model="user_model.firstname"
class="col-xs-12 col-sm-6 q-pa-sm" class="col-xs-12 col-sm-6 q-pa-sm"
label="Vorname" label="Vorname"
:rules="[notEmpty]" :rules="[notEmpty]"
v-model="user_model.firstname"
filled filled
/> />
<q-input <q-input
v-model="user_model.lastname"
class="col-xs-12 col-sm-6 q-pa-sm" class="col-xs-12 col-sm-6 q-pa-sm"
label="Nachname" label="Nachname"
:rules="[notEmpty]" :rules="[notEmpty]"
v-model="user_model.lastname"
filled filled
/> />
<q-input <q-input
v-model="user_model.display_name"
class="col-xs-12 col-sm-6 q-pa-sm" class="col-xs-12 col-sm-6 q-pa-sm"
label="Angezeigter Name" label="Angezeigter Name"
:rules="[notEmpty]" :rules="[notEmpty]"
v-model="user_model.display_name"
filled filled
/> />
<q-input <q-input
v-model="user_model.mail"
class="col-xs-12 col-sm-6 q-pa-sm" class="col-xs-12 col-sm-6 q-pa-sm"
label="E-Mail" label="E-Mail"
:rules="[isEmail, notEmpty]" :rules="[isEmail, notEmpty]"
v-model="user_model.mail"
filled filled
/> />
<q-input <q-input
v-model="user_model.userid"
class="col-xs-12 col-sm-6 q-pa-sm" class="col-xs-12 col-sm-6 q-pa-sm"
label="Benutzername" label="Benutzername"
:readonly="!newUser" :readonly="!newUser"
v-model="user_model.userid"
:rules="[isUseridUsed, notEmpty]" :rules="[isUseridUsed, notEmpty]"
filled filled
/> />
<q-select <q-select
v-model="user_model.roles"
class="col-xs-12 col-sm-6 q-pa-sm" class="col-xs-12 col-sm-6 q-pa-sm"
label="Rollen" label="Rollen"
filled filled
multiple multiple
use-chips use-chips
v-model="user_model.roles"
:readonly="!canSetRoles" :readonly="!canSetRoles"
:options="allRoles" :options="allRoles"
option-label="name" option-label="name"
option-value="name" option-value="name"
/> />
<IsoDateInput <IsoDateInput
class="col-xs-12 col-sm-6 q-pa-sm"
v-model="user_model.birthday" v-model="user_model.birthday"
class="col-xs-12 col-sm-6 q-pa-sm"
label="Geburtstag" label="Geburtstag"
/> />
<q-file <q-file
class="col-xs-12 col-sm-6 q-pa-sm"
v-model="avatar" v-model="avatar"
class="col-xs-12 col-sm-6 q-pa-sm"
filled filled
label="Avatar" label="Avatar"
accept=".jpg, image/*" accept=".jpg, image/*"
@ -71,31 +71,31 @@
</q-file> </q-file>
</q-card-section> </q-card-section>
<q-separator v-if="!newUser" /> <q-separator v-if="!newUser" />
<q-card-section class="fit row justify-start content-center items-center" v-if="!newUser"> <q-card-section v-if="!newUser" class="fit row justify-start content-center items-center">
<q-input <q-input
v-if="isCurrentUser" v-if="isCurrentUser"
v-model="password"
class="col-xs-12 col-sm-6 col-md-4 q-pa-sm" class="col-xs-12 col-sm-6 col-md-4 q-pa-sm"
label="Password" label="Password"
type="password" type="password"
hint="Password muss immer eingetragen werden" hint="Password muss immer eingetragen werden"
:rules="[notEmpty]" :rules="[notEmpty]"
v-model="password"
filled filled
/> />
<q-input <q-input
v-model="new_password"
class="col-xs-12 col-sm-6 col-md-4 q-pa-sm" class="col-xs-12 col-sm-6 col-md-4 q-pa-sm"
label="Neues Password" label="Neues Password"
type="password" type="password"
v-model="new_password"
filled filled
/> />
<q-input <q-input
v-model="new_password2"
class="col-xs-12 col-sm-6 col-md-4 q-pa-sm" class="col-xs-12 col-sm-6 col-md-4 q-pa-sm"
label="Wiederhole neues Password" label="Wiederhole neues Password"
type="password" type="password"
:disable="new_password.length == 0" :disable="new_password.length == 0"
:rules="[samePassword]" :rules="[samePassword]"
v-model="new_password2"
filled filled
/> />
</q-card-section> </q-card-section>

View File

@ -15,22 +15,22 @@
option-label="name" option-label="name"
option-value="name" option-value="name"
map-options map-options
clearable
@new-value="createRole" @new-value="createRole"
@input="updateRole" @input="updateRole"
@clear="removeRole" @clear="removeRole"
clearable
/> />
</q-card-section> </q-card-section>
<q-separator /> <q-separator />
<q-card-section v-if="role" class="fit row justify-start content-center items-center"> <q-card-section v-if="role" class="fit row justify-start content-center items-center">
<q-scroll-area style="height: 20em; width: 100%"> <q-scroll-area style="height: 20em; width: 100%">
<q-input filled v-model="newRoleName" label="neuer Name" v-if="role.id != -1" /> <q-input v-if="role.id != -1" v-model="newRoleName" filled label="neuer Name" />
<q-option-group <q-option-group
:value="role.permissions" :value="role.permissions"
@input="updatePermissions"
:options="permissions" :options="permissions"
color="primary" color="primary"
type="checkbox" type="checkbox"
@input="updatePermissions"
/> />
</q-scroll-area> </q-scroll-area>
</q-card-section> </q-card-section>

View File

@ -16,29 +16,29 @@
{{ session.platform }} {{ session.platform }}
</div> </div>
</div> </div>
<div class="row" v-if="!isEdit"> <div v-if="!isEdit" class="row">
<div class="col-xs-12 col-sm-6"> <div class="col-xs-12 col-sm-6">
Lebenszeit: Lebenszeit:
{{ session.lifetime }} {{ session.lifetime }}
</div> </div>
<div class="col-xs-12 col-sm-6">Läuft aus: {{ dateTime(session.expires) }}</div> <div class="col-xs-12 col-sm-6">Läuft aus: {{ dateTime(session.expires) }}</div>
</div> </div>
<div class="row q-my-sm" v-else> <div v-else class="row q-my-sm">
<q-input <q-input
class="col-xs-12 col-sm-6 q-px-sm"
v-model="computedLifetime" v-model="computedLifetime"
class="col-xs-12 col-sm-6 q-px-sm"
type="number" type="number"
label="Zeit" label="Zeit"
filled filled
/> />
<q-select class="col-xs-12 col-sm-6 q-px-sm" :options="options" v-model="option" filled /> <q-select v-model="option" class="col-xs-12 col-sm-6 q-px-sm" :options="options" filled />
</div> </div>
</q-card-section> </q-card-section>
<q-card-actions align="right" v-if="!isEdit"> <q-card-actions v-if="!isEdit" align="right">
<q-btn flat round dense icon="mdi-pencil" @click="edit(true)" /> <q-btn flat round dense icon="mdi-pencil" @click="edit(true)" />
<q-btn flat round dense icon="mdi-delete" @click="deleteSession(session.token)" /> <q-btn flat round dense icon="mdi-delete" @click="deleteSession(session.token)" />
</q-card-actions> </q-card-actions>
<q-card-actions align="right" v-else> <q-card-actions v-else align="right">
<q-btn flat dense label="Abbrechen" @click="edit(false)" /> <q-btn flat dense label="Abbrechen" @click="edit(false)" />
<q-btn flat dense label="Speichern" @click="save" /> <q-btn flat dense label="Speichern" @click="save" />
</q-card-actions> </q-card-actions>

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<q-tabs v-model="tab" v-if="$q.screen.gt.sm"> <q-tabs v-if="$q.screen.gt.sm" v-model="tab">
<q-tab <q-tab
v-for="(tabindex, index) in tabs" v-for="(tabindex, index) in tabs"
:key="'tab' + index" :key="'tab' + index"
@ -8,10 +8,10 @@
:label="tabindex.label" :label="tabindex.label"
/> />
</q-tabs> </q-tabs>
<div class="fit row justify-end" v-else> <div v-else class="fit row justify-end">
<q-btn flat round icon="mdi-menu" @click="showDrawer = !showDrawer" /> <q-btn flat round icon="mdi-menu" @click="showDrawer = !showDrawer" />
</div> </div>
<q-drawer side="right" v-model="showDrawer" @click="showDrawer = !showDrawer" behavior="mobile"> <q-drawer v-model="showDrawer" side="right" behavior="mobile" @click="showDrawer = !showDrawer">
<q-list v-model="tab"> <q-list v-model="tab">
<q-item <q-item
v-for="(tabindex, index) in tabs" v-for="(tabindex, index) in tabs"

View File

@ -1,6 +1,6 @@
<template> <template>
<div> <div>
<q-page padding v-if="checkMain"> <q-page v-if="checkMain" padding>
<q-card> <q-card>
<q-card-section> <q-card-section>
<q-list v-for="(mainRoute, index) in mainRoutes" :key="'mainRoute' + index"> <q-list v-for="(mainRoute, index) in mainRoutes" :key="'mainRoute' + index">