2023-04-19 23:14:30 +00:00
|
|
|
import { generateUrl } from '@nextcloud/router';
|
|
|
|
import { translate as t } from '@nextcloud/l10n';
|
|
|
|
import Router from 'vue-router';
|
|
|
|
import Vue from 'vue';
|
|
|
|
import Timeline from './components/Timeline.vue';
|
|
|
|
import SplitTimeline from './components/SplitTimeline.vue';
|
|
|
|
import ClusterView from './components/ClusterView.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({
|
2023-04-19 23:14:30 +00:00
|
|
|
mode: 'history',
|
2022-10-28 19:08:34 +00:00
|
|
|
// 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
|
2023-04-19 23:14:30 +00:00
|
|
|
base: generateUrl('/apps/memories'),
|
|
|
|
linkActiveClass: 'active',
|
2022-10-28 19:08:34 +00:00
|
|
|
routes: [
|
|
|
|
{
|
2023-04-19 23:14:30 +00:00
|
|
|
path: '/',
|
2022-10-28 19:08:34 +00:00
|
|
|
component: Timeline,
|
2023-04-19 23:14:30 +00:00
|
|
|
name: 'timeline',
|
2022-10-28 19:08:34 +00:00
|
|
|
props: (route) => ({
|
2023-04-19 23:14:30 +00:00
|
|
|
rootTitle: t('memories', 'Timeline'),
|
2022-10-28 19:08:34 +00:00
|
|
|
}),
|
|
|
|
},
|
2022-08-17 20:39:48 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
2023-04-19 23:14:30 +00:00
|
|
|
path: '/folders/:path*',
|
2022-10-28 19:08:34 +00:00
|
|
|
component: Timeline,
|
2023-04-19 23:14:30 +00:00
|
|
|
name: 'folders',
|
2022-10-28 19:08:34 +00:00
|
|
|
props: (route) => ({
|
2023-04-19 23:14:30 +00:00
|
|
|
rootTitle: t('memories', 'Folders'),
|
2022-10-28 19:08:34 +00:00
|
|
|
}),
|
|
|
|
},
|
2022-09-12 02:21:20 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
2023-04-19 23:14:30 +00:00
|
|
|
path: '/favorites',
|
2022-10-28 19:08:34 +00:00
|
|
|
component: Timeline,
|
2023-04-19 23:14:30 +00:00
|
|
|
name: 'favorites',
|
2022-10-28 19:08:34 +00:00
|
|
|
props: (route) => ({
|
2023-04-19 23:14:30 +00:00
|
|
|
rootTitle: t('memories', 'Favorites'),
|
2022-10-28 19:08:34 +00:00
|
|
|
}),
|
|
|
|
},
|
2022-09-13 07:55:32 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
2023-04-19 23:14:30 +00:00
|
|
|
path: '/videos',
|
2022-10-28 19:08:34 +00:00
|
|
|
component: Timeline,
|
2023-04-19 23:14:30 +00:00
|
|
|
name: 'videos',
|
2022-10-28 19:08:34 +00:00
|
|
|
props: (route) => ({
|
2023-04-19 23:14:30 +00:00
|
|
|
rootTitle: t('memories', 'Videos'),
|
2022-10-28 19:08:34 +00:00
|
|
|
}),
|
|
|
|
},
|
2022-09-25 23:02:26 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
2023-04-19 23:14:30 +00:00
|
|
|
path: '/albums/:user?/:name?',
|
2023-03-24 19:30:08 +00:00
|
|
|
component: ClusterView,
|
2023-04-19 23:14:30 +00:00
|
|
|
name: 'albums',
|
2022-10-28 19:08:34 +00:00
|
|
|
props: (route) => ({
|
2023-04-19 23:14:30 +00:00
|
|
|
rootTitle: t('memories', 'Albums'),
|
2022-10-28 19:08:34 +00:00
|
|
|
}),
|
|
|
|
},
|
2022-10-26 22:12:46 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
2023-04-19 23:14:30 +00:00
|
|
|
path: '/archive',
|
2022-10-28 19:08:34 +00:00
|
|
|
component: Timeline,
|
2023-04-19 23:14:30 +00:00
|
|
|
name: 'archive',
|
2022-10-28 19:08:34 +00:00
|
|
|
props: (route) => ({
|
2023-04-19 23:14:30 +00:00
|
|
|
rootTitle: t('memories', 'Archive'),
|
2022-10-28 19:08:34 +00:00
|
|
|
}),
|
|
|
|
},
|
2022-10-06 20:20:29 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
2023-04-19 23:14:30 +00:00
|
|
|
path: '/thisday',
|
2022-10-28 19:08:34 +00:00
|
|
|
component: Timeline,
|
2023-04-19 23:14:30 +00:00
|
|
|
name: 'thisday',
|
2022-10-28 19:08:34 +00:00
|
|
|
props: (route) => ({
|
2023-04-19 23:14:30 +00:00
|
|
|
rootTitle: t('memories', 'On this day'),
|
2022-10-28 19:08:34 +00:00
|
|
|
}),
|
|
|
|
},
|
2022-10-06 23:28:35 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
2023-04-19 23:14:30 +00:00
|
|
|
path: '/recognize/:user?/:name?',
|
2023-03-24 19:30:08 +00:00
|
|
|
component: ClusterView,
|
2023-04-19 23:14:30 +00:00
|
|
|
name: 'recognize',
|
2022-12-08 21:00:53 +00:00
|
|
|
props: (route) => ({
|
2023-04-19 23:14:30 +00:00
|
|
|
rootTitle: t('memories', 'People'),
|
2022-12-08 21:00:53 +00:00
|
|
|
}),
|
|
|
|
},
|
|
|
|
|
|
|
|
{
|
2023-04-19 23:14:30 +00:00
|
|
|
path: '/facerecognition/:user?/:name?',
|
2023-03-24 19:30:08 +00:00
|
|
|
component: ClusterView,
|
2023-04-19 23:14:30 +00:00
|
|
|
name: 'facerecognition',
|
2022-10-28 19:08:34 +00:00
|
|
|
props: (route) => ({
|
2023-04-19 23:14:30 +00:00
|
|
|
rootTitle: t('memories', 'People'),
|
2022-10-28 19:08:34 +00:00
|
|
|
}),
|
|
|
|
},
|
2022-10-07 19:28:39 +00:00
|
|
|
|
2023-02-05 21:43:25 +00:00
|
|
|
{
|
2023-04-19 23:14:30 +00:00
|
|
|
path: '/places/:name*',
|
2023-03-24 19:30:08 +00:00
|
|
|
component: ClusterView,
|
2023-04-19 23:14:30 +00:00
|
|
|
name: 'places',
|
2023-02-05 21:43:25 +00:00
|
|
|
props: (route) => ({
|
2023-04-19 23:14:30 +00:00
|
|
|
rootTitle: t('memories', 'Places'),
|
2023-02-05 21:43:25 +00:00
|
|
|
}),
|
|
|
|
},
|
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
2023-04-19 23:14:30 +00:00
|
|
|
path: '/tags/:name*',
|
2023-03-24 19:30:08 +00:00
|
|
|
component: ClusterView,
|
2023-04-19 23:14:30 +00:00
|
|
|
name: 'tags',
|
2022-10-28 19:08:34 +00:00
|
|
|
props: (route) => ({
|
2023-04-19 23:14:30 +00:00
|
|
|
rootTitle: t('memories', 'Tags'),
|
2022-10-28 19:08:34 +00:00
|
|
|
}),
|
|
|
|
},
|
2022-10-26 18:58:06 +00:00
|
|
|
|
2022-10-28 19:08:34 +00:00
|
|
|
{
|
2023-04-19 23:14:30 +00:00
|
|
|
path: '/maps',
|
|
|
|
name: 'maps',
|
2022-10-28 19:08:34 +00:00
|
|
|
// router-link doesn't support external url, let's force the redirect
|
|
|
|
beforeEnter() {
|
2023-04-19 23:14:30 +00:00
|
|
|
window.open(generateUrl('/apps/maps'), '_blank');
|
2022-10-28 19:08:34 +00:00
|
|
|
},
|
|
|
|
},
|
2022-10-29 00:25:39 +00:00
|
|
|
|
|
|
|
{
|
2023-04-19 23:14:30 +00:00
|
|
|
path: '/s/:token',
|
2022-10-29 00:25:39 +00:00
|
|
|
component: Timeline,
|
2023-04-19 23:14:30 +00:00
|
|
|
name: 'folder-share',
|
2022-10-29 00:25:39 +00:00
|
|
|
props: (route) => ({
|
2023-04-19 23:14:30 +00:00
|
|
|
rootTitle: t('memories', 'Shared Folder'),
|
2022-10-29 00:25:39 +00:00
|
|
|
}),
|
|
|
|
},
|
2023-01-18 03:02:00 +00:00
|
|
|
|
|
|
|
{
|
2023-04-19 23:14:30 +00:00
|
|
|
path: '/a/:token',
|
2023-01-18 03:02:00 +00:00
|
|
|
component: Timeline,
|
2023-04-19 23:14:30 +00:00
|
|
|
name: 'album-share',
|
2023-01-18 03:02:00 +00:00
|
|
|
props: (route) => ({
|
2023-04-19 23:14:30 +00:00
|
|
|
rootTitle: t('memories', 'Shared Album'),
|
2023-01-18 03:02:00 +00:00
|
|
|
}),
|
|
|
|
},
|
2023-01-25 18:41:55 +00:00
|
|
|
|
|
|
|
{
|
2023-04-19 23:14:30 +00:00
|
|
|
path: '/map',
|
2023-02-08 21:35:42 +00:00
|
|
|
component: SplitTimeline,
|
2023-04-19 23:14:30 +00:00
|
|
|
name: 'map',
|
2023-01-25 18:41:55 +00:00
|
|
|
props: (route) => ({
|
2023-04-19 23:14:30 +00:00
|
|
|
rootTitle: t('memories', 'Map'),
|
2023-02-08 21:35:42 +00:00
|
|
|
}),
|
2023-01-25 18:41:55 +00:00
|
|
|
},
|
2022-10-28 19:08:34 +00:00
|
|
|
],
|
|
|
|
});
|