2020-11-27 18:27:44 +00:00
|
|
|
import { Route, RouteConfig } from "vue-router";
|
2021-06-16 12:39:43 +00:00
|
|
|
import { ImportedComponent } from "vue/types/options";
|
2021-10-10 14:24:12 +00:00
|
|
|
import { i18n } from "@/utils/i18n";
|
2020-03-12 13:29:21 +00:00
|
|
|
|
|
|
|
export enum SettingsRouteName {
|
2020-02-18 07:57:00 +00:00
|
|
|
SETTINGS = "SETTINGS",
|
|
|
|
ACCOUNT_SETTINGS = "ACCOUNT_SETTINGS",
|
|
|
|
ACCOUNT_SETTINGS_GENERAL = "ACCOUNT_SETTINGS_GENERAL",
|
|
|
|
PREFERENCES = "PREFERENCES",
|
|
|
|
NOTIFICATIONS = "NOTIFICATIONS",
|
|
|
|
ADMIN = "ADMIN",
|
|
|
|
ADMIN_DASHBOARD = "ADMIN_DASHBOARD",
|
|
|
|
ADMIN_SETTINGS = "ADMIN_SETTINGS",
|
2021-12-28 10:42:08 +00:00
|
|
|
INSTANCES = "INSTANCES",
|
|
|
|
INSTANCE = "INSTANCE",
|
2020-06-11 17:13:21 +00:00
|
|
|
USERS = "USERS",
|
|
|
|
PROFILES = "PROFILES",
|
|
|
|
ADMIN_PROFILE = "ADMIN_PROFILE",
|
|
|
|
ADMIN_USER_PROFILE = "ADMIN_USER_PROFILE",
|
2020-08-27 09:53:24 +00:00
|
|
|
ADMIN_GROUPS = "ADMIN_GROUPS",
|
|
|
|
ADMIN_GROUP_PROFILE = "ADMIN_GROUP_PROFILE",
|
2020-02-18 07:57:00 +00:00
|
|
|
MODERATION = "MODERATION",
|
|
|
|
REPORTS = "Reports",
|
|
|
|
REPORT = "Report",
|
|
|
|
REPORT_LOGS = "Logs",
|
|
|
|
CREATE_IDENTITY = "CreateIdentity",
|
|
|
|
UPDATE_IDENTITY = "UpdateIdentity",
|
|
|
|
IDENTITIES = "IDENTITIES",
|
2020-03-12 13:29:21 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
export const settingsRoutes: RouteConfig[] = [
|
|
|
|
{
|
2020-02-18 07:57:00 +00:00
|
|
|
path: "/settings",
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 09:24:11 +00:00
|
|
|
import(/* webpackChunkName: "Settings" */ "@/views/Settings.vue"),
|
2020-03-12 13:29:21 +00:00
|
|
|
props: true,
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2020-03-12 13:29:21 +00:00
|
|
|
redirect: { name: SettingsRouteName.ACCOUNT_SETTINGS },
|
|
|
|
name: SettingsRouteName.SETTINGS,
|
|
|
|
children: [
|
|
|
|
{
|
2020-02-18 07:57:00 +00:00
|
|
|
path: "account",
|
2020-03-12 13:29:21 +00:00
|
|
|
name: SettingsRouteName.ACCOUNT_SETTINGS,
|
|
|
|
redirect: { name: SettingsRouteName.ACCOUNT_SETTINGS_GENERAL },
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: { skip: true },
|
|
|
|
},
|
2020-03-12 13:29:21 +00:00
|
|
|
},
|
|
|
|
{
|
2020-02-18 07:57:00 +00:00
|
|
|
path: "account/general",
|
2020-03-12 13:29:21 +00:00
|
|
|
name: SettingsRouteName.ACCOUNT_SETTINGS_GENERAL,
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 09:24:11 +00:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "AccountSettings" */ "@/views/Settings/AccountSettings.vue"
|
|
|
|
),
|
2020-03-12 13:29:21 +00:00
|
|
|
props: true,
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: {
|
|
|
|
message: (): string => i18n.t("Account settings") as string,
|
|
|
|
},
|
|
|
|
},
|
2020-03-12 13:29:21 +00:00
|
|
|
},
|
|
|
|
{
|
2020-02-18 07:57:00 +00:00
|
|
|
path: "preferences",
|
2020-03-12 13:29:21 +00:00
|
|
|
name: SettingsRouteName.PREFERENCES,
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 09:24:11 +00:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "Preferences" */ "@/views/Settings/Preferences.vue"
|
|
|
|
),
|
2020-03-12 13:29:21 +00:00
|
|
|
props: true,
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: { message: (): string => i18n.t("Preferences") as string },
|
|
|
|
},
|
2020-03-12 13:29:21 +00:00
|
|
|
},
|
|
|
|
{
|
2020-02-18 07:57:00 +00:00
|
|
|
path: "notifications",
|
2020-03-12 13:29:21 +00:00
|
|
|
name: SettingsRouteName.NOTIFICATIONS,
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 09:24:11 +00:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "Notifications" */ "@/views/Settings/Notifications.vue"
|
|
|
|
),
|
2020-03-12 13:29:21 +00:00
|
|
|
props: true,
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: {
|
|
|
|
message: (): string => i18n.t("Notifications") as string,
|
|
|
|
},
|
|
|
|
},
|
2020-03-12 13:29:21 +00:00
|
|
|
},
|
|
|
|
{
|
2020-02-18 07:57:00 +00:00
|
|
|
path: "admin",
|
2020-03-12 13:29:21 +00:00
|
|
|
name: SettingsRouteName.ADMIN,
|
|
|
|
redirect: { name: SettingsRouteName.ADMIN_DASHBOARD },
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2020-03-12 13:29:21 +00:00
|
|
|
},
|
|
|
|
{
|
2020-02-18 07:57:00 +00:00
|
|
|
path: "admin/dashboard",
|
2020-03-12 13:29:21 +00:00
|
|
|
name: SettingsRouteName.ADMIN_DASHBOARD,
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 09:24:11 +00:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "Dashboard" */ "@/views/Admin/Dashboard.vue"
|
|
|
|
),
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: {
|
|
|
|
message: (): string => i18n.t("Admin dashboard") as string,
|
|
|
|
},
|
|
|
|
},
|
2020-03-12 13:29:21 +00:00
|
|
|
},
|
|
|
|
{
|
2020-02-18 07:57:00 +00:00
|
|
|
path: "admin/settings",
|
2020-03-12 13:29:21 +00:00
|
|
|
name: SettingsRouteName.ADMIN_SETTINGS,
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 09:24:11 +00:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "AdminSettings" */ "@/views/Admin/Settings.vue"
|
|
|
|
),
|
2020-03-12 13:29:21 +00:00
|
|
|
props: true,
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: {
|
|
|
|
message: (): string => i18n.t("Admin settings") as string,
|
|
|
|
},
|
|
|
|
},
|
2020-03-12 13:29:21 +00:00
|
|
|
},
|
2020-06-11 17:13:21 +00:00
|
|
|
{
|
|
|
|
path: "admin/users",
|
|
|
|
name: SettingsRouteName.USERS,
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 09:24:11 +00:00
|
|
|
import(/* webpackChunkName: "Users" */ "@/views/Admin/Users.vue"),
|
2020-06-11 17:13:21 +00:00
|
|
|
props: true,
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: { message: (): string => i18n.t("Users") as string },
|
|
|
|
},
|
2020-06-11 17:13:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "admin/users/:id",
|
|
|
|
name: SettingsRouteName.ADMIN_USER_PROFILE,
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 09:24:11 +00:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "AdminUserProfile" */ "@/views/Admin/AdminUserProfile.vue"
|
|
|
|
),
|
2020-06-11 17:13:21 +00:00
|
|
|
props: true,
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: { skip: true },
|
|
|
|
},
|
2020-06-11 17:13:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "admin/profiles",
|
|
|
|
name: SettingsRouteName.PROFILES,
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 09:24:11 +00:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "AdminProfiles" */ "@/views/Admin/Profiles.vue"
|
|
|
|
),
|
2020-06-11 17:13:21 +00:00
|
|
|
props: true,
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: { message: (): string => i18n.t("Profiles") as string },
|
|
|
|
},
|
2020-06-11 17:13:21 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "admin/profiles/:id",
|
|
|
|
name: SettingsRouteName.ADMIN_PROFILE,
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 09:24:11 +00:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "AdminProfile" */ "@/views/Admin/AdminProfile.vue"
|
|
|
|
),
|
2020-06-11 17:13:21 +00:00
|
|
|
props: true,
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2020-06-11 17:13:21 +00:00
|
|
|
},
|
2020-08-27 09:53:24 +00:00
|
|
|
{
|
|
|
|
path: "admin/groups",
|
|
|
|
name: SettingsRouteName.ADMIN_GROUPS,
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 09:24:11 +00:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "GroupProfiles" */ "@/views/Admin/GroupProfiles.vue"
|
|
|
|
),
|
2020-08-27 09:53:24 +00:00
|
|
|
props: true,
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: {
|
|
|
|
message: (): string => i18n.t("Group profiles") as string,
|
|
|
|
},
|
|
|
|
},
|
2020-08-27 09:53:24 +00:00
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "admin/groups/:id",
|
|
|
|
name: SettingsRouteName.ADMIN_GROUP_PROFILE,
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 09:24:11 +00:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "AdminGroupProfile" */ "@/views/Admin/AdminGroupProfile.vue"
|
|
|
|
),
|
2020-08-27 09:53:24 +00:00
|
|
|
props: true,
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2020-08-27 09:53:24 +00:00
|
|
|
},
|
2020-03-12 13:29:21 +00:00
|
|
|
{
|
2021-12-28 10:42:08 +00:00
|
|
|
path: "admin/instances",
|
|
|
|
name: SettingsRouteName.INSTANCES,
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2021-12-28 10:42:08 +00:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "Instances" */ "@/views/Admin/Instances.vue"
|
|
|
|
),
|
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: {
|
|
|
|
message: (): string => i18n.t("Instances") as string,
|
2020-03-12 13:29:21 +00:00
|
|
|
},
|
2021-12-28 10:42:08 +00:00
|
|
|
},
|
2020-03-12 13:29:21 +00:00
|
|
|
props: true,
|
|
|
|
},
|
2021-12-28 10:42:08 +00:00
|
|
|
{
|
|
|
|
path: "admin/instances/:domain",
|
|
|
|
name: SettingsRouteName.INSTANCE,
|
|
|
|
component: (): Promise<ImportedComponent> =>
|
|
|
|
import(
|
|
|
|
/* webpackChunkName: "Instance" */ "@/views/Admin/Instance.vue"
|
|
|
|
),
|
|
|
|
props: true,
|
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: {
|
|
|
|
message: (): string => i18n.t("Instance") as string,
|
|
|
|
},
|
|
|
|
},
|
|
|
|
},
|
2020-03-12 13:29:21 +00:00
|
|
|
{
|
2020-02-18 07:57:00 +00:00
|
|
|
path: "/moderation",
|
2020-03-12 13:29:21 +00:00
|
|
|
name: SettingsRouteName.MODERATION,
|
|
|
|
redirect: { name: SettingsRouteName.REPORTS },
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2020-03-12 13:29:21 +00:00
|
|
|
},
|
|
|
|
{
|
2020-02-18 07:57:00 +00:00
|
|
|
path: "/moderation/reports/:filter?",
|
2020-03-12 13:29:21 +00:00
|
|
|
name: SettingsRouteName.REPORTS,
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 09:24:11 +00:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "ReportList" */ "@/views/Moderation/ReportList.vue"
|
|
|
|
),
|
2020-03-12 13:29:21 +00:00
|
|
|
props: true,
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: {
|
|
|
|
message: (): string => i18n.t("Reports list") as string,
|
|
|
|
},
|
|
|
|
},
|
2020-03-12 13:29:21 +00:00
|
|
|
},
|
|
|
|
{
|
2020-02-18 07:57:00 +00:00
|
|
|
path: "/moderation/report/:reportId",
|
2020-03-12 13:29:21 +00:00
|
|
|
name: SettingsRouteName.REPORT,
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 09:24:11 +00:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "Report" */ "@/views/Moderation/Report.vue"
|
|
|
|
),
|
2020-03-12 13:29:21 +00:00
|
|
|
props: true,
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: { message: (): string => i18n.t("Report") as string },
|
|
|
|
},
|
2020-03-12 13:29:21 +00:00
|
|
|
},
|
|
|
|
{
|
2020-02-18 07:57:00 +00:00
|
|
|
path: "/moderation/logs",
|
2020-03-12 13:29:21 +00:00
|
|
|
name: SettingsRouteName.REPORT_LOGS,
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-11-30 09:24:11 +00:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "ModerationLogs" */ "@/views/Moderation/Logs.vue"
|
|
|
|
),
|
2020-03-12 13:29:21 +00:00
|
|
|
props: true,
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: {
|
|
|
|
message: (): string => i18n.t("Moderation logs") as string,
|
|
|
|
},
|
|
|
|
},
|
2020-03-12 13:29:21 +00:00
|
|
|
},
|
|
|
|
{
|
2020-02-18 07:57:00 +00:00
|
|
|
path: "/identity",
|
2020-03-12 13:29:21 +00:00
|
|
|
name: SettingsRouteName.IDENTITIES,
|
|
|
|
redirect: { name: SettingsRouteName.UPDATE_IDENTITY },
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2020-03-12 13:29:21 +00:00
|
|
|
},
|
|
|
|
{
|
2020-02-18 07:57:00 +00:00
|
|
|
path: "/identity/create",
|
2020-03-12 13:29:21 +00:00
|
|
|
name: SettingsRouteName.CREATE_IDENTITY,
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-10-14 16:59:36 +00:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "EditIdentity" */ "@/views/Account/children/EditIdentity.vue"
|
|
|
|
),
|
2020-11-27 18:27:44 +00:00
|
|
|
props: (route: Route): Record<string, unknown> => ({
|
|
|
|
identityName: route.params.identityName,
|
|
|
|
isUpdate: false,
|
|
|
|
}),
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: {
|
|
|
|
requiredAuth: true,
|
|
|
|
announcer: {
|
|
|
|
message: (): string => i18n.t("Create identity") as string,
|
|
|
|
},
|
|
|
|
},
|
2020-03-12 13:29:21 +00:00
|
|
|
},
|
|
|
|
{
|
2020-02-18 07:57:00 +00:00
|
|
|
path: "/identity/update/:identityName?",
|
2020-03-12 13:29:21 +00:00
|
|
|
name: SettingsRouteName.UPDATE_IDENTITY,
|
2021-06-16 12:39:43 +00:00
|
|
|
component: (): Promise<ImportedComponent> =>
|
2020-10-14 16:59:36 +00:00
|
|
|
import(
|
|
|
|
/* webpackChunkName: "EditIdentity" */ "@/views/Account/children/EditIdentity.vue"
|
|
|
|
),
|
2020-11-27 18:27:44 +00:00
|
|
|
props: (route: Route): Record<string, unknown> => ({
|
|
|
|
identityName: route.params.identityName,
|
|
|
|
isUpdate: true,
|
|
|
|
}),
|
2021-10-10 14:24:12 +00:00
|
|
|
meta: { requiredAuth: true, announcer: { skip: true } },
|
2020-03-12 13:29:21 +00:00
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|