Skip to content

Commit a83cf08

Browse files
author
yaroslav8765
committed
Revert "fix: Add load .env.local in index.ts.hbs to fix undefined DB URL in resource command"
This reverts commit ba323c8.
1 parent ba323c8 commit a83cf08

File tree

14 files changed

+52
-487
lines changed

14 files changed

+52
-487
lines changed

adminforth/commands/createApp/templates/index.ts.hbs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ import AdminForth from 'adminforth';
33
import usersResource from "./resources/adminuser.js";
44
import { fileURLToPath } from 'url';
55
import path from 'path';
6-
import dotenv from "dotenv";
7-
dotenv.config({ path: '.env.local' });
86

97
const ADMIN_BASE_URL = '';
108

adminforth/commands/createApp/utils.js

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ export async function promptForMissingOptions(options) {
6161
questions.push({
6262
type: 'input',
6363
name: 'appName',
64-
message: 'Please specify the name of the app (TEEEEEEEEEESTTTTT)>',
64+
message: 'Please specify the name of the app >',
6565
default: 'adminforth-app',
6666
});
6767
};
@@ -108,11 +108,9 @@ function detectDbProvider(protocol) {
108108
return 'mongodb';
109109
} else if (protocol.startsWith('mysql')) {
110110
return 'mysql';
111-
} else if (protocol.startsWith('clickhouse')) {
112-
return 'clickhouse';
113111
}
114112

115-
const message = `Unknown database provider for ${protocol}. Only SQLite, PostgreSQL, MongoDB, and ClickHouse are supported now.`;
113+
const message = `Unknown database provider for ${protocol}. Only SQLite, PostgreSQL, and MongoDB are supported now.`;
116114
throw new Error(message);
117115
}
118116

dev-demo/.env.sample

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
AWS_ACCESS_KEY_ID=
22
AWS_SECRET_ACCESS_KEY=
3+
ADMINFORTH_SECRET=123
4+
NODE_ENV=development
35
OPENAI_API_KEY=1
46
HEAVY_DEBUG=
5-
HEAVY_DEBUG_QUERY=
7+
HEAVY_DEBUG_QUERY=
8+
PORT=3000
9+
10+
DATABASE_FILE=./db.sqlite
11+
DATABASE_FILE_URL=file:${DATABASE_FILE}

dev-demo/.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
node_modules
22
*.sqlite
3-
*.sqlite-journal
43
.env
54
db

dev-demo/custom/PageForTests.vue

Lines changed: 0 additions & 184 deletions
This file was deleted.

dev-demo/index.ts

Lines changed: 21 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ import apartmentBuyersResource from './resources/apartment_buyers.js';
88
import auditLogResource from './resources/audit_log.js';
99
import descriptionImageResource from './resources/description_image.js';
1010
import usersResource from './resources/users.js';
11-
import gameResource from './resources/game.js';
12-
import gamesUsersResource from './resources/games_users.js';
13-
import gamesResource from './resources/games.js';
11+
// import gameResource from './resources/game.js';
12+
// import gamesUsersResource from './resources/games_users.js';
13+
// import gamesResource from './resources/games.js';
1414
import translationsResource from './resources/translation.js';
1515
import clinicsResource from './resources/clinics.js';
1616
import providersResource from './resources/providers.js';
@@ -190,7 +190,7 @@ export const admin = new AdminForth({
190190
dataSources: [
191191
{
192192
id: 'maindb',
193-
url: process.env.DATABASE_URL as string,
193+
url: process.env.DATABASE_URL,
194194
},
195195
{
196196
id: 'pg',
@@ -202,7 +202,7 @@ export const admin = new AdminForth({
202202
},
203203
{
204204
id: 'ch',
205-
url: 'clickhouse://demo:demo@localhost:8124/demo',
205+
url: 'clickhouse://demo:demo@localhost:8125/demo',
206206
},
207207
{
208208
id: 'mysql',
@@ -219,18 +219,22 @@ export const admin = new AdminForth({
219219
clinicsResource,
220220
providersResource,
221221
apiKeysResource,
222-
gamesResource,
223-
gamesUsersResource,
224-
gameResource,
222+
// gamesResource,
223+
// gamesUsersResource,
224+
// gameResource,
225225
translationsResource,
226226
],
227227
menu: [
228228
{
229-
label: 'Tests',
230-
path: '/Tests',
231-
homepage: true,
229+
label: 'Dashboard',
232230
icon: 'flowbite:chart-pie-solid',
233-
component: '@@/PageForTests.vue',
231+
component: '@@/Dash.vue',
232+
path: '/dashboard',
233+
// homepage: true,
234+
isStaticRoute:false,
235+
// meta:{
236+
// title: 'Dashboard',
237+
// }
234238
},
235239
{
236240
label: 'Core',
@@ -257,11 +261,11 @@ export const admin = new AdminForth({
257261

258262
},
259263

260-
{
261-
label: 'Games',
262-
icon: 'flowbite:caret-right-solid',
263-
resourceId: 'game',
264-
},
264+
// {
265+
// label: 'Games',
266+
// icon: 'flowbite:caret-right-solid',
267+
// resourceId: 'game',
268+
// },
265269
// {
266270
// label: 'Games Users',
267271
// icon: 'flowbite:user-solid',

0 commit comments

Comments
 (0)