adminforth 1.2.51 → 1.2.53
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/dist/modules/configValidator.js +1 -1
- package/dist/modules/restApi.js +28 -25
- package/dist/modules/styles.js +10 -8
- package/dist/spa/spa/src/App.vue +1 -1
- package/dist/spa/spa/src/components/Filters.vue +1 -1
- package/dist/spa/spa/src/components/ResourceForm.vue +1 -1
- package/dist/spa/spa/src/components/ResourceListTable.vue +5 -3
- package/modules/configValidator.ts +1 -1
- package/modules/restApi.ts +6 -2
- package/modules/styles.ts +11 -8
- package/package.json +1 -1
- package/spa/src/App.vue +1 -1
- package/spa/src/components/Filters.vue +1 -1
- package/spa/src/components/ResourceForm.vue +1 -1
- package/spa/src/components/ResourceListTable.vue +5 -3
|
@@ -54,7 +54,7 @@ export default class ConfigValidator {
|
|
|
54
54
|
if (!this.config.rootUser.password) {
|
|
55
55
|
throw new Error('rootUser.password is required');
|
|
56
56
|
}
|
|
57
|
-
console.log('\n
|
|
57
|
+
console.log('\n ☝️☝️☝️ [INSECURE ALERT] config.rootUser is set, please create a new user to login in backoffice and remove config.rootUser from config ASAP when you are in production\n');
|
|
58
58
|
}
|
|
59
59
|
if (!this.config.customization.customComponentsDir) {
|
|
60
60
|
this.config.customization.customComponentsDir = './custom';
|
package/dist/modules/restApi.js
CHANGED
|
@@ -26,7 +26,9 @@ export default class AdminForthRestAPI {
|
|
|
26
26
|
let adminUser;
|
|
27
27
|
let toReturn = { ok: true, allowedLogin: true };
|
|
28
28
|
let token;
|
|
29
|
-
if (
|
|
29
|
+
if (this.adminforth.config.rootUser
|
|
30
|
+
&& username === this.adminforth.config.rootUser.username
|
|
31
|
+
&& password === this.adminforth.config.rootUser.password) {
|
|
30
32
|
this.adminforth.auth.setAuthCookie({ response, username, pk: null });
|
|
31
33
|
adminUser = { isRoot: true, dbUser: null, pk: null, username: this.adminforth.config.rootUser.username };
|
|
32
34
|
}
|
|
@@ -130,11 +132,12 @@ export default class AdminForthRestAPI {
|
|
|
130
132
|
method: 'GET',
|
|
131
133
|
path: '/get_base_config',
|
|
132
134
|
handler: (_k) => __awaiter(this, [_k], void 0, function* ({ input, adminUser, cookies }) {
|
|
133
|
-
var _l, _m;
|
|
135
|
+
var _l, _m, _o;
|
|
134
136
|
let username = '';
|
|
135
137
|
let userFullName = '';
|
|
136
138
|
if (adminUser.isRoot) {
|
|
137
|
-
|
|
139
|
+
// isRoot can be in JWT token still when rootUser deleted, so we check for rootUser?"
|
|
140
|
+
username = ((_l = this.adminforth.config.rootUser) === null || _l === void 0 ? void 0 : _l.username) || 'RootUser';
|
|
138
141
|
}
|
|
139
142
|
else {
|
|
140
143
|
const dbUser = adminUser.dbUser;
|
|
@@ -191,8 +194,8 @@ export default class AdminForthRestAPI {
|
|
|
191
194
|
deleteConfirmation: this.adminforth.config.deleteConfirmation,
|
|
192
195
|
auth: this.adminforth.config.auth,
|
|
193
196
|
usernameField: this.adminforth.config.auth.usernameField,
|
|
194
|
-
title: (
|
|
195
|
-
emptyFieldPlaceholder: (
|
|
197
|
+
title: (_m = this.adminforth.config.customization) === null || _m === void 0 ? void 0 : _m.title,
|
|
198
|
+
emptyFieldPlaceholder: (_o = this.adminforth.config.customization) === null || _o === void 0 ? void 0 : _o.emptyFieldPlaceholder,
|
|
196
199
|
},
|
|
197
200
|
adminUser,
|
|
198
201
|
version: ADMINFORTH_VERSION,
|
|
@@ -231,7 +234,7 @@ export default class AdminForthRestAPI {
|
|
|
231
234
|
server.endpoint({
|
|
232
235
|
method: 'POST',
|
|
233
236
|
path: '/get_resource',
|
|
234
|
-
handler: (
|
|
237
|
+
handler: (_p) => __awaiter(this, [_p], void 0, function* ({ body, adminUser }) {
|
|
235
238
|
const { resourceId } = body;
|
|
236
239
|
if (!this.adminforth.statuses.dbDiscover) {
|
|
237
240
|
return { error: 'Database discovery not started' };
|
|
@@ -262,8 +265,8 @@ export default class AdminForthRestAPI {
|
|
|
262
265
|
server.endpoint({
|
|
263
266
|
method: 'POST',
|
|
264
267
|
path: '/get_resource_data',
|
|
265
|
-
handler: (
|
|
266
|
-
var
|
|
268
|
+
handler: (_q) => __awaiter(this, [_q], void 0, function* ({ body, adminUser }) {
|
|
269
|
+
var _r, _s, _t, _u;
|
|
267
270
|
const { resourceId, source } = body;
|
|
268
271
|
if (['show', 'list'].includes(source) === false) {
|
|
269
272
|
return { error: 'Invalid source, should be list or show' };
|
|
@@ -283,7 +286,7 @@ export default class AdminForthRestAPI {
|
|
|
283
286
|
if (!allowed) {
|
|
284
287
|
return { error };
|
|
285
288
|
}
|
|
286
|
-
for (const hook of listify((
|
|
289
|
+
for (const hook of listify((_s = (_r = resource.hooks) === null || _r === void 0 ? void 0 : _r[source]) === null || _s === void 0 ? void 0 : _s.beforeDatasourceRequest)) {
|
|
287
290
|
const resp = yield hook({ resource, query: body, adminUser });
|
|
288
291
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
289
292
|
throw new Error(`Hook must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -362,7 +365,7 @@ export default class AdminForthRestAPI {
|
|
|
362
365
|
item._label = resource.recordLabel(item);
|
|
363
366
|
});
|
|
364
367
|
// only after adminforth made all post processing, give user ability to edit it
|
|
365
|
-
for (const hook of listify((
|
|
368
|
+
for (const hook of listify((_u = (_t = resource.hooks) === null || _t === void 0 ? void 0 : _t[source]) === null || _u === void 0 ? void 0 : _u.afterDatasourceResponse)) {
|
|
366
369
|
const resp = yield hook({ resource, response: data.data, adminUser });
|
|
367
370
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
368
371
|
throw new Error(`Hook must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -377,8 +380,8 @@ export default class AdminForthRestAPI {
|
|
|
377
380
|
server.endpoint({
|
|
378
381
|
method: 'POST',
|
|
379
382
|
path: '/get_resource_foreign_data',
|
|
380
|
-
handler: (
|
|
381
|
-
var
|
|
383
|
+
handler: (_v) => __awaiter(this, [_v], void 0, function* ({ body, adminUser }) {
|
|
384
|
+
var _w, _x, _y, _z;
|
|
382
385
|
const { resourceId, column } = body;
|
|
383
386
|
if (!this.adminforth.statuses.dbDiscover) {
|
|
384
387
|
return { error: 'Database discovery not started' };
|
|
@@ -399,7 +402,7 @@ export default class AdminForthRestAPI {
|
|
|
399
402
|
}
|
|
400
403
|
const targetResourceId = columnConfig.foreignResource.resourceId;
|
|
401
404
|
const targetResource = this.adminforth.config.resources.find((res) => res.resourceId == targetResourceId);
|
|
402
|
-
for (const hook of listify((
|
|
405
|
+
for (const hook of listify((_x = (_w = columnConfig.foreignResource.hooks) === null || _w === void 0 ? void 0 : _w.dropdownList) === null || _x === void 0 ? void 0 : _x.beforeDatasourceRequest)) {
|
|
403
406
|
const resp = yield hook({ query: body, adminUser, resource: targetResource });
|
|
404
407
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
405
408
|
throw new Error(`Hook must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -428,7 +431,7 @@ export default class AdminForthRestAPI {
|
|
|
428
431
|
const response = {
|
|
429
432
|
items
|
|
430
433
|
};
|
|
431
|
-
for (const hook of listify((
|
|
434
|
+
for (const hook of listify((_z = (_y = columnConfig.foreignResource.hooks) === null || _y === void 0 ? void 0 : _y.dropdownList) === null || _z === void 0 ? void 0 : _z.afterDatasourceResponse)) {
|
|
432
435
|
const resp = yield hook({ response, adminUser, resource: targetResource });
|
|
433
436
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
434
437
|
throw new Error(`Hook must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -443,7 +446,7 @@ export default class AdminForthRestAPI {
|
|
|
443
446
|
server.endpoint({
|
|
444
447
|
method: 'POST',
|
|
445
448
|
path: '/get_min_max_for_columns',
|
|
446
|
-
handler: (
|
|
449
|
+
handler: (_0) => __awaiter(this, [_0], void 0, function* ({ body }) {
|
|
447
450
|
const { resourceId } = body;
|
|
448
451
|
if (!this.adminforth.statuses.dbDiscover) {
|
|
449
452
|
return { error: 'Database discovery not started' };
|
|
@@ -472,7 +475,7 @@ export default class AdminForthRestAPI {
|
|
|
472
475
|
server.endpoint({
|
|
473
476
|
method: 'POST',
|
|
474
477
|
path: '/create_record',
|
|
475
|
-
handler: (
|
|
478
|
+
handler: (_1) => __awaiter(this, [_1], void 0, function* ({ body, adminUser }) {
|
|
476
479
|
const resource = this.adminforth.config.resources.find((res) => res.resourceId == body['resourceId']);
|
|
477
480
|
if (!resource) {
|
|
478
481
|
return { error: `Resource '${body['resourceId']}' not found` };
|
|
@@ -496,8 +499,8 @@ export default class AdminForthRestAPI {
|
|
|
496
499
|
server.endpoint({
|
|
497
500
|
method: 'POST',
|
|
498
501
|
path: '/update_record',
|
|
499
|
-
handler: (
|
|
500
|
-
var
|
|
502
|
+
handler: (_2) => __awaiter(this, [_2], void 0, function* ({ body, adminUser }) {
|
|
503
|
+
var _3, _4, _5, _6;
|
|
501
504
|
const resource = this.adminforth.config.resources.find((res) => res.resourceId == body['resourceId']);
|
|
502
505
|
if (!resource) {
|
|
503
506
|
return { error: `Resource '${body['resourceId']}' not found` };
|
|
@@ -516,7 +519,7 @@ export default class AdminForthRestAPI {
|
|
|
516
519
|
return { error };
|
|
517
520
|
}
|
|
518
521
|
// execute hook if needed
|
|
519
|
-
for (const hook of listify((
|
|
522
|
+
for (const hook of listify((_4 = (_3 = resource.hooks) === null || _3 === void 0 ? void 0 : _3.edit) === null || _4 === void 0 ? void 0 : _4.beforeSave)) {
|
|
520
523
|
const resp = yield hook({ resource, record, adminUser });
|
|
521
524
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
522
525
|
throw new Error(`Hook beforeSave must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -543,7 +546,7 @@ export default class AdminForthRestAPI {
|
|
|
543
546
|
yield connector.updateRecord({ resource, recordId, newValues });
|
|
544
547
|
}
|
|
545
548
|
// execute hook if needed
|
|
546
|
-
for (const hook of listify((
|
|
549
|
+
for (const hook of listify((_6 = (_5 = resource.hooks) === null || _5 === void 0 ? void 0 : _5.edit) === null || _6 === void 0 ? void 0 : _6.afterSave)) {
|
|
547
550
|
const resp = yield hook({ resource, record, adminUser, oldRecord });
|
|
548
551
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
549
552
|
throw new Error(`Hook afterSave must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -560,8 +563,8 @@ export default class AdminForthRestAPI {
|
|
|
560
563
|
server.endpoint({
|
|
561
564
|
method: 'POST',
|
|
562
565
|
path: '/delete_record',
|
|
563
|
-
handler: (
|
|
564
|
-
var
|
|
566
|
+
handler: (_7) => __awaiter(this, [_7], void 0, function* ({ body, adminUser }) {
|
|
567
|
+
var _8, _9, _10, _11;
|
|
565
568
|
const resource = this.adminforth.config.resources.find((res) => res.resourceId == body['resourceId']);
|
|
566
569
|
const record = yield this.adminforth.connectors[resource.dataSource].getRecordByPrimaryKey(resource, body['primaryKey']);
|
|
567
570
|
if (!resource) {
|
|
@@ -579,7 +582,7 @@ export default class AdminForthRestAPI {
|
|
|
579
582
|
return { error };
|
|
580
583
|
}
|
|
581
584
|
// execute hook if needed
|
|
582
|
-
for (const hook of listify((
|
|
585
|
+
for (const hook of listify((_9 = (_8 = resource.hooks) === null || _8 === void 0 ? void 0 : _8.delete) === null || _9 === void 0 ? void 0 : _9.beforeSave)) {
|
|
583
586
|
const resp = yield hook({ resource, record, adminUser });
|
|
584
587
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
585
588
|
throw new Error(`Hook beforeSave must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -591,7 +594,7 @@ export default class AdminForthRestAPI {
|
|
|
591
594
|
const connector = this.adminforth.connectors[resource.dataSource];
|
|
592
595
|
yield connector.deleteRecord({ resource, recordId: body['primaryKey'] });
|
|
593
596
|
// execute hook if needed
|
|
594
|
-
for (const hook of listify((
|
|
597
|
+
for (const hook of listify((_11 = (_10 = resource.hooks) === null || _10 === void 0 ? void 0 : _10.delete) === null || _11 === void 0 ? void 0 : _11.afterSave)) {
|
|
595
598
|
const resp = yield hook({ resource, record, adminUser });
|
|
596
599
|
if (!resp || (!resp.ok && !resp.error)) {
|
|
597
600
|
throw new Error(`Hook afterSave must return object with {ok: true} or { error: 'Error' } `);
|
|
@@ -608,7 +611,7 @@ export default class AdminForthRestAPI {
|
|
|
608
611
|
server.endpoint({
|
|
609
612
|
method: 'POST',
|
|
610
613
|
path: '/start_bulk_action',
|
|
611
|
-
handler: (
|
|
614
|
+
handler: (_12) => __awaiter(this, [_12], void 0, function* ({ body, adminUser }) {
|
|
612
615
|
const { resourceId, actionId, recordIds } = body;
|
|
613
616
|
const resource = this.adminforth.config.resources.find((res) => res.resourceId == resourceId);
|
|
614
617
|
if (!resource) {
|
package/dist/modules/styles.js
CHANGED
|
@@ -7,11 +7,11 @@ export const styles = () => ({
|
|
|
7
7
|
lightNavbarTextHover: "alias:lightNavbarText darken", // navbar text hover
|
|
8
8
|
lightNavbarTextActive: "alias:lightNavbarText darken", // navbar text active
|
|
9
9
|
lightNavbarIcons: "alias:lightNavbarText opacity:0.7", // navbar icons
|
|
10
|
-
lightSidebar: "#
|
|
11
|
-
lightSidebarBorder: "alias:lightSidebarText opacity:0.
|
|
12
|
-
lightSidebarItemHover: "alias:lightSidebarText opacity:0.
|
|
13
|
-
lightSidebarItemActive: "alias:lightSidebarText opacity:0.
|
|
14
|
-
lightSidebarText: "#
|
|
10
|
+
lightSidebar: "#f9fafb", // sidebar background
|
|
11
|
+
lightSidebarBorder: "alias:lightSidebarText opacity:0.05", // sidebar right border
|
|
12
|
+
lightSidebarItemHover: "alias:lightSidebarText opacity:0.05", // sidebar list item hover
|
|
13
|
+
lightSidebarItemActive: "alias:lightSidebarText opacity:0.05", // sidebar list item active
|
|
14
|
+
lightSidebarText: "#213045", // sidebar list item text
|
|
15
15
|
lightSidebarTextHover: "alias:lightSidebarText darken", // sidebar list item text hover
|
|
16
16
|
lightSidebarTextActive: "alias:lightSidebarText darken", // sidebar list item text active
|
|
17
17
|
lightSidebarDevider: "alias:lightSidebarText opacity:0.3", // sidebar devider
|
|
@@ -21,7 +21,7 @@ export const styles = () => ({
|
|
|
21
21
|
lightList: "#FFFFFF", // list view background
|
|
22
22
|
lightListTable: "#FFFFFF", // list view table background
|
|
23
23
|
lightListTableHeading: "alias:lightListTableHeadingText opacity:0.04", // list view table heading
|
|
24
|
-
lightListTableHeadingText: "#
|
|
24
|
+
lightListTableHeadingText: "#43445B", // list view table heading text
|
|
25
25
|
lightListTableText: "#333333", // list view table text
|
|
26
26
|
lightListTableRowHover: "rgb(249 250 251)", // list view row hover
|
|
27
27
|
lightListBreadcrumbsText: "#666666", // list view breadcrumbs text
|
|
@@ -81,12 +81,14 @@ export const styles = () => ({
|
|
|
81
81
|
customLight: "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
|
|
82
82
|
headerShadow: "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
|
|
83
83
|
listTableShadow: "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
|
|
84
|
-
|
|
84
|
+
darkListTableShadow: "0 4px 8px rgba(0, 0, 0, 0.3)", // Lighter shadow
|
|
85
|
+
resourseFormShadow: "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
|
|
86
|
+
darkResourseFormShadow: "0 4px 8px rgba(0, 0, 0, 0.3)", // Lighter shadow
|
|
85
87
|
},
|
|
86
88
|
fontSize: {
|
|
87
89
|
"headerText-size": "1rem"
|
|
88
90
|
},
|
|
89
91
|
borderRadius: {
|
|
90
|
-
"default": "
|
|
92
|
+
"default": ".5rem"
|
|
91
93
|
}
|
|
92
94
|
});
|
package/dist/spa/spa/src/App.vue
CHANGED
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
</aside>
|
|
110
110
|
|
|
111
111
|
|
|
112
|
-
<div class="sm:ml-64
|
|
112
|
+
<div class="sm:ml-64" v-if="loggedIn && routerIsReady && loginRedirectCheckIsReady">
|
|
113
113
|
<div class="p-0 dark:border-gray-700 mt-14">
|
|
114
114
|
<RouterView/>
|
|
115
115
|
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<!-- drawer component -->
|
|
3
3
|
<div id="drawer-navigation"
|
|
4
4
|
|
|
5
|
-
class="fixed right-0 z-50 p-4 overflow-y-auto transition-transform translate-x-full bg-white w-80 dark:bg-gray-800 shadow-xl dark:shadow-
|
|
5
|
+
class="fixed right-0 z-50 p-4 overflow-y-auto transition-transform translate-x-full bg-white w-80 dark:bg-gray-800 shadow-xl dark:shadow-gray-900"
|
|
6
6
|
|
|
7
7
|
:class="show ? 'top-0 transform-none' : ''"
|
|
8
8
|
tabindex="-1" aria-labelledby="drawer-navigation-label"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="rounded-default">
|
|
3
3
|
<div
|
|
4
|
-
class="relative shadow-resourseFormShadow sm:rounded-lg dark:shadow-2xl
|
|
4
|
+
class="relative shadow-resourseFormShadow dark:shadow-darkResourseFormShadow sm:rounded-lg dark:shadow-2xl rounded-default"
|
|
5
5
|
>
|
|
6
6
|
<form autocomplete="off" @submit.prevent>
|
|
7
7
|
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 ">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- table -->
|
|
3
|
-
<div class="relative overflow-x-auto shadow-listTableShadow dark:shadow-
|
|
3
|
+
<div class="relative overflow-x-auto shadow-listTableShadow dark:shadow-darkListTableShadow overflow-y-hidden rounded-default">
|
|
4
4
|
|
|
5
5
|
<!-- skelet loader -->
|
|
6
6
|
<div role="status" v-if="!resource || !resource.columns"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
</thead>
|
|
56
56
|
<tbody>
|
|
57
57
|
<SkeleteLoader v-if="!rows" :columns="3" :rows="resource?.columns.length + 2"/>
|
|
58
|
-
<tr v-else-if="rows.length === 0" class="bg-lightListTable
|
|
58
|
+
<tr v-else-if="rows.length === 0" class="bg-lightListTable dark:bg-darkListTable dark:border-darkListTableBorder">
|
|
59
59
|
<td :colspan="resource?.columns.length + 2">
|
|
60
60
|
|
|
61
61
|
<div id="toast-simple"
|
|
@@ -69,7 +69,9 @@
|
|
|
69
69
|
</tr>
|
|
70
70
|
|
|
71
71
|
<tr @click="onClick($event,row)" v-else v-for="(row, rowI) in rows" :key="row.id"
|
|
72
|
-
class="bg-lightListTable
|
|
72
|
+
class="bg-lightListTable dark:bg-darkListTable border-lightListBorder dark:border-gray-700 hover:bg-lightListTableRowHover dark:hover:bg-darkListTableRowHover cursor-pointer"
|
|
73
|
+
:class="{'border-b': rowI !== rows.length - 1}"
|
|
74
|
+
>
|
|
73
75
|
<td class="w-4 p-4 cursor-default" @click="(e)=>{e.stopPropagation()}">
|
|
74
76
|
<div class="flex items center ">
|
|
75
77
|
<input
|
|
@@ -59,7 +59,7 @@ export default class ConfigValidator implements IConfigValidator {
|
|
|
59
59
|
throw new Error('rootUser.password is required');
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
console.log('\n
|
|
62
|
+
console.log('\n ☝️☝️☝️ [INSECURE ALERT] config.rootUser is set, please create a new user to login in backoffice and remove config.rootUser from config ASAP when you are in production\n');
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
if (!this.config.customization.customComponentsDir) {
|
package/modules/restApi.ts
CHANGED
|
@@ -42,7 +42,10 @@ export default class AdminForthRestAPI {
|
|
|
42
42
|
let toReturn: { ok: boolean, redirectTo?: string, allowedLogin:boolean } = { ok: true, allowedLogin:true};
|
|
43
43
|
|
|
44
44
|
let token;
|
|
45
|
-
if (
|
|
45
|
+
if (this.adminforth.config.rootUser
|
|
46
|
+
&& username === this.adminforth.config.rootUser.username
|
|
47
|
+
&& password === this.adminforth.config.rootUser.password
|
|
48
|
+
) {
|
|
46
49
|
this.adminforth.auth.setAuthCookie({ response, username, pk: null });
|
|
47
50
|
adminUser = { isRoot: true, dbUser: null, pk: null, username: this.adminforth.config.rootUser.username};
|
|
48
51
|
} else {
|
|
@@ -160,7 +163,8 @@ export default class AdminForthRestAPI {
|
|
|
160
163
|
let username = ''
|
|
161
164
|
let userFullName = ''
|
|
162
165
|
if (adminUser.isRoot) {
|
|
163
|
-
|
|
166
|
+
// isRoot can be in JWT token still when rootUser deleted, so we check for rootUser?"
|
|
167
|
+
username = this.adminforth.config.rootUser?.username || 'RootUser';
|
|
164
168
|
} else {
|
|
165
169
|
const dbUser = adminUser.dbUser;
|
|
166
170
|
username = dbUser[this.adminforth.config.auth.usernameField];
|
package/modules/styles.ts
CHANGED
|
@@ -11,11 +11,11 @@ export const styles = () => ({
|
|
|
11
11
|
lightNavbarTextActive: "alias:lightNavbarText darken", // navbar text active
|
|
12
12
|
lightNavbarIcons: "alias:lightNavbarText opacity:0.7", // navbar icons
|
|
13
13
|
|
|
14
|
-
lightSidebar: "#
|
|
15
|
-
lightSidebarBorder: "alias:lightSidebarText opacity:0.
|
|
16
|
-
lightSidebarItemHover: "alias:lightSidebarText opacity:0.
|
|
17
|
-
lightSidebarItemActive: "alias:lightSidebarText opacity:0.
|
|
18
|
-
lightSidebarText: "#
|
|
14
|
+
lightSidebar: "#f9fafb", // sidebar background
|
|
15
|
+
lightSidebarBorder: "alias:lightSidebarText opacity:0.05", // sidebar right border
|
|
16
|
+
lightSidebarItemHover: "alias:lightSidebarText opacity:0.05", // sidebar list item hover
|
|
17
|
+
lightSidebarItemActive: "alias:lightSidebarText opacity:0.05", // sidebar list item active
|
|
18
|
+
lightSidebarText: "#213045", // sidebar list item text
|
|
19
19
|
lightSidebarTextHover: "alias:lightSidebarText darken", // sidebar list item text hover
|
|
20
20
|
lightSidebarTextActive: "alias:lightSidebarText darken", // sidebar list item text active
|
|
21
21
|
lightSidebarDevider: "alias:lightSidebarText opacity:0.3", // sidebar devider
|
|
@@ -26,7 +26,7 @@ export const styles = () => ({
|
|
|
26
26
|
lightList: "#FFFFFF", // list view background
|
|
27
27
|
lightListTable: "#FFFFFF", // list view table background
|
|
28
28
|
lightListTableHeading: "alias:lightListTableHeadingText opacity:0.04", // list view table heading
|
|
29
|
-
lightListTableHeadingText: "#
|
|
29
|
+
lightListTableHeadingText: "#43445B", // list view table heading text
|
|
30
30
|
lightListTableText: "#333333", // list view table text
|
|
31
31
|
lightListTableRowHover: "rgb(249 250 251)", // list view row hover
|
|
32
32
|
lightListBreadcrumbsText: "#666666", // list view breadcrumbs text
|
|
@@ -97,13 +97,16 @@ export const styles = () => ({
|
|
|
97
97
|
customLight: "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
|
|
98
98
|
headerShadow: "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
|
|
99
99
|
listTableShadow: "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
|
|
100
|
-
|
|
100
|
+
darkListTableShadow: "0 4px 8px rgba(0, 0, 0, 0.3)", // Lighter shadow
|
|
101
|
+
resourseFormShadow: "0 4px 8px rgba(0, 0, 0, 0.1)", // Lighter shadow
|
|
102
|
+
darkResourseFormShadow: "0 4px 8px rgba(0, 0, 0, 0.3)", // Lighter shadow
|
|
103
|
+
|
|
101
104
|
},
|
|
102
105
|
fontSize: {
|
|
103
106
|
"headerText-size": "1rem"
|
|
104
107
|
},
|
|
105
108
|
borderRadius: {
|
|
106
|
-
"default": "
|
|
109
|
+
"default": ".5rem"
|
|
107
110
|
}
|
|
108
111
|
});
|
|
109
112
|
|
package/package.json
CHANGED
package/spa/src/App.vue
CHANGED
|
@@ -109,7 +109,7 @@
|
|
|
109
109
|
</aside>
|
|
110
110
|
|
|
111
111
|
|
|
112
|
-
<div class="sm:ml-64
|
|
112
|
+
<div class="sm:ml-64" v-if="loggedIn && routerIsReady && loginRedirectCheckIsReady">
|
|
113
113
|
<div class="p-0 dark:border-gray-700 mt-14">
|
|
114
114
|
<RouterView/>
|
|
115
115
|
</div>
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
<!-- drawer component -->
|
|
3
3
|
<div id="drawer-navigation"
|
|
4
4
|
|
|
5
|
-
class="fixed right-0 z-50 p-4 overflow-y-auto transition-transform translate-x-full bg-white w-80 dark:bg-gray-800 shadow-xl dark:shadow-
|
|
5
|
+
class="fixed right-0 z-50 p-4 overflow-y-auto transition-transform translate-x-full bg-white w-80 dark:bg-gray-800 shadow-xl dark:shadow-gray-900"
|
|
6
6
|
|
|
7
7
|
:class="show ? 'top-0 transform-none' : ''"
|
|
8
8
|
tabindex="-1" aria-labelledby="drawer-navigation-label"
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<div class="rounded-default">
|
|
3
3
|
<div
|
|
4
|
-
class="relative shadow-resourseFormShadow sm:rounded-lg dark:shadow-2xl
|
|
4
|
+
class="relative shadow-resourseFormShadow dark:shadow-darkResourseFormShadow sm:rounded-lg dark:shadow-2xl rounded-default"
|
|
5
5
|
>
|
|
6
6
|
<form autocomplete="off" @submit.prevent>
|
|
7
7
|
<table class="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400 ">
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<template>
|
|
2
2
|
<!-- table -->
|
|
3
|
-
<div class="relative overflow-x-auto shadow-listTableShadow dark:shadow-
|
|
3
|
+
<div class="relative overflow-x-auto shadow-listTableShadow dark:shadow-darkListTableShadow overflow-y-hidden rounded-default">
|
|
4
4
|
|
|
5
5
|
<!-- skelet loader -->
|
|
6
6
|
<div role="status" v-if="!resource || !resource.columns"
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
</thead>
|
|
56
56
|
<tbody>
|
|
57
57
|
<SkeleteLoader v-if="!rows" :columns="3" :rows="resource?.columns.length + 2"/>
|
|
58
|
-
<tr v-else-if="rows.length === 0" class="bg-lightListTable
|
|
58
|
+
<tr v-else-if="rows.length === 0" class="bg-lightListTable dark:bg-darkListTable dark:border-darkListTableBorder">
|
|
59
59
|
<td :colspan="resource?.columns.length + 2">
|
|
60
60
|
|
|
61
61
|
<div id="toast-simple"
|
|
@@ -69,7 +69,9 @@
|
|
|
69
69
|
</tr>
|
|
70
70
|
|
|
71
71
|
<tr @click="onClick($event,row)" v-else v-for="(row, rowI) in rows" :key="row.id"
|
|
72
|
-
class="bg-lightListTable
|
|
72
|
+
class="bg-lightListTable dark:bg-darkListTable border-lightListBorder dark:border-gray-700 hover:bg-lightListTableRowHover dark:hover:bg-darkListTableRowHover cursor-pointer"
|
|
73
|
+
:class="{'border-b': rowI !== rows.length - 1}"
|
|
74
|
+
>
|
|
73
75
|
<td class="w-4 p-4 cursor-default" @click="(e)=>{e.stopPropagation()}">
|
|
74
76
|
<div class="flex items center ">
|
|
75
77
|
<input
|