2018-03-31 21:52:11 +01:00
|
|
|
import Vue from 'vue';
|
2018-03-31 22:33:10 +01:00
|
|
|
import Vuex from 'vuex';
|
|
|
|
import vuexI18n from 'vuex-i18n';
|
2018-04-01 23:46:16 +01:00
|
|
|
import VuexFlash from 'vuex-flash';
|
|
|
|
import { createFlashStore } from 'vuex-flash';
|
2018-03-31 21:52:11 +01:00
|
|
|
import VueRouter from 'vue-router';
|
2018-03-31 22:33:10 +01:00
|
|
|
|
|
|
|
// Helpers
|
2018-03-31 21:52:11 +01:00
|
|
|
import { Ziggy } from './helpers/ziggy';
|
2018-04-07 20:06:30 +01:00
|
|
|
import Locales from './../../../../resources/lang/locales';
|
2018-03-31 21:52:11 +01:00
|
|
|
|
|
|
|
// Base Vuejs Templates
|
|
|
|
import Login from './components/auth/Login';
|
2018-04-08 21:18:13 +01:00
|
|
|
import ResetPassword from './components/auth/ResetPassword';
|
2018-03-31 21:52:11 +01:00
|
|
|
|
2018-03-31 22:33:10 +01:00
|
|
|
// Used for the route() helper.
|
2018-03-31 21:52:11 +01:00
|
|
|
window.Ziggy = Ziggy;
|
|
|
|
|
2018-03-31 22:33:10 +01:00
|
|
|
Vue.use(Vuex);
|
2018-03-31 21:52:11 +01:00
|
|
|
|
2018-04-01 23:46:16 +01:00
|
|
|
const store = new Vuex.Store({
|
|
|
|
plugins: [
|
|
|
|
createFlashStore(),
|
|
|
|
],
|
|
|
|
});
|
2018-03-31 21:52:11 +01:00
|
|
|
const route = require('./../../../../vendor/tightenco/ziggy/src/js/route').default;
|
|
|
|
|
|
|
|
Vue.config.productionTip = false;
|
|
|
|
Vue.mixin({
|
|
|
|
methods: {
|
|
|
|
route: route,
|
|
|
|
},
|
|
|
|
});
|
|
|
|
|
|
|
|
Vue.use(VueRouter);
|
2018-04-01 23:46:16 +01:00
|
|
|
Vue.use(VuexFlash, {
|
|
|
|
mixin: true,
|
|
|
|
template: require('./components/errors/Flash.template')
|
|
|
|
});
|
2018-03-31 22:33:10 +01:00
|
|
|
Vue.use(vuexI18n.plugin, store);
|
|
|
|
|
|
|
|
Vue.i18n.add('en', Locales.en);
|
|
|
|
Vue.i18n.set('en');
|
2018-03-31 21:52:11 +01:00
|
|
|
|
|
|
|
const router = new VueRouter({
|
2018-04-08 21:46:32 +01:00
|
|
|
mode: 'history',
|
2018-03-31 21:52:11 +01:00
|
|
|
routes: [
|
|
|
|
{
|
2018-04-01 23:46:16 +01:00
|
|
|
name: 'login',
|
2018-04-08 21:46:32 +01:00
|
|
|
path: '/auth/login',
|
2018-04-01 23:46:16 +01:00
|
|
|
component: Login,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'forgot-password',
|
2018-04-08 21:46:32 +01:00
|
|
|
path: '/auth/password',
|
2018-04-01 23:46:16 +01:00
|
|
|
component: Login,
|
|
|
|
},
|
|
|
|
{
|
|
|
|
name: 'checkpoint',
|
|
|
|
path: '/checkpoint',
|
2018-03-31 21:52:11 +01:00
|
|
|
component: Login,
|
2018-04-01 23:46:16 +01:00
|
|
|
},
|
2018-04-08 21:18:13 +01:00
|
|
|
{
|
|
|
|
name: 'reset-password',
|
2018-04-08 21:46:32 +01:00
|
|
|
path: '/auth/password/reset/:token',
|
2018-04-08 21:18:13 +01:00
|
|
|
component: ResetPassword,
|
|
|
|
props: function (route) {
|
|
|
|
return {
|
|
|
|
token: route.params.token,
|
|
|
|
email: route.query.email || '',
|
|
|
|
}
|
|
|
|
},
|
|
|
|
}
|
2018-03-31 21:52:11 +01:00
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2018-03-31 22:33:10 +01:00
|
|
|
require('./bootstrap');
|
|
|
|
|
2018-03-31 21:52:11 +01:00
|
|
|
const app = new Vue({
|
2018-03-31 22:33:10 +01:00
|
|
|
store,
|
2018-03-31 21:52:11 +01:00
|
|
|
router,
|
|
|
|
}).$mount('#pterodactyl');
|