@motor-cms/ui-admin 1.0.1-alpha.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.
Files changed (103) hide show
  1. package/README.md +77 -0
  2. package/app/components/form/inputs/CategoryTreeInput.vue +154 -0
  3. package/app/components/form/inputs/CategoryTreePicker.vue +355 -0
  4. package/app/components/form/inputs/NestedDraggable.vue +217 -0
  5. package/app/components/form/inputs/QuicklinksInput.vue +186 -0
  6. package/app/lang/de/motor-admin/CLAUDE.md +21 -0
  7. package/app/lang/de/motor-admin/ai_system_prompts.json +12 -0
  8. package/app/lang/de/motor-admin/categories.json +12 -0
  9. package/app/lang/de/motor-admin/category_trees.json +14 -0
  10. package/app/lang/de/motor-admin/clients.json +26 -0
  11. package/app/lang/de/motor-admin/config_variables.json +14 -0
  12. package/app/lang/de/motor-admin/domains.json +19 -0
  13. package/app/lang/de/motor-admin/email_templates.json +38 -0
  14. package/app/lang/de/motor-admin/global.json +5 -0
  15. package/app/lang/de/motor-admin/languages.json +16 -0
  16. package/app/lang/de/motor-admin/permissions.json +14 -0
  17. package/app/lang/de/motor-admin/roles.json +15 -0
  18. package/app/lang/de/motor-admin/users.json +22 -0
  19. package/app/lang/en/motor-admin/CLAUDE.md +7 -0
  20. package/app/lang/en/motor-admin/ai_system_prompts.json +12 -0
  21. package/app/lang/en/motor-admin/categories.json +12 -0
  22. package/app/lang/en/motor-admin/category_trees.json +14 -0
  23. package/app/lang/en/motor-admin/clients.json +26 -0
  24. package/app/lang/en/motor-admin/config_variables.json +14 -0
  25. package/app/lang/en/motor-admin/domains.json +18 -0
  26. package/app/lang/en/motor-admin/email_templates.json +33 -0
  27. package/app/lang/en/motor-admin/global.json +5 -0
  28. package/app/lang/en/motor-admin/languages.json +16 -0
  29. package/app/lang/en/motor-admin/permissions.json +14 -0
  30. package/app/lang/en/motor-admin/roles.json +15 -0
  31. package/app/lang/en/motor-admin/users.json +22 -0
  32. package/app/pages/dashboard.vue +5 -0
  33. package/app/pages/index.vue +39 -0
  34. package/app/pages/login.vue +85 -0
  35. package/app/pages/motor-admin/ai-system-prompts/CLAUDE.md +7 -0
  36. package/app/pages/motor-admin/ai-system-prompts/[id]/edit.vue +48 -0
  37. package/app/pages/motor-admin/ai-system-prompts/create.vue +40 -0
  38. package/app/pages/motor-admin/ai-system-prompts/index.vue +68 -0
  39. package/app/pages/motor-admin/category-trees/CLAUDE.md +7 -0
  40. package/app/pages/motor-admin/category-trees/[id]/CLAUDE.md +7 -0
  41. package/app/pages/motor-admin/category-trees/[id]/categories/[categoryId]/edit.vue +73 -0
  42. package/app/pages/motor-admin/category-trees/[id]/categories/create.vue +64 -0
  43. package/app/pages/motor-admin/category-trees/[id]/edit.vue +45 -0
  44. package/app/pages/motor-admin/category-trees/[id]/index.vue +81 -0
  45. package/app/pages/motor-admin/category-trees/create.vue +37 -0
  46. package/app/pages/motor-admin/category-trees/index.vue +54 -0
  47. package/app/pages/motor-admin/clients/CLAUDE.md +11 -0
  48. package/app/pages/motor-admin/clients/[id]/CLAUDE.md +11 -0
  49. package/app/pages/motor-admin/clients/[id]/edit.vue +45 -0
  50. package/app/pages/motor-admin/clients/create.vue +37 -0
  51. package/app/pages/motor-admin/clients/index.vue +46 -0
  52. package/app/pages/motor-admin/config-variables/CLAUDE.md +11 -0
  53. package/app/pages/motor-admin/config-variables/[id]/edit.vue +44 -0
  54. package/app/pages/motor-admin/config-variables/create.vue +36 -0
  55. package/app/pages/motor-admin/config-variables/index.vue +66 -0
  56. package/app/pages/motor-admin/domains/CLAUDE.md +11 -0
  57. package/app/pages/motor-admin/domains/[id]/edit.vue +54 -0
  58. package/app/pages/motor-admin/domains/create.vue +46 -0
  59. package/app/pages/motor-admin/domains/index.vue +98 -0
  60. package/app/pages/motor-admin/email-templates/CLAUDE.md +12 -0
  61. package/app/pages/motor-admin/email-templates/[id]/CLAUDE.md +7 -0
  62. package/app/pages/motor-admin/email-templates/[id]/edit.vue +56 -0
  63. package/app/pages/motor-admin/email-templates/create.vue +48 -0
  64. package/app/pages/motor-admin/email-templates/index.vue +67 -0
  65. package/app/pages/motor-admin/index.vue +12 -0
  66. package/app/pages/motor-admin/languages/CLAUDE.md +7 -0
  67. package/app/pages/motor-admin/languages/[id]/edit.vue +44 -0
  68. package/app/pages/motor-admin/languages/create.vue +36 -0
  69. package/app/pages/motor-admin/languages/index.vue +44 -0
  70. package/app/pages/motor-admin/permission-groups/CLAUDE.md +14 -0
  71. package/app/pages/motor-admin/permission-groups/[id]/CLAUDE.md +11 -0
  72. package/app/pages/motor-admin/permission-groups/[id]/edit.vue +49 -0
  73. package/app/pages/motor-admin/permission-groups/create.vue +41 -0
  74. package/app/pages/motor-admin/permission-groups/index.vue +43 -0
  75. package/app/pages/motor-admin/roles/CLAUDE.md +7 -0
  76. package/app/pages/motor-admin/roles/[id]/edit.vue +47 -0
  77. package/app/pages/motor-admin/roles/create.vue +40 -0
  78. package/app/pages/motor-admin/roles/index.vue +45 -0
  79. package/app/pages/motor-admin/theme-preview/CLAUDE.md +7 -0
  80. package/app/pages/motor-admin/theme-preview/index.vue +4801 -0
  81. package/app/pages/motor-admin/theme-preview/themes/CLAUDE.md +11 -0
  82. package/app/pages/motor-admin/theme-preview/themes/asymmetric-brutalist.md +381 -0
  83. package/app/pages/motor-admin/theme-preview/themes/bold-modern.md +231 -0
  84. package/app/pages/motor-admin/theme-preview/themes/geometric-minimal.md +778 -0
  85. package/app/pages/motor-admin/theme-preview/themes/gradient-flow.md +1057 -0
  86. package/app/pages/motor-admin/theme-preview/themes/liquid-glass.md +823 -0
  87. package/app/pages/motor-admin/theme-preview/themes/neon-amber.md +1223 -0
  88. package/app/pages/motor-admin/theme-preview/themes/neon-terminal.md +779 -0
  89. package/app/pages/motor-admin/theme-preview/themes/neon-violet.md +1134 -0
  90. package/app/pages/motor-admin/theme-preview/themes/professional-clean.md +232 -0
  91. package/app/pages/motor-admin/theme-preview/themes/refined-brutalist.md +462 -0
  92. package/app/pages/motor-admin/theme-preview/themes/wild-card.md +263 -0
  93. package/app/pages/motor-admin/users/CLAUDE.md +17 -0
  94. package/app/pages/motor-admin/users/[id]/CLAUDE.md +11 -0
  95. package/app/pages/motor-admin/users/[id]/edit.vue +83 -0
  96. package/app/pages/motor-admin/users/create.vue +40 -0
  97. package/app/pages/motor-admin/users/index.vue +66 -0
  98. package/app/pages/profile.vue +363 -0
  99. package/app/pages/search.vue +91 -0
  100. package/app/types/generated/form-meta.ts +258 -0
  101. package/app/types/generated/grid-meta.ts +172 -0
  102. package/nuxt.config.ts +1 -0
  103. package/package.json +26 -0
@@ -0,0 +1,12 @@
1
+ {
2
+ "categories": "Categories",
3
+ "category": "Category",
4
+ "title": "Categories",
5
+ "add": "Add Category",
6
+ "create_title": "Create Category",
7
+ "edit_title": "Edit Category",
8
+ "created_success": "Category was created successfully",
9
+ "updated_success": "Category was updated successfully",
10
+ "parent": "Parent Category",
11
+ "root": "Root (top level)"
12
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "category_trees": "Category Trees",
3
+ "category_tree": "Category Tree",
4
+ "title": "Category Trees",
5
+ "subtitle": "Manage category trees and their categories",
6
+ "add": "Add Category Tree",
7
+ "create_title": "Create Category Tree",
8
+ "edit_title": "Edit Category Tree",
9
+ "created_success": "Category tree was created successfully",
10
+ "updated_success": "Category tree was updated successfully",
11
+ "children": "Children",
12
+ "children_title": "Categories in \"{name}\"",
13
+ "children_subtitle": "Manage categories within this tree"
14
+ }
@@ -0,0 +1,26 @@
1
+ {
2
+ "clients": "Clients",
3
+ "client": "Client",
4
+ "title": "Clients",
5
+ "subtitle": "Manage system clients",
6
+ "add": "Add Client",
7
+ "create_title": "Create Client",
8
+ "edit_title": "Edit Client",
9
+ "created_success": "Client successfully created.",
10
+ "updated_success": "Client successfully updated.",
11
+ "slug": "Slug",
12
+ "slug_description": "URL-friendly identifier, auto-generated from name",
13
+ "address": "Address",
14
+ "zip": "ZIP",
15
+ "city": "City",
16
+ "country": "Country",
17
+ "country_iso_3166_1": "Country Code",
18
+ "website": "Website",
19
+ "description": "Description",
20
+ "contact_name": "Contact Name",
21
+ "contact_email": "Contact Email",
22
+ "contact_phone": "Phone",
23
+ "group_address": "Address",
24
+ "group_contact": "Contact",
25
+ "group_other": "Other"
26
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "config_variables": "Config Variables",
3
+ "title": "Config Variables",
4
+ "subtitle": "Manage configuration variables",
5
+ "add": "Add Config Variable",
6
+ "package": "Package",
7
+ "group": "Group",
8
+ "value": "Value",
9
+ "is_invisible": "Hidden",
10
+ "create_title": "Create Config Variable",
11
+ "edit_title": "Edit Config Variable",
12
+ "created_success": "Config variable created successfully.",
13
+ "updated_success": "Config variable updated successfully."
14
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "domains": "Domains",
3
+ "title": "Domains",
4
+ "subtitle": "Manage system domains",
5
+ "add": "Add Domain",
6
+ "create_title": "Create Domain",
7
+ "edit_title": "Edit Domain",
8
+ "created_success": "Domain successfully created.",
9
+ "updated_success": "Domain successfully updated.",
10
+ "host": "Host",
11
+ "protocol": "Protocol",
12
+ "port": "Port",
13
+ "path": "Path",
14
+ "target": "Target",
15
+ "parameters": "Parameters",
16
+ "group_connection": "Connection",
17
+ "group_routing": "Routing"
18
+ }
@@ -0,0 +1,33 @@
1
+ {
2
+ "email_templates": "Email Templates",
3
+ "title": "Email Templates",
4
+ "subtitle": "Manage email templates",
5
+ "add": "Add Email Template",
6
+ "create_title": "Create Email Template",
7
+ "edit_title": "Edit Email Template",
8
+ "slug": "Slug",
9
+ "slug_description": "URL-friendly identifier, auto-generated from name",
10
+ "subject": "Subject",
11
+ "subject_description": "Email subject line",
12
+ "body_text": "Body (Text)",
13
+ "body_text_description": "Plain text version of the email body",
14
+ "body_html": "Body (HTML)",
15
+ "body_html_description": "HTML version of the email body",
16
+ "has_body_html": "HTML",
17
+ "default_sender_name": "Sender Name",
18
+ "default_sender_email": "Sender Email",
19
+ "default_sender_email_description": "Used as the email From address",
20
+ "default_recipient_name": "Recipient Name",
21
+ "default_recipient_email": "Recipient Email",
22
+ "default_cc_email": "CC Email",
23
+ "default_cc_email_description": "Comma-separated list of CC addresses",
24
+ "default_bcc_email": "BCC Email",
25
+ "default_bcc_email_description": "Comma-separated list of BCC addresses",
26
+ "default_replyto_email": "Reply-To Email",
27
+ "default_replyto_name": "Reply-To Name",
28
+ "group_content": "Content",
29
+ "group_sender": "Sender Defaults",
30
+ "group_recipient": "Recipient Defaults",
31
+ "created_success": "Email template created successfully.",
32
+ "updated_success": "Email template updated successfully."
33
+ }
@@ -0,0 +1,5 @@
1
+ {
2
+ "dashboard": "Dashboard",
3
+ "administration": "Administration",
4
+ "section_subtitle": "Manage users, roles, permissions and system settings"
5
+ }
@@ -0,0 +1,16 @@
1
+ {
2
+ "languages": "Languages",
3
+ "language": "Language",
4
+ "title": "Languages",
5
+ "subtitle": "Manage system languages",
6
+ "add": "Add Language",
7
+ "code": "Code",
8
+ "english_name": "English Name",
9
+ "native_name": "Native Name",
10
+ "create_title": "Create Language",
11
+ "edit_title": "Edit Language",
12
+ "created_success": "Language created successfully.",
13
+ "updated_success": "Language updated successfully.",
14
+ "iso_639_1": "ISO 639-1 Code",
15
+ "iso_639_1_description": "Two-letter language code (e.g. en, de, fr)"
16
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "permissions": "Permissions",
3
+ "permission_group": "Permission Group",
4
+ "permission_groups": "Permission Groups",
5
+ "title": "Permission Groups",
6
+ "subtitle": "Manage permission groups",
7
+ "add": "Add Permission Group",
8
+ "position": "Position",
9
+ "create_title": "Create Permission Group",
10
+ "edit_title": "Edit Permission Group",
11
+ "created_success": "Permission group created successfully.",
12
+ "updated_success": "Permission group updated successfully.",
13
+ "group_permissions": "Permissions"
14
+ }
@@ -0,0 +1,15 @@
1
+ {
2
+ "roles": "Roles",
3
+ "role": "Role",
4
+ "title": "Roles",
5
+ "subtitle": "Manage user roles",
6
+ "add": "Add Role",
7
+ "guard": "Guard",
8
+ "permissions": "Permissions",
9
+ "create_title": "Create Role",
10
+ "edit_title": "Edit Role",
11
+ "created_success": "Role created successfully.",
12
+ "updated_success": "Role updated successfully.",
13
+ "guard_name": "Guard Name",
14
+ "group_access": "Permissions"
15
+ }
@@ -0,0 +1,22 @@
1
+ {
2
+ "users": "Users",
3
+ "user": "User",
4
+ "title": "Users",
5
+ "subtitle": "Manage system users",
6
+ "add": "Add User",
7
+ "avatar": "",
8
+ "clients": "Clients",
9
+ "roles": "Roles",
10
+ "permissions": "Permissions",
11
+ "create_title": "Create User",
12
+ "edit_title": "Edit User",
13
+ "created_success": "User was created successfully",
14
+ "updated_success": "User was updated successfully",
15
+ "password": "Password",
16
+ "password_description": "Leave blank to keep current password",
17
+ "change_password": "Change Password",
18
+ "password_confirmation": "Confirm Password",
19
+ "password_mismatch": "Passwords do not match",
20
+ "group_security": "Security",
21
+ "group_access": "Access"
22
+ }
@@ -0,0 +1,5 @@
1
+ <script setup lang="ts">
2
+ definePageMeta({
3
+ redirect: '/'
4
+ })
5
+ </script>
@@ -0,0 +1,39 @@
1
+ <script setup lang="ts">
2
+ import type { User } from '@motor-cms/ui-core/app/types/auth'
3
+
4
+ const { user } = useSanctumAuth<User>()
5
+ const { clientName } = useRuntimeConfig().public
6
+ const { t } = useI18n()
7
+
8
+ // Helper to access user data
9
+ const userData = computed(() => user.value?.data)
10
+
11
+ definePageMeta({
12
+ layout: 'default',
13
+ permission: 'dashboard.read'
14
+ })
15
+ </script>
16
+
17
+ <template>
18
+ <div class="p-6">
19
+ <!-- Mobile sidebar toggle -->
20
+ <div class="lg:hidden mb-3">
21
+ <UDashboardSidebarToggle />
22
+ </div>
23
+
24
+ <div class="mb-6">
25
+ <h1 class="text-2xl font-bold">
26
+ {{ t('motor-core.global.dashboard') }}
27
+ </h1>
28
+ </div>
29
+
30
+ <UPageCard :title="t('motor-core.global.welcome_back')">
31
+ <template #description>
32
+ {{ t('motor-core.global.logged_in_as') }} {{ userData?.name || userData?.email || 'User' }}.
33
+ </template>
34
+ <p class="text-sm text-muted">
35
+ {{ t('motor-core.global.dashboard_description', { clientName }) }}
36
+ </p>
37
+ </UPageCard>
38
+ </div>
39
+ </template>
@@ -0,0 +1,85 @@
1
+ <script setup lang="ts">
2
+ import { z } from 'zod'
3
+ import type { FormSubmitEvent } from '@nuxt/ui'
4
+
5
+ const { t } = useI18n()
6
+ const { login } = useSanctumAuth()
7
+
8
+ definePageMeta({
9
+ layout: 'auth',
10
+ sanctum: {
11
+ guestOnly: true
12
+ }
13
+ })
14
+
15
+ const schema = z.object({
16
+ email: z.string({ message: t('motor-core.login.email_required') })
17
+ .min(1, t('motor-core.login.email_required'))
18
+ .email(t('motor-core.login.email_invalid')),
19
+ password: z.string({ message: t('motor-core.login.password_required') })
20
+ .min(1, t('motor-core.login.password_required'))
21
+ })
22
+
23
+ type Schema = z.infer<typeof schema>
24
+
25
+ const fields = [
26
+ {
27
+ name: 'email',
28
+ type: 'email' as const,
29
+ label: t('motor-core.login.email'),
30
+ placeholder: 'admin@example.com',
31
+ icon: 'i-lucide-mail',
32
+ required: true
33
+ },
34
+ {
35
+ name: 'password',
36
+ type: 'password' as const,
37
+ label: t('motor-core.login.password'),
38
+ placeholder: '••••••••',
39
+ icon: 'i-lucide-lock',
40
+ required: true
41
+ }
42
+ ]
43
+
44
+ const loading = ref(false)
45
+ const error = ref<string | null>(null)
46
+
47
+ async function onSubmit(event: FormSubmitEvent<Schema>) {
48
+ loading.value = true
49
+ error.value = null
50
+
51
+ try {
52
+ await login({
53
+ email: event.data.email,
54
+ password: event.data.password
55
+ })
56
+ } catch {
57
+ error.value = t('motor-core.login.login_failed')
58
+ } finally {
59
+ loading.value = false
60
+ }
61
+ }
62
+ </script>
63
+
64
+ <template>
65
+ <UAuthForm
66
+ :title="t('motor-core.login.sign_in')"
67
+ :description="t('motor-core.login.sign_in_description')"
68
+ method="POST"
69
+ action=""
70
+ :schema="schema"
71
+ :fields="fields"
72
+ :loading="loading"
73
+ :submit="{ label: t('motor-core.login.sign_in'), color: 'primary' }"
74
+ @submit="onSubmit"
75
+ >
76
+ <template #validation>
77
+ <UAlert
78
+ v-if="error"
79
+ color="error"
80
+ icon="i-lucide-circle-alert"
81
+ :title="error"
82
+ />
83
+ </template>
84
+ </UAuthForm>
85
+ </template>
@@ -0,0 +1,7 @@
1
+ <claude-mem-context>
2
+ # Recent Activity
3
+
4
+ <!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->
5
+
6
+ *No recent activity*
7
+ </claude-mem-context>
@@ -0,0 +1,48 @@
1
+ <!-- app/pages/motor-admin/ai-system-prompts/[id]/edit.vue -->
2
+ <script setup lang="ts">
3
+ import { aISystemPromptFormMeta } from '../../../../types/generated/form-meta'
4
+ import { aiSystemPromptFormConfig, aiSystemPromptSelectOptionConfigs } from '@motor-cms/ui-core/app/types/config/ai-system-prompt'
5
+
6
+ definePageMeta({ layout: 'default', permission: 'ai-system-prompts.write' })
7
+
8
+ const route = useRoute()
9
+ const { t } = useI18n()
10
+ const { fields, schema, groups, state, loading, fetching, fetchError, formRef, selectOptions, selectOptionsLoading, onSubmit, onSaveAndContinue, onSaveAndNew, deleteRecord, deleting } = await useEntityForm({
11
+ apiEndpoint: '/api/v2/ai-system-prompts',
12
+ routePrefix: '/motor-admin/ai-system-prompts',
13
+ translationPrefix: 'motor-admin.ai_system_prompts',
14
+ formMeta: aISystemPromptFormMeta,
15
+ formConfig: aiSystemPromptFormConfig,
16
+ mode: 'edit',
17
+ id: route.params.id as string,
18
+ selectOptionConfigs: aiSystemPromptSelectOptionConfigs
19
+ })
20
+ </script>
21
+
22
+ <template>
23
+ <FormPage
24
+ :title="t('motor-admin.ai_system_prompts.edit_title')"
25
+ back-route="/motor-admin/ai-system-prompts"
26
+ :loading="fetching"
27
+ :error="fetchError"
28
+ >
29
+ <FormBase
30
+ ref="formRef"
31
+ v-model:state="state"
32
+ :fields="fields"
33
+ :schema="schema"
34
+ :groups="groups"
35
+ :select-options="selectOptions"
36
+ :select-options-loading="selectOptionsLoading"
37
+ :loading="loading"
38
+ :delete-record="deleteRecord"
39
+ :deleting="deleting"
40
+ cancel-route="/motor-admin/ai-system-prompts"
41
+ show-save-and-continue
42
+ show-save-and-new
43
+ @submit="onSubmit"
44
+ @save-and-continue="onSaveAndContinue"
45
+ @save-and-new="onSaveAndNew"
46
+ />
47
+ </FormPage>
48
+ </template>
@@ -0,0 +1,40 @@
1
+ <!-- app/pages/motor-admin/ai-system-prompts/create.vue -->
2
+ <script setup lang="ts">
3
+ import { aISystemPromptFormMeta } from '../../../types/generated/form-meta'
4
+ import { aiSystemPromptFormConfig, aiSystemPromptSelectOptionConfigs } from '@motor-cms/ui-core/app/types/config/ai-system-prompt'
5
+
6
+ definePageMeta({ layout: 'default', permission: 'ai-system-prompts.write' })
7
+
8
+ const { t } = useI18n()
9
+ const { fields, schema, groups, state, loading, selectOptions, selectOptionsLoading, formRef, onSubmit, onSaveAndNew } = await useEntityForm({
10
+ apiEndpoint: '/api/v2/ai-system-prompts',
11
+ routePrefix: '/motor-admin/ai-system-prompts',
12
+ translationPrefix: 'motor-admin.ai_system_prompts',
13
+ formMeta: aISystemPromptFormMeta,
14
+ formConfig: aiSystemPromptFormConfig,
15
+ mode: 'create',
16
+ selectOptionConfigs: aiSystemPromptSelectOptionConfigs
17
+ })
18
+ </script>
19
+
20
+ <template>
21
+ <FormPage
22
+ :title="t('motor-admin.ai_system_prompts.create_title')"
23
+ back-route="/motor-admin/ai-system-prompts"
24
+ >
25
+ <FormBase
26
+ ref="formRef"
27
+ v-model:state="state"
28
+ :fields="fields"
29
+ :schema="schema"
30
+ :groups="groups"
31
+ :select-options="selectOptions"
32
+ :select-options-loading="selectOptionsLoading"
33
+ :loading="loading"
34
+ cancel-route="/motor-admin/ai-system-prompts"
35
+ show-save-and-new
36
+ @submit="onSubmit"
37
+ @save-and-new="onSaveAndNew"
38
+ />
39
+ </FormPage>
40
+ </template>
@@ -0,0 +1,68 @@
1
+ <!-- app/pages/motor-admin/ai-system-prompts/index.vue -->
2
+ <script setup lang="ts">
3
+ import type { ColumnDef } from '@motor-cms/ui-core/app/types/grid'
4
+
5
+ definePageMeta({ permission: 'ai-system-prompts.read' })
6
+
7
+ interface AISystemPromptApi {
8
+ id: number
9
+ name: string
10
+ prompt: string
11
+ client: { id: number, name: string } | null
12
+ client_id: number
13
+ created_at: string
14
+ updated_at: string
15
+ }
16
+
17
+ interface AISystemPrompt {
18
+ id: number
19
+ name: string
20
+ prompt: string
21
+ client_name: string
22
+ created_at: string
23
+ updated_at: string
24
+ }
25
+
26
+ const { t } = useI18n()
27
+
28
+ const columns: ColumnDef<AISystemPrompt>[] = [
29
+ { key: 'name', label: t('motor-core.global.name'), sortable: true, hideable: false },
30
+ { key: 'client_name', label: t('motor-admin.clients.client') },
31
+ { key: 'prompt', label: t('motor-admin.ai_system_prompts.prompt'), class: 'truncate max-w-xs' },
32
+ createdAtColumn(t)
33
+ ]
34
+
35
+ const filters = [useClientFilter()]
36
+
37
+ const fetchAISystemPrompts = useGridFetch<AISystemPromptApi, AISystemPrompt>('/api/v2/ai-system-prompts', {
38
+ transform: record => ({
39
+ id: record.id,
40
+ name: record.name,
41
+ prompt: record.prompt,
42
+ client_name: record.client?.name ?? '-',
43
+ created_at: record.created_at,
44
+ updated_at: record.updated_at
45
+ })
46
+ })
47
+ </script>
48
+
49
+ <template>
50
+ <GridPage
51
+ :title="t('motor-admin.ai_system_prompts.title')"
52
+ :subtitle="t('motor-admin.ai_system_prompts.subtitle')"
53
+ add-route="/motor-admin/ai-system-prompts/create"
54
+ :add-label="t('motor-admin.ai_system_prompts.add')"
55
+ write-permission="ai-system-prompts.write"
56
+ >
57
+ <GridBase
58
+ id="ai-system-prompts-grid"
59
+ :fetch="fetchAISystemPrompts"
60
+ :columns="columns"
61
+ :filters="filters"
62
+ base-path="/motor-admin/ai-system-prompts"
63
+ :row-click-to="(row: any) => `/motor-admin/ai-system-prompts/${row.id}/edit`"
64
+ write-permission="ai-system-prompts.write"
65
+ delete-permission="ai-system-prompts.delete"
66
+ />
67
+ </GridPage>
68
+ </template>
@@ -0,0 +1,7 @@
1
+ <claude-mem-context>
2
+ # Recent Activity
3
+
4
+ <!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->
5
+
6
+ *No recent activity*
7
+ </claude-mem-context>
@@ -0,0 +1,7 @@
1
+ <claude-mem-context>
2
+ # Recent Activity
3
+
4
+ <!-- This section is auto-generated by claude-mem. Edit content outside the tags. -->
5
+
6
+ *No recent activity*
7
+ </claude-mem-context>
@@ -0,0 +1,73 @@
1
+ <!-- app/pages/motor-admin/category-trees/[id]/categories/[categoryId]/edit.vue -->
2
+ <script setup lang="ts">
3
+ import { categoryFormMeta } from '@motor-cms/ui-core/app/types/generated/form-meta'
4
+ import { categoryFormConfig } from '@motor-cms/ui-core/app/types/config/category'
5
+
6
+ definePageMeta({ layout: 'default', permission: 'categories.write' })
7
+
8
+ const route = useRoute()
9
+ const { t } = useI18n()
10
+ const treeId = route.params.id as string
11
+ const categoryId = route.params.categoryId as string
12
+
13
+ const { fields, schema, groups, state, loading, fetching, fetchError, formRef, selectOptions, selectOptionsLoading, onSubmit, onSaveAndContinue, onSaveAndNew, deleteRecord, deleting } = await useEntityForm({
14
+ apiEndpoint: `/api/v2/category-trees/${treeId}/categories`,
15
+ routePrefix: `/motor-admin/category-trees/${treeId}`,
16
+ translationPrefix: 'motor-admin.categories',
17
+ formMeta: categoryFormMeta,
18
+ formConfig: categoryFormConfig,
19
+ mode: 'edit',
20
+ id: categoryId,
21
+ selectOptionConfigs: {
22
+ parent_id: { endpoint: `/api/v2/category-trees/${treeId}/categories`, labelKey: 'name' }
23
+ }
24
+ })
25
+ </script>
26
+
27
+ <template>
28
+ <FormPage
29
+ :title="t('motor-admin.categories.edit_title')"
30
+ :back-route="`/motor-admin/category-trees/${treeId}`"
31
+ :loading="fetching"
32
+ :error="fetchError"
33
+ >
34
+ <FormBase
35
+ ref="formRef"
36
+ v-model:state="state"
37
+ :fields="fields"
38
+ :schema="schema"
39
+ :groups="groups"
40
+ :select-options="selectOptions"
41
+ :select-options-loading="selectOptionsLoading"
42
+ :loading="loading"
43
+ :delete-record="deleteRecord"
44
+ :deleting="deleting"
45
+ :cancel-route="`/motor-admin/category-trees/${treeId}`"
46
+ show-save-and-continue
47
+ show-save-and-new
48
+ @submit="onSubmit"
49
+ @save-and-continue="onSaveAndContinue"
50
+ @save-and-new="onSaveAndNew"
51
+ >
52
+ <template #field-parent_id="{ value, update }">
53
+ <UFormField
54
+ name="parent_id"
55
+ :label="t('motor-admin.categories.parent')"
56
+ :required="true"
57
+ orientation="horizontal"
58
+ :ui="{ container: 'w-full max-w-lg' }"
59
+ >
60
+ <FormInputsCategoryTreePicker
61
+ :tree-id="treeId"
62
+ :model-value="(value as number | null)"
63
+ :current-id="Number(categoryId)"
64
+ :new-item-name="state.name as string ?? ''"
65
+ @update:model-value="update"
66
+ @update:previous-sibling-id="(v: number | null) => state.previous_sibling_id = v"
67
+ @update:next-sibling-id="(v: number | null) => state.next_sibling_id = v"
68
+ />
69
+ </UFormField>
70
+ </template>
71
+ </FormBase>
72
+ </FormPage>
73
+ </template>
@@ -0,0 +1,64 @@
1
+ <!-- app/pages/motor-admin/category-trees/[id]/categories/create.vue -->
2
+ <script setup lang="ts">
3
+ import { categoryFormMeta } from '@motor-cms/ui-core/app/types/generated/form-meta'
4
+ import { categoryFormConfig } from '@motor-cms/ui-core/app/types/config/category'
5
+
6
+ definePageMeta({ layout: 'default', permission: 'categories.write' })
7
+
8
+ const route = useRoute()
9
+ const { t } = useI18n()
10
+ const treeId = route.params.id as string
11
+
12
+ const { fields, schema, groups, state, loading, selectOptions, selectOptionsLoading, formRef, onSubmit, onSaveAndNew } = await useEntityForm({
13
+ apiEndpoint: `/api/v2/category-trees/${treeId}/categories`,
14
+ routePrefix: `/motor-admin/category-trees/${treeId}`,
15
+ translationPrefix: 'motor-admin.categories',
16
+ formMeta: categoryFormMeta,
17
+ formConfig: categoryFormConfig,
18
+ mode: 'create',
19
+ selectOptionConfigs: {
20
+ parent_id: { endpoint: `/api/v2/category-trees/${treeId}/categories`, labelKey: 'name' }
21
+ }
22
+ })
23
+ </script>
24
+
25
+ <template>
26
+ <FormPage
27
+ :title="t('motor-admin.categories.create_title')"
28
+ :back-route="`/motor-admin/category-trees/${treeId}`"
29
+ >
30
+ <FormBase
31
+ ref="formRef"
32
+ v-model:state="state"
33
+ :fields="fields"
34
+ :schema="schema"
35
+ :groups="groups"
36
+ :select-options="selectOptions"
37
+ :select-options-loading="selectOptionsLoading"
38
+ :loading="loading"
39
+ :cancel-route="`/motor-admin/category-trees/${treeId}`"
40
+ show-save-and-new
41
+ @submit="onSubmit"
42
+ @save-and-new="onSaveAndNew"
43
+ >
44
+ <template #field-parent_id="{ value, update }">
45
+ <UFormField
46
+ name="parent_id"
47
+ :label="t('motor-admin.categories.parent')"
48
+ :required="true"
49
+ orientation="horizontal"
50
+ :ui="{ container: 'w-full max-w-lg' }"
51
+ >
52
+ <FormInputsCategoryTreePicker
53
+ :tree-id="treeId"
54
+ :model-value="(value as number | null)"
55
+ :new-item-name="state.name as string ?? ''"
56
+ @update:model-value="update"
57
+ @update:previous-sibling-id="(v: number | null) => state.previous_sibling_id = v"
58
+ @update:next-sibling-id="(v: number | null) => state.next_sibling_id = v"
59
+ />
60
+ </UFormField>
61
+ </template>
62
+ </FormBase>
63
+ </FormPage>
64
+ </template>