feat(cabana): read-only Plugins screen with installed plugins
- GET /plugins (backend.view_plugins, superusers always pass) lists the plugins from party.Installed, or party.Activated IDs for older builds, with the built framework version and whether the registry is configured - Settings -> System -> Plugins entry with the new SettingsEntry.path, added only for principals allowed to open it - PluginsView at /system/plugins with an Installed tab (reka-ui Tabs); settings panel, rail, breadcrumbs and page title know the route - OpenAPI and SPA types regenerated; contract, token-class and conformance inventories list the route; en/pl strings; docs
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
// Settings pages the admin may manage (D-21), server-filtered like the
|
||||
// navigation. The rail shows "Ustawienia" only when this list is non-empty.
|
||||
// An entry is either a singleton settings form (/settings/<code>) or a link
|
||||
// that opens an admin controller (its `controller` is set).
|
||||
// An entry is either a singleton settings form (/settings/<code>), a link
|
||||
// that opens an admin controller (its `controller` is set) or one of the
|
||||
// admin's own screens (its `path` is set, for example /system/plugins).
|
||||
import { computed, readonly, ref } from 'vue'
|
||||
import { api } from '../api/client'
|
||||
import { controllerPath } from '../app/controllerRoutes'
|
||||
@@ -28,10 +29,14 @@ export function settingsEntry(code: string): SettingsEntry | null {
|
||||
}
|
||||
|
||||
/**
|
||||
* Route a settings entry opens: its controller for a link entry (the index
|
||||
* when the ID is malformed), otherwise its singleton form.
|
||||
* Route a settings entry opens: its own SPA path for an admin screen, its
|
||||
* controller for a link entry (the index when the ID is malformed),
|
||||
* otherwise its singleton form.
|
||||
*/
|
||||
export function settingsPath(entry: SettingsEntry): string {
|
||||
if (entry.path) {
|
||||
return entry.path
|
||||
}
|
||||
if (entry.controller) {
|
||||
return controllerPath(entry.controller) ?? '/settings'
|
||||
}
|
||||
@@ -46,6 +51,11 @@ export function settingsLinkFor(controllerId: string | null): SettingsEntry | nu
|
||||
return entries.value.find((entry) => entry.controller !== '' && entry.controller === controllerId) ?? null
|
||||
}
|
||||
|
||||
/** The entry that opens the admin screen at path (entry.path), if any. */
|
||||
export function settingsEntryForPath(path: string): SettingsEntry | null {
|
||||
return entries.value.find((entry) => !!entry.path && entry.path === path) ?? null
|
||||
}
|
||||
|
||||
/** Entries grouped by category, categories in first-seen order, by order. */
|
||||
export const settingsGroups = computed(() => {
|
||||
const sorted = entries.value
|
||||
@@ -97,6 +107,7 @@ export function useSettings() {
|
||||
settingsEntry,
|
||||
settingsPath,
|
||||
settingsLinkFor,
|
||||
settingsEntryForPath,
|
||||
settingsSectionOf,
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user