Compare commits
8 Commits
v1.3.1
...
b726eb42dc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b726eb42dc | ||
|
|
8963cba016 | ||
|
|
73901335a3 | ||
|
|
62aed501f3 | ||
|
|
43d81dd27a | ||
|
|
ce654bbb6a | ||
|
|
9b2b1d3ef7 | ||
|
|
f59443ce5a |
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "lightcontrol",
|
"name": "lightcontrol",
|
||||||
"version": "1.3.0",
|
"version": "1.3.2",
|
||||||
"description": "A Tecamino App",
|
"description": "A Tecamino App",
|
||||||
"productName": "Attendence Records",
|
"productName": "Attendence Records",
|
||||||
"author": "A. Zuercher",
|
"author": "A. Zuercher",
|
||||||
|
|||||||
@@ -170,3 +170,30 @@ week: Wuche
|
|||||||
month: Monat
|
month: Monat
|
||||||
year: Jahr
|
year: Jahr
|
||||||
appName: Applikationsname
|
appName: Applikationsname
|
||||||
|
calendar:
|
||||||
|
days:
|
||||||
|
- 'Suntig'
|
||||||
|
- 'Mäntig'
|
||||||
|
- 'Zistig'
|
||||||
|
- 'Mittwuch'
|
||||||
|
- 'Donstig'
|
||||||
|
- 'Fritig'
|
||||||
|
- 'Samstig'
|
||||||
|
daysShort: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa']
|
||||||
|
months:
|
||||||
|
- 'Januar'
|
||||||
|
- 'Februar'
|
||||||
|
- 'März'
|
||||||
|
- 'April'
|
||||||
|
- 'Mai'
|
||||||
|
- 'Juni'
|
||||||
|
- 'Juli'
|
||||||
|
- 'Ougust'
|
||||||
|
- 'Septämber'
|
||||||
|
- 'Oktober'
|
||||||
|
- 'Novämber'
|
||||||
|
- 'Dezämber'
|
||||||
|
monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez']
|
||||||
|
firstDayOfWeek: 1
|
||||||
|
format24h: true
|
||||||
|
pluralDay: 'Täg'
|
||||||
|
|||||||
@@ -170,3 +170,30 @@ week: Woche
|
|||||||
month: Monat
|
month: Monat
|
||||||
year: Jahr
|
year: Jahr
|
||||||
appName: Applikationsname
|
appName: Applikationsname
|
||||||
|
calendar:
|
||||||
|
days:
|
||||||
|
- 'Sonntag'
|
||||||
|
- 'Montag'
|
||||||
|
- 'Dienstag'
|
||||||
|
- 'Mittwoch'
|
||||||
|
- 'Donnerstag'
|
||||||
|
- 'Freitag'
|
||||||
|
- 'Samstag'
|
||||||
|
daysShort: ['So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa']
|
||||||
|
months:
|
||||||
|
- 'Januar'
|
||||||
|
- 'Februar'
|
||||||
|
- 'März'
|
||||||
|
- 'April'
|
||||||
|
- 'Mai'
|
||||||
|
- 'Juni'
|
||||||
|
- 'Juli'
|
||||||
|
- 'August'
|
||||||
|
- 'September'
|
||||||
|
- 'Oktober'
|
||||||
|
- 'November'
|
||||||
|
- 'Dezember'
|
||||||
|
monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez']
|
||||||
|
firstDayOfWeek: 1
|
||||||
|
format24h: true
|
||||||
|
pluralDay: 'Tage'
|
||||||
|
|||||||
@@ -170,3 +170,30 @@ week: Week
|
|||||||
month: Month
|
month: Month
|
||||||
year: Year
|
year: Year
|
||||||
appName: Applicationname
|
appName: Applicationname
|
||||||
|
calendar:
|
||||||
|
days:
|
||||||
|
- 'Sunday'
|
||||||
|
- 'Monday'
|
||||||
|
- 'Tuesday'
|
||||||
|
- 'Wednesday'
|
||||||
|
- 'Thursday'
|
||||||
|
- 'Friday'
|
||||||
|
- 'Saturday'
|
||||||
|
daysShort: ['Sun', 'Mon', 'Tue', 'Wed', 'Thur', 'Fri', 'Sat']
|
||||||
|
months:
|
||||||
|
- 'January'
|
||||||
|
- 'February'
|
||||||
|
- 'March'
|
||||||
|
- 'April'
|
||||||
|
- 'May'
|
||||||
|
- 'June'
|
||||||
|
- 'July'
|
||||||
|
- 'August'
|
||||||
|
- 'September'
|
||||||
|
- 'October'
|
||||||
|
- 'November'
|
||||||
|
- 'December'
|
||||||
|
monthsShort: ['Jan', 'Feb', 'Mar', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
||||||
|
firstDayOfWeek: 0
|
||||||
|
format24h: false
|
||||||
|
pluralDay: 'Days'
|
||||||
|
|||||||
@@ -170,3 +170,30 @@ week: Semana
|
|||||||
month: Mes
|
month: Mes
|
||||||
year: Año
|
year: Año
|
||||||
appName: Nombre de la aplicación
|
appName: Nombre de la aplicación
|
||||||
|
calendar:
|
||||||
|
days:
|
||||||
|
- 'Domingo'
|
||||||
|
- 'Lunes'
|
||||||
|
- 'Martes'
|
||||||
|
- 'Miércoles'
|
||||||
|
- 'Jueves'
|
||||||
|
- 'Viernes'
|
||||||
|
- 'Sábado'
|
||||||
|
daysShort: ['Dom', 'Lun', 'Mar', 'Mié', 'Jue', 'Vie', 'Sáb']
|
||||||
|
months:
|
||||||
|
- 'Enero'
|
||||||
|
- 'Febrero'
|
||||||
|
- 'Marzo'
|
||||||
|
- 'Abril'
|
||||||
|
- 'Mayo'
|
||||||
|
- 'Junio'
|
||||||
|
- 'Julio'
|
||||||
|
- 'Agosto'
|
||||||
|
- 'Septiembre'
|
||||||
|
- 'Octubre'
|
||||||
|
- 'Noviembre'
|
||||||
|
- 'Diciembre'
|
||||||
|
monthsShort: ['Ene', 'Feb', 'Mar', 'Abr', 'May', 'Jun', 'Jul', 'Ago', 'Sep', 'Oct', 'Nov', 'Dic']
|
||||||
|
firstDayOfWeek: 1
|
||||||
|
format24h: true
|
||||||
|
pluralDay: 'dias'
|
||||||
|
|||||||
@@ -31,16 +31,16 @@
|
|||||||
</q-tabs>
|
</q-tabs>
|
||||||
</div>
|
</div>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<q-date v-model="dateRange" range flat />
|
<q-date :locale="calendarLanguage" v-model="dateRange" range flat />
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted, watch, type PropType } from 'vue';
|
import { ref, onMounted, watch, type PropType, computed } from 'vue';
|
||||||
import { date } from 'quasar';
|
import { date } from 'quasar';
|
||||||
import { i18n } from 'src/boot/lang';
|
import { i18n } from 'src/boot/lang';
|
||||||
|
import type { QDateLocale } from 'src/vueLib/models/qDateLocale';
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
title: String,
|
title: String,
|
||||||
height: { type: Number, default: 400 },
|
height: { type: Number, default: 400 },
|
||||||
@@ -74,6 +74,20 @@ const weekdayOptions = [
|
|||||||
{ label: i18n.global.t('SundayShort'), value: 0 },
|
{ label: i18n.global.t('SundayShort'), value: 0 },
|
||||||
];
|
];
|
||||||
|
|
||||||
|
const calendarLanguage = computed(() => {
|
||||||
|
// eslint-disable-next-line @typescript-eslint/no-unnecessary-type-assertion
|
||||||
|
const localeData = i18n.global.tm('calendar') as unknown as QDateLocale;
|
||||||
|
return {
|
||||||
|
days: localeData.days,
|
||||||
|
daysShort: localeData.daysShort,
|
||||||
|
months: localeData.months,
|
||||||
|
monthsShort: localeData.monthsShort,
|
||||||
|
firstDayOfWeek: localeData.firstDayOfWeek,
|
||||||
|
format24h: localeData.format24h,
|
||||||
|
pluralDay: localeData.pluralDay,
|
||||||
|
};
|
||||||
|
});
|
||||||
|
|
||||||
const onTabChange = (val: 'today' | 'week' | 'month' | 'year') => {
|
const onTabChange = (val: 'today' | 'week' | 'month' | 'year') => {
|
||||||
if (val) setRange(val);
|
if (val) setRange(val);
|
||||||
// Optional: Reset tab to empty so user can click the same tab again later
|
// Optional: Reset tab to empty so user can click the same tab again later
|
||||||
|
|||||||
@@ -77,7 +77,7 @@
|
|||||||
:label="$t('responsible')"
|
:label="$t('responsible')"
|
||||||
filled
|
filled
|
||||||
:options="props.responsibles"
|
:options="props.responsibles"
|
||||||
:option-label="(opt) => opt.firstName + ' ' + opt.lastName"
|
:option-label="(opt) => opt.member.firstName + ' ' + opt.member.lastName"
|
||||||
v-model="localMember.responsible"
|
v-model="localMember.responsible"
|
||||||
></q-select>
|
></q-select>
|
||||||
<q-input
|
<q-input
|
||||||
|
|||||||
@@ -30,6 +30,9 @@
|
|||||||
class="col-5 required"
|
class="col-5 required"
|
||||||
:label="$t('role')"
|
:label="$t('role')"
|
||||||
filled
|
filled
|
||||||
|
option-label="role"
|
||||||
|
option-value="role"
|
||||||
|
emit-value
|
||||||
:options="props.roles"
|
:options="props.roles"
|
||||||
:rules="[(val) => !!val || $t('roleIsRequired')]"
|
:rules="[(val) => !!val || $t('roleIsRequired')]"
|
||||||
v-model="role"
|
v-model="role"
|
||||||
|
|||||||
@@ -11,8 +11,15 @@
|
|||||||
align="justify"
|
align="justify"
|
||||||
narrow-indicator
|
narrow-indicator
|
||||||
>
|
>
|
||||||
<q-tab name="users" no-caps :label="$t('users')" />
|
<q-tab name="users" icon="people" no-caps :label="$t('users')" />
|
||||||
<q-tab name="roles" no-caps :label="$t('roles')" />
|
<q-tab name="roles" icon="rule" no-caps :label="$t('roles')" />
|
||||||
|
<q-tab
|
||||||
|
v-if="user?.user?.role.role.includes('admin')"
|
||||||
|
name="workspaces"
|
||||||
|
icon="dashboard"
|
||||||
|
no-caps
|
||||||
|
:label="$t('workspaces')"
|
||||||
|
/>
|
||||||
</q-tabs>
|
</q-tabs>
|
||||||
<q-separator />
|
<q-separator />
|
||||||
|
|
||||||
@@ -23,16 +30,24 @@
|
|||||||
<q-tab-panel name="roles" style="padding: 0px">
|
<q-tab-panel name="roles" style="padding: 0px">
|
||||||
<RoleTable />
|
<RoleTable />
|
||||||
</q-tab-panel>
|
</q-tab-panel>
|
||||||
|
<q-tab-panel name="workspaces" style="padding: 0px">
|
||||||
|
<RoleTable />
|
||||||
|
</q-tab-panel>
|
||||||
</q-tab-panels>
|
</q-tab-panels>
|
||||||
</q-card>
|
</q-card>
|
||||||
</div>
|
</div>
|
||||||
|
{{ user?.user?.role }}
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import UserTable from 'src/vueLib/tables/users/UserTable.vue';
|
import UserTable from 'src/vueLib/tables/users/UserTable.vue';
|
||||||
import RoleTable from 'src/vueLib/tables/roles/RoleTable.vue';
|
import RoleTable from 'src/vueLib/tables/roles/RoleTable.vue';
|
||||||
import SiteTitle from 'src/vueLib/general/SiteTitle.vue';
|
import SiteTitle from 'src/vueLib/general/SiteTitle.vue';
|
||||||
|
import { useUserStore } from 'src/vueLib/login/userStore';
|
||||||
|
import type { UserState } from 'src/vueLib/models/user';
|
||||||
|
|
||||||
const tab = ref('users');
|
const tab = ref('users');
|
||||||
|
const user = ref<UserState>();
|
||||||
|
onMounted(() => (user.value = useUserStore()));
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
9
src/vueLib/models/qDateLocale.ts
Normal file
9
src/vueLib/models/qDateLocale.ts
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
export interface QDateLocale {
|
||||||
|
days: string[];
|
||||||
|
daysShort: string[];
|
||||||
|
months: string[];
|
||||||
|
monthsShort: string[];
|
||||||
|
firstDayOfWeek: number;
|
||||||
|
format24h: boolean;
|
||||||
|
pluralDay: string;
|
||||||
|
}
|
||||||
@@ -6,6 +6,7 @@ export interface User {
|
|||||||
user: string;
|
user: string;
|
||||||
email: string;
|
email: string;
|
||||||
role?: Role;
|
role?: Role;
|
||||||
|
roleId?: number;
|
||||||
expiration?: string;
|
expiration?: string;
|
||||||
password?: string;
|
password?: string;
|
||||||
newPassword?: string;
|
newPassword?: string;
|
||||||
|
|||||||
@@ -307,8 +307,11 @@ onMounted(() => {
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
async function updateTable() {
|
async function updateTable(add?: Members) {
|
||||||
localCompareMembers.value = inProps.compareMembers;
|
localCompareMembers.value = inProps.compareMembers;
|
||||||
|
if (add) {
|
||||||
|
localCompareMembers.value?.push(...add);
|
||||||
|
}
|
||||||
await updateMembers(localCompareMembers.value, inProps.addResponsible).catch((err) =>
|
await updateMembers(localCompareMembers.value, inProps.addResponsible).catch((err) =>
|
||||||
NotifyResponse(err, 'error'),
|
NotifyResponse(err, 'error'),
|
||||||
);
|
);
|
||||||
@@ -452,15 +455,15 @@ async function addMemberTo() {
|
|||||||
})
|
})
|
||||||
.catch((err) => {
|
.catch((err) => {
|
||||||
NotifyResponse(err, 'error');
|
NotifyResponse(err, 'error');
|
||||||
})
|
});
|
||||||
.finally(() => (selected.value = []));
|
|
||||||
|
|
||||||
if (inProps.addAttendees) {
|
if (inProps.addAttendees) {
|
||||||
await updateMemberLastVisit(selected.value);
|
await updateMemberLastVisit(selected.value);
|
||||||
} else {
|
} else {
|
||||||
await updateTable();
|
await updateTable(selected.value);
|
||||||
emit('update-event', filteredMembers.value.length);
|
emit('update-event', filteredMembers.value.length);
|
||||||
}
|
}
|
||||||
|
selected.value = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
async function updateMemberLastVisit(members: Members) {
|
async function updateMemberLastVisit(members: Members) {
|
||||||
|
|||||||
@@ -148,7 +148,7 @@
|
|||||||
query-id
|
query-id
|
||||||
v-on:update="(val) => updateUser(val)"
|
v-on:update="(val) => updateUser(val)"
|
||||||
></EditOneDialog>
|
></EditOneDialog>
|
||||||
<EditAllDialog ref="editAllDialog" :roles="localRoles" v-on:update="updateUsers"></EditAllDialog>
|
<EditAllDialog ref="editAllDialog" :roles="roles" v-on:update="updateUsers"></EditAllDialog>
|
||||||
<OkDialog
|
<OkDialog
|
||||||
ref="okDialog"
|
ref="okDialog"
|
||||||
:dialog-label="$t('delete')"
|
:dialog-label="$t('delete')"
|
||||||
@@ -184,7 +184,10 @@ const editAllDialog = ref();
|
|||||||
const okDialog = ref();
|
const okDialog = ref();
|
||||||
const deleteText = ref('');
|
const deleteText = ref('');
|
||||||
const localRoles = computed(() => {
|
const localRoles = computed(() => {
|
||||||
return roles.value.map((role) => role.role);
|
return roles.value.filter((role) => {
|
||||||
|
if (user.user?.role.role.includes('admin') || !user.user?.role.role.includes('admin'))
|
||||||
|
return role;
|
||||||
|
});
|
||||||
});
|
});
|
||||||
const selectOption = ref(false);
|
const selectOption = ref(false);
|
||||||
const selected = ref<Users>([]);
|
const selected = ref<Users>([]);
|
||||||
@@ -272,6 +275,9 @@ function removeUser(...removeUsers: Users) {
|
|||||||
|
|
||||||
// update role select
|
// update role select
|
||||||
function updateUser(user: User) {
|
function updateUser(user: User) {
|
||||||
|
if (user.role?.id) {
|
||||||
|
user.roleId = user.role?.id;
|
||||||
|
}
|
||||||
appApi
|
appApi
|
||||||
.post('/users/update', user)
|
.post('/users/update', user)
|
||||||
.then(() => NotifyResponse(i18n.global.t('userUpdated')))
|
.then(() => NotifyResponse(i18n.global.t('userUpdated')))
|
||||||
|
|||||||
Reference in New Issue
Block a user