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/>.
|
|
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2018-06-12 11:32:18 +03:00
|
|
|
|
import Vue from 'vue';
|
2018-03-09 19:46:34 +03:00
|
|
|
|
import Router from 'vue-router';
|
2018-10-01 08:03:23 +03:00
|
|
|
|
|
|
|
|
|
// Dynamic loading
|
|
|
|
|
const Users = () => import('./views/Users');
|
|
|
|
|
const Apps = () => import('./views/Apps');
|
2018-03-09 19:46:34 +03:00
|
|
|
|
|
|
|
|
|
Vue.use(Router);
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
* 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
|
2018-05-11 10:57:13 +03:00
|
|
|
|
base: OC.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: [
|
|
|
|
|
{
|
|
|
|
|
path: ':selectedGroup',
|
|
|
|
|
name: 'group',
|
|
|
|
|
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',
|
|
|
|
|
component: Apps
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
}
|
|
|
|
|
]
|
2018-05-09 16:37:35 +03:00
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
});
|