6 Commits

Author SHA1 Message Date
Adrian Zürcher
9a55d4c2f0 fix source string undefined in logo image 2026-02-09 07:38:47 +01:00
Adrian Zürcher
bf481da21e hide image if undefined 2026-02-09 07:36:32 +01:00
Adrian Zürcher
b0d225f7b8 fix add member with with group close #38 2026-02-09 07:28:20 +01:00
Adrian Zürcher
5324787f23 fix language duplicate error 2026-02-09 07:16:11 +01:00
Adrian Zürcher
bb626bf6b5 fix cookie error close #40 2026-02-09 07:15:28 +01:00
Adrian Zürcher
d4663a9afc add first version of report page (development)
All checks were successful
Build Quasar SPA and Go Backend for memberApp / build-spa (push) Successful in 3m1s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, , linux) (push) Successful in 3m48s
Build Quasar SPA and Go Backend for memberApp / build-backend (amd64, .exe, windows) (push) Successful in 3m34s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm, 6, , linux) (push) Successful in 3m30s
Build Quasar SPA and Go Backend for memberApp / build-backend (arm64, , linux) (push) Successful in 3m42s
2026-02-08 08:55:54 +01:00
8 changed files with 130 additions and 9 deletions

View File

@@ -1,6 +1,6 @@
{
"name": "lightcontrol",
"version": "1.2.3",
"version": "1.2.4",
"description": "A Tecamino App",
"productName": "Attendence Records",
"author": "A. Zuercher",

View File

@@ -112,7 +112,7 @@ export default defineConfig((/* ctx */) => {
//directives: [],
// Quasar plugins
plugins: ['Notify', 'Dialog'],
plugins: ['Cookies', 'Notify', 'Dialog'],
},
// animations: 'all', // --- includes all animations

View File

@@ -145,7 +145,7 @@ FridayShort: Vi
Saturday: Sábado
SaturdayShort:
Sunday: Domingo
Sunday: Do
SundayShort: Do
currentPassword: Contraseña actual
addFirstUser: Añadir primer usuario administrador
report: Informe

View File

@@ -0,0 +1,78 @@
<template>
<div class="q-gutter-sm">
<h6 class="text-center text-bold q-ma-md text-primary">{{ props.title }}</h6>
<div class="row">
<q-checkbox
style="min-width: 75px"
dense
v-for="opt in weekdayOptions"
:key="opt.value"
v-model="selectedWeekdays"
:val="opt.value"
:label="opt.label"
/>
</div>
<div class="row">
<q-date v-model="dateRange" range flat />
<div>
<q-badge color="secondary"> Total dates selected: {{ filteredDates.length }} </q-badge>
</div>
</div>
</div>
</template>
<script setup lang="ts">
import { ref, computed, onMounted } from 'vue';
import { date } from 'quasar';
import { i18n } from 'src/boot/lang';
const props = defineProps({
title: String,
});
const startDate = new Date();
// Initial range (format: YYYY/MM/DD)
const dateRange = ref();
const selectedWeekdays = ref([0, 3]); // Default to weekdays
onMounted(() => {
dateRange.value = date.formatDate(startDate, 'YYYY/MM/DD');
});
const weekdayOptions = [
{ label: i18n.global.t('MondayShort'), value: 1 },
{ label: i18n.global.t('TuesdayShort'), value: 2 },
{ label: i18n.global.t('WednesdayShort'), value: 3 },
{ label: i18n.global.t('ThursdayShort'), value: 4 },
{ label: i18n.global.t('FridayShort'), value: 5 },
{ label: i18n.global.t('SaturdayShort'), value: 6 },
{ label: i18n.global.t('SundayShort'), value: 0 },
];
// The Logic: Calculate all specific dates within the range that match weekdays
const filteredDates = computed(() => {
if (!dateRange.value) {
return [];
} else if (typeof dateRange.value === 'string') {
const current = new Date(dateRange.value);
if (current !== undefined && selectedWeekdays.value.includes(current.getDay())) {
return [date.formatDate(current, 'YYYY/MM/DD')];
}
return [];
}
const end = new Date(dateRange.value.to);
const result = [];
let current = new Date(dateRange.value.from);
while (current <= end) {
if (selectedWeekdays.value.includes(current.getDay())) {
result.push(date.formatDate(current, 'YYYY/MM/DD'));
}
current = date.addToDate(current, { days: 1 });
}
return result;
});
</script>

View File

@@ -69,7 +69,6 @@
filled
emit-value
map-options
option-value="name"
option-label="name"
v-model="localMember.group"
></q-select>
@@ -107,7 +106,7 @@
import DialogFrame from 'src/vueLib/dialog/DialogFrame.vue';
import { type PropType, ref } from 'vue';
import { appApi } from 'src/boot/axios';
import type { Member } from 'src/vueLib/models/member';
import type { Member, Members } from 'src/vueLib/models/member';
import { useNotify } from 'src/vueLib/general/useNotify';
import { i18n } from 'src/boot/lang';
import type { Responsibles } from 'src/vueLib/models/responsible';
@@ -127,7 +126,7 @@ const props = defineProps({
type: Object as PropType<Responsibles>,
},
group: {
type: Array,
type: Object as PropType<Members>,
},
});
@@ -164,6 +163,7 @@ async function save() {
let payload = JSON.stringify([localMember.value]);
if (newMember.value) {
query = 'members/add';
console.log(33, localMember.value);
payload = JSON.stringify(localMember.value);
}

View File

@@ -3,11 +3,13 @@
<q-header elevated>
<q-toolbar>
<q-img
v-if="localLogo !== undefined && localLogo !== ''"
:src="localLogo"
alt="Logo"
style="width: 40px; height: 40px; background-color: var(--q-primary)"
class="q-mr-sm"
/>
<q-btn flat dense round icon="menu" aria-label="Menu" @click="toggleLeftDrawer" />
<q-toolbar-title class="text-primary-text"> {{ $t(appName) }} </q-toolbar-title>
@@ -66,7 +68,7 @@
<q-item v-if="!autorized" to="/login" exact clickable v-ripple @click="closeDrawer">
<q-item-section>{{ $t('login') }}</q-item-section>
</q-item>
<!-- <q-item
<q-item
v-if="autorized || user.isPermittedTo('members', 'read')"
to="/report"
exact
@@ -75,7 +77,7 @@
@click="closeDrawer"
>
<q-item-section> {{ $t('report') }}</q-item-section>
</q-item> -->
</q-item>
<q-item v-if="autorized" to="/stats" exact clickable v-ripple @click="closeDrawer">
<q-item-section> {{ $t('stats') }}</q-item-section>
</q-item>

View File

@@ -24,8 +24,13 @@ export function getLocalSettings(): Settings {
db = databaseName.value;
}
let iconName = localStorage.getItem('icon');
if (iconName === undefined || iconName === 'undefined') {
iconName = '';
}
return <Settings>{
icon: localStorage.getItem('icon'),
icon: iconName,
appName: name,
databaseName: db,
primaryColor: localStorage.getItem('primaryColor'),

36
src/pages/ReportPage.vue Normal file
View File

@@ -0,0 +1,36 @@
<template>
<div class="rows">
<div class="row justify-end">
<div class="column">
<DateDaySelect title="hjgjh" />
</div>
</div>
</div>
<q-btn @click="openDateSelect">Hallo</q-btn>
<DialogFrame :header-title="$t('selectDates')" :width="350" :height="500" ref="dateSelect">
<DateDaySelect :title="$t('selectDates')" />
<q-btn color="primary" no-caps>{{ $t('apply') }}</q-btn>
</DialogFrame>
</template>
<script setup lang="ts">
import { appApi } from 'src/boot/axios';
import DateDaySelect from 'src/components/DateDaySelect.vue';
import { onMounted, ref } from 'vue';
import { useNotify } from 'src/vueLib/general/useNotify';
import DialogFrame from 'src/vueLib/dialog/DialogFrame.vue';
const dateSelect = ref();
const { NotifyResponse } = useNotify();
onMounted(() => {
appApi
.get('events')
.then((resp) => console.log(1, resp))
.catch((err) => NotifyResponse(err, 'error'));
});
function openDateSelect() {
dateSelect.value?.open();
}
</script>