adminizer 4.1.0-commit.ad1476a → 4.1.1
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/Readme.md +46 -0
- package/assets/{VanillaJSONEditor-FUe77pIA.js → VanillaJSONEditor-DfRefswH.js} +104 -104
- package/assets/add-CJ1-zeA1.js +1 -0
- package/assets/add-form-CbNl0wdS.js +1 -0
- package/assets/add-group-form-Bt_Dx9wm.js +1 -0
- package/assets/add-group-pIFJV5qL.js +1 -0
- package/assets/add-user-D2US8hL_.js +1 -0
- package/assets/add-user-form-Bt8Jy6S2.js +1 -0
- package/assets/{app-DMmad2-f.css → app-B6cCPfWk.css} +1 -1
- package/assets/app-layout-B86jl9bH.js +1 -0
- package/assets/app-shell-CiGyzQ0C.js +1 -0
- package/assets/app-sidebar-Bz-SRwBg.js +1 -0
- package/assets/app-sidebar-header-7CNCx7Rs.js +11 -0
- package/assets/app.js +45 -37
- package/assets/breadcrumbs-_jhtTcOi.js +1 -0
- package/assets/catalog-CON6moaA.js +16 -0
- package/assets/catalog-Cc6Mk9sX.css +1 -0
- package/assets/checkbox-CQdZw5mb.js +1 -0
- package/assets/dashboard-BOltB2Hq.css +1 -0
- package/assets/dashboard-es9ZT8qk.js +3 -0
- package/assets/{date-picker-B__dVVqj.js → date-picker-Dz-d-YWX.js} +2 -2
- package/assets/debounce-qdyXyOeG.js +1 -0
- package/assets/del-modal-D0mrZvki.js +11 -0
- package/assets/dialog-stack-BiMbfm58.js +1 -0
- package/assets/dropdown-menu-BSBcRiXx.js +1 -0
- package/assets/{field-renderer-CapylJU9.js → field-renderer-B6hFAeiU.js} +3 -3
- package/assets/form-Buslty7y.js +1 -0
- package/assets/form-aqiRmPix.js +1 -0
- package/assets/{geo-json-CwteYDGB.js → geo-json-BKmYmu3d.js} +2 -2
- package/assets/{handsontable-BCnjOpBr.js → handsontable-B8xVeMAQ.js} +5 -5
- package/assets/home-Dr72Jk-w.js +2 -0
- package/assets/icon-B-a7xg54.js +1 -0
- package/assets/index-B68_akQe.js +1 -0
- package/assets/index-B7-xTDyy.js +1 -0
- package/assets/index-BJFFlCSo.js +1 -0
- package/assets/{index-DTRTjOmh.js → index-BOuMo_nl.js} +3 -3
- package/assets/index-BzOcGsBq.js +1 -0
- package/assets/index-CFbQ2Rv0.js +1 -0
- package/assets/{index-D5ir9iUV.js → index-Cq31rrfZ.js} +1 -1
- package/assets/{index-BcE9FUM6.js → index-D5UDXTFs.js} +1 -1
- package/assets/index-oxIQWAdI.js +41 -0
- package/assets/init-user-5H689LP0.js +1 -0
- package/assets/input-CSJjrf2i.js +1 -0
- package/assets/input-error-CK92Shhm.js +1 -0
- package/assets/label-Muj0-Efy.js +1 -0
- package/assets/list-Cvh7zbyG.js +1 -0
- package/assets/list-table-Bs_vbQiV.js +52 -0
- package/assets/login-DliJrjMQ.js +6 -0
- package/assets/manifest.json +589 -666
- package/assets/material-icon-BRS58Qpk.js +1 -0
- package/assets/module-CjG21VCT.js +1 -0
- package/assets/{monaco-editor-DqAqwxw4.js → monaco-editor-9fDiyfuW.js} +2 -2
- package/assets/{multi-select-oabtVhUP.js → multi-select-CMQIJ0JT.js} +2 -2
- package/assets/nav-footer-IGMn9NiE.js +1 -0
- package/assets/nav-main-DBE4rMiZ.js +1 -0
- package/assets/nav-user-CjyLRyq-.js +1 -0
- package/assets/pagination-render-DUAq2klc.js +1 -0
- package/assets/popover-C_cww-4_.js +1 -0
- package/assets/register-UzQn3J0g.js +1 -0
- package/assets/{select-D1N8zRPY.js → select-DzBno-dc.js} +2 -2
- package/assets/{sidebar-4D-sX2l4.js → sidebar-Dc4iqfu-.js} +2 -2
- package/assets/skeleton-Dkmj2o2Z.js +1 -0
- package/assets/sonner-De1t71Gj.js +1 -0
- package/assets/{toast-editor-FbrFd1ft.js → toast-editor-1Pul3oMs.js} +2 -2
- package/assets/tooltip-CwPrC-HD.js +1 -0
- package/assets/use-appearance-J8J2w43p.js +1 -0
- package/assets/use-window-size-DLSEoR6e.js +1 -0
- package/assets/{user-info-DBYoAJYJ.js → user-info-8RyDk7qh.js} +2 -2
- package/assets/user-menu-content-CpxTLH56.js +6 -0
- package/assets/welcome-BYKI6yO-.js +1 -0
- package/controllers/add.js +10 -10
- package/controllers/addGroup.js +2 -4
- package/controllers/addUser.js +4 -6
- package/controllers/catalog/Catalog.d.ts +1 -1
- package/controllers/catalog/Catalog.js +42 -37
- package/controllers/catalog/FrontentCatalogAdapter.d.ts +36 -26
- package/controllers/catalog/FrontentCatalogAdapter.js +71 -73
- package/controllers/ckeditorUpload.js +2 -3
- package/controllers/dashboard.js +16 -2
- package/controllers/edit.js +10 -14
- package/controllers/editGroup.js +2 -4
- package/controllers/editUser.js +3 -5
- package/controllers/form.js +2 -3
- package/controllers/getAllWidgets.js +3 -3
- package/controllers/initUser.js +1 -2
- package/controllers/list.js +6 -6
- package/controllers/login.js +43 -18
- package/controllers/media-manager/mediaManagerAdapter.js +1 -2
- package/controllers/media-manager/mediaManagerApi.js +2 -2
- package/controllers/navigation/edit.js +2 -2
- package/controllers/register.js +1 -4
- package/controllers/remove.js +3 -3
- package/controllers/timezones.js +1 -1
- package/controllers/view.js +3 -3
- package/controllers/welcome.js +1 -1
- package/controllers/widgets/Action.js +2 -2
- package/controllers/widgets/Custom.js +2 -2
- package/controllers/widgets/Info.js +2 -2
- package/controllers/widgets/switch.js +2 -2
- package/controllers/widgetsDB.js +5 -5
- package/helpers/JsUtils.d.ts +1 -0
- package/helpers/JsUtils.js +3 -0
- package/helpers/accessRightsHelper.d.ts +6 -2
- package/helpers/accessRightsHelper.js +28 -5
- package/helpers/configHelper.js +2 -1
- package/helpers/controllerHelper.js +39 -18
- package/helpers/fieldsHelper.d.ts +4 -3
- package/helpers/fieldsHelper.js +5 -1
- package/helpers/inertiaActionsHelper.js +1 -1
- package/helpers/inertiaAddHelper.d.ts +3 -4
- package/helpers/inertiaAddHelper.js +27 -7
- package/helpers/inertiaFromHelper.js +2 -0
- package/helpers/inertiaGroupHelper.d.ts +4 -2
- package/helpers/inertiaGroupHelper.js +1 -1
- package/helpers/inertiaListHelper.js +5 -5
- package/helpers/inertiaMenuHelper.d.ts +1 -1
- package/helpers/inertiaMenuHelper.js +2 -2
- package/helpers/inertiaUserHelper.d.ts +7 -1
- package/helpers/inertiaUserHelper.js +5 -1
- package/helpers/menuHelper.d.ts +8 -3
- package/helpers/menuHelper.js +26 -17
- package/index.d.ts +6 -3
- package/index.js +9 -3
- package/interfaces/adminpanelConfig.d.ts +41 -32
- package/interfaces/global.d.ts +10 -28
- package/interfaces/types.d.ts +1 -1
- package/lib/Adminizer.d.ts +11 -3
- package/lib/Adminizer.js +49 -17
- package/lib/media-manager/AbstractMediaManager.d.ts +2 -2
- package/lib/media-manager/AbstractMediaManager.js +1 -1
- package/lib/media-manager/Items.js +0 -3
- package/lib/requestProcessor.js +10 -3
- package/lib/v4/DataAccessor.d.ts +5 -2
- package/lib/v4/DataAccessor.js +44 -19
- package/lib/v4/I18n.js +2 -0
- package/lib/v4/POWCaptcha.js +0 -1
- package/lib/v4/PolicyManager.js +0 -1
- package/lib/{catalog → v4/catalog}/AbstractCatalog.d.ts +89 -60
- package/lib/{catalog → v4/catalog}/AbstractCatalog.js +59 -55
- package/lib/v4/catalog/Navigation.d.ts +43 -0
- package/lib/v4/catalog/Navigation.js +457 -0
- package/lib/{controls → v4/controls}/AbstractControls.d.ts +1 -1
- package/lib/{controls → v4/controls}/codeEditor/MonacoEditor.d.ts +1 -1
- package/lib/{controls → v4/controls}/geojsoneditor/GeoEditor.d.ts +1 -1
- package/lib/{controls → v4/controls}/jsoneditor/JsonEditor.d.ts +1 -1
- package/lib/{controls → v4/controls}/markdown/ToastUiEditor.d.ts +1 -1
- package/lib/{controls → v4/controls}/table/Handsontable.d.ts +1 -1
- package/lib/{controls → v4/controls}/wysiwyg/CKeditor.d.ts +1 -1
- package/lib/{datatable → v4/datatable}/NodeTable.d.ts +3 -3
- package/lib/{datatable → v4/datatable}/NodeTable.js +8 -8
- package/lib/v4/helper/jwt.d.ts +10 -0
- package/lib/v4/helper/jwt.js +18 -0
- package/lib/{inertia → v4/inertia}/inertiaAdapter.js +0 -1
- package/lib/v4/model/AbstractModel.d.ts +5 -1
- package/lib/v4/model/AbstractModel.js +2 -3
- package/lib/v4/model/ModelHandler.js +1 -4
- package/lib/v4/model/adapter/sequelize.d.ts +11 -2
- package/lib/v4/model/adapter/sequelize.js +451 -118
- package/lib/v4/model/adapter/waterline.js +5 -3
- package/lib/{widgets → v4/widgets}/abstractAction.d.ts +1 -1
- package/lib/v4/widgets/abstractCustom.d.ts +28 -0
- package/lib/v4/widgets/abstractCustom.js +9 -0
- package/lib/{widgets → v4/widgets}/abstractInfo.d.ts +1 -1
- package/lib/{widgets → v4/widgets}/abstractInfo.js +1 -1
- package/lib/{widgets → v4/widgets}/abstractLink.d.ts +2 -1
- package/lib/{widgets → v4/widgets}/abstractSwitch.d.ts +1 -1
- package/lib/{widgets → v4/widgets}/abstractWidgetBase.d.ts +2 -2
- package/lib/{widgets → v4/widgets}/widgetHandler.d.ts +29 -5
- package/lib/{widgets → v4/widgets}/widgetHandler.js +25 -25
- package/models/GroupAP.d.ts +8 -0
- package/models/NavigationAP.d.ts +7 -3
- package/models/NavigationAP.js +5 -6
- package/models/UserAP.d.ts +24 -2
- package/models/UserAP.js +2 -2
- package/package.json +29 -11
- package/policies/checkAuth.js +4 -3
- package/policies/setLocale.js +2 -2
- package/system/Router.js +14 -17
- package/system/bindAccessRights.js +0 -4
- package/system/bindAuthorization.js +4 -5
- package/system/bindControls.js +6 -6
- package/system/bindDev.js +1 -0
- package/system/bindInertia.js +17 -12
- package/system/bindMediaManager.js +0 -1
- package/system/bindModels.js +9 -6
- package/system/bindNavigation.d.ts +2 -0
- package/system/bindNavigation.js +42 -42
- package/system/bindReqFunctions.js +15 -0
- package/system/defaults.js +13 -6
- package/translations/ar.json +70 -1
- package/translations/cn.json +70 -1
- package/translations/de.json +71 -3
- package/translations/en.json +70 -102
- package/translations/es.json +70 -1
- package/translations/fr.json +70 -1
- package/translations/hi.json +70 -1
- package/translations/jp.json +70 -1
- package/translations/ko.json +70 -1
- package/translations/pt.json +70 -1
- package/translations/ru.json +71 -94
- package/translations/ua.json +70 -1
- package/translations/uz.json +72 -0
- package/translations/vi.json +70 -1
- package/assets/add-ZITr43GJ.js +0 -1
- package/assets/add-form-CYOfr0Ef.js +0 -1
- package/assets/add-group-B332wN8K.js +0 -1
- package/assets/add-group-form-dzadPSfL.js +0 -1
- package/assets/add-user-TC-mYdsB.js +0 -1
- package/assets/add-user-form-y2f_1_lM.js +0 -1
- package/assets/app-layout-D1m9Kvxq.js +0 -1
- package/assets/app-shell-BWMRMkHM.js +0 -1
- package/assets/app-sidebar-BCtaEFGb.js +0 -1
- package/assets/app-sidebar-header-DLAFi13E.js +0 -11
- package/assets/breadcrumbs-CQNon4Vl.js +0 -1
- package/assets/button-CQ9t1kLz.js +0 -1
- package/assets/checkbox-W0nGAXIj.js +0 -1
- package/assets/compiler-runtime-tM4jBQ-T.js +0 -9
- package/assets/dashboard-BR602KhL.js +0 -1
- package/assets/dropdown-menu-SEBnEIiL.js +0 -1
- package/assets/form-DOUNk3o2.js +0 -1
- package/assets/form-lOKv4Qbw.js +0 -1
- package/assets/home-Ch6QfTIt.js +0 -2
- package/assets/icon-Bz9BMaD0.js +0 -1
- package/assets/index-BC0yfOHo.js +0 -1
- package/assets/index-BbXEMx9n.js +0 -1
- package/assets/index-C0SL3SHw.js +0 -41
- package/assets/index-Cdb9ACvz.js +0 -1
- package/assets/index-DEk3sC8d.js +0 -1
- package/assets/index-DrWfGwtf.js +0 -1
- package/assets/index-K81GbF6O.js +0 -1
- package/assets/init-user-D9mW-g14.js +0 -1
- package/assets/input-DF7Ue23C.js +0 -1
- package/assets/input-error-BBygona6.js +0 -1
- package/assets/label-Z506NKsW.js +0 -1
- package/assets/list-Qyd7ecQH.js +0 -1
- package/assets/list-table-DB1sEQLF.js +0 -62
- package/assets/login-DrGaTWhY.js +0 -6
- package/assets/material-icon-CItZiB53.js +0 -1
- package/assets/module-DBaykv8l.js +0 -1
- package/assets/nav-footer-CM-yHiRs.js +0 -1
- package/assets/nav-main-Q3xofGRT.js +0 -1
- package/assets/nav-user-Ds8i0Pa2.js +0 -1
- package/assets/pagination-render-B57pOpFy.js +0 -1
- package/assets/popover-I249Gg2O.js +0 -1
- package/assets/register-C9FQIDtS.js +0 -1
- package/assets/sonner-Dzckw3U3.js +0 -1
- package/assets/tooltip-D2ehgLlB.js +0 -1
- package/assets/use-appearance-Co6mO0dV.js +0 -1
- package/assets/use-window-size-B8l6Bpkf.js +0 -1
- package/assets/user-menu-content-qkvdkUVd.js +0 -6
- package/assets/utils-DjqsqOe8.js +0 -1
- package/assets/welcome-D2adQ8EU.js +0 -1
- package/controllers/processInstallFinalize.d.ts +0 -1
- package/controllers/processInstallFinalize.js +0 -16
- package/controllers/processInstallStep.d.ts +0 -1
- package/controllers/processInstallStep.js +0 -132
- package/lib/catalog/Navigation.d.ts +0 -0
- package/lib/catalog/Navigation.js +0 -532
- package/lib/installStepper/InstallStepAbstract.d.ts +0 -52
- package/lib/installStepper/InstallStepAbstract.js +0 -69
- package/lib/installStepper/finalizeStep.d.ts +0 -21
- package/lib/installStepper/finalizeStep.js +0 -48
- package/lib/installStepper/installStepper.d.ts +0 -40
- package/lib/installStepper/installStepper.js +0 -195
- package/lib/widgets/abstractCustom.d.ts +0 -13
- package/lib/widgets/abstractCustom.js +0 -3
- package/models/MediaManagerAP.d.ts +0 -46
- package/models/MediaManagerAP.js +0 -45
- package/models/MediaManagerAssociationsAP.d.ts +0 -28
- package/models/MediaManagerAssociationsAP.js +0 -27
- package/models/MediaManagerMetaAP.d.ts +0 -22
- package/models/MediaManagerMetaAP.js +0 -21
- package/system/bindInstallStepper.d.ts +0 -2
- package/system/bindInstallStepper.js +0 -23
- /package/lib/{catalog → v4/catalog}/CatalogHandler.d.ts +0 -0
- /package/lib/{catalog → v4/catalog}/CatalogHandler.js +0 -0
- /package/lib/{controls → v4/controls}/AbstractControls.js +0 -0
- /package/lib/{controls → v4/controls}/ControlsHandler.d.ts +0 -0
- /package/lib/{controls → v4/controls}/ControlsHandler.js +0 -0
- /package/lib/{controls → v4/controls}/codeEditor/MonacoEditor.js +0 -0
- /package/lib/{controls → v4/controls}/geojsoneditor/GeoEditor.js +0 -0
- /package/lib/{controls → v4/controls}/jsoneditor/JsonEditor.js +0 -0
- /package/lib/{controls → v4/controls}/markdown/ToastUiEditor.js +0 -0
- /package/lib/{controls → v4/controls}/table/Handsontable.js +0 -0
- /package/lib/{controls → v4/controls}/wysiwyg/CKeditor.js +0 -0
- /package/lib/{inertia → v4/inertia}/flash.d.ts +0 -0
- /package/lib/{inertia → v4/inertia}/flash.js +0 -0
- /package/lib/{inertia → v4/inertia}/inertiaAdapter.d.ts +0 -0
- /package/lib/{widgets → v4/widgets}/abstractAction.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractLink.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractSwitch.js +0 -0
- /package/lib/{widgets → v4/widgets}/abstractWidgetBase.js +0 -0
|
@@ -48,7 +48,6 @@ export class WaterlineModel extends AbstractModel {
|
|
|
48
48
|
query = query.limit(options.limit);
|
|
49
49
|
}
|
|
50
50
|
let result = await query;
|
|
51
|
-
console.log(result, "result");
|
|
52
51
|
return result;
|
|
53
52
|
}
|
|
54
53
|
async _updateOne(criteria, data) {
|
|
@@ -91,10 +90,13 @@ export class WaterlineAdapter extends AbstractAdapter {
|
|
|
91
90
|
/** Method that processes custom waterline model creation. Is used for system models. Replaces beforeCreate method in waterline */
|
|
92
91
|
static async registerSystemModels(waterlineORM) {
|
|
93
92
|
const systemModelsDir = path.resolve(import.meta.dirname, "../../../../models");
|
|
94
|
-
|
|
93
|
+
let systemModelsFiles = fs.readdirSync(systemModelsDir).filter(file => file.endsWith(".js"));
|
|
94
|
+
if (!systemModelsFiles.length) {
|
|
95
|
+
systemModelsFiles = fs.readdirSync(systemModelsDir).filter(file => file.endsWith(".ts") && !file.endsWith(".d.ts"));
|
|
96
|
+
}
|
|
95
97
|
// Register adminizer system models
|
|
96
98
|
await Promise.all(systemModelsFiles.map(async (file) => {
|
|
97
|
-
const modelName = path.basename(file
|
|
99
|
+
const modelName = path.basename(file).replace(/\.(ts|js)$/, "");
|
|
98
100
|
const systemModelPath = path.resolve(systemModelsDir, file);
|
|
99
101
|
const adminizerModel = (await import(pathToFileURL(systemModelPath).href)).default;
|
|
100
102
|
const waterlineLikeModel = generateWaterlineModel(modelName, adminizerModel);
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BaseWidget from "./abstractWidgetBase";
|
|
2
2
|
export default abstract class ActionBase extends BaseWidget {
|
|
3
3
|
readonly widgetType = "action";
|
|
4
|
-
/** Widget background css
|
|
4
|
+
/** Widget background css color */
|
|
5
5
|
abstract readonly backgroundCSS: string | null;
|
|
6
6
|
abstract action(): Promise<any>;
|
|
7
7
|
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { MaterialIcon } from "material-icons";
|
|
2
|
+
export default abstract class CustomBase {
|
|
3
|
+
/** Widget unique id */
|
|
4
|
+
abstract readonly id: string;
|
|
5
|
+
/** Widget Name */
|
|
6
|
+
abstract readonly name: string;
|
|
7
|
+
/** JS module file path */
|
|
8
|
+
abstract readonly jsPath: {
|
|
9
|
+
dev: string;
|
|
10
|
+
production: string;
|
|
11
|
+
};
|
|
12
|
+
/** For group access rights by department */
|
|
13
|
+
abstract readonly department: string;
|
|
14
|
+
/** Widget background css color */
|
|
15
|
+
readonly backgroundCSS: string;
|
|
16
|
+
/** Widget size */
|
|
17
|
+
abstract readonly size: {
|
|
18
|
+
h: number;
|
|
19
|
+
w: number;
|
|
20
|
+
} | null;
|
|
21
|
+
/** Widget description */
|
|
22
|
+
abstract readonly description: string;
|
|
23
|
+
/** Widget icon */
|
|
24
|
+
abstract readonly icon?: MaterialIcon | string;
|
|
25
|
+
readonly widgetType: 'custom';
|
|
26
|
+
routePrefix: string;
|
|
27
|
+
protected constructor(routePrefix: string);
|
|
28
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BaseWidget from "./abstractWidgetBase";
|
|
2
2
|
export default abstract class InfoBase extends BaseWidget {
|
|
3
3
|
readonly widgetType = "info";
|
|
4
|
-
/** Widget background css
|
|
4
|
+
/** Widget background css color */
|
|
5
5
|
readonly backgroundCSS: string;
|
|
6
6
|
/** Widget size */
|
|
7
7
|
readonly size: {
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import BaseWidget from "./abstractWidgetBase";
|
|
2
|
-
import { MaterialIcon } from "
|
|
2
|
+
import { MaterialIcon } from "../../../interfaces/MaaterialIcons";
|
|
3
3
|
export interface Links {
|
|
4
4
|
name: string;
|
|
5
5
|
description: string;
|
|
6
6
|
icon?: MaterialIcon;
|
|
7
7
|
link: string;
|
|
8
|
+
linkType: 'self' | 'blank';
|
|
8
9
|
backgroundCSS: string | null;
|
|
9
10
|
}
|
|
10
11
|
export default abstract class LinkBase extends BaseWidget {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import BaseWidget from "./abstractWidgetBase";
|
|
2
2
|
export default abstract class SwitchBase extends BaseWidget {
|
|
3
3
|
readonly widgetType = "switcher";
|
|
4
|
-
/** Widget background css
|
|
4
|
+
/** Widget background css color */
|
|
5
5
|
abstract readonly backgroundCSS: string | null;
|
|
6
6
|
/** Get current state */
|
|
7
7
|
abstract getState(): Promise<boolean>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MaterialIcon } from "
|
|
1
|
+
import { MaterialIcon } from "../../../interfaces/MaaterialIcons";
|
|
2
2
|
export default abstract class BaseWidget {
|
|
3
3
|
/** Widget unique id */
|
|
4
4
|
abstract readonly id: string;
|
|
@@ -23,5 +23,5 @@ export default abstract class BaseWidget {
|
|
|
23
23
|
/** Run task */
|
|
24
24
|
"action" |
|
|
25
25
|
/** Change location, or open in new tab */
|
|
26
|
-
"link"
|
|
26
|
+
"link";
|
|
27
27
|
}
|
|
@@ -3,8 +3,10 @@ import InfoBase from "./abstractInfo";
|
|
|
3
3
|
import ActionBase from "./abstractAction";
|
|
4
4
|
import LinkBase from "./abstractLink";
|
|
5
5
|
import CustomBase from "./abstractCustom";
|
|
6
|
-
import { AdminpanelIcon } from "
|
|
7
|
-
import { Adminizer } from "
|
|
6
|
+
import { AdminpanelIcon } from "../../../interfaces/adminpanelConfig";
|
|
7
|
+
import { Adminizer } from "../../Adminizer";
|
|
8
|
+
import { UserAP } from "models/UserAP";
|
|
9
|
+
import { I18n } from "../I18n";
|
|
8
10
|
export type WidgetType = (SwitcherBase | InfoBase | ActionBase | LinkBase | CustomBase);
|
|
9
11
|
export interface WidgetConfig {
|
|
10
12
|
id: string;
|
|
@@ -16,6 +18,7 @@ export interface WidgetConfig {
|
|
|
16
18
|
name: string;
|
|
17
19
|
backgroundCSS: string;
|
|
18
20
|
scriptUrl?: string;
|
|
21
|
+
linkType?: 'self' | 'blank';
|
|
19
22
|
constructorName?: string;
|
|
20
23
|
constructorOption?: any;
|
|
21
24
|
size?: {
|
|
@@ -25,6 +28,21 @@ export interface WidgetConfig {
|
|
|
25
28
|
added?: boolean;
|
|
26
29
|
hideAdminPanelUI?: boolean;
|
|
27
30
|
}
|
|
31
|
+
export interface WidgetLayoutItem {
|
|
32
|
+
x: number;
|
|
33
|
+
y: number;
|
|
34
|
+
w: number;
|
|
35
|
+
h: number;
|
|
36
|
+
i: string;
|
|
37
|
+
id: string;
|
|
38
|
+
}
|
|
39
|
+
export interface WidgetsLayouts {
|
|
40
|
+
lg: WidgetLayoutItem[];
|
|
41
|
+
md: WidgetLayoutItem[];
|
|
42
|
+
sm: WidgetLayoutItem[];
|
|
43
|
+
xs: WidgetLayoutItem[];
|
|
44
|
+
xxs: WidgetLayoutItem[];
|
|
45
|
+
}
|
|
28
46
|
export declare class WidgetHandler {
|
|
29
47
|
private widgets;
|
|
30
48
|
adminizer: Adminizer;
|
|
@@ -32,7 +50,13 @@ export declare class WidgetHandler {
|
|
|
32
50
|
add(widget: WidgetType): void;
|
|
33
51
|
getById(id: string): WidgetType | undefined;
|
|
34
52
|
removeById(id: string): void;
|
|
35
|
-
getAll(user:
|
|
36
|
-
getWidgetsDB(id: number, auth: boolean): Promise<
|
|
37
|
-
|
|
53
|
+
getAll(user: UserAP, i18n: I18n): Promise<WidgetConfig[]>;
|
|
54
|
+
getWidgetsDB(id: number, auth: boolean, i18n: I18n): Promise<{
|
|
55
|
+
widgets: WidgetConfig[];
|
|
56
|
+
layout: WidgetsLayouts;
|
|
57
|
+
}>;
|
|
58
|
+
setWidgetsDB(id: number, body: {
|
|
59
|
+
widgets: WidgetConfig[];
|
|
60
|
+
layout: WidgetLayoutItem[];
|
|
61
|
+
}, auth: boolean): Promise<number>;
|
|
38
62
|
}
|
|
@@ -3,6 +3,7 @@ import InfoBase from "./abstractInfo";
|
|
|
3
3
|
import ActionBase from "./abstractAction";
|
|
4
4
|
import LinkBase from "./abstractLink";
|
|
5
5
|
import CustomBase from "./abstractCustom";
|
|
6
|
+
import * as process from "node:process";
|
|
6
7
|
export class WidgetHandler {
|
|
7
8
|
widgets = [];
|
|
8
9
|
adminizer;
|
|
@@ -34,7 +35,7 @@ export class WidgetHandler {
|
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
}
|
|
37
|
-
getAll(user) {
|
|
38
|
+
getAll(user, i18n) {
|
|
38
39
|
let widgets = [];
|
|
39
40
|
if (this.widgets.length) {
|
|
40
41
|
let id_key = 0;
|
|
@@ -45,9 +46,9 @@ export class WidgetHandler {
|
|
|
45
46
|
id: `${widget.id}__${id_key}`,
|
|
46
47
|
type: widget.widgetType,
|
|
47
48
|
api: `${this.adminizer.config.routePrefix}/widgets-switch/${widget.id}`,
|
|
48
|
-
description: widget.description,
|
|
49
|
+
description: i18n.__(widget.description),
|
|
49
50
|
icon: widget.icon,
|
|
50
|
-
name: widget.name,
|
|
51
|
+
name: i18n.__(widget.name),
|
|
51
52
|
backgroundCSS: widget.backgroundCSS ?? null,
|
|
52
53
|
size: widget.size ?? null
|
|
53
54
|
});
|
|
@@ -59,9 +60,9 @@ export class WidgetHandler {
|
|
|
59
60
|
id: `${widget.id}__${id_key}`,
|
|
60
61
|
type: widget.widgetType,
|
|
61
62
|
api: `${this.adminizer.config.routePrefix}/widgets-info/${widget.id}`,
|
|
62
|
-
description: widget.description,
|
|
63
|
+
description: i18n.__(widget.description),
|
|
63
64
|
icon: widget.icon,
|
|
64
|
-
name: widget.name,
|
|
65
|
+
name: i18n.__(widget.name),
|
|
65
66
|
backgroundCSS: widget.backgroundCSS ?? null,
|
|
66
67
|
size: widget.size ?? null
|
|
67
68
|
});
|
|
@@ -73,9 +74,9 @@ export class WidgetHandler {
|
|
|
73
74
|
id: `${widget.id}__${id_key}`,
|
|
74
75
|
type: widget.widgetType,
|
|
75
76
|
api: `${this.adminizer.config.routePrefix}/widgets-action/${widget.id}`,
|
|
76
|
-
description: widget.description,
|
|
77
|
+
description: i18n.__(widget.description),
|
|
77
78
|
icon: widget.icon,
|
|
78
|
-
name: widget.name,
|
|
79
|
+
name: i18n.__(widget.name),
|
|
79
80
|
backgroundCSS: widget.backgroundCSS ?? null,
|
|
80
81
|
size: widget.size ?? null
|
|
81
82
|
});
|
|
@@ -86,10 +87,11 @@ export class WidgetHandler {
|
|
|
86
87
|
let links_id_key = 0;
|
|
87
88
|
for (const link of widget.links) {
|
|
88
89
|
widgets.push({
|
|
89
|
-
name: link.name,
|
|
90
|
+
name: i18n.__(link.name),
|
|
90
91
|
id: `${widget.id}__${links_id_key}`,
|
|
91
92
|
type: 'link',
|
|
92
|
-
|
|
93
|
+
linkType: link.linkType,
|
|
94
|
+
description: i18n.__(link.description),
|
|
93
95
|
link: link.link,
|
|
94
96
|
icon: link.icon,
|
|
95
97
|
backgroundCSS: link.backgroundCSS
|
|
@@ -104,15 +106,12 @@ export class WidgetHandler {
|
|
|
104
106
|
id: `${widget.id}_${id_key}`,
|
|
105
107
|
type: widget.widgetType,
|
|
106
108
|
api: `${this.adminizer.config.routePrefix}/widgets-custom/${widget.id}`,
|
|
107
|
-
description: widget.description,
|
|
109
|
+
description: i18n.__(widget.description),
|
|
108
110
|
icon: widget.icon,
|
|
109
|
-
name: widget.name,
|
|
111
|
+
name: i18n.__(widget.name),
|
|
110
112
|
backgroundCSS: widget.backgroundCSS ?? null,
|
|
111
113
|
size: widget.size ?? null,
|
|
112
|
-
scriptUrl: widget.
|
|
113
|
-
constructorName: widget.constructorName,
|
|
114
|
-
constructorOption: widget.constructorOption,
|
|
115
|
-
hideAdminPanelUI: widget.hideAdminPanelUI
|
|
114
|
+
scriptUrl: process.env.VITE_ENV === 'dev' ? widget.jsPath.dev : widget.jsPath.production,
|
|
116
115
|
});
|
|
117
116
|
}
|
|
118
117
|
}
|
|
@@ -123,9 +122,9 @@ export class WidgetHandler {
|
|
|
123
122
|
}
|
|
124
123
|
return Promise.resolve(widgets);
|
|
125
124
|
}
|
|
126
|
-
async getWidgetsDB(id, auth) {
|
|
125
|
+
async getWidgetsDB(id, auth, i18n) {
|
|
127
126
|
let user;
|
|
128
|
-
let widgets;
|
|
127
|
+
let result = { widgets: [], layout: { lg: [], md: [], sm: [], xs: [], xxs: [] } };
|
|
129
128
|
if (!auth) {
|
|
130
129
|
// TODO refactor CRUD functions for DataAccessor usage
|
|
131
130
|
user = await this.adminizer.modelHandler.model.get("UserAP")?.["_findOne"]({ login: this.adminizer.config.administrator?.login ?? 'admin' });
|
|
@@ -134,11 +133,11 @@ export class WidgetHandler {
|
|
|
134
133
|
// TODO refactor CRUD functions for DataAccessor usage
|
|
135
134
|
user = await this.adminizer.modelHandler.model.get("UserAP")?.["_findOne"]({ id: id });
|
|
136
135
|
}
|
|
137
|
-
if (!user || !user.widgets || user.widgets.length === 0) {
|
|
136
|
+
if (!user || !user.widgets || user.widgets.widgets.length === 0) {
|
|
138
137
|
if (this.adminizer.config.dashboard && typeof this.adminizer.config.dashboard !== "boolean" && this.adminizer.config.dashboard.defaultWidgets) {
|
|
139
138
|
let defaultWidgets = this.adminizer.config.dashboard.defaultWidgets;
|
|
140
|
-
widgets = await this.getAll(user);
|
|
141
|
-
widgets.forEach(widget => {
|
|
139
|
+
result.widgets = await this.getAll(user, i18n);
|
|
140
|
+
result.widgets.forEach(widget => {
|
|
142
141
|
if (defaultWidgets.includes(widget.id.split("__")[0])) {
|
|
143
142
|
widget.added = true;
|
|
144
143
|
}
|
|
@@ -146,19 +145,20 @@ export class WidgetHandler {
|
|
|
146
145
|
}
|
|
147
146
|
}
|
|
148
147
|
else {
|
|
149
|
-
widgets = user.widgets;
|
|
148
|
+
result.widgets = user.widgets.widgets;
|
|
149
|
+
result.layout = user.widgets.layout;
|
|
150
150
|
}
|
|
151
|
-
return
|
|
151
|
+
return result;
|
|
152
152
|
}
|
|
153
|
-
async setWidgetsDB(id,
|
|
153
|
+
async setWidgetsDB(id, body, auth) {
|
|
154
154
|
if (!auth) {
|
|
155
155
|
// TODO refactor CRUD functions for DataAccessor usage
|
|
156
|
-
let updatedUser = await this.adminizer.modelHandler.model.get("UserAP")?.["_updateOne"]({ login: this.adminizer.config.administrator?.login ?? 'admin' }, { widgets:
|
|
156
|
+
let updatedUser = await this.adminizer.modelHandler.model.get("UserAP")?.["_updateOne"]({ login: this.adminizer.config.administrator?.login ?? 'admin' }, { widgets: body });
|
|
157
157
|
return updatedUser.id;
|
|
158
158
|
}
|
|
159
159
|
else {
|
|
160
160
|
// TODO refactor CRUD functions for DataAccessor usage
|
|
161
|
-
let updatedUser = await this.adminizer.modelHandler.model.get("UserAP")?.["_updateOne"]({ id: id }, { widgets:
|
|
161
|
+
let updatedUser = await this.adminizer.modelHandler.model.get("UserAP")?.["_updateOne"]({ id: id }, { widgets: body });
|
|
162
162
|
return updatedUser.id;
|
|
163
163
|
}
|
|
164
164
|
}
|
package/models/GroupAP.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { UserAP } from "./UserAP";
|
|
1
2
|
declare const _default: {
|
|
2
3
|
id: {
|
|
3
4
|
type: string;
|
|
@@ -21,3 +22,10 @@ declare const _default: {
|
|
|
21
22
|
};
|
|
22
23
|
};
|
|
23
24
|
export default _default;
|
|
25
|
+
export interface GroupAP {
|
|
26
|
+
id: number;
|
|
27
|
+
name: string;
|
|
28
|
+
description?: string;
|
|
29
|
+
tokens?: string[];
|
|
30
|
+
users?: UserAP[];
|
|
31
|
+
}
|
package/models/NavigationAP.d.ts
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
declare const _default: {
|
|
2
2
|
id: {
|
|
3
3
|
type: string;
|
|
4
|
-
|
|
5
|
-
uuid: boolean;
|
|
4
|
+
autoIncrement: boolean;
|
|
6
5
|
primaryKey: boolean;
|
|
7
|
-
required: boolean;
|
|
8
6
|
};
|
|
9
7
|
label: {
|
|
10
8
|
type: string;
|
|
11
9
|
required: boolean;
|
|
10
|
+
unique: boolean;
|
|
12
11
|
};
|
|
13
12
|
tree: {
|
|
14
13
|
type: string;
|
|
@@ -16,3 +15,8 @@ declare const _default: {
|
|
|
16
15
|
};
|
|
17
16
|
};
|
|
18
17
|
export default _default;
|
|
18
|
+
export interface NavigationAP {
|
|
19
|
+
id: string;
|
|
20
|
+
label: string;
|
|
21
|
+
tree: Record<string, unknown>;
|
|
22
|
+
}
|
package/models/NavigationAP.js
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
export default {
|
|
2
2
|
id: {
|
|
3
|
-
type: "
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
primaryKey: true,
|
|
7
|
-
required: true
|
|
3
|
+
type: "number",
|
|
4
|
+
autoIncrement: true,
|
|
5
|
+
primaryKey: true
|
|
8
6
|
},
|
|
9
7
|
label: {
|
|
10
8
|
type: "string",
|
|
11
|
-
required: true
|
|
9
|
+
required: true,
|
|
10
|
+
unique: true
|
|
12
11
|
},
|
|
13
12
|
tree: {
|
|
14
13
|
type: "json",
|
package/models/UserAP.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { WidgetConfig, WidgetsLayouts } from "lib/v4/widgets/widgetHandler";
|
|
2
|
+
import { GroupAP } from "./GroupAP";
|
|
1
3
|
declare const _default: {
|
|
2
4
|
id: {
|
|
3
5
|
type: string;
|
|
@@ -16,10 +18,10 @@ declare const _default: {
|
|
|
16
18
|
email: {
|
|
17
19
|
type: string;
|
|
18
20
|
};
|
|
19
|
-
|
|
21
|
+
avatar: {
|
|
20
22
|
type: string;
|
|
21
23
|
};
|
|
22
|
-
|
|
24
|
+
passwordHashed: {
|
|
23
25
|
type: string;
|
|
24
26
|
};
|
|
25
27
|
timezone: {
|
|
@@ -52,3 +54,23 @@ declare const _default: {
|
|
|
52
54
|
};
|
|
53
55
|
};
|
|
54
56
|
export default _default;
|
|
57
|
+
export interface UserAP {
|
|
58
|
+
id: number;
|
|
59
|
+
login: string;
|
|
60
|
+
fullName?: string;
|
|
61
|
+
email?: string;
|
|
62
|
+
avatar?: string;
|
|
63
|
+
passwordHashed?: string;
|
|
64
|
+
timezone?: string;
|
|
65
|
+
expires?: string;
|
|
66
|
+
locale?: string;
|
|
67
|
+
isDeleted?: boolean;
|
|
68
|
+
isActive?: boolean;
|
|
69
|
+
isAdministrator?: boolean;
|
|
70
|
+
groups?: GroupAP[];
|
|
71
|
+
widgets?: {
|
|
72
|
+
widgets: WidgetConfig[];
|
|
73
|
+
layout: WidgetsLayouts;
|
|
74
|
+
};
|
|
75
|
+
isConfirmed?: boolean;
|
|
76
|
+
}
|
package/models/UserAP.js
CHANGED
package/package.json
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "adminizer",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "4.1.
|
|
4
|
+
"version": "4.1.1",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
7
|
-
"test": "
|
|
8
|
-
"start": "tsx --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
7
|
+
"test": "vitest --reporter verbose",
|
|
8
|
+
"start": "cross-env NO_SEED_DATA=true ORM=sequelize tsx --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
9
9
|
"dev": "cross-env VITE_ENV=dev tsx watch --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
10
|
+
"dev:sequelize": "cross-env VITE_ENV=dev NO_SEED_DATA=true ORM=sequelize tsx watch --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
10
11
|
"build:assets": "vite build",
|
|
11
12
|
"compile:backend": "tsc -p src/tsconfig.json",
|
|
12
13
|
"watch:backend": "tsc -w -p src/tsconfig.json",
|
|
@@ -15,21 +16,24 @@
|
|
|
15
16
|
"build": "npm run copy:backend && npm run compile:backend && npm run build:assets",
|
|
16
17
|
"build:module": "vite build --config modules/test/vite.config.module.ts",
|
|
17
18
|
"build:react-quill": "vite build --config modules/controls/wysiwyg/vite.config.react-quill.ts",
|
|
19
|
+
"build:catalog-modules": "vite build --config modules/testCatalog/vite.config.module.ts",
|
|
18
20
|
"copy:modules": "node copy-modules.js",
|
|
19
21
|
"build:assets:modules": "npm run build:assets && npm run copy:modules",
|
|
20
|
-
"start:seed": "cross-env
|
|
22
|
+
"start:seed": "cross-env ORM=sequelize tsx --tsconfig ./fixture/tsconfig.json ./fixture/index.ts",
|
|
21
23
|
"demo:build": "npm run copy:backend && npm run compile:backend && npm run build:assets && npm run copy:modules",
|
|
22
|
-
"demo": "cross-env
|
|
24
|
+
"demo": "cross-env ORM=sequelize tsx --tsconfig ./fixture/tsconfig.json ./fixture/index.ts"
|
|
23
25
|
},
|
|
24
26
|
"keywords": [],
|
|
25
27
|
"author": "",
|
|
26
28
|
"license": "MIT",
|
|
27
29
|
"description": "",
|
|
28
30
|
"dependencies": {
|
|
29
|
-
"@
|
|
31
|
+
"@minoru/react-dnd-treeview": "^3.5.2",
|
|
32
|
+
"@radix-ui/react-context-menu": "^2.2.15",
|
|
30
33
|
"body-parser": "^1.20.3",
|
|
31
34
|
"chalk": "^5.4.1",
|
|
32
35
|
"cmdk": "^1.1.1",
|
|
36
|
+
"cookie": "^1.0.2",
|
|
33
37
|
"cookie-parser": "^1.4.7",
|
|
34
38
|
"cors": "^2.8.5",
|
|
35
39
|
"crypto-puzzle": "^5.0.2",
|
|
@@ -37,17 +41,22 @@
|
|
|
37
41
|
"ejs": "^3.1.10",
|
|
38
42
|
"express": "^4.21.2",
|
|
39
43
|
"express-session": "^1.18.1",
|
|
40
|
-
"
|
|
44
|
+
"jsonwebtoken": "^9.0.2",
|
|
41
45
|
"multer": "^1.4.5-lts.1",
|
|
42
46
|
"next-themes": "^0.4.6",
|
|
43
47
|
"password-hash": "^1.2.2",
|
|
48
|
+
"react-dnd": "^16.0.1",
|
|
44
49
|
"sharp": "^0.33.5",
|
|
45
50
|
"typeorm": "^0.3.20",
|
|
46
51
|
"uuid": "^11.0.5",
|
|
52
|
+
"waterline": "^0.15.2",
|
|
47
53
|
"winston": "^3.17.0"
|
|
48
54
|
},
|
|
49
55
|
"devDependencies": {
|
|
56
|
+
"isomorphic-webcrypto": "^2.3.8",
|
|
57
|
+
"@babel/plugin-proposal-decorators": "^7.27.1",
|
|
50
58
|
"@ckeditor/ckeditor5-react": "^9.5.0",
|
|
59
|
+
"@eslint/compat": "^1.2.9",
|
|
51
60
|
"@faker-js/faker": "^9.7.0",
|
|
52
61
|
"@handsontable/react": "^15.2.0",
|
|
53
62
|
"@inertiajs/react": "^2.0.0",
|
|
@@ -58,11 +67,14 @@
|
|
|
58
67
|
"@radix-ui/react-dialog": "^1.1.7",
|
|
59
68
|
"@radix-ui/react-dropdown-menu": "^2.1.6",
|
|
60
69
|
"@radix-ui/react-label": "^2.1.2",
|
|
70
|
+
"@radix-ui/react-menubar": "^1.1.12",
|
|
61
71
|
"@radix-ui/react-popover": "^1.1.7",
|
|
72
|
+
"@radix-ui/react-portal": "^1.1.6",
|
|
62
73
|
"@radix-ui/react-select": "^2.1.6",
|
|
63
74
|
"@radix-ui/react-separator": "^1.1.3",
|
|
64
75
|
"@radix-ui/react-slider": "^1.2.3",
|
|
65
76
|
"@radix-ui/react-slot": "^1.2.0",
|
|
77
|
+
"@radix-ui/react-switch": "^1.2.4",
|
|
66
78
|
"@radix-ui/react-tooltip": "^1.1.8",
|
|
67
79
|
"@tailwindcss/vite": "^4.0.15",
|
|
68
80
|
"@tanstack/react-table": "^8.21.2",
|
|
@@ -73,22 +85,27 @@
|
|
|
73
85
|
"@types/express-session": "^1.18.1",
|
|
74
86
|
"@types/he": "^1.2.3",
|
|
75
87
|
"@types/json-schema": "^7.0.15",
|
|
88
|
+
"@types/jsonwebtoken": "^9.0.9",
|
|
76
89
|
"@types/leaflet": "^1.9.17",
|
|
90
|
+
"@types/lodash": "^4.17.17",
|
|
77
91
|
"@types/lodash-es": "^4.17.12",
|
|
78
92
|
"@types/multer": "^1.4.12",
|
|
79
93
|
"@types/node": "^22.10.5",
|
|
80
94
|
"@types/password-hash": "^1.2.24",
|
|
81
95
|
"@types/react": "^19.0.3",
|
|
82
96
|
"@types/react-dom": "^19.0.2",
|
|
97
|
+
"@types/react-grid-layout": "^1.3.5",
|
|
83
98
|
"@types/sprintf-js": "^1.1.4",
|
|
84
99
|
"@types/uuid": "^10.0.0",
|
|
85
100
|
"@types/waterline": "^0.13.9",
|
|
101
|
+
"@typescript-eslint/eslint-plugin": "^8.32.1",
|
|
86
102
|
"@vitejs/plugin-react": "^4.3.4",
|
|
87
103
|
"babel-plugin-react-compiler": "^19.0.0-beta-e993439-20250405",
|
|
88
104
|
"ckeditor5": "^45.0.0",
|
|
89
105
|
"class-variance-authority": "^0.7.1",
|
|
90
106
|
"clsx": "^2.1.1",
|
|
91
107
|
"cross-env": "^7.0.3",
|
|
108
|
+
"eslint": "^9.26.0",
|
|
92
109
|
"handsontable": "^15.2.0",
|
|
93
110
|
"json-schema": "^0.4.0",
|
|
94
111
|
"leaflet": "^1.9.4",
|
|
@@ -99,15 +116,19 @@
|
|
|
99
116
|
"react": "^19.0.0",
|
|
100
117
|
"react-day-picker": "^8.10.1",
|
|
101
118
|
"react-dom": "^19.0.0",
|
|
119
|
+
"react-grid-layout": "^1.5.1",
|
|
102
120
|
"react-intersection-observer": "^9.16.0",
|
|
103
121
|
"react-leaflet": "^5.0.0",
|
|
104
122
|
"react-quill-new": "^3.4.6",
|
|
105
123
|
"react-simple-wysiwyg": "^3.2.2",
|
|
106
124
|
"sails-disk": "^2.1.2",
|
|
107
125
|
"sails-postgresql": "^5.0.1",
|
|
126
|
+
"sequelize": "^6.37.5",
|
|
127
|
+
"sequelize-typescript": "^2.1.6",
|
|
108
128
|
"shelljs": "^0.9.2",
|
|
109
129
|
"sonner": "^2.0.3",
|
|
110
130
|
"sprintf-js": "^1.1.3",
|
|
131
|
+
"sqlite3": "^5.1.7",
|
|
111
132
|
"tailwind-merge": "^3.0.2",
|
|
112
133
|
"tailwindcss": "^4.0.15",
|
|
113
134
|
"tsx": "^4.19.3",
|
|
@@ -117,9 +138,6 @@
|
|
|
117
138
|
"vite": "^6.1.0",
|
|
118
139
|
"vite-plugin-externals": "^0.6.2",
|
|
119
140
|
"vite-plugin-full-reload": "^1.2.0",
|
|
120
|
-
"
|
|
121
|
-
"sqlite3": "^5.1.7",
|
|
122
|
-
"sequelize": "^6.37.5",
|
|
123
|
-
"sequelize-typescript": "^2.1.6"
|
|
141
|
+
"vitest": "^3.0.7"
|
|
124
142
|
}
|
|
125
143
|
}
|
package/policies/checkAuth.js
CHANGED
|
@@ -4,12 +4,13 @@ export default async function checkAuth(req, res, proceed) {
|
|
|
4
4
|
locale = req.adminizer.config.translation.defaultLocale;
|
|
5
5
|
}
|
|
6
6
|
if (!req.adminizer.config.auth.enable) {
|
|
7
|
-
if (req.
|
|
8
|
-
req.
|
|
7
|
+
if (req.user) {
|
|
8
|
+
req.user.isAdministrator = true;
|
|
9
9
|
}
|
|
10
10
|
else {
|
|
11
|
-
req.
|
|
11
|
+
req.user = {
|
|
12
12
|
id: 0,
|
|
13
|
+
login: "No Auth",
|
|
13
14
|
isAdministrator: true,
|
|
14
15
|
locale: locale
|
|
15
16
|
};
|
package/policies/setLocale.js
CHANGED
|
@@ -5,8 +5,8 @@ export default async function setLocale(req, res, proceed) {
|
|
|
5
5
|
if (typeof req.adminizer.config.translation === 'boolean') {
|
|
6
6
|
return proceed();
|
|
7
7
|
}
|
|
8
|
-
if (req.
|
|
9
|
-
req.i18n.setLocale(req.
|
|
8
|
+
if (req.user && req.user.locale) {
|
|
9
|
+
req.i18n.setLocale(req.user.locale);
|
|
10
10
|
}
|
|
11
11
|
else {
|
|
12
12
|
req.i18n.setLocale(req.adminizer.config.translation.defaultLocale);
|