routing is this plugin's, not the manifest's
The platform hands over the whole subtree under the mount. Which paths exist and what they mean is web/routes.ts. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
+4
-37
@@ -27,14 +27,14 @@ import type { PluginManifest } from '@@/plugins/manifest';
|
|||||||
* is `ownerOnly` — the split that field exists for, and the same shape proxy-manager and Jellyfin use
|
* is `ownerOnly` — the split that field exists for, and the same shape proxy-manager and Jellyfin use
|
||||||
* for the same reason.
|
* for the same reason.
|
||||||
*
|
*
|
||||||
* ── No `screens`, but a route table ──
|
* ── No `screens` ──
|
||||||
*
|
*
|
||||||
* One screen at the mount prefix, labelled `label`: the sections are panels of one workspace, and
|
* One screen at the mount prefix, labelled `label`: the sections are panels of one workspace, and
|
||||||
* `screens` is for a plugin contributing genuinely separate destinations with their own dock tiles.
|
* `screens` is for a plugin contributing genuinely separate destinations with their own dock tiles.
|
||||||
*
|
*
|
||||||
* They ARE routes, though. `routes` below names each one, which is what moved the sections out of the
|
* They are URLs under it, though — `/fofos-admin/layout/header`, `/fofos-admin/pages/home`. The
|
||||||
* query string and into the path — and what lets a route arrange the screen's panels its own way when
|
* platform hands this plugin the whole subtree and nothing more; which paths exist and what they mean
|
||||||
* one of them needs to.
|
* is web/routes.ts, here, where it belongs.
|
||||||
*/
|
*/
|
||||||
export const manifest: PluginManifest = {
|
export const manifest: PluginManifest = {
|
||||||
publisher: 'officerdev',
|
publisher: 'officerdev',
|
||||||
@@ -70,39 +70,6 @@ export const manifest: PluginManifest = {
|
|||||||
'@tiptap/extension-link': '^3.15.3',
|
'@tiptap/extension-link': '^3.15.3',
|
||||||
},
|
},
|
||||||
|
|
||||||
/*
|
|
||||||
The URLs this admin has.
|
|
||||||
|
|
||||||
── Why they are declared rather than guessed ──
|
|
||||||
|
|
||||||
Every plugin screen gets `/<route>` and `/<route>/:section` for free, which is enough for one
|
|
||||||
segment. These need two — `/fofos-admin/layout/header`, `/fofos-admin/pages/home` — and naming them
|
|
||||||
is what makes each one a place the platform knows about rather than a shape it inferred.
|
|
||||||
|
|
||||||
── They all share one layout, for now ──
|
|
||||||
|
|
||||||
No `layout` on any entry, so each renders `web/layout.ts`. That is the point of declaring them
|
|
||||||
anyway: the day the page builder wants a third column and Layout does not, it is one field here
|
|
||||||
rather than a new mechanism.
|
|
||||||
|
|
||||||
── The pairs ──
|
|
||||||
|
|
||||||
`layout` and `layout/:band` are two entries rather than `layout/:band?`, so either can take its own
|
|
||||||
arrangement later. React-router ranks a static segment above a dynamic one, so `/pages/home` cannot
|
|
||||||
be swallowed by something broader.
|
|
||||||
*/
|
|
||||||
routes: [
|
|
||||||
// The bare screen. Redirected to Layout by the detail panel — see DEFAULT_SECTION.
|
|
||||||
{ path: '' },
|
|
||||||
{ path: 'layout' },
|
|
||||||
{ path: 'layout/:band' },
|
|
||||||
{ path: 'pages' },
|
|
||||||
{ path: 'pages/:slug' },
|
|
||||||
{ path: 'galleries' },
|
|
||||||
{ path: 'media' },
|
|
||||||
{ path: 'administration' },
|
|
||||||
],
|
|
||||||
|
|
||||||
permissions: [
|
permissions: [
|
||||||
{
|
{
|
||||||
key: 'fofos-admin',
|
key: 'fofos-admin',
|
||||||
|
|||||||
Reference in New Issue
Block a user