Loheide-eu-mitarbeiterplatt.../resources/js/app.js
Friederich Loheide 179471cb53
Some checks failed
CI / PHP 8.3 / mariadb:10.6 (pull_request) Successful in 8m15s
CI / PHP 8.4 / mariadb:10.6 (pull_request) Successful in 8m16s
CI / PHP 8.3 / mariadb:11.4 (pull_request) Successful in 8m10s
CI / PHP 8.4 / mariadb:11.4 (pull_request) Successful in 8m15s
CI / PHP 8.3 / mysql:8.0 (pull_request) Failing after 10m23s
CI / PHP 8.4 / mysql:8.0 (pull_request) Failing after 10m41s
CI / PHP 8.3 / mysql:8.4 (pull_request) Failing after 8m59s
CI / PHP 8.4 / mysql:8.4 (pull_request) Failing after 9m1s
CI / Bekannte Sicherheitslücken in Paketen (pull_request) Successful in 49s
CI / Build-Artefakte aktuell (pull_request) Successful in 1m11s
Einheitlicher Rahmen für alle Seiten (0.49.0)
Das Portal legt den Rahmen selbst um jede Plugin-Seite; AppLayout aus
@inhaus/ui setzt dort nur noch den Titel. Detailseiten nutzen PageHeader.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-29 04:28:23 +00:00

57 lines
2.1 KiB
JavaScript
Raw Permalink 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';
import { framePluginPage } from './lib/pluginFrame';
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);
// den Rahmen legt das Portal selbst darum
if (!page && plugin) {
const remote = loadPluginPage(name);
if (remote) return remote.then((module) => framePluginPage(module, name));
}
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)',
},
});