2021-09-07 13:28:20 +02:00
|
|
|
import '../scss/app.scss';
|
2021-10-09 17:15:15 +02:00
|
|
|
import '@mdi/font/scss/materialdesignicons.scss';
|
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';
|
2021-10-15 12:46:52 +02:00
|
|
|
import {
|
|
|
|
WAIT_FOREVER,
|
|
|
|
waitUntil
|
|
|
|
} from 'async-wait-until';
|
2021-10-08 16:38:46 +02:00
|
|
|
import $ from 'cash-dom';
|
2021-09-07 13:28:20 +02:00
|
|
|
import m from 'mithril';
|
|
|
|
|
2021-11-09 10:14:08 +01:00
|
|
|
import {__} from './utils';
|
|
|
|
|
2021-09-07 13:28:20 +02:00
|
|
|
// Variabili globali
|
2021-10-08 16:38:46 +02:00
|
|
|
window.$ = $;
|
2021-09-07 13:28:20 +02:00
|
|
|
window.m = m;
|
2021-11-09 10:14:08 +01:00
|
|
|
window.__ = __;
|
2021-09-07 13:28:20 +02:00
|
|
|
|
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
|
2021-10-15 12:46:52 +02:00
|
|
|
await waitUntil(() => typeof window.extmodule !== 'undefined', {
|
|
|
|
timeout: WAIT_FOREVER
|
|
|
|
});
|
2021-09-07 13:28:20 +02:00
|
|
|
// noinspection JSUnresolvedVariable
|
|
|
|
return window.extmodule[page];
|
|
|
|
},
|
2021-10-08 12:20:07 +02:00
|
|
|
setup({
|
|
|
|
el,
|
|
|
|
app
|
|
|
|
}) {
|
2021-08-02 13:13:02 +02:00
|
|
|
m.mount(el, app);
|
2021-12-13 21:07:23 +01:00
|
|
|
import('./_material');
|
2021-09-07 13:28:20 +02:00
|
|
|
}
|
2021-08-02 13:13:02 +02:00
|
|
|
});
|