2021-09-07 13:28:20 +02:00
|
|
|
import '../scss/app.scss';
|
2021-08-19 17:47:20 +02:00
|
|
|
import './_material';
|
2021-07-30 22:56:43 +02:00
|
|
|
|
2021-09-10 16:53:40 +02:00
|
|
|
import {InertiaProgress} from '@inertiajs/progress';
|
2021-09-07 13:28:20 +02:00
|
|
|
import {createInertiaApp} from '@maicol07/inertia-mithril';
|
|
|
|
import {waitUntil} from 'async-wait-until';
|
|
|
|
import jQuery from 'jquery';
|
|
|
|
import m from 'mithril';
|
|
|
|
|
|
|
|
// Fix Mithril JSX durante la compilazione
|
|
|
|
m.Fragment = '[';
|
|
|
|
|
|
|
|
// Variabili globali
|
|
|
|
window.$ = jQuery;
|
|
|
|
window.jQuery = jQuery;
|
|
|
|
window.m = m;
|
|
|
|
|
2021-09-10 16:53:40 +02:00
|
|
|
InertiaProgress.init();
|
|
|
|
|
2021-08-02 13:13:02 +02:00
|
|
|
// noinspection JSIgnoredPromiseFromCall
|
|
|
|
createInertiaApp({
|
2021-09-07 13:28:20 +02:00
|
|
|
title: title => `${title} - OpenSTAManager`,
|
|
|
|
resolve: async (name) => {
|
|
|
|
const split = name.split('::');
|
|
|
|
|
|
|
|
if (split.length === 1) {
|
|
|
|
return (await import(`./Views/${name}.jsx`)).default;
|
|
|
|
}
|
|
|
|
|
|
|
|
const [, page] = split;
|
|
|
|
// noinspection JSUnresolvedVariable
|
|
|
|
await waitUntil(() => typeof window.extmodule !== 'undefined');
|
|
|
|
// noinspection JSUnresolvedVariable
|
|
|
|
return window.extmodule[page];
|
|
|
|
},
|
2021-08-02 13:13:02 +02:00
|
|
|
setup({ el, app }) {
|
|
|
|
m.mount(el, app);
|
2021-09-07 13:28:20 +02:00
|
|
|
}
|
2021-08-02 13:13:02 +02:00
|
|
|
});
|