+
{{ appCustom_login_message }}
+
-
{{ appCustom_login_message }}
FF Admin
entwickelt von
diff --git a/src/components/setup/Account.vue b/src/components/setup/Account.vue
new file mode 100644
index 0000000..95b88bd
--- /dev/null
+++ b/src/components/setup/Account.vue
@@ -0,0 +1,70 @@
+
+
+
+
+
+
+
diff --git a/src/components/setup/App.vue b/src/components/setup/App.vue
new file mode 100644
index 0000000..fbc2079
--- /dev/null
+++ b/src/components/setup/App.vue
@@ -0,0 +1,66 @@
+
+
+
+
+
+
+
diff --git a/src/components/setup/Club.vue b/src/components/setup/Club.vue
new file mode 100644
index 0000000..96fa4f9
--- /dev/null
+++ b/src/components/setup/Club.vue
@@ -0,0 +1,99 @@
+
+
+
+
+
+
+
diff --git a/src/components/setup/Finished.vue b/src/components/setup/Finished.vue
new file mode 100644
index 0000000..c711b4e
--- /dev/null
+++ b/src/components/setup/Finished.vue
@@ -0,0 +1,3 @@
+
+ Sie haben einen Verifizierungslink per Mail erhalten.
+
diff --git a/src/components/setup/Images.vue b/src/components/setup/Images.vue
new file mode 100644
index 0000000..33f5c23
--- /dev/null
+++ b/src/components/setup/Images.vue
@@ -0,0 +1,87 @@
+
+
+
+
+
+
+
diff --git a/src/components/setup/Mail.vue b/src/components/setup/Mail.vue
new file mode 100644
index 0000000..170c541
--- /dev/null
+++ b/src/components/setup/Mail.vue
@@ -0,0 +1,95 @@
+
+
+
+
+
+
+
diff --git a/src/main.css b/src/main.css
index e618f2f..9f95aa5 100644
--- a/src/main.css
+++ b/src/main.css
@@ -18,7 +18,7 @@
--error: #9a0d55;
--warning: #bb6210;
--info: #388994;
- --success: #73ad0f;
+ --success: #7ac142;
}
.dark {
--primary: #ff0d00;
@@ -27,7 +27,7 @@
--error: #9a0d55;
--warning: #bb6210;
--info: #4ccbda;
- --success: #73ad0f;
+ --success: #7ac142;
}
}
diff --git a/src/stores/setup.ts b/src/stores/setup.ts
new file mode 100644
index 0000000..3958eee
--- /dev/null
+++ b/src/stores/setup.ts
@@ -0,0 +1,130 @@
+import { defineStore } from "pinia";
+import { http } from "../serverCom";
+import type { AxiosResponse } from "axios";
+import { useConfigurationStore } from "./configuration";
+
+export const useSetupStore = defineStore("setup", {
+ state: () => {
+ return {
+ dictionary: ["club", "clubImages", "app", "mail", "account", "finished"],
+ step: 0 as number,
+ successfull: 0 as number,
+ };
+ },
+ getters: {
+ stepIndex: (state) => (dict: string) => state.dictionary.findIndex((d) => d == dict),
+ },
+ actions: {
+ skip(dict: string) {
+ let myIndex = this.stepIndex(dict);
+ this.step += 1;
+ if (this.successfull <= myIndex) {
+ this.successfull = myIndex + 1;
+ }
+ },
+ async setClub(data: {
+ name?: string;
+ imprint?: string;
+ privacy?: string;
+ website?: string;
+ }): Promise> {
+ let configStore = useConfigurationStore();
+
+ let myIndex = this.stepIndex("club");
+ const res = await http.post(`/setup/club`, {
+ name: data.name,
+ imprint: data.imprint,
+ privacy: data.privacy,
+ website: data.website,
+ });
+ configStore.configure();
+
+ this.step += 1;
+ if (this.successfull <= myIndex) {
+ this.successfull = myIndex;
+ }
+ return res;
+ },
+ async setClubImages(data: { icon?: File; logo?: File }): Promise> {
+ let configStore = useConfigurationStore();
+
+ let myIndex = this.stepIndex("clubImages");
+ const formData = new FormData();
+
+ if (data.icon) {
+ formData.append("icon", data.icon);
+ }
+
+ if (data.logo) {
+ formData.append("logo", data.logo);
+ }
+
+ const res = await http.post(`/setup/club/images`, formData, {
+ headers: {
+ "Content-Type": "multipart/form-data",
+ },
+ });
+ configStore.configure();
+
+ this.step += 1;
+ if (this.successfull <= myIndex) {
+ this.successfull = myIndex;
+ }
+ return res;
+ },
+ async setApp(data: { login_message: string; show_cal_link: boolean }): Promise> {
+ let myIndex = this.stepIndex("app");
+ const res = await http.post(`/setup/app`, {
+ custom_login_message: data.login_message,
+ show_link_to_calendar: data.show_cal_link,
+ });
+ this.step += 1;
+ if (this.successfull <= myIndex) {
+ this.successfull = myIndex;
+ }
+ return res;
+ },
+ async setMailConfig(data: {
+ host: string;
+ port: number;
+ secure: boolean;
+ mail: string;
+ username: string;
+ password: string;
+ }): Promise> {
+ let myIndex = this.stepIndex("mail");
+ const res = await http.post(`/setup/mail`, {
+ host: data.host,
+ port: data.port,
+ secure: data.secure,
+ mail: data.mail,
+ username: data.username,
+ password: data.password,
+ });
+ this.step += 1;
+ if (this.successfull <= myIndex) {
+ this.successfull = myIndex;
+ }
+ return res;
+ },
+ async createAdmin(credentials: {
+ username: string;
+ mail: string;
+ firstname: string;
+ lastname: string;
+ }): Promise> {
+ let myIndex = this.stepIndex("account");
+ const res = await http.post(`/setup/me`, {
+ username: credentials.username,
+ mail: credentials.mail,
+ firstname: credentials.firstname,
+ lastname: credentials.lastname,
+ });
+ this.step += 1;
+ if (this.successfull < myIndex) {
+ this.successfull = myIndex;
+ }
+ return res;
+ },
+ },
+});
diff --git a/src/views/setup/Setup.vue b/src/views/setup/Setup.vue
index f707e96..dd51a4f 100644
--- a/src/views/setup/Setup.vue
+++ b/src/views/setup/Setup.vue
@@ -5,33 +5,15 @@