adminforth 1.7.0-next.12 → 1.7.0-next.14

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.
@@ -8,7 +8,7 @@ async function canModifyUsers({ adminUser }: { adminUser: AdminUser }): Promise<
8
8
  export default {
9
9
  dataSource: 'maindb',
10
10
  table: 'adminuser',
11
- resourceId: 'users',
11
+ resourceId: 'adminuser',
12
12
  label: 'Users',
13
13
  recordLabel: (r) => `👤 ${r.email}`,
14
14
  options: {
@@ -44,7 +44,7 @@ export default {
44
44
  {
45
45
  name: 'created_at',
46
46
  type: AdminForthDataTypes.DATETIME,
47
- showIn: [{
47
+ showIn: {
48
48
  edit: false,
49
49
  create: false,
50
50
  },
@@ -1,13 +1,13 @@
1
1
  import express from 'express';
2
2
  import AdminForth, { Filters } from 'adminforth';
3
- import usersResource from "./resources/users";
3
+ import usersResource from "./resources/adminuser";
4
4
 
5
5
  const ADMIN_BASE_URL = '';
6
6
 
7
7
  export const admin = new AdminForth({
8
8
  baseUrl: ADMIN_BASE_URL,
9
9
  auth: {
10
- usersResourceId: 'users',
10
+ usersResourceId: 'adminuser',
11
11
  usernameField: 'email',
12
12
  passwordHashField: 'password_hash',
13
13
  rememberMeDays: 30,
@@ -51,7 +51,7 @@ export const admin = new AdminForth({
51
51
  {
52
52
  label: 'Users',
53
53
  icon: 'flowbite:user-solid',
54
- resourceId: 'users'
54
+ resourceId: 'adminuser'
55
55
  }
56
56
  ],
57
57
  });
@@ -68,8 +68,8 @@ if (import.meta.url === `file://${process.argv[1]}`) {
68
68
  admin.express.serve(app)
69
69
 
70
70
  admin.discoverDatabases().then(async () => {
71
- if (!await admin.resource('users').get([Filters.EQ('email', 'adminforth')])) {
72
- await admin.resource('users').create({
71
+ if (!await admin.resource('adminuser').get([Filters.EQ('email', 'adminforth')])) {
72
+ await admin.resource('adminuser').create({
73
73
  email: 'adminforth',
74
74
  password_hash: await AdminForth.Utils.generatePasswordHash('adminforth'),
75
75
  role: 'superadmin',
@@ -191,8 +191,8 @@ async function writeTemplateFiles(dirname, cwd, options) {
191
191
  data: { dbUrl, prismaDbUrl },
192
192
  },
193
193
  {
194
- src: 'users.ts.hbs',
195
- dest: 'resources/users.ts',
194
+ src: 'adminuser.ts.hbs',
195
+ dest: 'resources/adminuser.ts',
196
196
  data: {},
197
197
  },
198
198
  {
@@ -54,7 +54,7 @@
54
54
  />
55
55
 
56
56
  <Input
57
- v-else-if="[ 'string', 'text' ].includes(c.type)"
57
+ v-else-if="['string', 'text', 'unknown'].includes(c.type)"
58
58
  type="text"
59
59
  full-width
60
60
  :placeholder="$t('Search')"
@@ -62,6 +62,14 @@
62
62
  :modelValue="getFilterItem({ column: c, operator: 'ilike' })"
63
63
  />
64
64
 
65
+ <textarea
66
+ v-else-if="['json', 'richtext'].includes(c.type)"
67
+ class="bg-gray-50 border border-gray-300 text-gray-900 text-sm rounded-lg block w-full p-2.5 dark:bg-gray-700 dark:border-gray-600 dark:placeholder-gray-400 dark:text-white focus:ring-lightPrimary focus:border-lightPrimary dark:focus:ring-darkPrimary dark:focus:border-darkPrimary"
68
+ :placeholder="$t('Search')"
69
+ :value="getFilterItem({ column: c, operator: 'ilike' })"
70
+ @input="setFilterItem({ column: c, operator: 'ilike', value: $event.target.value || undefined })"
71
+ />
72
+
65
73
  <CustomDateRangePicker
66
74
  v-else-if="['datetime'].includes(c.type)"
67
75
  :column="c"
@@ -72,7 +80,7 @@
72
80
  />
73
81
 
74
82
  <Input
75
- v-else-if="[ 'date', 'time' ].includes(c.type)"
83
+ v-else-if="['date', 'time'].includes(c.type)"
76
84
  type="text"
77
85
  full-width
78
86
  :placeholder="$t('Search datetime')"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "adminforth",
3
- "version": "1.7.0-next.12",
3
+ "version": "1.7.0-next.14",
4
4
  "description": "OpenSource Vue3 powered forth-generation admin panel",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.js",