2018-03-31 20:52:11 +00:00
|
|
|
import Vue from 'vue';
|
2018-03-31 21:33:10 +00:00
|
|
|
import Vuex from 'vuex';
|
|
|
|
import vuexI18n from 'vuex-i18n';
|
2018-03-31 20:52:11 +00:00
|
|
|
import VueRouter from 'vue-router';
|
2018-03-31 21:33:10 +00:00
|
|
|
|
|
|
|
// Helpers
|
2018-03-31 20:52:11 +00:00
|
|
|
import { Ziggy } from './helpers/ziggy';
|
2018-05-26 19:33:27 +00:00
|
|
|
import Locales from './../../../resources/lang/locales';
|
2018-05-26 21:50:38 +00:00
|
|
|
import { flash } from './mixins/flash';
|
2018-03-31 20:52:11 +00:00
|
|
|
|
2018-05-27 22:37:03 +00:00
|
|
|
import fontawesome from '@fortawesome/fontawesome';
|
|
|
|
import faSolid from '@fortawesome/fontawesome-free-solid';
|
|
|
|
import FontAwesomeIcon from '@fortawesome/vue-fontawesome';
|
|
|
|
fontawesome.library.add(faSolid);
|
|
|
|
|
2018-03-31 20:52:11 +00:00
|
|
|
// Base Vuejs Templates
|
|
|
|
import Login from './components/auth/Login';
|
2018-05-27 06:17:02 +00:00
|
|
|
import Dashboard from './components/dashboard/Dashboard';
|
|
|
|
import Account from './components/dashboard/Account';
|
2018-04-08 20:18:13 +00:00
|
|
|
import ResetPassword from './components/auth/ResetPassword';
|
2018-05-27 22:37:03 +00:00
|
|
|
import { Server, ServerConsole, ServerAllocations, ServerDatabases, ServerFiles, ServerSchedules, ServerSettings, ServerSubusers } from './components/server';
|
2018-03-31 20:52:11 +00:00
|
|
|
|
2018-05-26 21:50:38 +00:00
|
|
|
window.events = new Vue;
|
2018-03-31 20:52:11 +00:00
|
|
|
window.Ziggy = Ziggy;
|
|
|
|
|
2018-03-31 21:33:10 +00:00
|
|
|
Vue.use(Vuex);
|
2018-03-31 20:52:11 +00:00
|
|
|
|
2018-05-26 21:59:58 +00:00
|
|
|
const store = new Vuex.Store();
|
2018-05-26 19:33:27 +00:00
|
|
|
const route = require('./../../../vendor/tightenco/ziggy/src/js/route').default;
|
2018-03-31 20:52:11 +00:00
|
|
|
|
|
|
|
Vue.config.productionTip = false;
|
2018-04-08 21:00:52 +00:00
|
|
|
Vue.mixin({ methods: { route } });
|
2018-05-26 21:50:38 +00:00
|
|
|
Vue.mixin(flash);
|
2018-03-31 20:52:11 +00:00
|
|
|
|
|
|
|
Vue.use(VueRouter);
|
2018-03-31 21:33:10 +00:00
|
|
|
Vue.use(vuexI18n.plugin, store);
|
|
|
|
|
|
|
|
Vue.i18n.add('en', Locales.en);
|
|
|
|
Vue.i18n.set('en');
|
2018-03-31 20:52:11 +00:00
|
|
|
|
2018-05-27 22:37:03 +00:00
|
|
|
Vue.component('font-awesome-icon', FontAwesomeIcon);
|
|
|
|
|
2018-03-31 20:52:11 +00:00
|
|
|
const router = new VueRouter({
|
2018-04-08 20:46:32 +00:00
|
|
|
mode: 'history',
|
2018-03-31 20:52:11 +00:00
|
|
|
routes: [
|
2018-04-08 21:00:52 +00:00
|
|
|
{ name: 'login', path: '/auth/login', component: Login },
|
|
|
|
{ name: 'forgot-password', path: '/auth/password', component: Login },
|
|
|
|
{ name: 'checkpoint', path: '/checkpoint', component: Login },
|
2018-04-08 20:18:13 +00:00
|
|
|
{
|
|
|
|
name: 'reset-password',
|
2018-04-08 20:46:32 +00:00
|
|
|
path: '/auth/password/reset/:token',
|
2018-04-08 20:18:13 +00:00
|
|
|
component: ResetPassword,
|
|
|
|
props: function (route) {
|
2018-04-08 21:00:52 +00:00
|
|
|
return { token: route.params.token, email: route.query.email || '' };
|
|
|
|
}
|
|
|
|
},
|
2018-05-27 06:17:02 +00:00
|
|
|
{ name : 'index', path: '/', component: Dashboard },
|
|
|
|
{ name : 'account', path: '/account', component: Account },
|
|
|
|
{ name : 'account-api', path: '/account/api', component: Account },
|
|
|
|
{ name : 'account-security', path: '/account/security', component: Account },
|
2018-05-27 22:37:03 +00:00
|
|
|
{ path: '/server/:id', component: Server,
|
|
|
|
children: [
|
|
|
|
{ name: 'server', path: '', component: ServerConsole },
|
|
|
|
{ name: 'server-files', path: 'files', component: ServerFiles },
|
|
|
|
{ name: 'server-subusers', path: 'subusers', component: ServerSubusers },
|
|
|
|
{ name: 'server-schedules', path: 'schedules', component: ServerSchedules },
|
|
|
|
{ name: 'server-databases', path: 'databases', component: ServerDatabases },
|
|
|
|
{ name: 'server-allocations', path: 'allocations', component: ServerAllocations },
|
|
|
|
{ name: 'server-settings', path: 'settings', component: ServerSettings },
|
|
|
|
]
|
|
|
|
}
|
2018-03-31 20:52:11 +00:00
|
|
|
]
|
|
|
|
});
|
|
|
|
|
2018-03-31 21:33:10 +00:00
|
|
|
require('./bootstrap');
|
|
|
|
|
2018-04-08 21:00:52 +00:00
|
|
|
const app = new Vue({ store, router }).$mount('#pterodactyl');
|