@tower_74/cms-app 0.3.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tower_74/cms-app",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Front-end app shell for the Base CMS — Inertia/Vue pages, layouts, components and composables. Ships source; consumed by client sites as a versioned dependency (ADR-0023) and overridable per site.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -29,6 +29,7 @@ import {
|
|
|
29
29
|
ListOrdered,
|
|
30
30
|
Menu,
|
|
31
31
|
Paintbrush,
|
|
32
|
+
Puzzle,
|
|
32
33
|
Settings,
|
|
33
34
|
ShoppingBag,
|
|
34
35
|
Tag,
|
|
@@ -60,6 +61,7 @@ const nav: NavItem[] = [
|
|
|
60
61
|
{ label: 'Theme', href: '/admin/appearance/theme', icon: Paintbrush, permission: 'theme' },
|
|
61
62
|
{ label: 'Widgets', href: '/admin/appearance/widgets', icon: LayoutGrid, permission: 'widgets' },
|
|
62
63
|
{ label: 'Settings', href: '/admin/settings', icon: Settings, permission: 'settings' },
|
|
64
|
+
{ label: 'Plugins', href: '/admin/plugins', icon: Puzzle, permission: 'plugins' },
|
|
63
65
|
];
|
|
64
66
|
|
|
65
67
|
const page = usePage();
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import AdminLayout from '@/layouts/AdminLayout.vue';
|
|
3
|
+
import { router } from '@inertiajs/vue3';
|
|
4
|
+
|
|
5
|
+
defineProps<{
|
|
6
|
+
plugins: Array<{ key: string; name: string; version: string; enabled: boolean }>;
|
|
7
|
+
}>();
|
|
8
|
+
|
|
9
|
+
// Enabling/disabling persists via the PluginRegistry; the redirect back reflects the new
|
|
10
|
+
// state (a plugin's capabilities are gated on enable at boot — ADR-0026).
|
|
11
|
+
const toggle = (plugin: { key: string; enabled: boolean }) => {
|
|
12
|
+
router.post(`/admin/plugins/${plugin.key}/${plugin.enabled ? 'disable' : 'enable'}`, {}, { preserveScroll: true });
|
|
13
|
+
};
|
|
14
|
+
</script>
|
|
15
|
+
|
|
16
|
+
<template>
|
|
17
|
+
<AdminLayout>
|
|
18
|
+
<div class="p-6">
|
|
19
|
+
<h1 class="text-2xl font-semibold">Plugins</h1>
|
|
20
|
+
<p class="mt-1 text-sm text-muted">
|
|
21
|
+
Enable or disable installed plugins. New plugins become available by installing their package; manage them here.
|
|
22
|
+
</p>
|
|
23
|
+
|
|
24
|
+
<div v-if="plugins.length" class="mt-6 divide-y divide-border overflow-hidden rounded-lg border border-border">
|
|
25
|
+
<div v-for="plugin in plugins" :key="plugin.key" class="flex items-center justify-between gap-4 p-4">
|
|
26
|
+
<div>
|
|
27
|
+
<div class="font-medium">{{ plugin.name }}</div>
|
|
28
|
+
<div class="text-xs text-muted">{{ plugin.key }} · v{{ plugin.version }}</div>
|
|
29
|
+
</div>
|
|
30
|
+
<button
|
|
31
|
+
type="button"
|
|
32
|
+
class="rounded-md px-3 py-1.5 text-sm font-medium transition"
|
|
33
|
+
:class="
|
|
34
|
+
plugin.enabled
|
|
35
|
+
? 'bg-accent text-accent-foreground hover:bg-accent/80'
|
|
36
|
+
: 'bg-primary text-primary-foreground hover:opacity-90'
|
|
37
|
+
"
|
|
38
|
+
@click="toggle(plugin)"
|
|
39
|
+
>
|
|
40
|
+
{{ plugin.enabled ? 'Disable' : 'Enable' }}
|
|
41
|
+
</button>
|
|
42
|
+
</div>
|
|
43
|
+
</div>
|
|
44
|
+
|
|
45
|
+
<p v-else class="mt-6 text-sm text-muted">No plugins installed. Install a plugin package to manage it here.</p>
|
|
46
|
+
</div>
|
|
47
|
+
</AdminLayout>
|
|
48
|
+
</template>
|