1
|
|
|
/** |
2
|
|
|
* @copyright Copyright (c) 2018 John Molakvoæ <[email protected]> |
3
|
|
|
* |
4
|
|
|
* @author John Molakvoæ <[email protected]> |
5
|
|
|
* |
6
|
|
|
* @license GNU AGPL version 3 or any later version |
7
|
|
|
* |
8
|
|
|
* This program is free software: you can redistribute it and/or modify |
9
|
|
|
* it under the terms of the GNU Affero General Public License as |
10
|
|
|
* published by the Free Software Foundation, either version 3 of the |
11
|
|
|
* License, or (at your option) any later version. |
12
|
|
|
* |
13
|
|
|
* This program is distributed in the hope that it will be useful, |
14
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
15
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
16
|
|
|
* GNU Affero General Public License for more details. |
17
|
|
|
* |
18
|
|
|
* You should have received a copy of the GNU Affero General Public License |
19
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>. |
20
|
|
|
* |
21
|
|
|
*/ |
22
|
|
|
|
23
|
|
|
import { generateUrl } from '@nextcloud/router' |
24
|
|
|
import Router from 'vue-router' |
25
|
|
|
import Vue from 'vue' |
26
|
|
|
|
27
|
|
|
import Grid from '../views/Grid' |
28
|
|
|
|
29
|
|
|
Vue.use(Router) |
30
|
|
|
|
31
|
|
|
export default new Router({ |
32
|
|
|
mode: 'history', |
33
|
|
|
// if index.php is in the url AND we got this far, then it's working: |
34
|
|
|
// let's keep using index.php in the url |
35
|
|
|
base: generateUrl('/apps/gallery', ''), |
36
|
|
|
linkActiveClass: 'active', |
37
|
|
|
routes: [ |
38
|
|
|
{ |
39
|
|
|
path: '/', |
40
|
|
|
component: Grid, |
41
|
|
|
props: route => ({ |
42
|
|
|
// always lead current path with a slash |
43
|
|
|
path: `/${route.params.path ? route.params.path : ''}`, |
44
|
|
|
}), |
45
|
|
|
name: 'root', |
46
|
|
|
children: [ |
47
|
|
|
{ |
48
|
|
|
path: ':path*', |
49
|
|
|
name: 'path', |
50
|
|
|
component: Grid, |
51
|
|
|
}, |
52
|
|
|
], |
53
|
|
|
}, |
54
|
|
|
{ path: '*', redirect: { name: 'root' } }, |
55
|
|
|
], |
56
|
|
|
}) |
57
|
|
|
|