Files
onboard/resources/js/app.js
brusnitsyn 2026a1ca9f * добавил удаление карты, если она была добавлена не из МИС
* добавил диалог при удалении карты
* добавил сохранение движения
* добавил вывод сохраненного отчета
* изменил логику сохранения отчета
2026-05-06 17:03:41 +09:00

93 lines
2.7 KiB
JavaScript

import { createApp, h } from 'vue'
import { createInertiaApp, router } from '@inertiajs/vue3'
import {createPinia} from "pinia";
import {setupNaiveDiscreteApi} from "./Plugins/NaiveUI.js";
import * as Sentry from "@sentry/vue";
import {startGlobalLoading, stopGlobalLoading} from "./Composables/useGlobalLoading.js";
import './bootstrap';
import '../css/app.css';
import {NConfigProvider, NDialogProvider, NMessageProvider, ruRU, dateRuRU, darkTheme} from "naive-ui";
router.on('start', () => {
startGlobalLoading()
})
router.on('finish', () => {
stopGlobalLoading()
})
router.on('invalid', () => {
stopGlobalLoading()
})
router.on('exception', () => {
stopGlobalLoading()
})
const themeOverrides = {
Modal: {
peers: {
Dialog: {
borderRadius: '8px'
},
Card: {
borderRadius: '8px'
},
}
},
Dialog: {
borderRadius: '8px'
},
}
createInertiaApp({
id: 'onboard',
resolve: name => {
const pages = import.meta.glob('./Pages/**/*.vue', {eager: true})
return pages[`./Pages/${name}.vue`]
},
setup({el, App, props, plugin}) {
const vueApp = createApp({
render: () => h(NConfigProvider, {
theme: darkTheme,
themeOverrides: themeOverrides,
locale: ruRU,
dateLocale: dateRuRU
}, {
default: () => h(NDialogProvider, {}, {
default: () => h(NMessageProvider, {}, {
default: () => h(App, props)
})
})
})
})
const pinia = createPinia()
vueApp.use(plugin)
vueApp.use(pinia)
setupNaiveDiscreteApi(vueApp)
// Sentry.init({
// vueApp,
// dsn: import.meta.env.VITE_SENTRY_DNS,
// // Setting this option to true will send default PII data to Sentry.
// // For example, automatic IP address collection on events
// sendDefaultPii: true,
// integrations: [
// Sentry.replayIntegration()
// ],
// // Session Replay
// replaysSessionSampleRate: 0, // This sets the sample rate at 10%. You may want to change it to 100% while in development and then sample at a lower rate in production.
// replaysOnErrorSampleRate: 0.5, // If you're not already sampling the entire session, change the sample rate to 100% when sampling sessions where errors occur.,
// // Logs
// enableLogs: true
// });
vueApp.mount(el)
},
}).then(r => {
console.log('Инициализация прошла успешно')
})