Commit 215081fa authored by Dillenn Terumalai's avatar Dillenn Terumalai
Browse files

// WIP

parent 1f225bf1
import '@mdi/font/css/materialdesignicons.css'
import Vue from 'vue'
import { App, plugin } from '@inertiajs/inertia-vue'
import { InertiaProgress } from '@inertiajs/progress'
import vuetify from './Plugins/vuetify'
import route, { InputParams } from 'ziggy-js'
import Toast, { POSITION, TYPE } from 'vue-toastification'
import 'vue-toastification/dist/index.css'
import './bootstrap'
import { Inertia, VisitOptions } from '@inertiajs/inertia'
import Echo from 'laravel-echo'
import axios from 'axios'
import VueMeta from 'vue-meta'
import {App, plugin} from '@inertiajs/inertia-vue'
import route from 'ziggy-js'
import vuetify from './vuetify';
import ZiggyVue from 'ziggy-js';
import {Ziggy} from "@/ziggy";
Vue.use(ZiggyVue, Ziggy);
Vue.use(plugin)
Vue.mixin({ methods: { route } })
InertiaProgress.init()
Vue.mixin({methods: {route}})
const options = {
position: POSITION.BOTTOM_RIGHT
}
Vue.use(Toast, options)
Vue.use(VueMeta)
const el: HTMLElement = document.getElementById('app') || document.createElement('app')
Inertia.on('error', () => {
Vue.$toast('Oops... Something went wrong!', {
timeout: 2000,
type: TYPE.ERROR,
position: POSITION.BOTTOM_CENTER
})
})
Vue.prototype.$axios = axios.create({
timeout: 10000
})
Vue.prototype.$echo = new Echo({
broadcaster: 'pusher',
key: process.env.MIX_PUSHER_APP_KEY,
forceTLS: process.env.MIX_PUSHER_USE_TLS === 'true',
wsHost: window.location.hostname,
wsPort: process.env.MIX_PUSHER_PORT,
wssPort: process.env.MIX_PUSHER_PORT,
encrypted: process.env.MIX_PUSHER_ENCRYPTED === 'true',
disabledStats: false,
enabledTransports: ['ws', 'wss'],
disabledTransports: ['sockjs', 'xhr_polling', 'xhr_streaming']
})
Vue.mixin({
methods: {
$route: route,
formatDate (date) {
return new Date(date).toLocaleDateString('fr', {
year: 'numeric',
month: 'long',
day: 'numeric'
})
},
$visit (routeName: string, params?: InputParams, options?: (VisitOptions & { data?: object })): void {
this.$inertia.visit(route(routeName, params), options)
},
appName () {
return process.env.MIX_APP_NAME
},
formatNumber (number: string): string {
return String(number).replace(/(.)(?=(\d{3})+$)/g, "$1'")
},
formatSegmentPosition (chromosomeId: string, start: string, end: string): string {
// @ts-ignore
return 'chr' + chromosomeId + ':' + this.formatNumber(start) + ' - ' + this.formatNumber(end)
}
}
})
const el: HTMLElement = document.getElementById('laravel-cluster') || document.createElement('app')
new Vue({
vuetify,
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment