Skip to content

Commit 35ca466

Browse files
committed
Merge branch 'main' of github.com:devforth/adminforth into main
2 parents 0cead15 + 21c4190 commit 35ca466

File tree

29 files changed

+521
-102
lines changed

29 files changed

+521
-102
lines changed

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@ npm link
5757
# this will install deps in all plugins and link adminforth package
5858
npm run ci-plugins
5959
60+
# this will install deps in all plugins and link adminforth package
61+
npm run ci-adapters
62+
6063
# this is dev demo for development
6164
cd dev-demo
6265
cp .env.sample .env
@@ -71,3 +74,10 @@ Add some columns to a database. Open .prisma file, modify it, and run:
7174
npm run migrate -- --name desctiption_of_changes
7275
```
7376

77+
Add some columns to a database. Open .prisma file, modify it, and run:
78+
79+
```
80+
npm run migrate -- --name desctiption_of_changes
81+
```
82+
83+

adminforth/adapters/completion-adapter-open-ai-chat-gpt/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import { da } from "@faker-js/faker";
21
import type { AdapterOptions } from "./types.js";
32
import type { CompletionAdapter } from "adminforth";
43

adminforth/documentation/docs/tutorial/05-Plugins/04-RichEditor.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,9 +109,9 @@ To get completion suggestions for the text in the editor, you can use the `compl
109109
model: 'gpt-4o', //gpt-4o-mini is a default (cheapest one)
110110
expert: {
111111
//diff-add
112-
temperature: 0.7; //Model temperature, default 0.7
112+
temperature: 0.7 //Model temperature, default 0.7
113113
//diff-add
114-
};
114+
}
115115
//diff-add
116116
}),
117117
//diff-add

adminforth/documentation/docs/tutorial/05-Plugins/06-text-complete.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,9 +49,9 @@ export const admin = new AdminForth({
4949
//diff-add
5050
expert: {
5151
//diff-add
52-
temperature: 0.7; //Model temperature, default 0.7
52+
temperature: 0.7 //Model temperature, default 0.7
5353
//diff-add
54-
};
54+
}
5555
//diff-add
5656
}),
5757
//diff-add

adminforth/package.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@
2424
"docs": "typedoc",
2525
"--comment_postinstall": "postinstall executed after package installed in other project package and when we do npm ci in the package",
2626
"postinstall": "if test -d ./dist/spa/; then cd ./dist/spa/ && npm ci && echo 'installed spa dependencies'; fi",
27-
"ci-plugins": "for d in plugins/*; do cd $d && npm ci && cd ../..; done"
27+
"ci-plugins": "for d in plugins/*; do cd $d && npm ci && cd ../..; done",
28+
"ci-adapters": "for d in adapters/*; do cd $d && npm ci && cd ../..; done"
29+
2830
},
2931
"exports": {
3032
".": {

adminforth/plugins/i18n/index.ts

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,11 @@ ${JSON.stringify(obj)}
293293
[this.enFieldName]: key,
294294
...(this.options.sourceFieldName ? { [this.options.sourceFieldName]: `${source}:${file}` } : {}),
295295
};
296-
await adminforth.resource(this.resourceConfig.resourceId).create(record);
296+
try {
297+
await adminforth.resource(this.resourceConfig.resourceId).create(record);
298+
} catch (e) {
299+
console.error('🐛 Error creating record', e);
300+
}
297301
}))
298302

299303

adminforth/spa/src/App.vue

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
<div class="flex items-center justify-start rtl:justify-end">
99
<button @click="sideBarOpen = !sideBarOpen"
1010
type="button" class="inline-flex items-center p-2 text-sm rounded-lg sm:hidden hover:bg-lightSidebarItemHover focus:outline-none focus:ring-2 focus:ring-lightSidebarDevider dark:text-darkSidebarIcons dark:hover:bg-darkSidebarHover dark:focus:ring-lightSidebarDevider">
11-
<span class="sr-only">Open sidebar</span>
11+
<span class="sr-only">{{ $t('Open sidebar') }}</span>
1212
<svg class="w-6 h-6" aria-hidden="true" fill="currentColor" viewBox="0 0 20 20" xmlns="http://www.w3.org/2000/svg">
1313
<path clip-rule="evenodd" fill-rule="evenodd" d="M2 4.75A.75.75 0 012.75 4h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 4.75zm0 10.5a.75.75 0 01.75-.75h7.5a.75.75 0 010 1.5h-7.5a.75.75 0 01-.75-.75zM2 10a.75.75 0 01.75-.75h14.5a.75.75 0 010 1.5H2.75A.75.75 0 012 10z"></path>
1414
</svg>
@@ -33,7 +33,7 @@
3333
<button
3434
ref="dropdownUserButton"
3535
type="button" class="flex text-sm bg- rounded-full focus:ring-4 focus:ring-lightSidebarDevider dark:focus:ring-darkSidebarDevider dark:bg-" aria-expanded="false" data-dropdown-toggle="dropdown-user">
36-
<span class="sr-only">Open user menu</span>
36+
<span class="sr-only">{{ $t('Open user menu') }}</span>
3737
<svg class="w-8 h-8 text-lightNavbarIcons dark:text-darkNavbarIcons" aria-hidden="true" xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor" viewBox="0 0 24 24">
3838
<path fill-rule="evenodd" d="M12 20a7.966 7.966 0 0 1-5.002-1.756l.002.001v-.683c0-1.794 1.492-3.25 3.333-3.25h3.334c1.84 0 3.333 1.456 3.333 3.25v.683A7.966 7.966 0 0 1 12 20ZM2 12C2 6.477 6.477 2 12 2s10 4.477 10 10c0 5.5-4.44 9.963-9.932 10h-.138C6.438 21.962 2 17.5 2 12Zm10-5c-1.84 0-3.333 1.455-3.333 3.25S10.159 13.5 12 13.5c1.84 0 3.333-1.455 3.333-3.25S13.841 7 12 7Z" clip-rule="evenodd"/>
3939
</svg>
@@ -59,7 +59,7 @@
5959
/>
6060
</li>
6161
<li>
62-
<button @click="logout" class="cursor-pointer flex items-center gap-1 block px-4 py-2 text-sm text-black hover:bg-html dark:text-darkSidebarTextHover dark:hover:bg-darkSidebarItemHover dark:hover:text-darkSidebarTextActive w-full" role="menuitem">Sign out</button>
62+
<button @click="logout" class="cursor-pointer flex items-center gap-1 block px-4 py-2 text-sm text-black hover:bg-html dark:text-darkSidebarTextHover dark:hover:bg-darkSidebarItemHover dark:hover:text-darkSidebarTextActive w-full" role="menuitem">{{ $t('Sign out') }}</button>
6363
</li>
6464
</ul>
6565
</div>
@@ -179,7 +179,7 @@
179179
<div v-else class="flex items-center justify-center h-screen">
180180
<div class="text-3xl text-gray-400 animate-bounce">
181181
<svg aria-hidden="true" class="w-8 h-8 text-gray-200 animate-spin dark:text-gray-600 fill-blue-600" viewBox="0 0 100 101" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M100 50.5908C100 78.2051 77.6142 100.591 50 100.591C22.3858 100.591 0 78.2051 0 50.5908C0 22.9766 22.3858 0.59082 50 0.59082C77.6142 0.59082 100 22.9766 100 50.5908ZM9.08144 50.5908C9.08144 73.1895 27.4013 91.5094 50 91.5094C72.5987 91.5094 90.9186 73.1895 90.9186 50.5908C90.9186 27.9921 72.5987 9.67226 50 9.67226C27.4013 9.67226 9.08144 27.9921 9.08144 50.5908Z" fill="currentColor"/><path d="M93.9676 39.0409C96.393 38.4038 97.8624 35.9116 97.0079 33.5539C95.2932 28.8227 92.871 24.3692 89.8167 20.348C85.8452 15.1192 80.8826 10.7238 75.2124 7.41289C69.5422 4.10194 63.2754 1.94025 56.7698 1.05124C51.7666 0.367541 46.6976 0.446843 41.7345 1.27873C39.2613 1.69328 37.813 4.19778 38.4501 6.62326C39.0873 9.04874 41.5694 10.4717 44.0505 10.1071C47.8511 9.54855 51.7191 9.52689 55.5402 10.0491C60.8642 10.7766 65.9928 12.5457 70.6331 15.2552C75.2735 17.9648 79.3347 21.5619 82.5849 25.841C84.9175 28.9121 86.7997 32.2913 88.1811 35.8758C89.083 38.2158 91.5421 39.6781 93.9676 39.0409Z" fill="currentFill"/></svg>
182-
<span class="sr-only">Loading...</span>
182+
<span class="sr-only">{{ $t('Loading...') }}</span>
183183
</div>
184184
</div>
185185
<AcceptModal />

adminforth/spa/src/afcl/Dropzone.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
</div>
3131

32-
<p v-if="!selectedFiles.length" class="mb-2 text-sm text-gray-500 dark:text-gray-400"><span class="font-semibold">Click to upload</span> or drag and drop</p>
32+
<p v-if="!selectedFiles.length" class="mb-2 text-sm text-gray-500 dark:text-gray-400"><span class="font-semibold">{{ $t('Click to upload') }}</span> {{ $t('or drag and drop') }}</p>
3333
<p class="text-xs text-gray-500 dark:text-gray-400">
3434
{{ props.extensions.join(', ').toUpperCase().replace(/\./g, '') }}
3535
<template v-if="props.maxSizeBytes">

adminforth/spa/src/afcl/Select.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<label v-if="!$slots.item" :for="item.value">{{ item.label }}</label>
4545
</div>
4646
<div v-if="!filteredItems.length" class="px-4 py-2 cursor-pointer text-gray-400 dark:text-gray-300">
47-
No results found
47+
{{ $t('No results found') }}
4848
</div>
4949

5050
<div v-if="$slots['extra-item']" class="px-4 py-2 dark:text-gray-400">
@@ -66,7 +66,7 @@
6666
@click="toogleItem(item)"
6767
class="z-index-100 flex-shrink-0 ml-1 h-4 w-4 -mr-1 rounded-full inline-flex items-center justify-center text-gray-400 hover:text-gray-500 focus:outline-none focus:text-gray-500 focus:bg-gray-100"
6868
>
69-
<span class="sr-only">Remove item</span>
69+
<span class="sr-only">{{ $t('Remove item') }}</span>
7070
<svg class="h-2 w-2" stroke="currentColor" fill="none" viewBox="0 0 8 8">
7171
<path
7272
stroke-linecap="round"

adminforth/spa/src/components/AcceptModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const modalStore = useModalStore();
1313
<svg class="w-3 h-3" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 14 14">
1414
<path stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="m1 1 6 6m0 0 6 6M7 7l6-6M7 7l-6 6"/>
1515
</svg>
16-
<span class="sr-only">Close modal</span>
16+
<span class="sr-only">{{ $t('Close modal') }}</span>
1717
</button>
1818
<div class="p-4 md:p-5 text-center">
1919
<svg class="mx-auto mb-4 text-gray-400 w-12 h-12 dark:text-gray-200" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 20 20">

0 commit comments

Comments
 (0)