2018-03-31 15:52:11 -05:00
|
|
|
import Vue from 'vue';
|
2018-03-31 16:33:10 -05:00
|
|
|
import Vuex from 'vuex';
|
|
|
|
import vuexI18n from 'vuex-i18n';
|
2018-03-31 15:52:11 -05:00
|
|
|
import VueRouter from 'vue-router';
|
2018-03-31 16:33:10 -05:00
|
|
|
|
|
|
|
// Helpers
|
2018-03-31 15:52:11 -05:00
|
|
|
import { Ziggy } from './helpers/ziggy';
|
2018-05-26 12:33:27 -07:00
|
|
|
import Locales from './../../../resources/lang/locales';
|
2018-05-26 14:50:38 -07:00
|
|
|
import { flash } from './mixins/flash';
|
2018-03-31 15:52:11 -05:00
|
|
|
|
|
|
|
// Base Vuejs Templates
|
|
|
|
import Login from './components/auth/Login';
|
2018-04-08 15:18:13 -05:00
|
|
|
import ResetPassword from './components/auth/ResetPassword';
|
2018-03-31 15:52:11 -05:00
|
|
|
|
2018-05-26 14:50:38 -07:00
|
|
|
window.events = new Vue;
|
2018-03-31 15:52:11 -05:00
|
|
|
window.Ziggy = Ziggy;
|
|
|
|
|
2018-03-31 16:33:10 -05:00
|
|
|
Vue.use(Vuex);
|
2018-03-31 15:52:11 -05:00
|
|
|
|
2018-05-26 14:59:58 -07:00
|
|
|
const store = new Vuex.Store();
|
2018-05-26 12:33:27 -07:00
|
|
|
const route = require('./../../../vendor/tightenco/ziggy/src/js/route').default;
|
2018-03-31 15:52:11 -05:00
|
|
|
|
|
|
|
Vue.config.productionTip = false;
|
2018-04-08 16:00:52 -05:00
|
|
|
Vue.mixin({ methods: { route } });
|
2018-05-26 14:50:38 -07:00
|
|
|
Vue.mixin(flash);
|
2018-03-31 15:52:11 -05:00
|
|
|
|
|
|
|
Vue.use(VueRouter);
|
2018-03-31 16:33:10 -05:00
|
|
|
Vue.use(vuexI18n.plugin, store);
|
|
|
|
|
|
|
|
Vue.i18n.add('en', Locales.en);
|
|
|
|
Vue.i18n.set('en');
|
2018-03-31 15:52:11 -05:00
|
|
|
|
|
|
|
const router = new VueRouter({
|
2018-04-08 15:46:32 -05:00
|
|
|
mode: 'history',
|
2018-03-31 15:52:11 -05:00
|
|
|
routes: [
|
2018-04-08 16:00:52 -05:00
|
|
|
{ name: 'login', path: '/auth/login', component: Login },
|
|
|
|
{ name: 'forgot-password', path: '/auth/password', component: Login },
|
2018-06-02 17:01:54 -07:00
|
|
|
{ name: 'checkpoint', path: '/auth/checkpoint', component: Login },
|
2018-04-08 15:18:13 -05:00
|
|
|
{
|
|
|
|
name: 'reset-password',
|
2018-04-08 15:46:32 -05:00
|
|
|
path: '/auth/password/reset/:token',
|
2018-04-08 15:18:13 -05:00
|
|
|
component: ResetPassword,
|
|
|
|
props: function (route) {
|
2018-04-08 16:00:52 -05:00
|
|
|
return { token: route.params.token, email: route.query.email || '' };
|
|
|
|
}
|
|
|
|
},
|
|
|
|
{ path: '*', redirect: '/auth/login' }
|
2018-03-31 15:52:11 -05:00
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2018-03-31 16:33:10 -05:00
|
|
|
require('./bootstrap');
|
|
|
|
|
2018-04-08 16:00:52 -05:00
|
|
|
const app = new Vue({ store, router }).$mount('#pterodactyl');
|