2020-02-18 08:57:00 +01:00
|
|
|
import { RouteConfig } from "vue-router";
|
|
|
|
import Settings from "@/views/Settings.vue";
|
|
|
|
import AccountSettings from "@/views/Settings/AccountSettings.vue";
|
|
|
|
import Preferences from "@/views/Settings/Preferences.vue";
|
|
|
|
import Notifications from "@/views/Settings/Notifications.vue";
|
|
|
|
import Dashboard from "@/views/Admin/Dashboard.vue";
|
|
|
|
import AdminSettings from "@/views/Admin/Settings.vue";
|
|
|
|
import Follows from "@/views/Admin/Follows.vue";
|
|
|
|
import Followings from "@/components/Admin/Followings.vue";
|
|
|
|
import Followers from "@/components/Admin/Followers.vue";
|
|
|
|
import ReportList from "@/views/Moderation/ReportList.vue";
|
|
|
|
import Report from "@/views/Moderation/Report.vue";
|
|
|
|
import Logs from "@/views/Moderation/Logs.vue";
|
|
|
|
import EditIdentity from "@/views/Account/children/EditIdentity.vue";
|
2020-06-11 19:13:21 +02:00
|
|
|
import Users from "../views/Admin/Users.vue";
|
|
|
|
import Profiles from "../views/Admin/Profiles.vue";
|
|
|
|
import AdminProfile from "../views/Admin/AdminProfile.vue";
|
|
|
|
import AdminUserProfile from "../views/Admin/AdminUserProfile.vue";
|
2020-03-12 14:29:21 +01:00
|
|
|
|
|
|
|
export enum SettingsRouteName {
|
2020-02-18 08:57:00 +01: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",
|
|
|
|
RELAYS = "Relays",
|
|
|
|
RELAY_FOLLOWINGS = "Followings",
|
|
|
|
RELAY_FOLLOWERS = "Followers",
|
2020-06-11 19:13:21 +02:00
|
|
|
USERS = "USERS",
|
|
|
|
PROFILES = "PROFILES",
|
|
|
|
ADMIN_PROFILE = "ADMIN_PROFILE",
|
|
|
|
ADMIN_USER_PROFILE = "ADMIN_USER_PROFILE",
|
2020-02-18 08:57:00 +01:00
|
|
|
MODERATION = "MODERATION",
|
|
|
|
REPORTS = "Reports",
|
|
|
|
REPORT = "Report",
|
|
|
|
REPORT_LOGS = "Logs",
|
|
|
|
CREATE_IDENTITY = "CreateIdentity",
|
|
|
|
UPDATE_IDENTITY = "UpdateIdentity",
|
|
|
|
IDENTITIES = "IDENTITIES",
|
2020-03-12 14:29:21 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
export const settingsRoutes: RouteConfig[] = [
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/settings",
|
2020-03-12 14:29:21 +01:00
|
|
|
component: Settings,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
redirect: { name: SettingsRouteName.ACCOUNT_SETTINGS },
|
|
|
|
name: SettingsRouteName.SETTINGS,
|
|
|
|
children: [
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "account",
|
2020-03-12 14:29:21 +01:00
|
|
|
name: SettingsRouteName.ACCOUNT_SETTINGS,
|
|
|
|
redirect: { name: SettingsRouteName.ACCOUNT_SETTINGS_GENERAL },
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "account/general",
|
2020-03-12 14:29:21 +01:00
|
|
|
name: SettingsRouteName.ACCOUNT_SETTINGS_GENERAL,
|
|
|
|
component: AccountSettings,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "preferences",
|
2020-03-12 14:29:21 +01:00
|
|
|
name: SettingsRouteName.PREFERENCES,
|
|
|
|
component: Preferences,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "notifications",
|
2020-03-12 14:29:21 +01:00
|
|
|
name: SettingsRouteName.NOTIFICATIONS,
|
|
|
|
component: Notifications,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "admin",
|
2020-03-12 14:29:21 +01:00
|
|
|
name: SettingsRouteName.ADMIN,
|
|
|
|
redirect: { name: SettingsRouteName.ADMIN_DASHBOARD },
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "admin/dashboard",
|
2020-03-12 14:29:21 +01:00
|
|
|
name: SettingsRouteName.ADMIN_DASHBOARD,
|
|
|
|
component: Dashboard,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "admin/settings",
|
2020-03-12 14:29:21 +01:00
|
|
|
name: SettingsRouteName.ADMIN_SETTINGS,
|
|
|
|
component: AdminSettings,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
2020-06-11 19:13:21 +02:00
|
|
|
{
|
|
|
|
path: "admin/users",
|
|
|
|
name: SettingsRouteName.USERS,
|
|
|
|
component: Users,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "admin/users/:id",
|
|
|
|
name: SettingsRouteName.ADMIN_USER_PROFILE,
|
|
|
|
component: AdminUserProfile,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "admin/profiles",
|
|
|
|
name: SettingsRouteName.PROFILES,
|
|
|
|
component: Profiles,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
|
|
|
{
|
|
|
|
path: "admin/profiles/:id",
|
|
|
|
name: SettingsRouteName.ADMIN_PROFILE,
|
|
|
|
component: AdminProfile,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
2020-03-12 14:29:21 +01:00
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "admin/relays",
|
2020-03-12 14:29:21 +01:00
|
|
|
name: SettingsRouteName.RELAYS,
|
|
|
|
redirect: { name: SettingsRouteName.RELAY_FOLLOWINGS },
|
|
|
|
component: Follows,
|
|
|
|
children: [
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "followings",
|
2020-03-12 14:29:21 +01:00
|
|
|
name: SettingsRouteName.RELAY_FOLLOWINGS,
|
|
|
|
component: Followings,
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "followers",
|
2020-03-12 14:29:21 +01:00
|
|
|
name: SettingsRouteName.RELAY_FOLLOWERS,
|
|
|
|
component: Followers,
|
|
|
|
},
|
|
|
|
],
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/moderation",
|
2020-03-12 14:29:21 +01:00
|
|
|
name: SettingsRouteName.MODERATION,
|
|
|
|
redirect: { name: SettingsRouteName.REPORTS },
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/moderation/reports/:filter?",
|
2020-03-12 14:29:21 +01:00
|
|
|
name: SettingsRouteName.REPORTS,
|
|
|
|
component: ReportList,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/moderation/report/:reportId",
|
2020-03-12 14:29:21 +01:00
|
|
|
name: SettingsRouteName.REPORT,
|
|
|
|
component: Report,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/moderation/logs",
|
2020-03-12 14:29:21 +01:00
|
|
|
name: SettingsRouteName.REPORT_LOGS,
|
|
|
|
component: Logs,
|
|
|
|
props: true,
|
|
|
|
meta: { requiredAuth: true },
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/identity",
|
2020-03-12 14:29:21 +01:00
|
|
|
name: SettingsRouteName.IDENTITIES,
|
|
|
|
redirect: { name: SettingsRouteName.UPDATE_IDENTITY },
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/identity/create",
|
2020-03-12 14:29:21 +01:00
|
|
|
name: SettingsRouteName.CREATE_IDENTITY,
|
|
|
|
component: EditIdentity,
|
|
|
|
props: (route) => ({ identityName: route.params.identityName, isUpdate: false }),
|
|
|
|
},
|
|
|
|
{
|
2020-02-18 08:57:00 +01:00
|
|
|
path: "/identity/update/:identityName?",
|
2020-03-12 14:29:21 +01:00
|
|
|
name: SettingsRouteName.UPDATE_IDENTITY,
|
|
|
|
component: EditIdentity,
|
|
|
|
props: (route) => ({ identityName: route.params.identityName, isUpdate: true }),
|
|
|
|
},
|
|
|
|
],
|
|
|
|
},
|
|
|
|
];
|