Compare commits
7 commits
Author | SHA1 | Date | |
---|---|---|---|
033504b8d8 | |||
4f13b70ac8 | |||
7ded4a21bb | |||
ee42625d66 | |||
f715a4ab9d | |||
ab3e2b9dc4 | |||
924a6bf647 |
17 changed files with 777 additions and 4 deletions
81
src/components/admin/user/webapi/CreateWebapiModal.vue
Normal file
81
src/components/admin/user/webapi/CreateWebapiModal.vue
Normal file
|
@ -0,0 +1,81 @@
|
||||||
|
<template>
|
||||||
|
<div class="w-full md:max-w-md">
|
||||||
|
<div class="flex flex-col items-center">
|
||||||
|
<p class="text-xl font-medium">Webapi-Token erstellen</p>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<form class="flex flex-col gap-4 py-2" @submit.prevent="triggerCreateWebapi">
|
||||||
|
<div>
|
||||||
|
<label for="title">Bezeichnung</label>
|
||||||
|
<input type="text" id="title" required />
|
||||||
|
</div>
|
||||||
|
<div class="w-full">
|
||||||
|
<label for="expiry">Ablaufdatum (optional)</label>
|
||||||
|
<input type="date" id="expiry" step="1" />
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-row gap-2">
|
||||||
|
<button primary type="submit" :disabled="status == 'loading' || status?.status == 'success'">erstellen</button>
|
||||||
|
<Spinner v-if="status == 'loading'" class="my-auto" />
|
||||||
|
<SuccessCheckmark v-else-if="status?.status == 'success'" />
|
||||||
|
<FailureXMark v-else-if="status?.status == 'failed'" />
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
|
||||||
|
<div class="flex flex-row justify-end">
|
||||||
|
<div class="flex flex-row gap-4 py-2">
|
||||||
|
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
|
||||||
|
abbrechen
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { defineComponent } from "vue";
|
||||||
|
import { mapState, mapActions } from "pinia";
|
||||||
|
import { useModalStore } from "@/stores/modal";
|
||||||
|
import Spinner from "@/components/Spinner.vue";
|
||||||
|
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||||
|
import FailureXMark from "@/components/FailureXMark.vue";
|
||||||
|
import { useWebapiStore } from "@/stores/admin/user/webapi";
|
||||||
|
import type { CreateWebapiViewModel } from "../../../../viewmodels/admin/user/webapi.models";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default defineComponent({
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
|
||||||
|
timeout: undefined as any,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
beforeUnmount() {
|
||||||
|
try {
|
||||||
|
clearTimeout(this.timeout);
|
||||||
|
} catch (error) {}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapActions(useModalStore, ["closeModal"]),
|
||||||
|
...mapActions(useWebapiStore, ["createWebapi"]),
|
||||||
|
triggerCreateWebapi(e: any) {
|
||||||
|
let formData = e.target.elements;
|
||||||
|
let createWebapi: CreateWebapiViewModel = {
|
||||||
|
title: formData.title.value,
|
||||||
|
expiry: formData.expiry.value,
|
||||||
|
};
|
||||||
|
this.status = "loading";
|
||||||
|
this.createWebapi(createWebapi)
|
||||||
|
.then(() => {
|
||||||
|
this.status = { status: "success" };
|
||||||
|
this.timeout = setTimeout(() => {
|
||||||
|
this.closeModal();
|
||||||
|
}, 1500);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.status = { status: "failed" };
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
75
src/components/admin/user/webapi/DeleteWebapiModal.vue
Normal file
75
src/components/admin/user/webapi/DeleteWebapiModal.vue
Normal file
|
@ -0,0 +1,75 @@
|
||||||
|
<template>
|
||||||
|
<div class="w-full md:max-w-md">
|
||||||
|
<div class="flex flex-col items-center">
|
||||||
|
<p class="text-xl font-medium">Webapi-Token {{ webapi?.title }} löschen?</p>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
|
||||||
|
<div class="flex flex-row gap-2">
|
||||||
|
<button primary :disabled="status == 'loading' || status?.status == 'success'" @click="triggerDeleteWebapi">
|
||||||
|
unwiederuflich löschen
|
||||||
|
</button>
|
||||||
|
<Spinner v-if="status == 'loading'" class="my-auto" />
|
||||||
|
<SuccessCheckmark v-else-if="status?.status == 'success'" />
|
||||||
|
<FailureXMark v-else-if="status?.status == 'failed'" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-row justify-end">
|
||||||
|
<div class="flex flex-row gap-4 py-2">
|
||||||
|
<button primary-outline @click="closeModal" :disabled="status == 'loading' || status?.status == 'success'">
|
||||||
|
abbrechen
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { defineComponent } from "vue";
|
||||||
|
import { mapState, mapActions } from "pinia";
|
||||||
|
import { useModalStore } from "@/stores/modal";
|
||||||
|
import Spinner from "@/components/Spinner.vue";
|
||||||
|
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||||
|
import FailureXMark from "@/components/FailureXMark.vue";
|
||||||
|
import { useWebapiStore } from "@/stores/admin/user/webapi";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default defineComponent({
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
|
||||||
|
timeout: undefined as any,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
beforeUnmount() {
|
||||||
|
try {
|
||||||
|
clearTimeout(this.timeout);
|
||||||
|
} catch (error) {}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(useModalStore, ["data"]),
|
||||||
|
...mapState(useWebapiStore, ["webapis"]),
|
||||||
|
webapi() {
|
||||||
|
return this.webapis.find((r) => r.id == this.data);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapActions(useModalStore, ["closeModal"]),
|
||||||
|
...mapActions(useWebapiStore, ["deleteWebapi"]),
|
||||||
|
triggerDeleteWebapi() {
|
||||||
|
this.status = "loading";
|
||||||
|
this.deleteWebapi(this.data)
|
||||||
|
.then(() => {
|
||||||
|
this.status = { status: "success" };
|
||||||
|
this.timeout = setTimeout(() => {
|
||||||
|
this.closeModal();
|
||||||
|
}, 1500);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
this.status = { status: "failed" };
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
107
src/components/admin/user/webapi/WebapiListItem.vue
Normal file
107
src/components/admin/user/webapi/WebapiListItem.vue
Normal file
|
@ -0,0 +1,107 @@
|
||||||
|
<template>
|
||||||
|
<div class="flex flex-col h-fit w-full border border-primary rounded-md">
|
||||||
|
<div class="bg-primary p-2 text-white flex flex-row justify-between items-center">
|
||||||
|
<p>{{ webapi.title }} <small v-if="webapi.permissions.admin">(Admin)</small></p>
|
||||||
|
<div class="flex flex-row">
|
||||||
|
<div v-if="can('admin', 'user', 'webapi')" @click="openTokenViewModal">
|
||||||
|
<FingerPrintIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
|
||||||
|
</div>
|
||||||
|
<RouterLink
|
||||||
|
v-if="can('admin', 'user', 'webapi')"
|
||||||
|
:to="{ name: 'admin-user-webapi-permission', params: { id: webapi.id } }"
|
||||||
|
>
|
||||||
|
<WrenchScrewdriverIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
|
||||||
|
</RouterLink>
|
||||||
|
<RouterLink
|
||||||
|
v-if="can('update', 'user', 'webapi')"
|
||||||
|
:to="{ name: 'admin-user-webapi-edit', params: { id: webapi.id } }"
|
||||||
|
>
|
||||||
|
<PencilIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
|
||||||
|
</RouterLink>
|
||||||
|
<div v-if="can('delete', 'user', 'webapi')" @click="openDeleteModal">
|
||||||
|
<TrashIcon class="w-5 h-5 p-1 box-content cursor-pointer" />
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-col p-2">
|
||||||
|
<div class="flex flex-row gap-2">
|
||||||
|
<p class="">erstellt:</p>
|
||||||
|
<p class="grow overflow-hidden">
|
||||||
|
{{
|
||||||
|
new Date(webapi.createdAt).toLocaleDateString("de-DE", {
|
||||||
|
day: "2-digit",
|
||||||
|
month: "2-digit",
|
||||||
|
year: "numeric",
|
||||||
|
minute: "2-digit",
|
||||||
|
hour: "2-digit",
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-row gap-2">
|
||||||
|
<p class="">letzte Verwendung:</p>
|
||||||
|
<p class="grow overflow-hidden">
|
||||||
|
{{
|
||||||
|
webapi.lastUsage
|
||||||
|
? new Date(webapi.lastUsage).toLocaleDateString("de-DE", {
|
||||||
|
day: "2-digit",
|
||||||
|
month: "2-digit",
|
||||||
|
year: "numeric",
|
||||||
|
minute: "2-digit",
|
||||||
|
hour: "2-digit",
|
||||||
|
})
|
||||||
|
: "---"
|
||||||
|
}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
<div v-if="webapi.expiry" class="flex flex-row gap-2">
|
||||||
|
<p class="">verwendbar bis:</p>
|
||||||
|
<p class="grow overflow-hidden">
|
||||||
|
{{
|
||||||
|
new Date(webapi.expiry).toLocaleDateString("de-DE", {
|
||||||
|
day: "2-digit",
|
||||||
|
month: "2-digit",
|
||||||
|
year: "numeric",
|
||||||
|
})
|
||||||
|
}}
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { defineComponent, defineAsyncComponent, markRaw, type PropType } from "vue";
|
||||||
|
import { mapState, mapActions } from "pinia";
|
||||||
|
import { PencilIcon, WrenchScrewdriverIcon, TrashIcon, FingerPrintIcon } from "@heroicons/vue/24/outline";
|
||||||
|
import type { WebapiViewModel } from "@/viewmodels/admin/user/webapi.models";
|
||||||
|
import { RouterLink } from "vue-router";
|
||||||
|
import { useAbilityStore } from "@/stores/ability";
|
||||||
|
import { useModalStore } from "@/stores/modal";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default defineComponent({
|
||||||
|
props: {
|
||||||
|
webapi: { type: Object as PropType<WebapiViewModel>, default: {} },
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(useAbilityStore, ["can"]),
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapActions(useModalStore, ["openModal"]),
|
||||||
|
openTokenViewModal() {
|
||||||
|
this.openModal(
|
||||||
|
markRaw(defineAsyncComponent(() => import("@/components/admin/user/webapi/WebapiTokenModal.vue"))),
|
||||||
|
this.webapi.id
|
||||||
|
);
|
||||||
|
},
|
||||||
|
openDeleteModal() {
|
||||||
|
this.openModal(
|
||||||
|
markRaw(defineAsyncComponent(() => import("@/components/admin/user/webapi/DeleteWebapiModal.vue"))),
|
||||||
|
this.webapi.id
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
56
src/components/admin/user/webapi/WebapiTokenModal.vue
Normal file
56
src/components/admin/user/webapi/WebapiTokenModal.vue
Normal file
|
@ -0,0 +1,56 @@
|
||||||
|
<template>
|
||||||
|
<div class="relative w-full md:max-w-md">
|
||||||
|
<div class="flex flex-col items-center">
|
||||||
|
<p class="text-xl font-medium">Webapi-Token</p>
|
||||||
|
</div>
|
||||||
|
<br />
|
||||||
|
<div class="flex flex-col gap-2">
|
||||||
|
<TextCopy :copyText="token" />
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex flex-row justify-end">
|
||||||
|
<div class="flex flex-row gap-4 py-2">
|
||||||
|
<button primary-outline @click="closeModal">schließen</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { defineComponent } from "vue";
|
||||||
|
import { mapState, mapActions } from "pinia";
|
||||||
|
import { RouterLink } from "vue-router";
|
||||||
|
import { useModalStore } from "@/stores/modal";
|
||||||
|
import { useCalendarTypeStore } from "@/stores/admin/settings/calendarType";
|
||||||
|
import type { CalendarTypeViewModel } from "@/viewmodels/admin/settings/calendarType.models";
|
||||||
|
import { Listbox, ListboxButton, ListboxOptions, ListboxOption, ListboxLabel } from "@headlessui/vue";
|
||||||
|
import { CheckIcon, ChevronUpDownIcon } from "@heroicons/vue/20/solid";
|
||||||
|
import TextCopy from "@/components/TextCopy.vue";
|
||||||
|
import { CalendarDaysIcon, InformationCircleIcon } from "@heroicons/vue/24/outline";
|
||||||
|
import { host } from "@/serverCom";
|
||||||
|
import { useWebapiStore } from "../../../../stores/admin/user/webapi";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default defineComponent({
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
token: "" as string,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState(useModalStore, ["data"]),
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.fetchWebapiTokenById(this.data)
|
||||||
|
.then((res) => {
|
||||||
|
this.token = res.data;
|
||||||
|
})
|
||||||
|
.catch(() => {});
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapActions(useModalStore, ["closeModal"]),
|
||||||
|
...mapActions(useWebapiStore, ["fetchWebapiTokenById"]),
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
|
@ -582,6 +582,36 @@ const router = createRouter({
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
path: "webapi",
|
||||||
|
name: "admin-user-webapi-route",
|
||||||
|
component: () => import("@/views/RouterView.vue"),
|
||||||
|
meta: { type: "read", section: "user", module: "webapi" },
|
||||||
|
beforeEnter: [abilityAndNavUpdate],
|
||||||
|
children: [
|
||||||
|
{
|
||||||
|
path: "",
|
||||||
|
name: "admin-user-webapi",
|
||||||
|
component: () => import("@/views/admin/user/webapi/Webapi.vue"),
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: ":id/edit",
|
||||||
|
name: "admin-user-webapi-edit",
|
||||||
|
component: () => import("@/views/admin/user/webapi/WebapiEdit.vue"),
|
||||||
|
meta: { type: "update", section: "user", module: "webapi" },
|
||||||
|
beforeEnter: [abilityAndNavUpdate],
|
||||||
|
props: true,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
path: ":id/permission",
|
||||||
|
name: "admin-user-webapi-permission",
|
||||||
|
component: () => import("@/views/admin/user/webapi/WebapiEditPermission.vue"),
|
||||||
|
meta: { type: "update", section: "user", module: "webapi" },
|
||||||
|
beforeEnter: [abilityAndNavUpdate],
|
||||||
|
props: true,
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,9 @@
|
||||||
import { defineStore } from "pinia";
|
import { defineStore } from "pinia";
|
||||||
import type { CreateMemberViewModel, UpdateMemberViewModel } from "@/viewmodels/admin/club/member/member.models";
|
import type {
|
||||||
|
CreateMemberViewModel,
|
||||||
|
MemberStatisticsViewModel,
|
||||||
|
UpdateMemberViewModel,
|
||||||
|
} from "@/viewmodels/admin/club/member/member.models";
|
||||||
import { http } from "@/serverCom";
|
import { http } from "@/serverCom";
|
||||||
import type { AxiosResponse } from "axios";
|
import type { AxiosResponse } from "axios";
|
||||||
import type { MemberViewModel } from "@/viewmodels/admin/club/member/member.models";
|
import type { MemberViewModel } from "@/viewmodels/admin/club/member/member.models";
|
||||||
|
@ -12,6 +16,7 @@ export const useMemberStore = defineStore("member", {
|
||||||
loading: "loading" as "loading" | "fetched" | "failed",
|
loading: "loading" as "loading" | "fetched" | "failed",
|
||||||
activeMember: null as number | null,
|
activeMember: null as number | null,
|
||||||
activeMemberObj: null as MemberViewModel | null,
|
activeMemberObj: null as MemberViewModel | null,
|
||||||
|
activeMemberStatistics: null as MemberStatisticsViewModel | null,
|
||||||
loadingActive: "loading" as "loading" | "fetched" | "failed",
|
loadingActive: "loading" as "loading" | "fetched" | "failed",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -70,6 +75,17 @@ export const useMemberStore = defineStore("member", {
|
||||||
fetchMemberById(id: number) {
|
fetchMemberById(id: number) {
|
||||||
return http.get(`/admin/member/${id}`);
|
return http.get(`/admin/member/${id}`);
|
||||||
},
|
},
|
||||||
|
fetchMemberStatisticsByActiveId() {
|
||||||
|
http
|
||||||
|
.get(`/admin/member/${this.activeMember}/statistics`)
|
||||||
|
.then((res) => {
|
||||||
|
this.activeMemberStatistics = res.data;
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
},
|
||||||
|
fetchMemberStatisticsById(id: number) {
|
||||||
|
return http.get(`/admin/member/${id}/statistics`);
|
||||||
|
},
|
||||||
async createMember(member: CreateMemberViewModel): Promise<AxiosResponse<any, any>> {
|
async createMember(member: CreateMemberViewModel): Promise<AxiosResponse<any, any>> {
|
||||||
const result = await http.post(`/admin/member`, {
|
const result = await http.post(`/admin/member`, {
|
||||||
salutation: member.salutation,
|
salutation: member.salutation,
|
||||||
|
|
|
@ -6,6 +6,7 @@ import type { MemberViewModel } from "@/viewmodels/admin/club/member/member.mode
|
||||||
import { useMemberStore } from "./member";
|
import { useMemberStore } from "./member";
|
||||||
import type {
|
import type {
|
||||||
CreateMembershipViewModel,
|
CreateMembershipViewModel,
|
||||||
|
MembershipStatisticsViewModel,
|
||||||
MembershipViewModel,
|
MembershipViewModel,
|
||||||
UpdateMembershipViewModel,
|
UpdateMembershipViewModel,
|
||||||
} from "@/viewmodels/admin/club/member/membership.models";
|
} from "@/viewmodels/admin/club/member/membership.models";
|
||||||
|
@ -14,6 +15,7 @@ export const useMembershipStore = defineStore("membership", {
|
||||||
state: () => {
|
state: () => {
|
||||||
return {
|
return {
|
||||||
memberships: [] as Array<MembershipViewModel>,
|
memberships: [] as Array<MembershipViewModel>,
|
||||||
|
membershipStatistics: [] as Array<MembershipStatisticsViewModel>,
|
||||||
loading: "loading" as "loading" | "fetched" | "failed",
|
loading: "loading" as "loading" | "fetched" | "failed",
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
@ -31,6 +33,15 @@ export const useMembershipStore = defineStore("membership", {
|
||||||
this.loading = "failed";
|
this.loading = "failed";
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
|
fetchMembershipStatisticsForMember() {
|
||||||
|
const memberId = useMemberStore().activeMember;
|
||||||
|
http
|
||||||
|
.get(`/admin/member/${memberId}/memberships/statistics`)
|
||||||
|
.then((result) => {
|
||||||
|
this.membershipStatistics = result.data;
|
||||||
|
})
|
||||||
|
.catch((err) => {});
|
||||||
|
},
|
||||||
fetchMembershipById(id: number) {
|
fetchMembershipById(id: number) {
|
||||||
const memberId = useMemberStore().activeMember;
|
const memberId = useMemberStore().activeMember;
|
||||||
return http.get(`/admin/member/${memberId}/membership/${id}`);
|
return http.get(`/admin/member/${memberId}/membership/${id}`);
|
||||||
|
|
|
@ -131,6 +131,7 @@ export const useNavigationStore = defineStore("navigation", {
|
||||||
main: [
|
main: [
|
||||||
...(abilityStore.can("read", "user", "user") ? [{ key: "user", title: "Benutzer" }] : []),
|
...(abilityStore.can("read", "user", "user") ? [{ key: "user", title: "Benutzer" }] : []),
|
||||||
...(abilityStore.can("read", "user", "role") ? [{ key: "role", title: "Rollen" }] : []),
|
...(abilityStore.can("read", "user", "role") ? [{ key: "role", title: "Rollen" }] : []),
|
||||||
|
...(abilityStore.can("read", "user", "webapi") ? [{ key: "webapi", title: "Webapi-Token" }] : []),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
} as navigationModel;
|
} as navigationModel;
|
||||||
|
|
63
src/stores/admin/user/webapi.ts
Normal file
63
src/stores/admin/user/webapi.ts
Normal file
|
@ -0,0 +1,63 @@
|
||||||
|
import { defineStore } from "pinia";
|
||||||
|
import type {
|
||||||
|
CreateWebapiViewModel,
|
||||||
|
UpdateWebapiViewModel,
|
||||||
|
WebapiViewModel,
|
||||||
|
} from "@/viewmodels/admin/user/webapi.models";
|
||||||
|
import { http } from "@/serverCom";
|
||||||
|
import type { PermissionObject } from "@/types/permissionTypes";
|
||||||
|
import type { AxiosResponse } from "axios";
|
||||||
|
|
||||||
|
export const useWebapiStore = defineStore("webapi", {
|
||||||
|
state: () => {
|
||||||
|
return {
|
||||||
|
webapis: [] as Array<WebapiViewModel>,
|
||||||
|
loading: null as null | "loading" | "success" | "failed",
|
||||||
|
};
|
||||||
|
},
|
||||||
|
actions: {
|
||||||
|
fetchWebapis() {
|
||||||
|
this.loading = "loading";
|
||||||
|
http
|
||||||
|
.get("/admin/webapi")
|
||||||
|
.then((result) => {
|
||||||
|
this.webapis = result.data;
|
||||||
|
this.loading = "success";
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
this.loading = "failed";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
fetchWebapiById(id: number): Promise<AxiosResponse<any, any>> {
|
||||||
|
return http.get(`/admin/webapi/${id}`);
|
||||||
|
},
|
||||||
|
fetchWebapiTokenById(id: number): Promise<AxiosResponse<any, any>> {
|
||||||
|
return http.get(`/admin/webapi/${id}/token`);
|
||||||
|
},
|
||||||
|
async createWebapi(webapi: CreateWebapiViewModel): Promise<AxiosResponse<any, any>> {
|
||||||
|
const result = await http.post("/admin/webapi", webapi);
|
||||||
|
this.fetchWebapis();
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
async updateActiveWebapi(id: number, webapi: UpdateWebapiViewModel): Promise<AxiosResponse<any, any>> {
|
||||||
|
const result = await http.patch(`/admin/webapi/${id}`, webapi);
|
||||||
|
this.fetchWebapis();
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
async updateActiveWebapiPermissions(
|
||||||
|
webapi: number,
|
||||||
|
permission: PermissionObject
|
||||||
|
): Promise<AxiosResponse<any, any>> {
|
||||||
|
const result = await http.patch(`/admin/webapi/${webapi}/permissions`, {
|
||||||
|
permissions: permission,
|
||||||
|
});
|
||||||
|
this.fetchWebapis();
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
async deleteWebapi(webapi: number): Promise<AxiosResponse<any, any>> {
|
||||||
|
const result = await http.delete(`/admin/webapi/${webapi}`);
|
||||||
|
this.fetchWebapis();
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
|
@ -14,6 +14,7 @@ export type PermissionModule =
|
||||||
| "calendar_type"
|
| "calendar_type"
|
||||||
| "user"
|
| "user"
|
||||||
| "role"
|
| "role"
|
||||||
|
| "webapi"
|
||||||
| "query"
|
| "query"
|
||||||
| "query_store"
|
| "query_store"
|
||||||
| "template"
|
| "template"
|
||||||
|
@ -55,6 +56,7 @@ export const permissionModules: Array<PermissionModule> = [
|
||||||
"calendar_type",
|
"calendar_type",
|
||||||
"user",
|
"user",
|
||||||
"role",
|
"role",
|
||||||
|
"webapi",
|
||||||
"query",
|
"query",
|
||||||
"query_store",
|
"query_store",
|
||||||
"template",
|
"template",
|
||||||
|
@ -75,5 +77,5 @@ export const sectionsAndModules: SectionsAndModulesObject = {
|
||||||
"template_usage",
|
"template_usage",
|
||||||
"newsletter_config",
|
"newsletter_config",
|
||||||
],
|
],
|
||||||
user: ["user", "role"],
|
user: ["user", "role", "webapi"],
|
||||||
};
|
};
|
||||||
|
|
|
@ -17,6 +17,18 @@ export interface MemberViewModel {
|
||||||
preferredCommunication?: Array<CommunicationViewModel>;
|
preferredCommunication?: Array<CommunicationViewModel>;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface MemberStatisticsViewModel {
|
||||||
|
id: number;
|
||||||
|
salutation: Salutation;
|
||||||
|
firstname: string;
|
||||||
|
lastname: string;
|
||||||
|
nameaffix: string;
|
||||||
|
birthdate: Date;
|
||||||
|
todayAge: number;
|
||||||
|
ageThisYear: number;
|
||||||
|
exactAge: string;
|
||||||
|
}
|
||||||
|
|
||||||
export interface CreateMemberViewModel {
|
export interface CreateMemberViewModel {
|
||||||
salutation: Salutation;
|
salutation: Salutation;
|
||||||
firstname: string;
|
firstname: string;
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
import type { Salutation } from "../../../../enums/salutation";
|
||||||
|
|
||||||
export interface MembershipViewModel {
|
export interface MembershipViewModel {
|
||||||
id: number;
|
id: number;
|
||||||
start: Date;
|
start: Date;
|
||||||
|
@ -7,6 +9,19 @@ export interface MembershipViewModel {
|
||||||
statusId: number;
|
statusId: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export interface MembershipStatisticsViewModel {
|
||||||
|
durationInDays: number;
|
||||||
|
durationInYears: string;
|
||||||
|
status: string;
|
||||||
|
statusId: number;
|
||||||
|
memberId: number;
|
||||||
|
memberSalutation: Salutation;
|
||||||
|
memberFirstname: string;
|
||||||
|
memberLastname: string;
|
||||||
|
memberNameaffix: string;
|
||||||
|
memberBirthdate: Date;
|
||||||
|
}
|
||||||
|
|
||||||
export interface CreateMembershipViewModel {
|
export interface CreateMembershipViewModel {
|
||||||
start: Date;
|
start: Date;
|
||||||
statusId: number;
|
statusId: number;
|
||||||
|
|
20
src/viewmodels/admin/user/webapi.models.ts
Normal file
20
src/viewmodels/admin/user/webapi.models.ts
Normal file
|
@ -0,0 +1,20 @@
|
||||||
|
import type { PermissionObject } from "@/types/permissionTypes";
|
||||||
|
|
||||||
|
export interface WebapiViewModel {
|
||||||
|
id: number;
|
||||||
|
permissions: PermissionObject;
|
||||||
|
title: string;
|
||||||
|
createdAt: Date;
|
||||||
|
lastUsage?: Date;
|
||||||
|
expiry?: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface CreateWebapiViewModel {
|
||||||
|
title: string;
|
||||||
|
expiry?: Date;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface UpdateWebapiViewModel {
|
||||||
|
title: string;
|
||||||
|
expiry?: Date;
|
||||||
|
}
|
|
@ -25,6 +25,20 @@
|
||||||
<label for="birthdate">Geburtsdatum</label>
|
<label for="birthdate">Geburtsdatum</label>
|
||||||
<input type="date" id="birthdate" :value="activeMemberObj.birthdate" readonly />
|
<input type="date" id="birthdate" :value="activeMemberObj.birthdate" readonly />
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="membershipStatistics.length != 0">
|
||||||
|
<p>Statistiken zur Mitgliedschaft</p>
|
||||||
|
<div class="flex flex-col h-fit w-full border border-primary rounded-md">
|
||||||
|
<div
|
||||||
|
v-for="stat in membershipStatistics"
|
||||||
|
class="bg-primary p-2 text-white flex flex-row justify-between items-center"
|
||||||
|
>
|
||||||
|
<p>
|
||||||
|
{{ stat.status }} für gesamt {{ stat.durationInDays }} Tage
|
||||||
|
<span class="whitespace-nowrap"> ~> {{ stat.durationInYears.replace("_", "") }} Jahre</span>
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div v-if="activeMemberObj.firstMembershipEntry">
|
<div v-if="activeMemberObj.firstMembershipEntry">
|
||||||
<p>Erster Eintrag Mitgliedschaft</p>
|
<p>Erster Eintrag Mitgliedschaft</p>
|
||||||
<div class="flex flex-col h-fit w-full border border-primary rounded-md">
|
<div class="flex flex-col h-fit w-full border border-primary rounded-md">
|
||||||
|
@ -125,6 +139,7 @@ import { defineComponent } from "vue";
|
||||||
import { mapActions, mapState } from "pinia";
|
import { mapActions, mapState } from "pinia";
|
||||||
import Spinner from "@/components/Spinner.vue";
|
import Spinner from "@/components/Spinner.vue";
|
||||||
import { useMemberStore } from "@/stores/admin/club/member/member";
|
import { useMemberStore } from "@/stores/admin/club/member/member";
|
||||||
|
import { useMembershipStore } from "@/stores/admin/club/member/membership";
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
@ -133,13 +148,17 @@ export default defineComponent({
|
||||||
memberId: String,
|
memberId: String,
|
||||||
},
|
},
|
||||||
computed: {
|
computed: {
|
||||||
...mapState(useMemberStore, ["activeMemberObj", "loadingActive"]),
|
...mapState(useMemberStore, ["activeMemberObj", "activeMemberStatistics", "loadingActive"]),
|
||||||
|
...mapState(useMembershipStore, ["membershipStatistics"]),
|
||||||
},
|
},
|
||||||
mounted() {
|
mounted() {
|
||||||
this.fetchMemberByActiveId();
|
this.fetchMemberByActiveId();
|
||||||
|
this.fetchMemberStatisticsByActiveId();
|
||||||
|
this.fetchMembershipStatisticsForMember();
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
...mapActions(useMemberStore, ["fetchMemberByActiveId"]),
|
...mapActions(useMemberStore, ["fetchMemberByActiveId", "fetchMemberStatisticsByActiveId"]),
|
||||||
|
...mapActions(useMembershipStore, ["fetchMembershipStatisticsForMember"]),
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|
52
src/views/admin/user/webapi/Webapi.vue
Normal file
52
src/views/admin/user/webapi/Webapi.vue
Normal file
|
@ -0,0 +1,52 @@
|
||||||
|
<template>
|
||||||
|
<MainTemplate>
|
||||||
|
<template #topBar>
|
||||||
|
<div class="flex flex-row items-center justify-between pt-5 pb-3 px-7">
|
||||||
|
<h1 class="font-bold text-xl h-8">Webapi-Token</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #diffMain>
|
||||||
|
<div class="flex flex-col gap-4 h-full pl-7">
|
||||||
|
<div class="flex flex-col gap-2 grow overflow-y-scroll pr-7">
|
||||||
|
<WebapiListItem v-for="webapi in webapis" :key="webapi.id" :webapi="webapi" />
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-row gap-4">
|
||||||
|
<button v-if="can('create', 'user', 'webapi')" primary class="!w-fit" @click="openCreateModal">
|
||||||
|
Webapi-Token erstellen
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
</MainTemplate>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { defineAsyncComponent, defineComponent, markRaw } from "vue";
|
||||||
|
import { mapState, mapActions } from "pinia";
|
||||||
|
import MainTemplate from "@/templates/Main.vue";
|
||||||
|
import { useWebapiStore } from "@/stores/admin/user/webapi";
|
||||||
|
import WebapiListItem from "@/components/admin/user/webapi/WebapiListItem.vue";
|
||||||
|
import { useModalStore } from "@/stores/modal";
|
||||||
|
import { useAbilityStore } from "@/stores/ability";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default defineComponent({
|
||||||
|
computed: {
|
||||||
|
...mapState(useWebapiStore, ["webapis"]),
|
||||||
|
...mapState(useAbilityStore, ["can"]),
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.fetchWebapis();
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapActions(useWebapiStore, ["fetchWebapis"]),
|
||||||
|
...mapActions(useModalStore, ["openModal"]),
|
||||||
|
openCreateModal() {
|
||||||
|
this.openModal(
|
||||||
|
markRaw(defineAsyncComponent(() => import("@/components/admin/user/webapi/CreateWebapiModal.vue")))
|
||||||
|
);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
126
src/views/admin/user/webapi/WebapiEdit.vue
Normal file
126
src/views/admin/user/webapi/WebapiEdit.vue
Normal file
|
@ -0,0 +1,126 @@
|
||||||
|
<template>
|
||||||
|
<MainTemplate>
|
||||||
|
<template #headerInsert>
|
||||||
|
<RouterLink to="../" class="text-primary">zurück zur Liste (abbrechen)</RouterLink>
|
||||||
|
</template>
|
||||||
|
<template #topBar>
|
||||||
|
<div class="flex flex-row items-center justify-between pt-5 pb-3 px-7">
|
||||||
|
<h1 class="font-bold text-xl h-8">Webapi-Token {{ origin?.title }} - Daten bearbeiten</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #main>
|
||||||
|
<Spinner v-if="loading == 'loading'" class="mx-auto" />
|
||||||
|
<p v-else-if="loading == 'failed'">laden fehlgeschlagen</p>
|
||||||
|
<form
|
||||||
|
v-else-if="webapi"
|
||||||
|
class="flex flex-col gap-4 py-2 w-full max-w-xl mx-auto"
|
||||||
|
@submit.prevent="triggerWebapiUpdate"
|
||||||
|
>
|
||||||
|
<div>
|
||||||
|
<label for="title">Bezeichnung</label>
|
||||||
|
<input type="text" id="title" required v-model="webapi.title" />
|
||||||
|
</div>
|
||||||
|
<div class="w-full">
|
||||||
|
<label for="expiry">Ablaufdatum (optional)</label>
|
||||||
|
<input type="date" id="expiry" step="1" v-model="webapi.expiry" />
|
||||||
|
</div>
|
||||||
|
<div class="flex flex-row justify-end gap-2">
|
||||||
|
<button primary-outline type="reset" class="!w-fit" :disabled="canSaveOrReset" @click="resetForm">
|
||||||
|
verwerfen
|
||||||
|
</button>
|
||||||
|
<button primary type="submit" class="!w-fit" :disabled="status == 'loading' || canSaveOrReset">
|
||||||
|
speichern
|
||||||
|
</button>
|
||||||
|
<Spinner v-if="status == 'loading'" class="my-auto" />
|
||||||
|
<SuccessCheckmark v-else-if="status?.status == 'success'" />
|
||||||
|
<FailureXMark v-else-if="status?.status == 'failed'" />
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</template>
|
||||||
|
</MainTemplate>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { defineComponent } from "vue";
|
||||||
|
import { mapState, mapActions } from "pinia";
|
||||||
|
import MainTemplate from "@/templates/Main.vue";
|
||||||
|
import { useWebapiStore } from "@/stores/admin/user/webapi";
|
||||||
|
import Spinner from "@/components/Spinner.vue";
|
||||||
|
import SuccessCheckmark from "@/components/SuccessCheckmark.vue";
|
||||||
|
import FailureXMark from "@/components/FailureXMark.vue";
|
||||||
|
import { RouterLink } from "vue-router";
|
||||||
|
import cloneDeep from "lodash.clonedeep";
|
||||||
|
import isEqual from "lodash.isequal";
|
||||||
|
import type { UpdateWebapiViewModel, WebapiViewModel } from "@/viewmodels/admin/user/webapi.models";
|
||||||
|
import type { Update } from "vite/types/hmrPayload.js";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default defineComponent({
|
||||||
|
props: {
|
||||||
|
id: String,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: "loading" as "loading" | "fetched" | "failed",
|
||||||
|
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
|
||||||
|
origin: null as null | WebapiViewModel,
|
||||||
|
webapi: null as null | WebapiViewModel,
|
||||||
|
timeout: null as any,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
canSaveOrReset(): boolean {
|
||||||
|
return isEqual(this.origin, this.webapi);
|
||||||
|
},
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.fetchItem();
|
||||||
|
},
|
||||||
|
beforeUnmount() {
|
||||||
|
try {
|
||||||
|
clearTimeout(this.timeout);
|
||||||
|
} catch (error) {}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapActions(useWebapiStore, ["fetchWebapiById", "updateActiveWebapi"]),
|
||||||
|
resetForm() {
|
||||||
|
this.webapi = cloneDeep(this.origin);
|
||||||
|
},
|
||||||
|
fetchItem() {
|
||||||
|
this.fetchWebapiById(parseInt(this.id ?? ""))
|
||||||
|
.then((result) => {
|
||||||
|
this.webapi = result.data;
|
||||||
|
this.origin = cloneDeep(result.data);
|
||||||
|
this.loading = "fetched";
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
this.loading = "failed";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
triggerWebapiUpdate(e: any) {
|
||||||
|
if (this.webapi == null) return;
|
||||||
|
let formData = e.target.elements;
|
||||||
|
let updateWebapi: UpdateWebapiViewModel = {
|
||||||
|
title: formData.title.value,
|
||||||
|
expiry: formData.expiry.value,
|
||||||
|
};
|
||||||
|
|
||||||
|
this.status = "loading";
|
||||||
|
this.updateActiveWebapi(this.webapi.id, updateWebapi)
|
||||||
|
.then(() => {
|
||||||
|
this.fetchItem();
|
||||||
|
this.status = { status: "success" };
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
this.status = { status: "failed" };
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.timeout = setTimeout(() => {
|
||||||
|
this.status = null;
|
||||||
|
}, 2000);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
87
src/views/admin/user/webapi/WebapiEditPermission.vue
Normal file
87
src/views/admin/user/webapi/WebapiEditPermission.vue
Normal file
|
@ -0,0 +1,87 @@
|
||||||
|
<template>
|
||||||
|
<MainTemplate>
|
||||||
|
<template #headerInsert>
|
||||||
|
<RouterLink to="../" class="text-primary">zurück zur Liste (abbrechen)</RouterLink>
|
||||||
|
</template>
|
||||||
|
<template #topBar>
|
||||||
|
<div class="flex flex-row items-center justify-between pt-5 pb-3 px-7">
|
||||||
|
<h1 class="font-bold text-xl h-8">Webapi-Token {{ webapi?.title }} - Berechtigungen bearbeiten</h1>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
<template #main>
|
||||||
|
<Spinner v-if="loading == 'loading'" class="mx-auto" />
|
||||||
|
<p v-else-if="loading == 'failed'">laden fehlgeschlagen</p>
|
||||||
|
<Permission
|
||||||
|
v-else-if="webapi != null"
|
||||||
|
:permissions="webapi.permissions"
|
||||||
|
:status="status"
|
||||||
|
@savePermissions="triggerUpdate"
|
||||||
|
/>
|
||||||
|
</template>
|
||||||
|
</MainTemplate>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { defineComponent } from "vue";
|
||||||
|
import { mapState, mapActions } from "pinia";
|
||||||
|
import MainTemplate from "@/templates/Main.vue";
|
||||||
|
import { useWebapiStore } from "@/stores/admin/user/webapi";
|
||||||
|
import Permission from "@/components/admin/Permission.vue";
|
||||||
|
import Spinner from "@/components/Spinner.vue";
|
||||||
|
import type { PermissionObject } from "@/types/permissionTypes";
|
||||||
|
import type { WebapiViewModel } from "@/viewmodels/admin/user/webapi.models";
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<script lang="ts">
|
||||||
|
export default defineComponent({
|
||||||
|
props: {
|
||||||
|
id: String,
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
loading: "loading" as "loading" | "fetched" | "failed",
|
||||||
|
status: null as null | "loading" | { status: "success" | "failed"; reason?: string },
|
||||||
|
webapi: null as null | WebapiViewModel,
|
||||||
|
timeout: null as any,
|
||||||
|
};
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.fetchItem();
|
||||||
|
},
|
||||||
|
beforeUnmount() {
|
||||||
|
try {
|
||||||
|
clearTimeout(this.timeout);
|
||||||
|
} catch (error) {}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapActions(useWebapiStore, ["fetchWebapiById", "updateActiveWebapiPermissions"]),
|
||||||
|
fetchItem() {
|
||||||
|
this.fetchWebapiById(parseInt(this.id ?? ""))
|
||||||
|
.then((result) => {
|
||||||
|
this.webapi = result.data;
|
||||||
|
this.loading = "fetched";
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
this.loading = "failed";
|
||||||
|
});
|
||||||
|
},
|
||||||
|
triggerUpdate(e: PermissionObject) {
|
||||||
|
if (this.webapi == null) return;
|
||||||
|
this.status = "loading";
|
||||||
|
this.updateActiveWebapiPermissions(this.webapi.id, e)
|
||||||
|
.then(() => {
|
||||||
|
this.fetchItem();
|
||||||
|
this.status = { status: "success" };
|
||||||
|
})
|
||||||
|
.catch((err) => {
|
||||||
|
this.status = { status: "failed" };
|
||||||
|
})
|
||||||
|
.finally(() => {
|
||||||
|
this.timeout = setTimeout(() => {
|
||||||
|
this.status = null;
|
||||||
|
}, 2000);
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
});
|
||||||
|
</script>
|
Loading…
Reference in a new issue