2022-10-28 19:08:34 +00:00
|
|
|
import { generateUrl } from "@nextcloud/router";
|
|
|
|
import { translate as t, translatePlural as n } from "@nextcloud/l10n";
|
|
|
|
import Router from "vue-router";
|
|
|
|
import Vue from "vue";
|
|
|
|
import Timeline from "./components/Timeline.vue";
|
2022-08-16 01:12:14 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
Vue.use(Router);
|
2022-08-16 01:12:14 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
export default new Router({
|
|
|
|
mode: "history",
|
|
|
|
// if index.php is in the url AND we got this far, then it's working:
|
|
|
|
// let's keep using index.php in the url
|
|
|
|
base: generateUrl("/apps/memories"),
|
|
|
|
linkActiveClass: "active",
|
|
|
|
routes: [
|
|
|
|
{
|
|
|
|
path: "/",
|
|
|
|
component: Timeline,
|
|
|
|
name: "timeline",
|
|
|
|
props: (route) => ({
|
|
|
|
rootTitle: t("memories", "Timeline"),
|
|
|
|
}),
|
|
|
|
},
|
2022-08-17 20:39:48 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
|
|
|
path: "/folders/:path*",
|
|
|
|
component: Timeline,
|
|
|
|
name: "folders",
|
|
|
|
props: (route) => ({
|
|
|
|
rootTitle: t("memories", "Folders"),
|
|
|
|
}),
|
|
|
|
},
|
2022-09-12 02:21:20 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
|
|
|
path: "/favorites",
|
|
|
|
component: Timeline,
|
|
|
|
name: "favorites",
|
|
|
|
props: (route) => ({
|
|
|
|
rootTitle: t("memories", "Favorites"),
|
|
|
|
}),
|
|
|
|
},
|
2022-09-13 07:55:32 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
|
|
|
path: "/videos",
|
|
|
|
component: Timeline,
|
|
|
|
name: "videos",
|
|
|
|
props: (route) => ({
|
|
|
|
rootTitle: t("memories", "Videos"),
|
|
|
|
}),
|
|
|
|
},
|
2022-09-25 23:02:26 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
|
|
|
path: "/albums/:user?/:name?",
|
|
|
|
component: Timeline,
|
|
|
|
name: "albums",
|
|
|
|
props: (route) => ({
|
|
|
|
rootTitle: t("memories", "Albums"),
|
|
|
|
}),
|
|
|
|
},
|
2022-10-26 22:12:46 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
|
|
|
path: "/archive",
|
|
|
|
component: Timeline,
|
|
|
|
name: "archive",
|
|
|
|
props: (route) => ({
|
|
|
|
rootTitle: t("memories", "Archive"),
|
|
|
|
}),
|
|
|
|
},
|
2022-10-06 20:20:29 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
|
|
|
path: "/thisday",
|
|
|
|
component: Timeline,
|
|
|
|
name: "thisday",
|
|
|
|
props: (route) => ({
|
|
|
|
rootTitle: t("memories", "On this day"),
|
|
|
|
}),
|
|
|
|
},
|
2022-10-06 23:28:35 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
2022-12-08 21:00:53 +00:00
|
|
|
path: "/recognize/:user?/:name?",
|
2022-10-28 19:08:34 +00:00
|
|
|
component: Timeline,
|
2022-12-08 21:00:53 +00:00
|
|
|
name: "recognize",
|
|
|
|
props: (route) => ({
|
|
|
|
rootTitle: t("memories", "People"),
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
|
|
|
path: "/facerecognition/:user?/:name?",
|
|
|
|
component: Timeline,
|
|
|
|
name: "facerecognition",
|
2022-10-28 19:08:34 +00:00
|
|
|
props: (route) => ({
|
|
|
|
rootTitle: t("memories", "People"),
|
|
|
|
}),
|
|
|
|
},
|
2022-10-07 19:28:39 +00:00
|
|
|
|
2023-02-05 21:43:25 +00:00
|
|
|
{
|
|
|
|
path: "/places/:name*",
|
|
|
|
component: Timeline,
|
|
|
|
name: "places",
|
|
|
|
props: (route) => ({
|
|
|
|
rootTitle: t("memories", "Places"),
|
|
|
|
}),
|
|
|
|
},
|
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
|
|
|
path: "/tags/:name*",
|
|
|
|
component: Timeline,
|
|
|
|
name: "tags",
|
|
|
|
props: (route) => ({
|
|
|
|
rootTitle: t("memories", "Tags"),
|
|
|
|
}),
|
|
|
|
},
|
2022-10-26 18:58:06 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
|
|
|
path: "/maps",
|
|
|
|
name: "maps",
|
|
|
|
// router-link doesn't support external url, let's force the redirect
|
|
|
|
beforeEnter() {
|
|
|
|
window.open(generateUrl("/apps/maps"), "_blank");
|
|
|
|
},
|
|
|
|
},
|
2022-10-29 00:25:39 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
path: "/s/:token",
|
|
|
|
component: Timeline,
|
|
|
|
name: "folder-share",
|
|
|
|
props: (route) => ({
|
|
|
|
rootTitle: t("memories", "Shared Folder"),
|
|
|
|
}),
|
|
|
|
},
|
2023-01-18 03:02:00 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
path: "/a/:token",
|
|
|
|
component: Timeline,
|
|
|
|
name: "album-share",
|
|
|
|
props: (route) => ({
|
|
|
|
rootTitle: t("memories", "Shared Album"),
|
|
|
|
}),
|
|
|
|
},
|
2023-01-25 18:41:55 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
path: "/locations",
|
|
|
|
component: Timeline,
|
|
|
|
name: "locations",
|
|
|
|
props: (route) => ({
|
|
|
|
rootTitle: t("memories", "Locations"),
|
|
|
|
})
|
|
|
|
},
|
2022-10-28 19:08:34 +00:00
|
|
|
],
|
|
|
|
});
|