data-primals-engine 1.4.2 → 1.5.0
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 +878 -856
- package/client/package-lock.json +82 -0
- package/client/package.json +2 -0
- package/client/src/App.jsx +1 -1
- package/client/src/App.scss +25 -7
- package/client/src/AssistantChat.scss +3 -2
- package/client/src/ConditionBuilder.jsx +1 -1
- package/client/src/ConditionBuilder2.jsx +2 -1
- package/client/src/DashboardView.jsx +569 -569
- package/client/src/DataEditor.jsx +376 -368
- package/client/src/DataLayout.jsx +4 -10
- package/client/src/DataTable.jsx +858 -817
- package/client/src/Field.jsx +1825 -1784
- package/client/src/FlexDataRenderer.jsx +2 -0
- package/client/src/FlexTreeUtils.js +1 -1
- package/client/src/GeolocationField.jsx +94 -0
- package/client/src/KPIDialog.jsx +11 -1
- package/client/src/ModelCreator.jsx +1 -2
- package/client/src/ModelCreatorField.jsx +24 -27
- package/client/src/ModelList.jsx +1 -1
- package/client/src/RelationField.jsx +2 -2
- package/client/src/constants.js +3 -3
- package/client/src/filter.js +0 -155
- package/client/src/hooks/useTutorials.jsx +62 -65
- package/client/src/translations.js +14 -2
- package/package.json +2 -1
- package/perf/README.md +147 -0
- package/perf/artillery-hooks.js +37 -0
- package/perf/perf-shot-hardwork.yml +84 -0
- package/perf/perf-shot-search.yml +45 -0
- package/perf/setup.yml +26 -0
- package/server.js +1 -1
- package/src/constants.js +264 -31
- package/src/core.js +15 -1
- package/src/data.js +1 -1
- package/src/defaultModels.js +1544 -1540
- package/src/email.js +5 -2
- package/src/engine.js +10 -3
- package/src/filter.js +274 -260
- package/src/i18n.js +187 -177
- package/src/modules/assistant/assistant.js +3 -1
- package/src/modules/bucket.js +12 -15
- package/src/modules/data/data.backup.js +11 -8
- package/src/modules/data/data.core.js +2 -1
- package/src/modules/data/data.js +6 -3
- package/src/modules/data/data.operations.js +610 -168
- package/src/modules/data/data.routes.js +1821 -1785
- package/src/modules/data/data.scheduling.js +2 -1
- package/src/modules/data/data.validation.js +7 -1
- package/src/modules/file.js +4 -2
- package/src/modules/user.js +4 -1
- package/src/modules/workflow.js +9 -10
- package/src/openai.jobs.js +2 -0
- package/src/packs.js +22 -5
- package/src/providers.js +22 -7
- package/swagger-en.yml +133 -0
- package/test/data.integration.test.js +1060 -981
- package/test/import_export.integration.test.js +1 -1
- package/test/model.integration.test.js +377 -221
package/src/modules/data/data.js
CHANGED
|
@@ -2,7 +2,7 @@ import {Logger} from "../../gameObject.js";
|
|
|
2
2
|
import {mkdir} from 'node:fs/promises';
|
|
3
3
|
import {onInit as historyInit} from "./data.history.js";
|
|
4
4
|
import {isDemoUser, isLocalUser} from "../../data.js";
|
|
5
|
-
import {install, maxRequestData, storageSafetyMargin} from "../../constants.js";
|
|
5
|
+
import {install, maxAlertsPerUser, maxRequestData, storageSafetyMargin} from "../../constants.js";
|
|
6
6
|
import {createCollection, getCollection} from "../mongodb.js";
|
|
7
7
|
import path from "node:path";
|
|
8
8
|
import {isGUID, sequential} from "../../core.js";
|
|
@@ -22,6 +22,7 @@ import {validateField, onInit as validationInit} from "./data.validation.js";
|
|
|
22
22
|
import {cancelAlerts, scheduleAlerts, onInit as scheduleInit} from "./data.scheduling.js";
|
|
23
23
|
import {deleteData, installPack, onInit as operationsInit} from "./data.operations.js";
|
|
24
24
|
import {jobDumpUserData, onInit as backupInit} from "./data.backup.js";
|
|
25
|
+
import {Config} from "../../config.js";
|
|
25
26
|
|
|
26
27
|
let engine;
|
|
27
28
|
let logger;
|
|
@@ -54,7 +55,8 @@ export async function onInit(defaultEngine) {
|
|
|
54
55
|
|
|
55
56
|
let modelsCollection, datasCollection, filesCollection, packsCollection, magnetsCollection, historyCollection;
|
|
56
57
|
|
|
57
|
-
|
|
58
|
+
const i = Config.Get('install', install);
|
|
59
|
+
if( i ) {
|
|
58
60
|
datasCollection = await createCollection("datas");
|
|
59
61
|
historyCollection = await createCollection("history");
|
|
60
62
|
filesCollection = await createCollection("files");
|
|
@@ -220,8 +222,9 @@ export async function checkServerCapacity(incomingDataSize = 0) {
|
|
|
220
222
|
const diskSpace = await checkDiskSpace(DATA_STORAGE_PATH);
|
|
221
223
|
const { free, size } = diskSpace;
|
|
222
224
|
|
|
225
|
+
const storageMargin = Config.Get('storageSafetyMargin', storageSafetyMargin);
|
|
223
226
|
// Limite maximale d'utilisation du disque (ex: 90% de la taille totale)
|
|
224
|
-
const maxAllowedUsage = size *
|
|
227
|
+
const maxAllowedUsage = size * storageMargin;
|
|
225
228
|
const currentUsage = size - free;
|
|
226
229
|
const projectedUsage = currentUsage + incomingDataSize;
|
|
227
230
|
|