@dexteel/mesf-core 4.3.2 → 4.4.0-alpha
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/CHANGELOG.md +4 -0
- package/dist/configuration/pages/asset/repositories/ConfigurationAssetRepository.d.ts +4 -28
- package/dist/configuration/pages/job/repositories/JobsRepository.d.ts +3 -21
- package/dist/configuration/pages/log/repositories/LogsRepository.d.ts +1 -7
- package/dist/configuration/pages/profiles/repositories/ProfilesRepository.d.ts +6 -42
- package/dist/configuration/pages/shifCrew/repositories/ShiftsCrewsRepository.d.ts +3 -21
- package/dist/configuration/pages/users/repositories/UsersRepository.d.ts +7 -49
- package/dist/index.d.ts +1 -0
- package/dist/index.esm.js +731 -11
- package/dist/pages/trendings/components/chart/DateComponent.d.ts +6 -0
- package/dist/pages/trendings/components/chart/TableComponent.d.ts +12 -0
- package/dist/pages/trendings/components/chart/TagSelectionModal.d.ts +9 -0
- package/dist/pages/trendings/components/chart/Trending.d.ts +34 -0
- package/dist/pages/trendings/components/chart/customOptionsComponent.d.ts +8 -0
- package/dist/pages/trendings/index.d.ts +4 -0
- package/dist/pages/trendings/reducers/trendings.reducer.d.ts +1 -0
- package/dist/repositorie/MESF-frontend-Repositorie.d.ts +4 -28
- package/package.json +9 -5
package/CHANGELOG.md
CHANGED
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
export declare const updateAsset: (AssetIds: (number | string)[], ParentAssetId: number) => Promise<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
ok: true;
|
|
6
|
-
data: any;
|
|
7
|
-
}>;
|
|
8
|
-
export declare const insertAsset: (AssetName: string, ParentAssetId: number, CanBeDefaultAsset: boolean | null) => Promise<{
|
|
9
|
-
ok: false;
|
|
10
|
-
message: string;
|
|
11
|
-
} | {
|
|
12
|
-
ok: true;
|
|
13
|
-
data: any;
|
|
14
|
-
}>;
|
|
15
|
-
export declare const UpdateAssetData: (AssetId: number, AssetName: string, ParentAssetId: number, IsAsset: boolean, CanBeDefaultAsset: boolean | null) => Promise<{
|
|
16
|
-
ok: false;
|
|
17
|
-
message: string;
|
|
18
|
-
} | {
|
|
19
|
-
ok: true;
|
|
20
|
-
data: any;
|
|
21
|
-
}>;
|
|
22
|
-
export declare const removeAsset: (AssetId: number, IsActive: boolean) => Promise<{
|
|
23
|
-
ok: false;
|
|
24
|
-
message: string;
|
|
25
|
-
} | {
|
|
26
|
-
ok: true;
|
|
27
|
-
data: any;
|
|
28
|
-
}>;
|
|
1
|
+
export declare const updateAsset: (AssetIds: (number | string)[], ParentAssetId: number) => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
2
|
+
export declare const insertAsset: (AssetName: string, ParentAssetId: number, CanBeDefaultAsset: boolean | null) => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
3
|
+
export declare const UpdateAssetData: (AssetId: number, AssetName: string, ParentAssetId: number, IsAsset: boolean, CanBeDefaultAsset: boolean | null) => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
4
|
+
export declare const removeAsset: (AssetId: number, IsActive: boolean) => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
@@ -1,21 +1,3 @@
|
|
|
1
|
-
export declare const GetJobsStatus: () => Promise<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
} | {
|
|
5
|
-
ok: true;
|
|
6
|
-
data: any;
|
|
7
|
-
}>;
|
|
8
|
-
export declare const SetJobEnable: (Enable: boolean, sProcedure: string) => Promise<{
|
|
9
|
-
ok: false;
|
|
10
|
-
message: string;
|
|
11
|
-
} | {
|
|
12
|
-
ok: true;
|
|
13
|
-
data: any;
|
|
14
|
-
}>;
|
|
15
|
-
export declare const RestartJob: (sProcedure: string) => Promise<{
|
|
16
|
-
ok: false;
|
|
17
|
-
message: string;
|
|
18
|
-
} | {
|
|
19
|
-
ok: true;
|
|
20
|
-
data: any;
|
|
21
|
-
}>;
|
|
1
|
+
export declare const GetJobsStatus: () => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
2
|
+
export declare const SetJobEnable: (Enable: boolean, sProcedure: string) => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
3
|
+
export declare const RestartJob: (sProcedure: string) => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
@@ -1,7 +1 @@
|
|
|
1
|
-
export declare const GetLogs: (Start: Date, End: Date, Search: string, LogTypeCode: number | string | null) => Promise<
|
|
2
|
-
ok: false;
|
|
3
|
-
message: string;
|
|
4
|
-
} | {
|
|
5
|
-
ok: true;
|
|
6
|
-
data: any;
|
|
7
|
-
}>;
|
|
1
|
+
export declare const GetLogs: (Start: Date, End: Date, Search: string, LogTypeCode: number | string | null) => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
@@ -1,44 +1,8 @@
|
|
|
1
1
|
import { Profile } from "../../profiles/models/Profile";
|
|
2
2
|
import { Action } from "../models/Action";
|
|
3
|
-
export declare const getProfiles: () => Promise<
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}>;
|
|
10
|
-
export declare const upsertProfile: (ProfileId: number, ProfileName: string) => Promise<{
|
|
11
|
-
ok: false;
|
|
12
|
-
message: string;
|
|
13
|
-
} | {
|
|
14
|
-
ok: true;
|
|
15
|
-
data: any;
|
|
16
|
-
}>;
|
|
17
|
-
export declare const getActions: () => Promise<{
|
|
18
|
-
ok: false;
|
|
19
|
-
message: string;
|
|
20
|
-
} | {
|
|
21
|
-
ok: true;
|
|
22
|
-
data: any;
|
|
23
|
-
}>;
|
|
24
|
-
export declare const getActionsByProfileId: (profile: Profile) => Promise<{
|
|
25
|
-
ok: false;
|
|
26
|
-
message: string;
|
|
27
|
-
} | {
|
|
28
|
-
ok: true;
|
|
29
|
-
data: any;
|
|
30
|
-
}>;
|
|
31
|
-
export declare const upsertProfileActions: (profile: Profile, actions: Action[]) => Promise<{
|
|
32
|
-
ok: false;
|
|
33
|
-
message: string;
|
|
34
|
-
} | {
|
|
35
|
-
ok: true;
|
|
36
|
-
data: any;
|
|
37
|
-
}>;
|
|
38
|
-
export declare const deleteProfile: (profileId: number) => Promise<{
|
|
39
|
-
ok: false;
|
|
40
|
-
message: string;
|
|
41
|
-
} | {
|
|
42
|
-
ok: true;
|
|
43
|
-
data: any;
|
|
44
|
-
}>;
|
|
3
|
+
export declare const getProfiles: () => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
4
|
+
export declare const upsertProfile: (ProfileId: number, ProfileName: string) => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
5
|
+
export declare const getActions: () => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
6
|
+
export declare const getActionsByProfileId: (profile: Profile) => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
7
|
+
export declare const upsertProfileActions: (profile: Profile, actions: Action[]) => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
8
|
+
export declare const deleteProfile: (profileId: number) => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
@@ -1,22 +1,4 @@
|
|
|
1
1
|
import { ShiftParameters } from "../models/ShiftParameters";
|
|
2
|
-
export declare const getShiftParameters: () => Promise<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
} | {
|
|
6
|
-
ok: true;
|
|
7
|
-
data: any;
|
|
8
|
-
}>;
|
|
9
|
-
export declare const upsertShiftParameters: ({ PatternStart, ShiftCodes, Crews, CrewRotation, Comments, }: ShiftParameters) => Promise<{
|
|
10
|
-
ok: false;
|
|
11
|
-
message: string;
|
|
12
|
-
} | {
|
|
13
|
-
ok: true;
|
|
14
|
-
data: any;
|
|
15
|
-
}>;
|
|
16
|
-
export declare const DeleteShiftParameters: (PatternStart: Date) => Promise<{
|
|
17
|
-
ok: false;
|
|
18
|
-
message: string;
|
|
19
|
-
} | {
|
|
20
|
-
ok: true;
|
|
21
|
-
data: any;
|
|
22
|
-
}>;
|
|
2
|
+
export declare const getShiftParameters: () => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
3
|
+
export declare const upsertShiftParameters: ({ PatternStart, ShiftCodes, Crews, CrewRotation, Comments, }: ShiftParameters) => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
4
|
+
export declare const DeleteShiftParameters: (PatternStart: Date) => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
@@ -1,32 +1,8 @@
|
|
|
1
1
|
import { User } from "../models/User";
|
|
2
|
-
export declare const getUsers: () => Promise<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
ok: true;
|
|
7
|
-
data: any;
|
|
8
|
-
}>;
|
|
9
|
-
export declare const getDataUser: (UserId: number | null) => Promise<{
|
|
10
|
-
ok: false;
|
|
11
|
-
message: string;
|
|
12
|
-
} | {
|
|
13
|
-
ok: true;
|
|
14
|
-
data: any;
|
|
15
|
-
}>;
|
|
16
|
-
export declare const getProfiles: () => Promise<{
|
|
17
|
-
ok: false;
|
|
18
|
-
message: string;
|
|
19
|
-
} | {
|
|
20
|
-
ok: true;
|
|
21
|
-
data: any;
|
|
22
|
-
}>;
|
|
23
|
-
export declare const deleteUser: (userId: number) => Promise<{
|
|
24
|
-
ok: false;
|
|
25
|
-
message: string;
|
|
26
|
-
} | {
|
|
27
|
-
ok: true;
|
|
28
|
-
data: any;
|
|
29
|
-
}>;
|
|
2
|
+
export declare const getUsers: () => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
3
|
+
export declare const getDataUser: (UserId: number | null) => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
4
|
+
export declare const getProfiles: () => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
5
|
+
export declare const deleteUser: (userId: number) => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
30
6
|
export declare const setPassword: (userId: number, password: string) => Promise<{
|
|
31
7
|
ok: boolean;
|
|
32
8
|
data: any;
|
|
@@ -36,24 +12,6 @@ export declare const setPassword: (userId: number, password: string) => Promise<
|
|
|
36
12
|
message: any;
|
|
37
13
|
data?: undefined;
|
|
38
14
|
}>;
|
|
39
|
-
export declare const upsertUser: (user: User) => Promise<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
} | {
|
|
43
|
-
ok: true;
|
|
44
|
-
data: any;
|
|
45
|
-
}>;
|
|
46
|
-
export declare const getAuthTypes: () => Promise<{
|
|
47
|
-
ok: false;
|
|
48
|
-
message: string;
|
|
49
|
-
} | {
|
|
50
|
-
ok: true;
|
|
51
|
-
data: any;
|
|
52
|
-
}>;
|
|
53
|
-
export declare const setProfilesToUser: (UserId: number, profileIds: number[]) => Promise<{
|
|
54
|
-
ok: false;
|
|
55
|
-
message: string;
|
|
56
|
-
} | {
|
|
57
|
-
ok: true;
|
|
58
|
-
data: any;
|
|
59
|
-
}>;
|
|
15
|
+
export declare const upsertUser: (user: User) => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
16
|
+
export declare const getAuthTypes: () => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
|
17
|
+
export declare const setProfilesToUser: (UserId: number, profileIds: number[]) => Promise<import("../../../../services/ApiService").ResponseMESF>;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export * from "./context/axiosInstance";
|
|
|
3
3
|
export * from "./MESFMain";
|
|
4
4
|
export * from "./components/modals/modal.mesf";
|
|
5
5
|
export * from "./components/modals/error-modal";
|
|
6
|
+
export * from './pages/trendings';
|
|
6
7
|
export * from "./configuration";
|
|
7
8
|
export * from "./context/UTLSettingContext";
|
|
8
9
|
export * from "./context/assetContext";
|
package/dist/index.esm.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Typography, TextField, makeStyles as makeStyles$1, Button as Button$1, Grid as Grid$1, Dialog as Dialog$1, DialogTitle as DialogTitle$2, DialogContent as DialogContent$2, DialogContentText, DialogActions as DialogActions$2, FormHelperText, CircularProgress as CircularProgress$1, Badge, FormControlLabel, Checkbox, Snackbar as Snackbar$1, Paper as Paper$1, MenuItem as MenuItem$1, useTheme as useTheme$1, createStyles as createStyles$1, List, ListItem, ListItemText } from '@material-ui/core';
|
|
1
|
+
import { Typography, TextField, makeStyles as makeStyles$1, Button as Button$1, Grid as Grid$1, Dialog as Dialog$1, DialogTitle as DialogTitle$2, DialogContent as DialogContent$2, DialogContentText, DialogActions as DialogActions$2, FormHelperText, CircularProgress as CircularProgress$1, Badge, FormControlLabel, Checkbox, Snackbar as Snackbar$1, Paper as Paper$1, MenuItem as MenuItem$1, useTheme as useTheme$1, Box, Container as Container$1, createStyles as createStyles$1, List, ListItem, ListItemText } from '@material-ui/core';
|
|
2
2
|
import { values, get, isNil as isNil$1, isEmpty } from 'lodash-es';
|
|
3
3
|
import * as React from 'react';
|
|
4
4
|
import React__default, { useState, useRef, useEffect, Component, createContext, useContext, useMemo, useCallback, lazy, Suspense } from 'react';
|
|
@@ -20,8 +20,16 @@ import Grid from '@material-ui/core/Grid';
|
|
|
20
20
|
import { isNil, get as get$1 } from 'lodash';
|
|
21
21
|
import { DndProvider } from 'react-dnd';
|
|
22
22
|
import { HTML5Backend } from 'react-dnd-html5-backend';
|
|
23
|
-
import
|
|
23
|
+
import { Line } from 'react-chartjs-2';
|
|
24
|
+
import { _adapters, Chart, CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend, TimeScale } from 'chart.js';
|
|
25
|
+
import moment from 'moment';
|
|
24
26
|
import axios from 'axios';
|
|
27
|
+
import zoomPlugin from 'chartjs-plugin-zoom';
|
|
28
|
+
import { Alert as Alert$3, TreeView as TreeView$1, TreeItem as TreeItem$1 } from '@material-ui/lab';
|
|
29
|
+
import ArrowDropDownIcon from '@material-ui/icons/ArrowDropDown';
|
|
30
|
+
import FolderIcon from '@material-ui/icons/Folder';
|
|
31
|
+
import InsertDriveFileIcon from '@material-ui/icons/InsertDriveFile';
|
|
32
|
+
import PersonPinCircleIcon from '@material-ui/icons/PersonPinCircle';
|
|
25
33
|
import PropTypes from 'prop-types';
|
|
26
34
|
import { ResponsiveBar } from '@nivo/bar';
|
|
27
35
|
import Select from '@material-ui/core/Select';
|
|
@@ -29,7 +37,6 @@ import { withStyles, alpha, makeStyles, createStyles, useTheme } from '@material
|
|
|
29
37
|
import Collapse from '@material-ui/core/Collapse';
|
|
30
38
|
import SvgIcon from '@material-ui/core/SvgIcon';
|
|
31
39
|
import Code from '@material-ui/icons/Code';
|
|
32
|
-
import Folder from '@material-ui/icons/Folder';
|
|
33
40
|
import TreeItem from '@material-ui/lab/TreeItem';
|
|
34
41
|
import TreeView from '@material-ui/lab/TreeView';
|
|
35
42
|
import { useSpring, animated } from 'react-spring';
|
|
@@ -39,7 +46,6 @@ import Card from '@material-ui/core/Card';
|
|
|
39
46
|
import CardActions from '@material-ui/core/CardActions';
|
|
40
47
|
import CardContent from '@material-ui/core/CardContent';
|
|
41
48
|
import Typography$1 from '@material-ui/core/Typography';
|
|
42
|
-
import moment from 'moment';
|
|
43
49
|
import Snackbar from '@material-ui/core/Snackbar';
|
|
44
50
|
import CircularProgress from '@material-ui/core/CircularProgress';
|
|
45
51
|
import Alert$2 from '@material-ui/lab/Alert';
|
|
@@ -65,7 +71,6 @@ import { ArrowRight } from '@material-ui/icons';
|
|
|
65
71
|
import ImageIcon from '@material-ui/icons/Image';
|
|
66
72
|
import ListAltIcon from '@material-ui/icons/ListAlt';
|
|
67
73
|
import DescriptionIcon from '@material-ui/icons/Description';
|
|
68
|
-
import { Alert as Alert$3 } from '@material-ui/lab';
|
|
69
74
|
import FormControlLabel$1 from '@material-ui/core/FormControlLabel';
|
|
70
75
|
import Checkbox$1 from '@material-ui/core/Checkbox';
|
|
71
76
|
import Input from '@material-ui/core/Input';
|
|
@@ -414,7 +419,7 @@ var ModalTreeFilterControl = function (props) {
|
|
|
414
419
|
nodes.isCode === true &&
|
|
415
420
|
React__default.createElement(Code, { className: classes.treeLabelIcon, htmlColor: "#1ABC9C" }),
|
|
416
421
|
nodes.isCode === false &&
|
|
417
|
-
React__default.createElement(
|
|
422
|
+
React__default.createElement(FolderIcon, { className: classes.treeLabelIcon, htmlColor: '#F1C40F' }),
|
|
418
423
|
React__default.createElement(Typography, { variant: "body2", className: [classes.treeLabelText, (nodes.isActive ? '' : classes.treeLabelInactive)].join(' ') },
|
|
419
424
|
React__default.createElement("span", null,
|
|
420
425
|
nodes.isCode &&
|
|
@@ -997,8 +1002,8 @@ var Alert = function (props) {
|
|
|
997
1002
|
|
|
998
1003
|
var e=[],t=[];function n(n,r){if(n&&"undefined"!=typeof document){var a,s=!0===r.prepend?"prepend":"append",d=!0===r.singleTag,i="string"==typeof r.container?document.querySelector(r.container):document.getElementsByTagName("head")[0];if(d){var u=e.indexOf(i);-1===u&&(u=e.push(i)-1,t[u]={}),a=t[u]&&t[u][s]?t[u][s]:t[u][s]=c();}else a=c();65279===n.charCodeAt(0)&&(n=n.substring(1)),a.styleSheet?a.styleSheet.cssText+=n:a.appendChild(document.createTextNode(n));}function c(){var e=document.createElement("style");if(e.setAttribute("type","text/css"),r.attributes)for(var t=Object.keys(r.attributes),n=0;n<t.length;n++)e.setAttribute(t[n],r.attributes[t[n]]);var a="prepend"===s?"afterbegin":"beforeend";return i.insertAdjacentElement(a,e),e}}
|
|
999
1004
|
|
|
1000
|
-
var css$
|
|
1001
|
-
n(css$
|
|
1005
|
+
var css$2 = ".lds-ring {\n display: inline-block;\n position: relative;\n width: 80px;\n height: 80px;\n}\n.lds-ring div {\n box-sizing: border-box;\n display: block;\n position: absolute;\n width: 64px;\n height: 64px;\n margin: 8px;\n border: 5px solid rgb(63,81,181);\n border-radius: 50%;\n animation: lds-ring 1.2s cubic-bezier(0.5, 0, 0.5, 1) infinite;\n border-color: rgb(63,81,181) transparent transparent transparent;\n}\n.lds-ring div:nth-child(1) {\n animation-delay: -0.45s;\n}\n.lds-ring div:nth-child(2) {\n animation-delay: -0.3s;\n}\n.lds-ring div:nth-child(3) {\n animation-delay: -0.15s;\n}\n@keyframes lds-ring {\n 0% {\n transform: rotate(0deg);\n }\n 100% {\n transform: rotate(360deg);\n }\n}\n";
|
|
1006
|
+
n(css$2,{});
|
|
1002
1007
|
|
|
1003
1008
|
var LazyLoading = function () {
|
|
1004
1009
|
return (React__default.createElement(React__default.Fragment, null,
|
|
@@ -3790,7 +3795,7 @@ var ShiftsCrewsPage = function (props) {
|
|
|
3790
3795
|
|
|
3791
3796
|
var TypeIcon = function (props) {
|
|
3792
3797
|
if (props.droppable) {
|
|
3793
|
-
return React__default.createElement(
|
|
3798
|
+
return React__default.createElement(FolderIcon, null);
|
|
3794
3799
|
}
|
|
3795
3800
|
switch (props.fileType) {
|
|
3796
3801
|
case "image":
|
|
@@ -7818,6 +7823,720 @@ var Home = function () { return (React__default.createElement("div", { style: {
|
|
|
7818
7823
|
position: 'absolute'
|
|
7819
7824
|
} })); };
|
|
7820
7825
|
|
|
7826
|
+
/*!
|
|
7827
|
+
* chartjs-adapter-moment v1.0.1
|
|
7828
|
+
* https://www.chartjs.org
|
|
7829
|
+
* (c) 2022 chartjs-adapter-moment Contributors
|
|
7830
|
+
* Released under the MIT license
|
|
7831
|
+
*/
|
|
7832
|
+
|
|
7833
|
+
const FORMATS = {
|
|
7834
|
+
datetime: 'MMM D, YYYY, h:mm:ss a',
|
|
7835
|
+
millisecond: 'h:mm:ss.SSS a',
|
|
7836
|
+
second: 'h:mm:ss a',
|
|
7837
|
+
minute: 'h:mm a',
|
|
7838
|
+
hour: 'hA',
|
|
7839
|
+
day: 'MMM D',
|
|
7840
|
+
week: 'll',
|
|
7841
|
+
month: 'MMM YYYY',
|
|
7842
|
+
quarter: '[Q]Q - YYYY',
|
|
7843
|
+
year: 'YYYY'
|
|
7844
|
+
};
|
|
7845
|
+
|
|
7846
|
+
_adapters._date.override(typeof moment === 'function' ? {
|
|
7847
|
+
_id: 'moment', // DEBUG ONLY
|
|
7848
|
+
|
|
7849
|
+
formats: function() {
|
|
7850
|
+
return FORMATS;
|
|
7851
|
+
},
|
|
7852
|
+
|
|
7853
|
+
parse: function(value, format) {
|
|
7854
|
+
if (typeof value === 'string' && typeof format === 'string') {
|
|
7855
|
+
value = moment(value, format);
|
|
7856
|
+
} else if (!(value instanceof moment)) {
|
|
7857
|
+
value = moment(value);
|
|
7858
|
+
}
|
|
7859
|
+
return value.isValid() ? value.valueOf() : null;
|
|
7860
|
+
},
|
|
7861
|
+
|
|
7862
|
+
format: function(time, format) {
|
|
7863
|
+
return moment(time).format(format);
|
|
7864
|
+
},
|
|
7865
|
+
|
|
7866
|
+
add: function(time, amount, unit) {
|
|
7867
|
+
return moment(time).add(amount, unit).valueOf();
|
|
7868
|
+
},
|
|
7869
|
+
|
|
7870
|
+
diff: function(max, min, unit) {
|
|
7871
|
+
return moment(max).diff(moment(min), unit);
|
|
7872
|
+
},
|
|
7873
|
+
|
|
7874
|
+
startOf: function(time, unit, weekday) {
|
|
7875
|
+
time = moment(time);
|
|
7876
|
+
if (unit === 'isoWeek') {
|
|
7877
|
+
weekday = Math.trunc(Math.min(Math.max(0, weekday), 6));
|
|
7878
|
+
return time.isoWeekday(weekday).startOf('day').valueOf();
|
|
7879
|
+
}
|
|
7880
|
+
return time.startOf(unit).valueOf();
|
|
7881
|
+
},
|
|
7882
|
+
|
|
7883
|
+
endOf: function(time, unit) {
|
|
7884
|
+
return moment(time).endOf(unit).valueOf();
|
|
7885
|
+
}
|
|
7886
|
+
} : {});
|
|
7887
|
+
|
|
7888
|
+
var formatDate = function (date) {
|
|
7889
|
+
// Format: "MM/DD/YYYY HH:MM:SS.sss"
|
|
7890
|
+
var day = date.getDate().toString();
|
|
7891
|
+
var month = (date.getMonth() + 1).toString(); // getMonth() returns 0-11
|
|
7892
|
+
var year = date.getFullYear();
|
|
7893
|
+
var hours = date.getHours().toString();
|
|
7894
|
+
var minutes = date.getMinutes().toString();
|
|
7895
|
+
var seconds = date.getSeconds().toString();
|
|
7896
|
+
var milliseconds = date.getMilliseconds().toString();
|
|
7897
|
+
// Adding leading zeros for day, month, hours, minutes, and seconds if necessary
|
|
7898
|
+
day = day.padStart(2, '0');
|
|
7899
|
+
month = month.padStart(2, '0');
|
|
7900
|
+
hours = hours.padStart(2, '0');
|
|
7901
|
+
minutes = minutes.padStart(2, '0');
|
|
7902
|
+
seconds = seconds.padStart(2, '0');
|
|
7903
|
+
// Milliseconds to ensure 3 digits
|
|
7904
|
+
milliseconds = milliseconds.padStart(3, '0');
|
|
7905
|
+
return "".concat(month, "/").concat(day, "/").concat(year, " ").concat(hours, ":").concat(minutes, ":").concat(seconds, ".").concat(milliseconds);
|
|
7906
|
+
};
|
|
7907
|
+
var DateComponent = function (_a) {
|
|
7908
|
+
var date = _a.date;
|
|
7909
|
+
return React__default.createElement("div", null, formatDate(date));
|
|
7910
|
+
};
|
|
7911
|
+
|
|
7912
|
+
var CustomOptionsComponent = function (_a) {
|
|
7913
|
+
var customOptions = _a.customOptions, setCustomOptions = _a.setCustomOptions;
|
|
7914
|
+
var handleGridChange = function (value) {
|
|
7915
|
+
setCustomOptions(function (prevOptions) { return (__assign(__assign({}, prevOptions), { showGrid: value })); });
|
|
7916
|
+
};
|
|
7917
|
+
var handleSteppedChange = function (value) {
|
|
7918
|
+
setCustomOptions(function (prevOptions) { return (__assign(__assign({}, prevOptions), { stepped: value })); });
|
|
7919
|
+
};
|
|
7920
|
+
return (React__default.createElement("div", null,
|
|
7921
|
+
React__default.createElement("label", null,
|
|
7922
|
+
React__default.createElement("input", { type: "checkbox", checked: customOptions.showGrid, onChange: function (e) { return handleGridChange(e.target.checked); } }),
|
|
7923
|
+
"Show Grid"),
|
|
7924
|
+
React__default.createElement("label", null,
|
|
7925
|
+
React__default.createElement("input", { type: "checkbox", checked: customOptions.stepped, onChange: function (e) { return handleSteppedChange(e.target.checked); } }),
|
|
7926
|
+
"Stepped")));
|
|
7927
|
+
};
|
|
7928
|
+
|
|
7929
|
+
var css$1 = "/* ContextMenu.css */\n.context-menu {\n position: absolute;\n z-index: 1000;\n background-color: #fff;\n border: 1px solid #ddd;\n box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.1);\n border-radius: 4px;\n overflow: hidden;\n}\n\n .context-menu ul {\n list-style: none;\n margin: 0;\n padding: 0;\n }\n\n .context-menu li {\n padding: 8px 15px;\n cursor: pointer;\n border-bottom: 1px solid #eee;\n background-color: #fff;\n color: #333;\n font-size: 14px;\n }\n\n .context-menu li:hover {\n background-color: #f5f5f5;\n }\n\n\n";
|
|
7930
|
+
n(css$1,{});
|
|
7931
|
+
|
|
7932
|
+
var TagSelectionModal = function (_a) {
|
|
7933
|
+
var isOpen = _a.isOpen; _a.onClose; var onTagSelect = _a.onTagSelect;
|
|
7934
|
+
var _b = useState([]), treeData = _b[0], setTreeData = _b[1];
|
|
7935
|
+
var _c = useState([]), expanded = _c[0], setExpanded = _c[1];
|
|
7936
|
+
useEffect(function () {
|
|
7937
|
+
var loadData = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
7938
|
+
var children;
|
|
7939
|
+
return __generator(this, function (_a) {
|
|
7940
|
+
switch (_a.label) {
|
|
7941
|
+
case 0:
|
|
7942
|
+
if (!isOpen) return [3 /*break*/, 2];
|
|
7943
|
+
return [4 /*yield*/, fetchChildren('root')];
|
|
7944
|
+
case 1:
|
|
7945
|
+
children = _a.sent();
|
|
7946
|
+
setTreeData([{ tagId: null, tagName: 'root', children: children, isLoaded: true, shortName: 'Tags', tag: null }]);
|
|
7947
|
+
_a.label = 2;
|
|
7948
|
+
case 2: return [2 /*return*/];
|
|
7949
|
+
}
|
|
7950
|
+
});
|
|
7951
|
+
}); };
|
|
7952
|
+
loadData();
|
|
7953
|
+
}, [isOpen]);
|
|
7954
|
+
var fetchChildren = function (tagName, depth, maxDepth) {
|
|
7955
|
+
if (depth === void 0) { depth = 0; }
|
|
7956
|
+
if (maxDepth === void 0) { maxDepth = 3; }
|
|
7957
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
7958
|
+
var response, childrenData, error_1;
|
|
7959
|
+
return __generator(this, function (_a) {
|
|
7960
|
+
switch (_a.label) {
|
|
7961
|
+
case 0:
|
|
7962
|
+
// Limiting the recursion depth for safety
|
|
7963
|
+
if (depth > maxDepth) {
|
|
7964
|
+
return [2 /*return*/, []];
|
|
7965
|
+
}
|
|
7966
|
+
_a.label = 1;
|
|
7967
|
+
case 1:
|
|
7968
|
+
_a.trys.push([1, 4, , 5]);
|
|
7969
|
+
return [4 /*yield*/, axios.get("/Tag/".concat(tagName, "/children"))];
|
|
7970
|
+
case 2:
|
|
7971
|
+
response = _a.sent();
|
|
7972
|
+
return [4 /*yield*/, Promise.all(response.data.map(function (dbTag) { return __awaiter(void 0, void 0, void 0, function () {
|
|
7973
|
+
var childTagName, children;
|
|
7974
|
+
return __generator(this, function (_a) {
|
|
7975
|
+
switch (_a.label) {
|
|
7976
|
+
case 0:
|
|
7977
|
+
childTagName = tagName !== 'root' ? tagName + '.' + dbTag.tagName : dbTag.tagName;
|
|
7978
|
+
return [4 /*yield*/, fetchChildren(childTagName, depth + 1, maxDepth)];
|
|
7979
|
+
case 1:
|
|
7980
|
+
children = _a.sent();
|
|
7981
|
+
return [2 /*return*/, {
|
|
7982
|
+
tagId: dbTag.tagId,
|
|
7983
|
+
tagName: childTagName,
|
|
7984
|
+
shortName: dbTag.tagName,
|
|
7985
|
+
children: children,
|
|
7986
|
+
isLoaded: true,
|
|
7987
|
+
tag: {
|
|
7988
|
+
tagId: dbTag.tagId,
|
|
7989
|
+
tagName: dbTag.tagName,
|
|
7990
|
+
tagType: dbTag.tagType,
|
|
7991
|
+
color: '#FF0000',
|
|
7992
|
+
autoScale: true,
|
|
7993
|
+
minScale: null,
|
|
7994
|
+
maxScale: null,
|
|
7995
|
+
visible: true
|
|
7996
|
+
}
|
|
7997
|
+
}];
|
|
7998
|
+
}
|
|
7999
|
+
});
|
|
8000
|
+
}); }))];
|
|
8001
|
+
case 3:
|
|
8002
|
+
childrenData = _a.sent();
|
|
8003
|
+
// Flatten the structure if needed or perform other transformations
|
|
8004
|
+
// ...
|
|
8005
|
+
return [2 /*return*/, childrenData];
|
|
8006
|
+
case 4:
|
|
8007
|
+
error_1 = _a.sent();
|
|
8008
|
+
console.error('Error fetching children:', error_1);
|
|
8009
|
+
return [2 /*return*/, []];
|
|
8010
|
+
case 5: return [2 /*return*/];
|
|
8011
|
+
}
|
|
8012
|
+
});
|
|
8013
|
+
});
|
|
8014
|
+
};
|
|
8015
|
+
/* I have to get the grandchildren because the toggle action would not be triggered if no children */
|
|
8016
|
+
var handleNodeToggle = function (event, nodeIds) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8017
|
+
return __generator(this, function (_a) {
|
|
8018
|
+
console.log('Toggle:', nodeIds);
|
|
8019
|
+
setExpanded(nodeIds);
|
|
8020
|
+
return [2 /*return*/];
|
|
8021
|
+
});
|
|
8022
|
+
}); };
|
|
8023
|
+
var handleNodeSelect = function (event, nodeId) { return __awaiter(void 0, void 0, void 0, function () {
|
|
8024
|
+
var node;
|
|
8025
|
+
return __generator(this, function (_a) {
|
|
8026
|
+
// console.log('Selected Node ID:', nodeId);
|
|
8027
|
+
console.log('treeData', treeData);
|
|
8028
|
+
node = findNode(treeData, nodeId);
|
|
8029
|
+
if (node === null || node === void 0 ? void 0 : node.tagId) {
|
|
8030
|
+
onTagSelect(node.tag);
|
|
8031
|
+
}
|
|
8032
|
+
return [2 /*return*/];
|
|
8033
|
+
});
|
|
8034
|
+
}); };
|
|
8035
|
+
var findNode = function (nodes, tagName) {
|
|
8036
|
+
for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {
|
|
8037
|
+
var node = nodes_1[_i];
|
|
8038
|
+
if (node.tagName === tagName) {
|
|
8039
|
+
return node;
|
|
8040
|
+
}
|
|
8041
|
+
else if (node.children) {
|
|
8042
|
+
var found = findNode(node.children, tagName);
|
|
8043
|
+
if (found)
|
|
8044
|
+
return found;
|
|
8045
|
+
}
|
|
8046
|
+
}
|
|
8047
|
+
return null;
|
|
8048
|
+
};
|
|
8049
|
+
var renderTree = function (node) { return (React__default.createElement(TreeItem$1, { key: node.tagName, nodeId: node.tagName, label: node.shortName, endIcon: React__default.createElement(ArrowDropDownIcon, null), icon: node.children && node.children.length > 0 ? React__default.createElement(FolderIcon, null) : React__default.createElement(InsertDriveFileIcon, null) }, node.children && node.children.map(function (child) { return renderTree(child); }))); };
|
|
8050
|
+
return (React__default.createElement("div", { style: { display: isOpen ? 'block' : 'none' } },
|
|
8051
|
+
React__default.createElement("div", null,
|
|
8052
|
+
React__default.createElement(TreeView$1, { expanded: expanded, onNodeSelect: handleNodeSelect, onNodeToggle: handleNodeToggle }, treeData.map(function (tree) { return renderTree(tree); })))));
|
|
8053
|
+
};
|
|
8054
|
+
|
|
8055
|
+
var TableComponent = function (_a) {
|
|
8056
|
+
var tagList = _a.tagList, setTagList = _a.setTagList, cursorData = _a.cursorData, onDeleteTag = _a.onDeleteTag, onAddTag = _a.onAddTag;
|
|
8057
|
+
var handleChange = function (index, value, property) {
|
|
8058
|
+
setTagList(function (prev) { return prev.map(function (tag, currentIndex) {
|
|
8059
|
+
var _a;
|
|
8060
|
+
return currentIndex === index ? __assign(__assign({}, tag), (_a = {}, _a[property] = value, _a.autoScale = false, _a)) : tag;
|
|
8061
|
+
}); });
|
|
8062
|
+
};
|
|
8063
|
+
var handleVisibilityChange = function (index, value) {
|
|
8064
|
+
setTagList(function (prev) { return prev.map(function (tag, currentIndex) { return currentIndex === index ? __assign(__assign({}, tag), { visible: value }) : tag; }); });
|
|
8065
|
+
};
|
|
8066
|
+
var handleAutoScaleChange = function (index, value) {
|
|
8067
|
+
setTagList(function (prev) { return prev.map(function (tag, currentIndex) { return currentIndex === index ? __assign(__assign({}, tag), { autoScale: value }) : tag; }); });
|
|
8068
|
+
};
|
|
8069
|
+
var _b = useState(null), selectedRowIndex = _b[0], setSelectedRowIndex = _b[1];
|
|
8070
|
+
var _c = useState(false), modalOpen = _c[0], setModalOpen = _c[1];
|
|
8071
|
+
var handleOpen = function () { return setModalOpen(true); };
|
|
8072
|
+
var handleClose = function () { return setModalOpen(false); };
|
|
8073
|
+
var ContextMenu = function (_a) {
|
|
8074
|
+
var x = _a.x, y = _a.y, options = _a.options;
|
|
8075
|
+
var handleContextMenuClick = function (e) {
|
|
8076
|
+
e.stopPropagation(); // Prevent click inside the menu from closing it
|
|
8077
|
+
};
|
|
8078
|
+
return (React__default.createElement("div", { className: "context-menu", style: { top: y, left: x }, onClick: handleContextMenuClick },
|
|
8079
|
+
React__default.createElement("ul", null, options.map(function (option) { return (React__default.createElement("li", { key: option.id, onClick: option.onClick }, option.label)); }))));
|
|
8080
|
+
};
|
|
8081
|
+
// Position state for the context menu
|
|
8082
|
+
var _d = useState({ x: 0, y: 0 }), contextMenuPosition = _d[0], setContextMenuPosition = _d[1];
|
|
8083
|
+
var contextMenuOptions = [
|
|
8084
|
+
{ id: 'delete', label: 'Remove Tag', onClick: function () { return handleDelete(); } },
|
|
8085
|
+
{ id: 'add', label: 'Add Tag', onClick: function () { return handleTagAdd(); } },
|
|
8086
|
+
// ... other options
|
|
8087
|
+
];
|
|
8088
|
+
var handleTagAdd = function () {
|
|
8089
|
+
handleOpen();
|
|
8090
|
+
};
|
|
8091
|
+
var handleTagSelect = function (selectedTag) {
|
|
8092
|
+
onAddTag(selectedTag);
|
|
8093
|
+
handleClose();
|
|
8094
|
+
};
|
|
8095
|
+
var handleDelete = function (index) {
|
|
8096
|
+
if (selectedRowIndex !== null) {
|
|
8097
|
+
var tagToDelete = tagList[selectedRowIndex];
|
|
8098
|
+
onDeleteTag(tagToDelete.tagId);
|
|
8099
|
+
setSelectedRowIndex(null); // Reset the selected row index
|
|
8100
|
+
}
|
|
8101
|
+
};
|
|
8102
|
+
useEffect(function () {
|
|
8103
|
+
var handleGlobalClick = function (e) {
|
|
8104
|
+
if (selectedRowIndex !== null) {
|
|
8105
|
+
setSelectedRowIndex(null);
|
|
8106
|
+
}
|
|
8107
|
+
};
|
|
8108
|
+
var handleKeyDown = function (e) {
|
|
8109
|
+
if (e.key === "Escape" && selectedRowIndex !== null) {
|
|
8110
|
+
setSelectedRowIndex(null);
|
|
8111
|
+
}
|
|
8112
|
+
};
|
|
8113
|
+
// Attach event listeners
|
|
8114
|
+
document.addEventListener('click', handleGlobalClick);
|
|
8115
|
+
document.addEventListener('keydown', handleKeyDown);
|
|
8116
|
+
// Cleanup function
|
|
8117
|
+
return function () {
|
|
8118
|
+
document.removeEventListener('click', handleGlobalClick);
|
|
8119
|
+
document.removeEventListener('keydown', handleKeyDown);
|
|
8120
|
+
};
|
|
8121
|
+
}, [selectedRowIndex]);
|
|
8122
|
+
var handleRowClick = function (index) {
|
|
8123
|
+
setSelectedRowIndex(index);
|
|
8124
|
+
};
|
|
8125
|
+
var handleRightClick = function (event, index) {
|
|
8126
|
+
event.preventDefault();
|
|
8127
|
+
event.stopPropagation(); // Prevent the click event from propagating to the document
|
|
8128
|
+
setSelectedRowIndex(index);
|
|
8129
|
+
setContextMenuPosition({ x: event.clientX, y: event.clientY });
|
|
8130
|
+
};
|
|
8131
|
+
var modalStyle = {
|
|
8132
|
+
position: 'absolute',
|
|
8133
|
+
top: '50%',
|
|
8134
|
+
left: '50%',
|
|
8135
|
+
transform: 'translate(-50%, -50%)',
|
|
8136
|
+
width: 600,
|
|
8137
|
+
minHeight: 800,
|
|
8138
|
+
bgcolor: 'background.paper',
|
|
8139
|
+
border: '2px solid #000',
|
|
8140
|
+
boxShadow: 24,
|
|
8141
|
+
p: 4
|
|
8142
|
+
};
|
|
8143
|
+
return (React__default.createElement("div", null,
|
|
8144
|
+
React__default.createElement("table", { cellPadding: '5px' },
|
|
8145
|
+
React__default.createElement("thead", null,
|
|
8146
|
+
React__default.createElement("tr", null,
|
|
8147
|
+
React__default.createElement("th", null, "Visible"),
|
|
8148
|
+
React__default.createElement("th", null, "Tag Name"),
|
|
8149
|
+
React__default.createElement("th", null, "Color"),
|
|
8150
|
+
React__default.createElement("th", null, "Min Scale"),
|
|
8151
|
+
React__default.createElement("th", null, "Max Scale"),
|
|
8152
|
+
React__default.createElement("th", null, "AutoScale"),
|
|
8153
|
+
React__default.createElement("th", null, "X"),
|
|
8154
|
+
React__default.createElement("th", null, "Y"))),
|
|
8155
|
+
React__default.createElement("tbody", null, tagList.map(function (tag, index) { return (React__default.createElement("tr", { key: tag.tagName, onClick: function () { return handleRowClick(index); }, onContextMenu: function (e) { return handleRightClick(e, index); }, className: selectedRowIndex === index ? "selected-row" : "" },
|
|
8156
|
+
React__default.createElement("td", null,
|
|
8157
|
+
React__default.createElement("input", { type: "checkbox", checked: tag.visible, onChange: function (e) { return handleVisibilityChange(index, e.target.checked); } })),
|
|
8158
|
+
React__default.createElement("td", null, tag.tagName),
|
|
8159
|
+
React__default.createElement("td", null,
|
|
8160
|
+
React__default.createElement("div", { style: {
|
|
8161
|
+
backgroundColor: tag.color,
|
|
8162
|
+
width: '20px',
|
|
8163
|
+
height: '20px'
|
|
8164
|
+
} })),
|
|
8165
|
+
React__default.createElement("td", null,
|
|
8166
|
+
React__default.createElement("input", { type: "text", style: { width: '100%' }, value: tag.minScale, onFocus: function (e) { return e.target.select(); }, onChange: function (e) {
|
|
8167
|
+
var value = e.target.value;
|
|
8168
|
+
var numericValue = Number(value);
|
|
8169
|
+
// Check if the value is a number and not empty
|
|
8170
|
+
handleChange(index, numericValue, 'minScale');
|
|
8171
|
+
} })),
|
|
8172
|
+
React__default.createElement("td", null,
|
|
8173
|
+
React__default.createElement("input", { type: "text", style: { width: '100%' }, value: tag.maxScale, onFocus: function (e) { return e.target.select(); }, onChange: function (e) {
|
|
8174
|
+
var value = e.target.value;
|
|
8175
|
+
var numericValue = Number(value);
|
|
8176
|
+
// Check if the value is a number and not empty
|
|
8177
|
+
if (!isNaN(numericValue) && value.trim() !== '') {
|
|
8178
|
+
handleChange(index, numericValue, 'maxScale');
|
|
8179
|
+
}
|
|
8180
|
+
} })),
|
|
8181
|
+
React__default.createElement("td", null,
|
|
8182
|
+
React__default.createElement("input", { type: "checkbox", checked: tag.autoScale, onChange: function (e) { return handleAutoScaleChange(index, e.target.checked); } })),
|
|
8183
|
+
React__default.createElement("td", null, cursorData ? (function () {
|
|
8184
|
+
var date = new Date(cursorData.x);
|
|
8185
|
+
var formattedDate = date.toLocaleString('en-US', {
|
|
8186
|
+
hour12: false,
|
|
8187
|
+
month: 'short',
|
|
8188
|
+
day: 'numeric',
|
|
8189
|
+
hour: '2-digit',
|
|
8190
|
+
minute: '2-digit',
|
|
8191
|
+
second: '2-digit'
|
|
8192
|
+
});
|
|
8193
|
+
var milliseconds = date.getMilliseconds().toString().padStart(3, '0');
|
|
8194
|
+
return "".concat(formattedDate, ".").concat(milliseconds);
|
|
8195
|
+
})() : null),
|
|
8196
|
+
React__default.createElement("td", null, cursorData ? cursorData.values[index] : null))); }))),
|
|
8197
|
+
selectedRowIndex !== null && (React__default.createElement(ContextMenu, { x: contextMenuPosition.x, y: contextMenuPosition.y, options: contextMenuOptions })),
|
|
8198
|
+
React__default.createElement(MesfModal, { open: modalOpen, handleClose: handleClose, "aria-labelledby": "modal-modal-title", "aria-describedby": "modal-modal-description" },
|
|
8199
|
+
React__default.createElement(MesfModal.Content, null,
|
|
8200
|
+
React__default.createElement(Box, { sx: modalStyle },
|
|
8201
|
+
React__default.createElement(Typography, { id: "modal-modal-title", variant: "h6", component: "h2" }, "Tags"),
|
|
8202
|
+
React__default.createElement(Typography, { id: "modal-modal-description" },
|
|
8203
|
+
React__default.createElement(TagSelectionModal, { isOpen: modalOpen, onClose: function () { return handleClose; }, onTagSelect: handleTagSelect })))))));
|
|
8204
|
+
};
|
|
8205
|
+
|
|
8206
|
+
Chart.register(CategoryScale, LinearScale, PointElement, LineElement, Title, Tooltip, Legend, TimeScale, zoomPlugin);
|
|
8207
|
+
function getVerticalLinePlugin(setCursorData) {
|
|
8208
|
+
return {
|
|
8209
|
+
id: 'verticalLinePlugin',
|
|
8210
|
+
beforeInit: function (chart) {
|
|
8211
|
+
var canvas = chart.canvas;
|
|
8212
|
+
chart.mouseX = null;
|
|
8213
|
+
canvas.addEventListener('mousemove', function (event) {
|
|
8214
|
+
var rect = canvas.getBoundingClientRect();
|
|
8215
|
+
chart.mouseX = event.clientX - rect.left;
|
|
8216
|
+
var xScale = chart.scales.x;
|
|
8217
|
+
var mouseXPixel = chart.mouseX - xScale.left; // Adjusting for the scale's position
|
|
8218
|
+
var timeAtCursor = xScale.min + (mouseXPixel * (xScale.max - xScale.min) / xScale.width);
|
|
8219
|
+
var valuesAtCursor = [];
|
|
8220
|
+
// Loop through each dataset to find the previous y-values at the current x-position
|
|
8221
|
+
chart.data.datasets.forEach(function (dataset) {
|
|
8222
|
+
// Find the closest preceding data point
|
|
8223
|
+
var previousDataPoint = null;
|
|
8224
|
+
for (var i = 0; i < dataset.data.length; i++) {
|
|
8225
|
+
if (dataset.data[i].x.getTime() <= timeAtCursor) {
|
|
8226
|
+
previousDataPoint = dataset.data[i];
|
|
8227
|
+
}
|
|
8228
|
+
else {
|
|
8229
|
+
break;
|
|
8230
|
+
}
|
|
8231
|
+
}
|
|
8232
|
+
if (previousDataPoint) {
|
|
8233
|
+
valuesAtCursor.push(previousDataPoint.y);
|
|
8234
|
+
}
|
|
8235
|
+
});
|
|
8236
|
+
setCursorData({ x: timeAtCursor, values: valuesAtCursor });
|
|
8237
|
+
chart.draw();
|
|
8238
|
+
});
|
|
8239
|
+
},
|
|
8240
|
+
afterDatasetsDraw: function (chart, args, options) {
|
|
8241
|
+
if (chart.mouseX) {
|
|
8242
|
+
var ctx = chart.ctx;
|
|
8243
|
+
var x = chart.mouseX;
|
|
8244
|
+
var topY = chart.chartArea.top;
|
|
8245
|
+
var bottomY = chart.chartArea.bottom;
|
|
8246
|
+
ctx.save();
|
|
8247
|
+
ctx.beginPath();
|
|
8248
|
+
ctx.moveTo(x, topY);
|
|
8249
|
+
ctx.lineTo(x, bottomY);
|
|
8250
|
+
ctx.strokeStyle = '#ff0000'; // Customize line color
|
|
8251
|
+
ctx.lineWidth = 1; // Customize line width
|
|
8252
|
+
ctx.stroke();
|
|
8253
|
+
ctx.restore();
|
|
8254
|
+
}
|
|
8255
|
+
}
|
|
8256
|
+
};
|
|
8257
|
+
}
|
|
8258
|
+
var Trending = function (_a) {
|
|
8259
|
+
_a.title; var start = _a.start, end = _a.end, tags = _a.tags;
|
|
8260
|
+
var _b = useState({
|
|
8261
|
+
labels: [],
|
|
8262
|
+
datasets: []
|
|
8263
|
+
}), chartData = _b[0], setChartData = _b[1];
|
|
8264
|
+
var _c = useState({
|
|
8265
|
+
start: start,
|
|
8266
|
+
end: end // assuming 'end' is a Date object
|
|
8267
|
+
}), timeScope = _c[0], setTimeScope = _c[1];
|
|
8268
|
+
var _d = useState(tags), tagList = _d[0], setTagList = _d[1];
|
|
8269
|
+
var _e = useState(null), cursorData = _e[0], setCursorData = _e[1];
|
|
8270
|
+
var verticalLinePlugin = getVerticalLinePlugin(setCursorData);
|
|
8271
|
+
var _f = useState({
|
|
8272
|
+
showGrid: true,
|
|
8273
|
+
stepped: false
|
|
8274
|
+
}), customOptions = _f[0], setCustomOptions = _f[1];
|
|
8275
|
+
var _g = useState(true), loading = _g[0], setLoading = _g[1];
|
|
8276
|
+
var _h = useState(''), error = _h[0], setError = _h[1];
|
|
8277
|
+
var debounceTimerRef = useRef(null);
|
|
8278
|
+
var handleZoom = function (_a) {
|
|
8279
|
+
var chart = _a.chart;
|
|
8280
|
+
console.log('detected');
|
|
8281
|
+
if (debounceTimerRef.current) {
|
|
8282
|
+
clearTimeout(debounceTimerRef.current);
|
|
8283
|
+
}
|
|
8284
|
+
debounceTimerRef.current = setTimeout(function () {
|
|
8285
|
+
// Handle zoom event and execute fetch
|
|
8286
|
+
var newStart = new Date(chart.scales.x.min);
|
|
8287
|
+
var newEnd = new Date(chart.scales.x.max);
|
|
8288
|
+
setTimeScope(function (prevData) { return (__assign(__assign({}, prevData), { start: newStart, end: newEnd })); });
|
|
8289
|
+
console.log('change start / end' + newStart + ' - ' + newEnd);
|
|
8290
|
+
}, 1000);
|
|
8291
|
+
};
|
|
8292
|
+
var handleDeleteTag = function (tagId) {
|
|
8293
|
+
setTagList(function (prevTagList) { return prevTagList.filter(function (tag) { return tag.tagId !== tagId; }); });
|
|
8294
|
+
};
|
|
8295
|
+
var handleAddTag = function (newTag) {
|
|
8296
|
+
if (newTag) {
|
|
8297
|
+
setTagList(function (prevTagList) {
|
|
8298
|
+
// Check if the tag is already in the list to avoid duplicates
|
|
8299
|
+
if (prevTagList.some(function (tag) { return tag.tagId === newTag.tagId; })) {
|
|
8300
|
+
return prevTagList; // Return the existing list if the tag is already there
|
|
8301
|
+
}
|
|
8302
|
+
return __spreadArray(__spreadArray([], prevTagList, true), [newTag], false); // Add the new tag to the list
|
|
8303
|
+
});
|
|
8304
|
+
}
|
|
8305
|
+
};
|
|
8306
|
+
var _j = useState({
|
|
8307
|
+
animation: {
|
|
8308
|
+
duration: 0 // No animation
|
|
8309
|
+
},
|
|
8310
|
+
responsive: true,
|
|
8311
|
+
maintainAspectRatio: false,
|
|
8312
|
+
scales: {
|
|
8313
|
+
x: {
|
|
8314
|
+
type: 'time',
|
|
8315
|
+
ticks: {
|
|
8316
|
+
// Customize tick behavior if needed
|
|
8317
|
+
autoSkip: true,
|
|
8318
|
+
maxTicksLimit: 20,
|
|
8319
|
+
callback: function (value, index, values) {
|
|
8320
|
+
// Extract the time and date from the current value
|
|
8321
|
+
var currentDate = new Date(value);
|
|
8322
|
+
var time = currentDate.toLocaleTimeString('en-US', { hour12: false, hour: '2-digit', minute: '2-digit', second: '2-digit' });
|
|
8323
|
+
var date = currentDate.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
|
|
8324
|
+
// For the first tick, return both date and time
|
|
8325
|
+
if (index === 0) {
|
|
8326
|
+
return [time, date];
|
|
8327
|
+
}
|
|
8328
|
+
// For subsequent ticks, compare the date with the previous tick
|
|
8329
|
+
var previousDate = new Date(values[index - 1].value);
|
|
8330
|
+
if (currentDate.getDate() !== previousDate.getDate() ||
|
|
8331
|
+
currentDate.getMonth() !== previousDate.getMonth() ||
|
|
8332
|
+
currentDate.getFullYear() !== previousDate.getFullYear()) {
|
|
8333
|
+
// If the date has changed, return both time and date
|
|
8334
|
+
return [time, date];
|
|
8335
|
+
}
|
|
8336
|
+
// If the date hasn't changed, return only the time
|
|
8337
|
+
return [time, ''];
|
|
8338
|
+
}
|
|
8339
|
+
},
|
|
8340
|
+
grid: {
|
|
8341
|
+
display: true
|
|
8342
|
+
}
|
|
8343
|
+
},
|
|
8344
|
+
y: {
|
|
8345
|
+
grid: {
|
|
8346
|
+
display: true
|
|
8347
|
+
}
|
|
8348
|
+
}
|
|
8349
|
+
},
|
|
8350
|
+
plugins: {
|
|
8351
|
+
tooltip: { enabled: false },
|
|
8352
|
+
legend: { display: false },
|
|
8353
|
+
zoom: {
|
|
8354
|
+
zoom: {
|
|
8355
|
+
wheel: { enabled: true, mode: 'x' },
|
|
8356
|
+
pinch: { enabled: true, mode: 'x' },
|
|
8357
|
+
onZoom: handleZoom,
|
|
8358
|
+
mode: 'x'
|
|
8359
|
+
},
|
|
8360
|
+
pan: {
|
|
8361
|
+
enabled: true,
|
|
8362
|
+
mode: 'x',
|
|
8363
|
+
onPan: handleZoom
|
|
8364
|
+
}
|
|
8365
|
+
}
|
|
8366
|
+
}
|
|
8367
|
+
}), chartOptions = _j[0], setChartOptions = _j[1];
|
|
8368
|
+
useEffect(function () {
|
|
8369
|
+
var fetchData = function () { return __awaiter(void 0, void 0, void 0, function () {
|
|
8370
|
+
var tagIds, response, series_1, axes_1, updatedSeries, error_1;
|
|
8371
|
+
return __generator(this, function (_a) {
|
|
8372
|
+
switch (_a.label) {
|
|
8373
|
+
case 0:
|
|
8374
|
+
_a.trys.push([0, 2, , 3]);
|
|
8375
|
+
console.log('fetching data');
|
|
8376
|
+
setLoading(true);
|
|
8377
|
+
tagIds = tagList.map(function (tag) { return tag.tagId; });
|
|
8378
|
+
return [4 /*yield*/, axios.post('/series?nodeName=null', {
|
|
8379
|
+
start: timeScope.start.getTime(),
|
|
8380
|
+
end: timeScope.end.getTime(),
|
|
8381
|
+
tagIds: tagIds,
|
|
8382
|
+
sampleCount: 1000
|
|
8383
|
+
})];
|
|
8384
|
+
case 1:
|
|
8385
|
+
response = _a.sent();
|
|
8386
|
+
series_1 = response.data;
|
|
8387
|
+
axes_1 = [];
|
|
8388
|
+
tagList.forEach(function (tag, index) {
|
|
8389
|
+
if (tag.autoScale && series_1[index]) {
|
|
8390
|
+
var serieSamples = series_1[index].map(function (sample) { return sample.value; });
|
|
8391
|
+
var _a = calculateScales(Math.min.apply(Math, serieSamples), Math.max.apply(Math, serieSamples), 3), minScale = _a.minScale, maxScale = _a.maxScale;
|
|
8392
|
+
tag.minScale = minScale;
|
|
8393
|
+
tag.maxScale = maxScale;
|
|
8394
|
+
}
|
|
8395
|
+
var existingAxis = axes_1.find(function (existingTag) { return areRangesSimilar(existingTag, tag); });
|
|
8396
|
+
if (!existingAxis) {
|
|
8397
|
+
axes_1.push(tag); // Add new axis if no similar one exists
|
|
8398
|
+
}
|
|
8399
|
+
});
|
|
8400
|
+
axes_1.map(function (axis, index) {
|
|
8401
|
+
return {
|
|
8402
|
+
id: "y-axis-".concat(index),
|
|
8403
|
+
type: 'linear',
|
|
8404
|
+
display: axis.visible,
|
|
8405
|
+
scaleLabel: {
|
|
8406
|
+
display: true,
|
|
8407
|
+
labelString: axis.tagName
|
|
8408
|
+
},
|
|
8409
|
+
ticks: {
|
|
8410
|
+
min: axis.autoScale ? undefined : axis.minScale,
|
|
8411
|
+
max: axis.autoScale ? undefined : axis.maxScale
|
|
8412
|
+
},
|
|
8413
|
+
grid: {
|
|
8414
|
+
display: true
|
|
8415
|
+
}
|
|
8416
|
+
};
|
|
8417
|
+
});
|
|
8418
|
+
setChartOptions(function (prevOptions) { return (__assign(__assign({}, prevOptions), { scales: __assign(__assign({}, prevOptions.scales), { y: { grid: { display: true } } }) })); });
|
|
8419
|
+
updatedSeries = series_1.map(function (serie, index) {
|
|
8420
|
+
var tag = tagList[index];
|
|
8421
|
+
var axisIndex = axes_1.findIndex(function (existingTag) { return areRangesSimilar(existingTag, tag); });
|
|
8422
|
+
return {
|
|
8423
|
+
yAxisID: "y-axis-".concat(axisIndex),
|
|
8424
|
+
data: serie.map(function (sample) { return ({
|
|
8425
|
+
x: new Date(sample.timestamp),
|
|
8426
|
+
y: sample.value
|
|
8427
|
+
}); }),
|
|
8428
|
+
borderColor: tag.color,
|
|
8429
|
+
hidden: !tag.visible,
|
|
8430
|
+
pointRadius: (serie.length <= 50) ? 3 : 0 // Example threshold
|
|
8431
|
+
};
|
|
8432
|
+
});
|
|
8433
|
+
setChartData({
|
|
8434
|
+
labels: [],
|
|
8435
|
+
datasets: updatedSeries
|
|
8436
|
+
});
|
|
8437
|
+
setLoading(false);
|
|
8438
|
+
return [3 /*break*/, 3];
|
|
8439
|
+
case 2:
|
|
8440
|
+
error_1 = _a.sent();
|
|
8441
|
+
console.error('Error fetching data:', error_1);
|
|
8442
|
+
setError('Failed to fetch data');
|
|
8443
|
+
setLoading(false);
|
|
8444
|
+
return [3 /*break*/, 3];
|
|
8445
|
+
case 3: return [2 /*return*/];
|
|
8446
|
+
}
|
|
8447
|
+
});
|
|
8448
|
+
}); };
|
|
8449
|
+
fetchData();
|
|
8450
|
+
}, [timeScope, tagList]);
|
|
8451
|
+
useEffect(function () {
|
|
8452
|
+
var changeOptions = function () {
|
|
8453
|
+
console.log('change options');
|
|
8454
|
+
setChartOptions(function (prevOptions) { return (__assign(__assign({}, prevOptions), { elements: {
|
|
8455
|
+
line: {
|
|
8456
|
+
stepped: customOptions.stepped,
|
|
8457
|
+
lineTension: 0.1
|
|
8458
|
+
}
|
|
8459
|
+
}, scales: __assign(__assign({}, prevOptions.scales), { x: __assign(__assign({}, prevOptions.scales.x), { grid: __assign(__assign({}, prevOptions.scales.x.grid), { display: customOptions.showGrid }) }), y: __assign(__assign({}, prevOptions.scales.y), { grid: __assign(__assign({}, prevOptions.scales.y.grid), { display: customOptions.showGrid }) }) }) })); });
|
|
8460
|
+
};
|
|
8461
|
+
changeOptions();
|
|
8462
|
+
}, [customOptions]);
|
|
8463
|
+
function areRangesSimilar(tag1, tag2) {
|
|
8464
|
+
var threshold = 1; // Define a threshold for "closeness"
|
|
8465
|
+
// Helper function to safely compute logarithm, avoiding negative and zero values
|
|
8466
|
+
var safeLog = function (value) {
|
|
8467
|
+
if (value <= 0) {
|
|
8468
|
+
return null; // or some safe value depending on your context
|
|
8469
|
+
}
|
|
8470
|
+
return Math.log(value);
|
|
8471
|
+
};
|
|
8472
|
+
var logTag1Min = safeLog(tag1.minScale);
|
|
8473
|
+
var logTag1Max = safeLog(tag1.maxScale);
|
|
8474
|
+
var logTag2Min = safeLog(tag2.minScale);
|
|
8475
|
+
var logTag2Max = safeLog(tag2.maxScale);
|
|
8476
|
+
// Check if any log value is null, which indicates an invalid comparison
|
|
8477
|
+
if (logTag1Min === null || logTag1Max === null || logTag2Min === null || logTag2Max === null) {
|
|
8478
|
+
return false;
|
|
8479
|
+
}
|
|
8480
|
+
var logDiffMin = Math.abs(logTag1Min - logTag2Min);
|
|
8481
|
+
var logDiffMax = Math.abs(logTag1Max - logTag2Max);
|
|
8482
|
+
return logDiffMin < threshold && logDiffMax < threshold;
|
|
8483
|
+
}
|
|
8484
|
+
function calculateScales(min, max, sigDigits) {
|
|
8485
|
+
var roundToSignificantDigits = function (num) {
|
|
8486
|
+
if (num === 0)
|
|
8487
|
+
return 0;
|
|
8488
|
+
var multiplier = Math.pow(10, sigDigits - Math.floor(Math.log10(Math.abs(num))) - 1);
|
|
8489
|
+
return Math.round(num * multiplier) / multiplier;
|
|
8490
|
+
};
|
|
8491
|
+
var minScale = roundToSignificantDigits(min);
|
|
8492
|
+
var maxScale = roundToSignificantDigits(max);
|
|
8493
|
+
// Adjust minScale and maxScale if necessary
|
|
8494
|
+
if (minScale > min) {
|
|
8495
|
+
minScale *= .9;
|
|
8496
|
+
}
|
|
8497
|
+
if (maxScale < max) {
|
|
8498
|
+
maxScale *= 1.1;
|
|
8499
|
+
}
|
|
8500
|
+
return { minScale: minScale, maxScale: maxScale };
|
|
8501
|
+
}
|
|
8502
|
+
if (error)
|
|
8503
|
+
return React__default.createElement("p", null,
|
|
8504
|
+
"Error: ",
|
|
8505
|
+
error);
|
|
8506
|
+
return (React__default.createElement("div", { className: "dashboard" },
|
|
8507
|
+
React__default.createElement("div", { className: "header" },
|
|
8508
|
+
React__default.createElement("div", { className: "date-pickers" },
|
|
8509
|
+
React__default.createElement(DateComponent, { date: timeScope.start }),
|
|
8510
|
+
React__default.createElement(DateComponent, { date: timeScope.end })),
|
|
8511
|
+
React__default.createElement("div", { className: "options" },
|
|
8512
|
+
React__default.createElement(CustomOptionsComponent, { customOptions: customOptions, setCustomOptions: setCustomOptions })),
|
|
8513
|
+
React__default.createElement("div", { className: "buttons" },
|
|
8514
|
+
React__default.createElement("button", null, "Button"),
|
|
8515
|
+
React__default.createElement("button", null, "Button"))),
|
|
8516
|
+
React__default.createElement("div", { className: "chart-container" },
|
|
8517
|
+
React__default.createElement(Line, { data: chartData, options: chartOptions, plugins: [verticalLinePlugin] })),
|
|
8518
|
+
React__default.createElement("div", { className: "table-container" },
|
|
8519
|
+
React__default.createElement(TableComponent, { tagList: tagList, setTagList: setTagList, cursorData: cursorData, onDeleteTag: handleDeleteTag, onAddTag: handleAddTag })),
|
|
8520
|
+
loading ? React__default.createElement("p", { className: "loading" }, "Loading...") : null));
|
|
8521
|
+
};
|
|
8522
|
+
|
|
8523
|
+
// @flow
|
|
8524
|
+
var TrendingsIndex = function (props) {
|
|
8525
|
+
var _a = useState(new Date('2023-11-16')), startDate = _a[0]; _a[1];
|
|
8526
|
+
var _b = useState(new Date('2023-11-17')), endDate = _b[0]; _b[1];
|
|
8527
|
+
return (React.createElement(Container$1, null,
|
|
8528
|
+
React.createElement(Box, { p: 1 },
|
|
8529
|
+
React.createElement(Paper, null,
|
|
8530
|
+
React.createElement(Grid$1, { container: true, spacing: 3 },
|
|
8531
|
+
React.createElement(Grid$1, { item: true, xs: 12 },
|
|
8532
|
+
React.createElement(Trending, { title: "Trending Chart", start: startDate, end: endDate, tags: [
|
|
8533
|
+
{ tagId: 29, tagName: 't1', tagType: 'number', color: 'red', autoScale: true, minScale: 0, maxScale: 100, visible: true },
|
|
8534
|
+
{ tagId: 44, tagName: 't2', tagType: 'number', color: 'blue', autoScale: true, minScale: 0, maxScale: 100, visible: true },
|
|
8535
|
+
{ tagId: 50, tagName: 't3', tagType: 'number', color: 'green', autoScale: true, minScale: 0, maxScale: 100, visible: true },
|
|
8536
|
+
{ tagId: 46, tagName: 't4', tagType: 'number', color: 'black', autoScale: true, minScale: 0, maxScale: 100, visible: true },
|
|
8537
|
+
] })))))));
|
|
8538
|
+
};
|
|
8539
|
+
|
|
7821
8540
|
var MESFMainRouter = function () {
|
|
7822
8541
|
var CustomRoutes = useContext(RouterContext);
|
|
7823
8542
|
return (React__default.createElement(React__default.Fragment, null,
|
|
@@ -7825,6 +8544,7 @@ var MESFMainRouter = function () {
|
|
|
7825
8544
|
React__default.createElement(Route, { path: "/", element: React__default.createElement(Navigate, { replace: true, to: "/home" }) }),
|
|
7826
8545
|
React__default.createElement(Route, { path: "/configuration/*", element: React__default.createElement(Configuration, null) }),
|
|
7827
8546
|
React__default.createElement(Route, { path: "/account", element: React__default.createElement(Account, null) }),
|
|
8547
|
+
React__default.createElement(Route, { path: "/trendings", element: React__default.createElement(TrendingsIndex, null) }),
|
|
7828
8548
|
React__default.createElement(Route, { path: "/home", element: React__default.createElement(Home, null) })),
|
|
7829
8549
|
React__default.createElement(CustomRoutes, null)));
|
|
7830
8550
|
};
|
|
@@ -7853,7 +8573,7 @@ var Navigation = function (_a) {
|
|
|
7853
8573
|
React__default.createElement(MESFMainContainer, null)));
|
|
7854
8574
|
};
|
|
7855
8575
|
|
|
7856
|
-
var css = "body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n background-color: #fafbfc !important;\n}\n.container-fluid-main{\n padding-right: 0px !important; \n padding-left: 0px !important;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n\n.mes-primary-color {\n background-color: #479dc4 !important;\n}\n.mes-button-primary{\n background-color: #479dc4 !important;\n border-color: #479dc4 !important;\n}\n\n.mes-selectable-datagrid .MuiDataGrid-row{\n cursor: pointer;\n}\n\n.mes-menu-top .navbar-brand{\n color: #FFFF !important;\n}\n.mes-menu-top .nav-link {\n color: #FFFF !important;\n}\n.mes-menu-top .navbar-toggler {\n color: #FFFF !important;\n}\n.mes-menu-top .navbar-text {\n color: #FFFF !important;\n}\n.mes-footer-login{\n position: absolute;\n bottom: 0;\n width: 100%;\n height: 10em;\n line-height: 60px;\n text-align:center;\n}\n.mes-filter-datepicker{\n padding: unset !important;\n border-top-left-radius: 0 !important;\n border-bottom-left-radius: 0 !important;\n padding-top: 0.375rem !important;\n padding-bottom: 0.375rem !important;\n padding-left: 0.75rem !important;\n cursor: pointer !important;\n max-width: 120px;\n}\n.mes-filter-datetimepicker{\n max-width: 97px;\n}\n.mes-not-rounded{\n border-radius: unset !important;\n}\n\n.mes-numeric{\n text-align: right;\n}\n.mes-drag-over{\n border: 3px dotted #666;\n background-color: #479dc4 !important;\n}\n.mes-drag-start{\n border: 3px solid #666;\n}\n\n.mes-selectable{\n cursor: pointer !important;\n}\n\n.mes-custom-select{\n width: auto !important;\n padding: 0.375rem 0 0.375rem 0 !important;\n background: unset !important;\n font-family: inherit !important;\n}\n.mes-custom-select .MuiSelect-select{\n padding-left: 14px;\n}\n\n.mes-custom-select::before{\n border-bottom: unset !important;\n}\n.mes-custom-select::after{\n border-bottom: unset !important;\n}\n.mes-no-border{\n border: unset;\n}\n.mes-no-border:focus-visible {\n outline: unset;\n}\n.mes-div-submenu{\n border-right: 1px solid #cfdbe2
|
|
8576
|
+
var css = "body {\n margin: 0;\n font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',\n 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',\n sans-serif;\n -webkit-font-smoothing: antialiased;\n -moz-osx-font-smoothing: grayscale;\n background-color: #fafbfc !important;\n}\n.container-fluid-main{\n padding-right: 0px !important; \n padding-left: 0px !important;\n}\n\ncode {\n font-family: source-code-pro, Menlo, Monaco, Consolas, 'Courier New',\n monospace;\n}\n\n.mes-primary-color {\n background-color: #479dc4 !important;\n}\n.mes-button-primary{\n background-color: #479dc4 !important;\n border-color: #479dc4 !important;\n}\n\n.mes-selectable-datagrid .MuiDataGrid-row{\n cursor: pointer;\n}\n\n.mes-menu-top .navbar-brand{\n color: #FFFF !important;\n}\n.mes-menu-top .nav-link {\n color: #FFFF !important;\n}\n.mes-menu-top .navbar-toggler {\n color: #FFFF !important;\n}\n.mes-menu-top .navbar-text {\n color: #FFFF !important;\n}\n.mes-footer-login{\n position: absolute;\n bottom: 0;\n width: 100%;\n height: 10em;\n line-height: 60px;\n text-align:center;\n}\n.mes-filter-datepicker{\n padding: unset !important;\n border-top-left-radius: 0 !important;\n border-bottom-left-radius: 0 !important;\n padding-top: 0.375rem !important;\n padding-bottom: 0.375rem !important;\n padding-left: 0.75rem !important;\n cursor: pointer !important;\n max-width: 120px;\n}\n.mes-filter-datetimepicker{\n max-width: 97px;\n}\n.mes-not-rounded{\n border-radius: unset !important;\n}\n\n.mes-numeric{\n text-align: right;\n}\n.mes-drag-over{\n border: 3px dotted #666;\n background-color: #479dc4 !important;\n}\n.mes-drag-start{\n border: 3px solid #666;\n}\n\n.mes-selectable{\n cursor: pointer !important;\n}\n\n.mes-custom-select{\n width: auto !important;\n padding: 0.375rem 0 0.375rem 0 !important;\n background: unset !important;\n font-family: inherit !important;\n}\n.mes-custom-select .MuiSelect-select{\n padding-left: 14px;\n}\n\n.mes-custom-select::before{\n border-bottom: unset !important;\n}\n.mes-custom-select::after{\n border-bottom: unset !important;\n}\n.mes-no-border{\n border: unset;\n}\n.mes-no-border:focus-visible {\n outline: unset;\n}\n.mes-div-submenu{\n border-right: 1px solid #cfdbe2;\n overflow-y: scroll;\n max-height: 80vh;\n}\n.mes-submenu a{\n width: 100% !important;\n /* color: rgba(0, 0, 0, 0.87); */\n color: #479dc4\n}\n.mes-submenu .Mui-selected{\n border-right: 3px solid #479dc4; \n}\n.mes-menu-group{\n font-size: 20px;\n line-height: 1.1;\n color: #929292; \n font-weight: normal; \n}\n\n/********************MUI DATAGRID*****************************/\n.Mui-selected{\n font-weight: bolder !important;\n opacity: 1 !important;\n}\n\n.mes-upload-control{\n\n}\n.mes-upload-control .file-box{\n /* border : 1px solid black; */\n height : 100px;\n position: relative; \n}\n.mes-upload-control .file-detail{\n position: absolute;\n left: 0px;\n top: 0px; \n z-index: 1;\n height: 100%;\n width: 100%;\n}\n\n.mes-upload-control input[type=file]{\n left: 0px;\n top: 0px;\n opacity: 0;\n z-index: 10000;\n height: 100%;\n cursor: pointer;\n}\n.mes-upload-control table{\n width: 100%;\n}\n.mes-upload-control td{\n font-size: 0.8rem !important;\n max-width:0;overflow: hidden;text-overflow: ellipsis;white-space: nowrap;\n}\n\n\n.input-group-text{\n background-color: #ced2cc !important;\n /* border: 1px solid #ced4da !important; */\n /* color: #000000 !important; */\n}\n\n\n\n\n.content-wrapper {\n padding: 15px;\n width: 100%;\n border-top: 1px solid rgba(0, 0, 0, 0.15);\n margin-top: -1px;\n}\n.content-wrapper > .unwrap {\n margin: -15px;\n}\n@media only screen and (min-width: 768px) {\n .content-wrapper > .unwrap {\n margin: -20px;\n }\n}\n.content-wrapper > h3,\n.content-wrapper > .content-heading {\n font-size: 24px;\n line-height: 1.1;\n color: #929292;\n margin: -15px;\n margin-bottom: 20px;\n padding: 15px;\n font-weight: normal;\n background-color: #fafbfc;\n border-bottom: 1px solid #cfdbe2;\n}\n.content-wrapper > h3 > small,\n.content-wrapper > .content-heading > small {\n display: block;\n font-size: 12px;\n color: #909fa7;\n}\n.content-wrapper > button,\n.content-wrapper > .btn {\n margin: 10px 10px 0 0;\n}\n.content-wrapper .container,\n.content-wrapper .container-fluid {\n padding-left: 0;\n padding-right: 0;\n}\n@media only screen and (min-width: 768px) {\n .content-wrapper {\n padding: 20px;\n }\n .content-wrapper > h3,\n .content-wrapper > .content-heading {\n margin: -20px;\n margin-bottom: 5px;\n padding: 15px;\n }\n .content-wrapper > button,\n .content-wrapper > .btn {\n margin: 0;\n }\n}\n\n @media print {\n .sidebar,\n .topnavbar,\n .offsidebar,\n .btn {\n display: none !important;\n width: 0 !important;\n height: 0 !important;\n }\n .wrapper,\n .wrapper > section,\n .content-wrapper {\n margin: 0 !important;\n /* remove margin used for sidebar and expand the content */\n padding: 0 !important;\n width: 100% !important;\n }\n .content-wrapper {\n overflow: hidden !important;\n }\n }\n ";
|
|
7857
8577
|
n(css,{});
|
|
7858
8578
|
|
|
7859
8579
|
var base = document.getElementsByTagName('base')[0].getAttribute('href') || '/';
|
|
@@ -8000,4 +8720,4 @@ var areaSelector = /*#__PURE__*/Object.freeze({
|
|
|
8000
8720
|
AreaSelector: AreaSelector
|
|
8001
8721
|
});
|
|
8002
8722
|
|
|
8003
|
-
export { Account, AssetProvider, AuthContext, AuthProvider, BarChartControl, ChangePassword, CheckBoxControl, Configuration$1 as Configuration, CurrencyFormatter, DataGridControl, DateFormatter, DateTimeFormatter, ErrorModal, FetchError, FilterPanel, GenericPanel, GenericTable, GetCrewColor, GetShiftColor, HorizontalTextControl, IntegerFormatter, Login, Logout, LongFilterPanel, MESApiService, MESFMain, MESSAGE_API, MESSAGE_ERRORS, MasterDetailPanel, MesfModal, ModalTreeFilterControl, MultipleSelectorControl, NumberFormatter, NumericTextControl, SimplePasswordControl, SimpleSelectorControl, SimpleTextAreaControl, SimpleTextControl, TimeFormatter, TreePickerControl, USER_LABELS, UTLSettingsProvider, UploadFileControl, UserProvider, axiosInstance, formatNumber, getCrewStyle, getError, getShiftStyle, getTokenFromLS, renewToken, useAssetContext, useToken, useUTLSettingsContext, useUserContext };
|
|
8723
|
+
export { Account, AssetProvider, AuthContext, AuthProvider, BarChartControl, ChangePassword, CheckBoxControl, Configuration$1 as Configuration, CurrencyFormatter, DataGridControl, DateFormatter, DateTimeFormatter, ErrorModal, FetchError, FilterPanel, GenericPanel, GenericTable, GetCrewColor, GetShiftColor, HorizontalTextControl, IntegerFormatter, Login, Logout, LongFilterPanel, MESApiService, MESFMain, MESSAGE_API, MESSAGE_ERRORS, MasterDetailPanel, MesfModal, ModalTreeFilterControl, MultipleSelectorControl, NumberFormatter, NumericTextControl, SimplePasswordControl, SimpleSelectorControl, SimpleTextAreaControl, SimpleTextControl, TimeFormatter, TreePickerControl, TrendingsIndex, USER_LABELS, UTLSettingsProvider, UploadFileControl, UserProvider, axiosInstance, formatNumber, getCrewStyle, getError, getShiftStyle, getTokenFromLS, renewToken, useAssetContext, useToken, useUTLSettingsContext, useUserContext };
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { CursorData, TagList } from './Trending';
|
|
3
|
+
import './ContextMenu.css';
|
|
4
|
+
interface TableComponentProps {
|
|
5
|
+
tagList: TagList;
|
|
6
|
+
setTagList: React.Dispatch<React.SetStateAction<TagList>>;
|
|
7
|
+
cursorData: CursorData;
|
|
8
|
+
onDeleteTag: (tagId: number) => void;
|
|
9
|
+
onAddTag: (tagId: number) => void;
|
|
10
|
+
}
|
|
11
|
+
declare const TableComponent: React.FC<TableComponentProps>;
|
|
12
|
+
export default TableComponent;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { Tag } from './Trending';
|
|
3
|
+
interface TagSelectionModalProps {
|
|
4
|
+
isOpen: boolean;
|
|
5
|
+
onClose: () => void;
|
|
6
|
+
onTagSelect: (tag: Tag) => void;
|
|
7
|
+
}
|
|
8
|
+
declare const TagSelectionModal: React.FC<TagSelectionModalProps>;
|
|
9
|
+
export default TagSelectionModal;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import 'chartjs-adapter-moment/dist/chartjs-adapter-moment.esm.js';
|
|
3
|
+
interface TrendingProps {
|
|
4
|
+
title: string;
|
|
5
|
+
start: Date;
|
|
6
|
+
end: Date;
|
|
7
|
+
tags: Tag[];
|
|
8
|
+
}
|
|
9
|
+
interface Sample {
|
|
10
|
+
timestamp: number;
|
|
11
|
+
value: number;
|
|
12
|
+
}
|
|
13
|
+
export type SampleArray = Sample[][];
|
|
14
|
+
export interface Tag {
|
|
15
|
+
tagId: number;
|
|
16
|
+
tagName: string;
|
|
17
|
+
tagType: string;
|
|
18
|
+
color: string;
|
|
19
|
+
autoScale: boolean;
|
|
20
|
+
minScale: number;
|
|
21
|
+
maxScale: number;
|
|
22
|
+
visible: boolean;
|
|
23
|
+
}
|
|
24
|
+
export interface CursorData {
|
|
25
|
+
x: Date;
|
|
26
|
+
values: number[];
|
|
27
|
+
}
|
|
28
|
+
export interface CustomOptions {
|
|
29
|
+
showGrid: boolean;
|
|
30
|
+
stepped: boolean;
|
|
31
|
+
}
|
|
32
|
+
export type TagList = Tag[];
|
|
33
|
+
declare const Trending: React.FC<TrendingProps>;
|
|
34
|
+
export default Trending;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import { CustomOptions } from "./Trending";
|
|
3
|
+
interface CustomOptionsComponentProps {
|
|
4
|
+
customOptions: CustomOptions;
|
|
5
|
+
setCustomOptions: React.Dispatch<React.SetStateAction<CustomOptions>>;
|
|
6
|
+
}
|
|
7
|
+
declare const CustomOptionsComponent: React.FC<CustomOptionsComponentProps>;
|
|
8
|
+
export default CustomOptionsComponent;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const TrendingsReducer: import("@reduxjs/toolkit").Slice<{}, {}, "__">;
|
|
@@ -1,28 +1,4 @@
|
|
|
1
|
-
export declare const getUser: (UserId: number, UserName: string | null) => Promise<
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
ok: true;
|
|
6
|
-
data: any;
|
|
7
|
-
}>;
|
|
8
|
-
export declare const getAssets: () => Promise<{
|
|
9
|
-
ok: false;
|
|
10
|
-
message: string;
|
|
11
|
-
} | {
|
|
12
|
-
ok: true;
|
|
13
|
-
data: any;
|
|
14
|
-
}>;
|
|
15
|
-
export declare const getUTLSettings: () => Promise<{
|
|
16
|
-
ok: false;
|
|
17
|
-
message: string;
|
|
18
|
-
} | {
|
|
19
|
-
ok: true;
|
|
20
|
-
data: any;
|
|
21
|
-
}>;
|
|
22
|
-
export declare const upsertDefaultAreaId: (UserId: number, DefaultAreaId: number | null) => Promise<{
|
|
23
|
-
ok: false;
|
|
24
|
-
message: string;
|
|
25
|
-
} | {
|
|
26
|
-
ok: true;
|
|
27
|
-
data: any;
|
|
28
|
-
}>;
|
|
1
|
+
export declare const getUser: (UserId: number, UserName: string | null) => Promise<import("../services").ResponseMESF>;
|
|
2
|
+
export declare const getAssets: () => Promise<import("../services").ResponseMESF>;
|
|
3
|
+
export declare const getUTLSettings: () => Promise<import("../services").ResponseMESF>;
|
|
4
|
+
export declare const upsertDefaultAreaId: (UserId: number, DefaultAreaId: number | null) => Promise<import("../services").ResponseMESF>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dexteel/mesf-core",
|
|
3
|
-
"version": "4.
|
|
3
|
+
"version": "4.4.0-alpha",
|
|
4
4
|
"author": "Dexteel Team",
|
|
5
5
|
"module": "dist/index.esm.js",
|
|
6
6
|
"typings": "dist/index.d.ts",
|
|
@@ -61,6 +61,9 @@
|
|
|
61
61
|
"@nivo/bar": "^0.79.1",
|
|
62
62
|
"@nivo/core": "^0.79.0",
|
|
63
63
|
"@reduxjs/toolkit": "^1.6.2",
|
|
64
|
+
"ag-grid-community": "^29.2.0",
|
|
65
|
+
"ag-grid-enterprise": "^29.2.0",
|
|
66
|
+
"ag-grid-react": "^29.2.0",
|
|
64
67
|
"bootstrap": "^4.6.1",
|
|
65
68
|
"moment": "^2.29.1",
|
|
66
69
|
"prop-types": "^15.8.1",
|
|
@@ -71,10 +74,7 @@
|
|
|
71
74
|
"react-spring": "^9.4.3",
|
|
72
75
|
"rimraf": "^3.0.2",
|
|
73
76
|
"string-to-color": "^2.2.2",
|
|
74
|
-
"use-complex-state": "^1.1.0"
|
|
75
|
-
"ag-grid-community": "^29.2.0",
|
|
76
|
-
"ag-grid-enterprise": "^29.2.0",
|
|
77
|
-
"ag-grid-react": "^29.2.0"
|
|
77
|
+
"use-complex-state": "^1.1.0"
|
|
78
78
|
},
|
|
79
79
|
"browserslist": {
|
|
80
80
|
"production": [
|
|
@@ -95,7 +95,11 @@
|
|
|
95
95
|
"@emotion/styled": "^11.11.0",
|
|
96
96
|
"@minoru/react-dnd-treeview": "^3.4.4",
|
|
97
97
|
"axios": "^1.3.5",
|
|
98
|
+
"chart.js": "^4.4.1",
|
|
99
|
+
"chartjs-adapter-moment": "^1.0.1",
|
|
100
|
+
"chartjs-plugin-zoom": "^2.0.1",
|
|
98
101
|
"lodash-es": "^4.17.21",
|
|
102
|
+
"react-chartjs-2": "^5.2.0",
|
|
99
103
|
"react-dnd": "^16.0.1",
|
|
100
104
|
"string-to-color": "^2.2.2",
|
|
101
105
|
"tsc": "^2.0.3"
|