1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-24 23:37:51 +01:00

56 lines
1.2 KiB
JavaScript
Raw Normal View History

import '../scss/app.scss';
import '@mdi/font/scss/materialdesignicons.scss';
import {InertiaProgress} from '@inertiajs/progress';
import {createInertiaApp} from '@maicol07/inertia-mithril';
2021-10-08 16:38:46 +02:00
import $ from 'cash-dom';
import m from 'mithril';
// noinspection SpellCheckingInspection
2021-12-14 12:34:17 +01:00
import redaxios from 'redaxios';
import {__} from './utils';
// Variabili globali
2021-10-08 16:38:46 +02:00
window.$ = $;
window.m = m;
window.__ = __;
InertiaProgress.init();
// noinspection JSIgnoredPromiseFromCall
createInertiaApp({
title: title => `${title} - OpenSTAManager`,
resolve: async (name) => {
const split = name.split('::');
if (split.length === 1) {
// Load bundled page
const {default: page} = await import(`./Views/${name}.jsx`);
return page;
}
// Load page from module
const [modulePath, page] = split;
// noinspection JSUnresolvedVariable
const osmModule = await import(
/* @vite-ignore */
`${window.import_path}/vendor/${modulePath}/index.js`
);
return osmModule[page];
},
setup({
el,
app
}) {
m.mount(el, app);
import('./_material');
}
});
2021-12-14 12:34:17 +01:00
$('#logout-button').on('click', async () => {
await redaxios.post(window.route('auth.logout'));
window.location.href = window.route('auth.login');
});