2019-05-28 17:29:15 +02:00
|
|
|
import Vue from 'vue'
|
|
|
|
import VueRouter from 'vue-router'
|
2020-01-12 15:12:32 +01:00
|
|
|
import VueInternationalization from 'vue-i18n';
|
|
|
|
import Locale from './vue-i18n-locales.generated';
|
2019-05-20 07:37:41 +02:00
|
|
|
|
2019-05-28 17:29:15 +02:00
|
|
|
Vue.use(VueRouter)
|
2020-01-12 15:12:32 +01:00
|
|
|
Vue.use(VueInternationalization);
|
2019-05-20 07:37:41 +02:00
|
|
|
|
2020-01-14 17:06:59 +01:00
|
|
|
import App from './views/App'
|
|
|
|
import Login from './views/Login'
|
|
|
|
import Register from './views/Register'
|
|
|
|
import Accounts from './views/Accounts'
|
|
|
|
import Create from './views/Create'
|
|
|
|
import Edit from './views/Edit'
|
|
|
|
import PasswordRequest from './views/auth/password/Request'
|
2020-01-14 23:50:07 +01:00
|
|
|
import PasswordReset from './views/auth/password/Reset'
|
2020-01-14 17:06:59 +01:00
|
|
|
import NotFound from './views/Error'
|
|
|
|
|
2019-06-24 00:29:14 +02:00
|
|
|
|
|
|
|
import { library } from '@fortawesome/fontawesome-svg-core'
|
2020-01-11 16:46:59 +01:00
|
|
|
import { faPlus, faQrcode, faImage, faTrash, faEdit, faCheck, faLock, faLockOpen, faSearch } from '@fortawesome/free-solid-svg-icons'
|
2019-06-24 00:29:14 +02:00
|
|
|
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome'
|
|
|
|
|
2020-01-11 16:46:59 +01:00
|
|
|
library.add(faPlus, faQrcode, faImage, faTrash, faEdit, faCheck, faLock, faLockOpen, faSearch);
|
2019-06-24 00:29:14 +02:00
|
|
|
|
|
|
|
Vue.component('font-awesome-icon', FontAwesomeIcon)
|
2019-05-20 07:37:41 +02:00
|
|
|
|
2020-01-12 15:12:32 +01:00
|
|
|
// const lang = document.documentElement.lang.substr(0, 2);
|
|
|
|
const lang = 'en';
|
|
|
|
|
|
|
|
const i18n = new VueInternationalization({
|
|
|
|
locale: lang,
|
|
|
|
messages: Locale
|
|
|
|
});
|
|
|
|
|
2019-05-28 17:29:15 +02:00
|
|
|
const router = new VueRouter({
|
|
|
|
mode: 'history',
|
|
|
|
routes: [
|
2020-01-14 17:06:59 +01:00
|
|
|
{ path: '/', name: 'accounts', component: Accounts, props: true },
|
|
|
|
{ path: '/login', name: 'login',component: Login },
|
|
|
|
{ path: '/register', name: 'register',component: Register },
|
|
|
|
{ path: '/create', name: 'create',component: Create },
|
|
|
|
{ path: '/edit/:twofaccountId', name: 'edit',component: Edit },
|
|
|
|
|
|
|
|
{ path: '/password/request', name: 'password.request', component: PasswordRequest },
|
2020-01-14 23:50:07 +01:00
|
|
|
{ path: '/password/reset/:token', name: 'password.reset', component: PasswordReset },
|
2020-01-14 17:06:59 +01:00
|
|
|
|
|
|
|
{ path: '/flooded', name: 'flooded',component: NotFound,props: true },
|
|
|
|
{ path: '/error', name: 'genericError',component: NotFound,props: true },
|
|
|
|
{ path: '/404', name: '404',component: NotFound,props: true },
|
|
|
|
{ path: '*', redirect: { name: '404' } }
|
2019-05-28 17:29:15 +02:00
|
|
|
],
|
|
|
|
});
|
2019-05-20 07:37:41 +02:00
|
|
|
|
|
|
|
const app = new Vue({
|
|
|
|
el: '#app',
|
2019-05-28 17:29:15 +02:00
|
|
|
components: { App },
|
2020-01-12 15:12:32 +01:00
|
|
|
i18n,
|
2019-05-28 17:29:15 +02:00
|
|
|
router,
|
|
|
|
});
|