2018-06-12 11:23:00 +03:00
|
|
|
|
/*
|
|
|
|
|
* @copyright Copyright (c) 2018 John Molakvoæ <skjnldsv@protonmail.com>
|
|
|
|
|
*
|
|
|
|
|
* @author John Molakvoæ <skjnldsv@protonmail.com>
|
|
|
|
|
* @author Julius Härtl <jus@bitgrid.net>
|
|
|
|
|
*
|
|
|
|
|
* @license GNU AGPL version 3 or any later version
|
|
|
|
|
*
|
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
|
* it under the terms of the GNU Affero General Public License as
|
|
|
|
|
* published by the Free Software Foundation, either version 3 of the
|
|
|
|
|
* License, or (at your option) any later version.
|
|
|
|
|
*
|
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
* GNU Affero General Public License for more details.
|
|
|
|
|
*
|
|
|
|
|
* You should have received a copy of the GNU Affero General Public License
|
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2019-09-25 19:19:42 +03:00
|
|
|
|
import Vue from 'vue'
|
|
|
|
|
import Router from 'vue-router'
|
2020-05-08 11:01:54 +03:00
|
|
|
|
import { generateUrl } from '@nextcloud/router'
|
2018-10-01 08:03:23 +03:00
|
|
|
|
|
|
|
|
|
// Dynamic loading
|
2019-09-25 19:19:42 +03:00
|
|
|
|
const Users = () => import('./views/Users')
|
|
|
|
|
const Apps = () => import('./views/Apps')
|
2018-03-09 19:46:34 +03:00
|
|
|
|
|
2019-09-25 19:19:42 +03:00
|
|
|
|
Vue.use(Router)
|
2018-03-09 19:46:34 +03:00
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* This is the list of routes where the vuejs app will
|
|
|
|
|
* take over php to provide data
|
|
|
|
|
* You need to forward the php routing (routes.php) to
|
2018-06-12 11:23:00 +03:00
|
|
|
|
* the settings-vue template, where the vue-router will
|
|
|
|
|
* ensure the proper route.
|
2018-03-09 19:46:34 +03:00
|
|
|
|
* ⚠️ Routes needs to match the php routes.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
export default new Router({
|
2018-04-09 12:03:21 +03:00
|
|
|
|
mode: 'history',
|
2018-05-10 18:55:08 +03: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
|
2020-05-08 11:01:54 +03:00
|
|
|
|
base: generateUrl(''),
|
2018-05-23 14:01:40 +03:00
|
|
|
|
linkActiveClass: 'active',
|
2018-05-09 16:37:35 +03:00
|
|
|
|
routes: [
|
|
|
|
|
{
|
|
|
|
|
path: '/:index(index.php/)?settings/users',
|
|
|
|
|
component: Users,
|
|
|
|
|
props: true,
|
|
|
|
|
name: 'users',
|
|
|
|
|
children: [
|
|
|
|
|
{
|
2020-02-25 21:06:55 +03:00
|
|
|
|
path: ':selectedGroup',
|
2018-05-09 16:37:35 +03:00
|
|
|
|
name: 'group',
|
2019-11-13 15:05:10 +03:00
|
|
|
|
component: Users,
|
|
|
|
|
},
|
|
|
|
|
],
|
2018-05-10 14:26:29 +03:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
path: '/:index(index.php/)?settings/apps',
|
|
|
|
|
component: Apps,
|
|
|
|
|
props: true,
|
|
|
|
|
name: 'apps',
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
path: ':category',
|
|
|
|
|
name: 'apps-category',
|
|
|
|
|
component: Apps,
|
|
|
|
|
children: [
|
|
|
|
|
{
|
|
|
|
|
path: ':id',
|
|
|
|
|
name: 'apps-details',
|
2019-11-13 15:05:10 +03:00
|
|
|
|
component: Apps,
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
},
|
|
|
|
|
],
|
2019-09-25 19:19:42 +03:00
|
|
|
|
})
|