Einheitlicher Rahmen für alle Seiten (0.49.0)
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
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
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>
This commit is contained in:
parent
ee6a5e02a0
commit
179471cb53
149 changed files with 508 additions and 484 deletions
|
|
@ -6,6 +6,7 @@ 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;
|
||||
|
|
@ -28,11 +29,12 @@ createInertiaApp({
|
|||
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)
|
||||
// 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;
|
||||
if (remote) return remote.then((module) => framePluginPage(module, name));
|
||||
}
|
||||
|
||||
if (!page) {
|
||||
|
|
|
|||
25
resources/js/layouts/PluginLayout.vue
Normal file
25
resources/js/layouts/PluginLayout.vue
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
<script setup>
|
||||
import { inject } from 'vue';
|
||||
import { Head } from '@inertiajs/vue3';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
import { FRAME } from '@/lib/pluginFrame';
|
||||
|
||||
/**
|
||||
* „AppLayout“ für Plugins (@inhaus/ui). Den Rahmen – Kopfzeile, Menü, Fußzeile – legt das Portal
|
||||
* selbst um jede Plugin-Seite (siehe lib/pluginFrame.js); hier wird dann nur noch der Titel gesetzt.
|
||||
* Außerhalb dieses Rahmens (ältere Portale, Vorschau) zeichnet die Komponente ihn wie bisher.
|
||||
*/
|
||||
defineProps({
|
||||
title: { type: String, default: '' },
|
||||
});
|
||||
|
||||
const framed = inject(FRAME, false);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<template v-if="framed">
|
||||
<Head v-if="title" :title="title" />
|
||||
<slot />
|
||||
</template>
|
||||
<AppLayout v-else :title="title"><slot /></AppLayout>
|
||||
</template>
|
||||
23
resources/js/lib/pluginFrame.js
Normal file
23
resources/js/lib/pluginFrame.js
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { defineComponent, h, provide } from 'vue';
|
||||
import AppLayout from '@/layouts/AppLayout.vue';
|
||||
|
||||
export const FRAME = Symbol('inhaus:frame');
|
||||
|
||||
/**
|
||||
* Legt den Portalrahmen um eine Seite aus einem Kunden-Plugin. So kommt das Äußere immer vom
|
||||
* Portal selbst – ein Plugin kann ihn weder weglassen noch ersetzen, und Änderungen am Rahmen
|
||||
* gelten ohne Plugin-Update.
|
||||
*/
|
||||
export function framePluginPage(module, name) {
|
||||
const page = module.default ?? module;
|
||||
|
||||
return defineComponent({
|
||||
name: `PluginPage(${name})`,
|
||||
inheritAttrs: false,
|
||||
setup(_, { attrs }) {
|
||||
provide(FRAME, true);
|
||||
|
||||
return () => h(AppLayout, null, { default: () => h(page, attrs) });
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
@ -11,7 +11,8 @@
|
|||
*/
|
||||
|
||||
// Seitenrahmen und Bausteine des Portals
|
||||
export { default as AppLayout } from '@/layouts/AppLayout.vue';
|
||||
// AppLayout setzt in Plugins nur den Titel – den Rahmen legt das Portal selbst um jede Plugin-Seite
|
||||
export { default as AppLayout } from '@/layouts/PluginLayout.vue';
|
||||
export { default as PageHeader } from '@/components/PageHeader.vue';
|
||||
export { default as Panel } from '@/components/Panel.vue';
|
||||
export { default as EmptyState } from '@/components/EmptyState.vue';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue