Loheide-eu-mitarbeiterplatt.../resources/js/app.js
Friederich Loheide f11a3e24b3
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 3m54s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 4m0s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 4m54s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 4m50s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 7m48s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 7m38s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 6m56s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 7m5s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m17s
Phase 8 Mobil: REST-API, Web-Push, installierbare App (0.25.0)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-27 08:20:07 +00:00

55 lines
1.9 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import '../css/app.css';
import 'vue-sonner/style.css';
import * as Vue from 'vue';
import * as Inertia from '@inertiajs/vue3';
import * as InhausUi from './sdk/ui';
import { registerServiceWorker } from './lib/push';
import { loadPluginPage } from './lib/pluginComponents';
const { createApp, h } = Vue;
const { createInertiaApp } = Inertia;
// Plugin-SDK: Module für die Import Map (public/sdk/*.js) – Plugins nutzen dieselben Instanzen.
window.__inhaus = { modules: { vue: Vue, '@inertiajs/vue3': Inertia, '@inhaus/ui': InhausUi } };
createInertiaApp({
title: (title, page) => {
const portalName = page.props.branding.portal_name;
return title ? `${title} – ${portalName}` : portalName;
},
resolve: (name) => {
// „news::Index“ → Seite aus einem mitgelieferten Plugin (plugins-core/news/resources/js/pages/Index.vue)
const pages = {
...import.meta.glob('./pages/**/*.vue'),
...import.meta.glob('../../plugins-core/*/resources/js/pages/**/*.vue'),
};
const [plugin, pageName] = name.includes('::') ? name.split('::') : [null, name];
const page = plugin ? pages[`../../plugins-core/${plugin}/resources/js/pages/${pageName}.vue`] : pages[`./pages/${name}.vue`];
// Separat installierte Plugins liefern ihre Seiten vorkompiliert mit (Plugin-SDK)
if (!page && plugin) {
const remote = loadPluginPage(name);
if (remote) return remote;
}
if (!page) {
throw new Error(`Seite nicht gefunden: ${name}`);
}
return page();
},
setup({ el, App, props, plugin }) {
createApp({ render: () => h(App, props) })
.use(plugin)
.mount(el);
// Service Worker: Push-Benachrichtigungen und Offline-Seite (nur angemeldet)
if (props.initialPage.props.auth?.user) registerServiceWorker();
},
progress: {
color: 'var(--brand)',
},
});