misc_pterodactyl-panel/resources/assets/pterodactyl/scripts/app.js

70 lines
1.4 KiB
JavaScript
Raw Normal View History

import Vue from 'vue';
2018-03-31 21:33:10 +00:00
import Vuex from 'vuex';
import vuexI18n from 'vuex-i18n';
import VuexFlash from 'vuex-flash';
import { createFlashStore } from 'vuex-flash';
import VueRouter from 'vue-router';
2018-03-31 21:33:10 +00:00
// Helpers
import { Ziggy } from './helpers/ziggy';
2018-03-31 21:33:10 +00:00
import Locales from './../../../../resources/i18n/locales';
// Base Vuejs Templates
import Login from './components/auth/Login';
2018-03-31 21:33:10 +00:00
// Used for the route() helper.
window.Ziggy = Ziggy;
2018-03-31 21:33:10 +00:00
Vue.use(Vuex);
const store = new Vuex.Store({
plugins: [
createFlashStore(),
],
});
const route = require('./../../../../vendor/tightenco/ziggy/src/js/route').default;
Vue.config.productionTip = false;
Vue.mixin({
methods: {
route: route,
},
});
Vue.use(VueRouter);
Vue.use(VuexFlash, {
mixin: true,
template: require('./components/errors/Flash.template')
});
2018-03-31 21:33:10 +00:00
Vue.use(vuexI18n.plugin, store);
Vue.i18n.add('en', Locales.en);
Vue.i18n.set('en');
const router = new VueRouter({
routes: [
{
name: 'login',
path: '/',
component: Login,
},
{
name: 'forgot-password',
path: '/forgot-password',
component: Login,
},
{
name: 'checkpoint',
path: '/checkpoint',
component: Login,
},
]
});
2018-03-31 21:33:10 +00:00
require('./bootstrap');
const app = new Vue({
2018-03-31 21:33:10 +00:00
store,
router,
}).$mount('#pterodactyl');