quidproquo-web-admin 0.0.241 → 0.0.243
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/lib/commonjs/LogViewer/AdminLogs/AdminLogGrid/AdminLogGrid.d.ts +8 -0
- package/lib/commonjs/LogViewer/AdminLogs/AdminLogGrid/AdminLogGrid.js +114 -0
- package/lib/commonjs/LogViewer/AdminLogs/AdminLogGrid/index.d.ts +1 -0
- package/lib/commonjs/LogViewer/AdminLogs/AdminLogGrid/index.js +17 -0
- package/lib/commonjs/LogViewer/AdminLogs/AdminLogSearchBar/AdminLogSearchBar.d.ts +7 -0
- package/lib/commonjs/LogViewer/AdminLogs/AdminLogSearchBar/AdminLogSearchBar.js +69 -0
- package/lib/commonjs/LogViewer/AdminLogs/AdminLogSearchBar/index.d.ts +1 -0
- package/lib/commonjs/LogViewer/AdminLogs/AdminLogSearchBar/index.js +17 -0
- package/lib/commonjs/LogViewer/AdminLogs/AdminLogs.d.ts +1 -0
- package/lib/commonjs/LogViewer/AdminLogs/AdminLogs.js +15 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/index.d.ts +3 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/index.js +19 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/logic/getLogLogs.d.ts +3 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/logic/getLogLogs.js +31 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/logic/searchLogLogs.d.ts +3 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/logic/searchLogLogs.js +34 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/types/LogLogSearchParams.d.ts +9 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/types/LogLogSearchParams.js +2 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/types/index.d.ts +1 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/types/index.js +17 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/useLogLogMananagement/index.d.ts +1 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/useLogLogMananagement/index.js +17 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/useLogLogMananagement/useLogLogMananagement.d.ts +9 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/useLogLogMananagement/useLogLogMananagement.js +29 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/useLogLogSearch/index.d.ts +1 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/useLogLogSearch/index.js +17 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/useLogLogSearch/useLogLogSearch.d.ts +10 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/useLogLogSearch/useLogLogSearch.js +31 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/useLogLogSearchRequest/index.d.ts +1 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/useLogLogSearchRequest/index.js +17 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/useLogLogSearchRequest/useLogLogSearchRequest.d.ts +3 -0
- package/lib/commonjs/LogViewer/AdminLogs/hooks/useLogLogSearchRequest/useLogLogSearchRequest.js +29 -0
- package/lib/commonjs/LogViewer/AdminLogs/index.d.ts +1 -0
- package/lib/commonjs/LogViewer/AdminLogs/index.js +17 -0
- package/lib/commonjs/LogViewer/LogViewer.js +7 -2
- package/lib/commonjs/LogViewer/actionComponents/custom/CoreLogCreateCustomAction.d.ts +3 -0
- package/lib/commonjs/LogViewer/actionComponents/custom/CoreLogCreateCustomAction.js +36 -0
- package/lib/commonjs/LogViewer/actionComponents/custom/CoreLogDisableEventHistoryCustomAction.d.ts +3 -0
- package/lib/commonjs/LogViewer/actionComponents/custom/CoreLogDisableEventHistoryCustomAction.js +18 -0
- package/lib/commonjs/LogViewer/actionComponents/custom/CoreLogTemplateLiteralCustomAction.d.ts +3 -0
- package/lib/commonjs/LogViewer/actionComponents/custom/CoreLogTemplateLiteralCustomAction.js +19 -0
- package/lib/commonjs/LogViewer/actionComponents/custom/CoreNetworkRequestCustomAction.d.ts +2 -1
- package/lib/commonjs/LogViewer/actionComponents/custom/CoreNetworkRequestCustomAction.js +3 -0
- package/lib/commonjs/LogViewer/actionComponents/custom/index.d.ts +3 -0
- package/lib/commonjs/LogViewer/actionComponents/custom/index.js +3 -0
- package/lib/commonjs/LogViewer/actionComponents/customActionsMap/core/coreLogActionComponentMap.d.ts +3 -0
- package/lib/commonjs/LogViewer/actionComponents/customActionsMap/core/coreLogActionComponentMap.js +10 -0
- package/lib/commonjs/LogViewer/actionComponents/customActionsMap/core/coreNetworkActionComponentMap.js +3 -2
- package/lib/commonjs/LogViewer/actionComponents/customActionsMap/core/index.d.ts +1 -1
- package/lib/commonjs/LogViewer/actionComponents/customActionsMap/core/index.js +2 -1
- package/lib/commonjs/LogViewer/actionComponents/customActionsMap/index.d.ts +1 -1
- package/lib/commonjs/LogViewer/actionComponents/genericActionRenderer/AnyVariableView/AnyVariableView.d.ts +3 -2
- package/lib/commonjs/LogViewer/actionComponents/genericActionRenderer/AnyVariableView/AnyVariableView.js +6 -3
- package/lib/commonjs/LogViewer/actionComponents/types/ActionComponentProps.d.ts +3 -3
- package/lib/esm/LogViewer/AdminLogs/AdminLogGrid/AdminLogGrid.d.ts +8 -0
- package/lib/esm/LogViewer/AdminLogs/AdminLogGrid/AdminLogGrid.js +107 -0
- package/lib/esm/LogViewer/AdminLogs/AdminLogGrid/index.d.ts +1 -0
- package/lib/esm/LogViewer/AdminLogs/AdminLogGrid/index.js +1 -0
- package/lib/esm/LogViewer/AdminLogs/AdminLogSearchBar/AdminLogSearchBar.d.ts +7 -0
- package/lib/esm/LogViewer/AdminLogs/AdminLogSearchBar/AdminLogSearchBar.js +78 -0
- package/lib/esm/LogViewer/AdminLogs/AdminLogSearchBar/index.d.ts +1 -0
- package/lib/esm/LogViewer/AdminLogs/AdminLogSearchBar/index.js +1 -0
- package/lib/esm/LogViewer/AdminLogs/AdminLogs.d.ts +1 -0
- package/lib/esm/LogViewer/AdminLogs/AdminLogs.js +11 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/index.d.ts +3 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/index.js +3 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/logic/getLogLogs.d.ts +3 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/logic/getLogLogs.js +21 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/logic/searchLogLogs.d.ts +3 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/logic/searchLogLogs.js +21 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/types/LogLogSearchParams.d.ts +9 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/types/LogLogSearchParams.js +1 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/types/index.d.ts +1 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/types/index.js +1 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/useLogLogMananagement/index.d.ts +1 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/useLogLogMananagement/index.js +1 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/useLogLogMananagement/useLogLogMananagement.d.ts +9 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/useLogLogMananagement/useLogLogMananagement.js +25 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/useLogLogSearch/index.d.ts +1 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/useLogLogSearch/index.js +1 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/useLogLogSearch/useLogLogSearch.d.ts +10 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/useLogLogSearch/useLogLogSearch.js +27 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/useLogLogSearchRequest/index.d.ts +1 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/useLogLogSearchRequest/index.js +1 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/useLogLogSearchRequest/useLogLogSearchRequest.d.ts +3 -0
- package/lib/esm/LogViewer/AdminLogs/hooks/useLogLogSearchRequest/useLogLogSearchRequest.js +16 -0
- package/lib/esm/LogViewer/AdminLogs/index.d.ts +1 -0
- package/lib/esm/LogViewer/AdminLogs/index.js +1 -0
- package/lib/esm/LogViewer/LogViewer.js +7 -2
- package/lib/esm/LogViewer/actionComponents/custom/CoreLogCreateCustomAction.d.ts +3 -0
- package/lib/esm/LogViewer/actionComponents/custom/CoreLogCreateCustomAction.js +28 -0
- package/lib/esm/LogViewer/actionComponents/custom/CoreLogDisableEventHistoryCustomAction.d.ts +3 -0
- package/lib/esm/LogViewer/actionComponents/custom/CoreLogDisableEventHistoryCustomAction.js +10 -0
- package/lib/esm/LogViewer/actionComponents/custom/CoreLogTemplateLiteralCustomAction.d.ts +3 -0
- package/lib/esm/LogViewer/actionComponents/custom/CoreLogTemplateLiteralCustomAction.js +11 -0
- package/lib/esm/LogViewer/actionComponents/custom/CoreNetworkRequestCustomAction.d.ts +2 -1
- package/lib/esm/LogViewer/actionComponents/custom/CoreNetworkRequestCustomAction.js +3 -0
- package/lib/esm/LogViewer/actionComponents/custom/index.d.ts +3 -0
- package/lib/esm/LogViewer/actionComponents/custom/index.js +3 -0
- package/lib/esm/LogViewer/actionComponents/customActionsMap/core/coreLogActionComponentMap.d.ts +3 -0
- package/lib/esm/LogViewer/actionComponents/customActionsMap/core/coreLogActionComponentMap.js +8 -0
- package/lib/esm/LogViewer/actionComponents/customActionsMap/core/coreNetworkActionComponentMap.js +3 -2
- package/lib/esm/LogViewer/actionComponents/customActionsMap/core/index.d.ts +1 -1
- package/lib/esm/LogViewer/actionComponents/customActionsMap/core/index.js +2 -0
- package/lib/esm/LogViewer/actionComponents/customActionsMap/index.d.ts +1 -1
- package/lib/esm/LogViewer/actionComponents/genericActionRenderer/AnyVariableView/AnyVariableView.d.ts +3 -2
- package/lib/esm/LogViewer/actionComponents/genericActionRenderer/AnyVariableView/AnyVariableView.js +6 -3
- package/lib/esm/LogViewer/actionComponents/types/ActionComponentProps.d.ts +3 -3
- package/package.json +6 -6
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { LogLog } from 'quidproquo-webserver';
|
|
2
|
+
type AdminLogGridProps = {
|
|
3
|
+
logs: LogLog[];
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
searchProgress: number;
|
|
6
|
+
};
|
|
7
|
+
export declare const AdminLogGrid: ({ logs, isLoading, searchProgress }: AdminLogGridProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
export {};
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AdminLogGrid = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
9
|
+
const LinearProgress_1 = __importDefault(require("@mui/material/LinearProgress"));
|
|
10
|
+
const x_data_grid_1 = require("@mui/x-data-grid");
|
|
11
|
+
const components_1 = require("../../../components");
|
|
12
|
+
const LogDialog_1 = require("../../LogDialog");
|
|
13
|
+
const hooks_1 = require("../hooks");
|
|
14
|
+
const columns = [
|
|
15
|
+
{
|
|
16
|
+
field: 'type',
|
|
17
|
+
headerName: 'Type',
|
|
18
|
+
flex: 1,
|
|
19
|
+
renderCell: (params) => (0, jsx_runtime_1.jsx)("div", { children: quidproquo_core_1.LogLevelEnum[params.value] }),
|
|
20
|
+
},
|
|
21
|
+
{
|
|
22
|
+
field: 'module',
|
|
23
|
+
headerName: 'Service',
|
|
24
|
+
flex: 1,
|
|
25
|
+
renderCell: (params) => (0, jsx_runtime_1.jsx)("div", { children: params.value || 'unknown' }),
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
field: 'timestamp',
|
|
29
|
+
headerName: 'When',
|
|
30
|
+
flex: 1,
|
|
31
|
+
renderCell: (params) => (0, jsx_runtime_1.jsx)(components_1.DateCell, { isoDateTime: params.value }),
|
|
32
|
+
},
|
|
33
|
+
{ field: 'reason', headerName: 'Message', flex: 8 },
|
|
34
|
+
];
|
|
35
|
+
const AdminLogGrid = ({ logs, isLoading, searchProgress }) => {
|
|
36
|
+
const { selectedLogCorrelation, setSelectedLogCorrelation, onRowClick, clearSelectedLogCorrelation } = (0, hooks_1.useLogLogMananagement)();
|
|
37
|
+
const getRowClassName = (params) => {
|
|
38
|
+
switch (params.row.type) {
|
|
39
|
+
case quidproquo_core_1.LogLevelEnum.Fatal:
|
|
40
|
+
return 'fatalRow';
|
|
41
|
+
case quidproquo_core_1.LogLevelEnum.Error:
|
|
42
|
+
return 'errorRow';
|
|
43
|
+
case quidproquo_core_1.LogLevelEnum.Warn:
|
|
44
|
+
return 'warnRow';
|
|
45
|
+
case quidproquo_core_1.LogLevelEnum.Info:
|
|
46
|
+
return 'infoRow';
|
|
47
|
+
case quidproquo_core_1.LogLevelEnum.Debug:
|
|
48
|
+
return 'debugRow';
|
|
49
|
+
case quidproquo_core_1.LogLevelEnum.Trace:
|
|
50
|
+
return 'traceRow';
|
|
51
|
+
default:
|
|
52
|
+
return '';
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
return ((0, jsx_runtime_1.jsxs)(jsx_runtime_1.Fragment, { children: [(0, jsx_runtime_1.jsx)("style", { children: `
|
|
56
|
+
.fatalRow {
|
|
57
|
+
background-color: #8B0000 !important; /* Dark Red */
|
|
58
|
+
color: #fff;
|
|
59
|
+
}
|
|
60
|
+
.fatalRow:hover {
|
|
61
|
+
background-color: #B22222 !important; /* FireBrick */
|
|
62
|
+
color: #fff;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
.errorRow {
|
|
66
|
+
background-color: #FF4C4C !important; /* Red-ish */
|
|
67
|
+
color: #fff;
|
|
68
|
+
}
|
|
69
|
+
.errorRow:hover {
|
|
70
|
+
background-color: #FF6666 !important; /* Lighter red for hover */
|
|
71
|
+
color: #fff;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
.warnRow {
|
|
75
|
+
background-color: #FFD700 !important; /* Gold */
|
|
76
|
+
color: #000;
|
|
77
|
+
}
|
|
78
|
+
.warnRow:hover {
|
|
79
|
+
background-color: #FFED85 !important; /* Lighter/gentler yellow */
|
|
80
|
+
color: #000;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
.infoRow {
|
|
84
|
+
background-color: #ADD8E6 !important; /* Light Blue (SkyBlue) */
|
|
85
|
+
color: #000;
|
|
86
|
+
}
|
|
87
|
+
.infoRow:hover {
|
|
88
|
+
background-color: #C4E4F2 !important; /* Slightly lighter blue */
|
|
89
|
+
color: #000;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
.debugRow {
|
|
93
|
+
background-color: #E0E0E0 !important; /* Light Gray */
|
|
94
|
+
color: #000;
|
|
95
|
+
}
|
|
96
|
+
.debugRow:hover {
|
|
97
|
+
background-color: #D0D0D0 !important; /* Slightly darker gray */
|
|
98
|
+
color: #000;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
.traceRow {
|
|
102
|
+
background-color: #F3F3F3 !important; /* Very Light Gray */
|
|
103
|
+
color: #000;
|
|
104
|
+
}
|
|
105
|
+
.traceRow:hover {
|
|
106
|
+
background-color: #E3E3E3 !important;
|
|
107
|
+
color: #000;
|
|
108
|
+
}
|
|
109
|
+
` }), (0, jsx_runtime_1.jsx)(x_data_grid_1.DataGrid, { components: {
|
|
110
|
+
Pagination: components_1.DataGridPagination,
|
|
111
|
+
LoadingOverlay: () => (0, jsx_runtime_1.jsx)(LinearProgress_1.default, { variant: "determinate", value: searchProgress }),
|
|
112
|
+
}, columns: columns, rows: logs.map((log, i) => (Object.assign(Object.assign({}, log), { id: `${i}` }))), autoPageSize: true, loading: isLoading, onRowClick: onRowClick, getRowClassName: getRowClassName }), (0, jsx_runtime_1.jsx)(LogDialog_1.LogDialog, { open: !!selectedLogCorrelation, handleClose: clearSelectedLogCorrelation, logCorrelation: selectedLogCorrelation, storyResultMetadatas: logs, setSelectedLogCorrelation: setSelectedLogCorrelation })] }));
|
|
113
|
+
};
|
|
114
|
+
exports.AdminLogGrid = AdminLogGrid;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AdminLogGrid';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AdminLogGrid"), exports);
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { LogLogSearchParams } from '../hooks/types';
|
|
2
|
+
export interface AdminLogSearchBarProps {
|
|
3
|
+
searchParams: LogLogSearchParams;
|
|
4
|
+
setLogLogSearchParams: (setter: (searchParams: LogLogSearchParams) => LogLogSearchParams) => void;
|
|
5
|
+
onSearch: () => Promise<any>;
|
|
6
|
+
}
|
|
7
|
+
export declare function AdminLogSearchBar({ searchParams, setLogLogSearchParams, onSearch }: AdminLogSearchBarProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
+
};
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.AdminLogSearchBar = void 0;
|
|
7
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
8
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
9
|
+
const react_1 = require("react");
|
|
10
|
+
const ExpandMore_1 = __importDefault(require("@mui/icons-material/ExpandMore"));
|
|
11
|
+
const material_1 = require("@mui/material");
|
|
12
|
+
const FormControl_1 = __importDefault(require("@mui/material/FormControl"));
|
|
13
|
+
const Grid_1 = __importDefault(require("@mui/material/Grid"));
|
|
14
|
+
const InputLabel_1 = __importDefault(require("@mui/material/InputLabel"));
|
|
15
|
+
const MenuItem_1 = __importDefault(require("@mui/material/MenuItem"));
|
|
16
|
+
const Select_1 = __importDefault(require("@mui/material/Select"));
|
|
17
|
+
const TextField_1 = __importDefault(require("@mui/material/TextField"));
|
|
18
|
+
const system_1 = require("@mui/system");
|
|
19
|
+
const x_date_pickers_1 = require("@mui/x-date-pickers");
|
|
20
|
+
const AdapterDateFns_1 = require("@mui/x-date-pickers/AdapterDateFns");
|
|
21
|
+
const components_1 = require("../../../components");
|
|
22
|
+
const hooks_1 = require("../../hooks");
|
|
23
|
+
function AdminLogSearchBar({ searchParams, setLogLogSearchParams, onSearch }) {
|
|
24
|
+
const [anchorEl, setAnchorEl] = (0, react_1.useState)(null);
|
|
25
|
+
const serviceOptions = (0, hooks_1.useServiceNames)();
|
|
26
|
+
const handleRuntimeTypeChange = (event) => {
|
|
27
|
+
setLogLogSearchParams((prevLogLogSearchParams) => (Object.assign(Object.assign({}, prevLogLogSearchParams), { logLevelLookup: event.target.value })));
|
|
28
|
+
};
|
|
29
|
+
const handleStartDateChange = (value) => {
|
|
30
|
+
if (value) {
|
|
31
|
+
setLogLogSearchParams((prevLogLogSearchParams) => (Object.assign(Object.assign({}, prevLogLogSearchParams), { startIsoDateTime: value.toISOString() })));
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
const handleEndDateChange = (value) => {
|
|
35
|
+
if (value) {
|
|
36
|
+
setLogLogSearchParams((prevLogLogSearchParams) => (Object.assign(Object.assign({}, prevLogLogSearchParams), { endIsoDateTime: value.toISOString() })));
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
const handleInfoFilterChange = (event) => {
|
|
40
|
+
setLogLogSearchParams((prev) => (Object.assign(Object.assign({}, prev), { infoFilter: event.target.value })));
|
|
41
|
+
};
|
|
42
|
+
const handleQuickTimeSelect = (minutes) => {
|
|
43
|
+
const now = new Date();
|
|
44
|
+
const startDate = new Date(now.getTime() - minutes * 60000);
|
|
45
|
+
const endDate = new Date(now.getTime() + 7 * 24 * 60 * 60000);
|
|
46
|
+
setLogLogSearchParams((prevLogLogSearchParams) => (Object.assign(Object.assign({}, prevLogLogSearchParams), { startIsoDateTime: startDate.toISOString(), endIsoDateTime: endDate.toISOString() })));
|
|
47
|
+
setAnchorEl(null);
|
|
48
|
+
};
|
|
49
|
+
const handleQuickTimeClick = (event) => {
|
|
50
|
+
setAnchorEl(event.currentTarget);
|
|
51
|
+
};
|
|
52
|
+
const handleQuickTimeClose = () => {
|
|
53
|
+
setAnchorEl(null);
|
|
54
|
+
};
|
|
55
|
+
const handleServiceChange = (event, value) => {
|
|
56
|
+
setLogLogSearchParams((prevLogLogSearchParams) => (Object.assign(Object.assign({}, prevLogLogSearchParams), { serviceFilter: value ? value.value : '' })));
|
|
57
|
+
};
|
|
58
|
+
return ((0, jsx_runtime_1.jsxs)(x_date_pickers_1.LocalizationProvider, Object.assign({ dateAdapter: AdapterDateFns_1.AdapterDateFns }, { children: [(0, jsx_runtime_1.jsxs)(Grid_1.default, Object.assign({ container: true, columns: 12, spacing: 2 }, { children: [(0, jsx_runtime_1.jsx)(Grid_1.default, Object.assign({ item: true, xs: 3 }, { children: (0, jsx_runtime_1.jsxs)(FormControl_1.default, Object.assign({ fullWidth: true }, { children: [(0, jsx_runtime_1.jsx)(InputLabel_1.default, Object.assign({ id: "runtime-select-label" }, { children: "Runtime Type" })), (0, jsx_runtime_1.jsx)(Select_1.default, Object.assign({ labelId: "runtime-select-label", id: "demo-simple-select", value: searchParams.logLevelLookup, label: "Log Level", onChange: handleRuntimeTypeChange }, { children: quidproquo_core_1.logLevelEnumLookups.map((key) => ((0, jsx_runtime_1.jsx)(MenuItem_1.default, Object.assign({ value: key }, { children: key }), key))) }))] })) })), (0, jsx_runtime_1.jsx)(Grid_1.default, Object.assign({ item: true, xs: 3 }, { children: (0, jsx_runtime_1.jsx)(FormControl_1.default, Object.assign({ fullWidth: true }, { children: (0, jsx_runtime_1.jsx)(material_1.Autocomplete, { options: serviceOptions, getOptionLabel: (option) => option.label, onChange: handleServiceChange, renderInput: (params) => ((0, jsx_runtime_1.jsx)(TextField_1.default, Object.assign({}, params, { label: "Service Name", InputLabelProps: {
|
|
59
|
+
shrink: true,
|
|
60
|
+
} }))) }) })) })), (0, jsx_runtime_1.jsx)(Grid_1.default, Object.assign({ item: true, xs: 3 }, { children: (0, jsx_runtime_1.jsxs)(system_1.Box, Object.assign({ position: "relative" }, { children: [(0, jsx_runtime_1.jsx)(FormControl_1.default, Object.assign({ fullWidth: true }, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.DateTimePicker, { label: "Start DateTime", value: new Date(searchParams.startIsoDateTime), onChange: handleStartDateChange }) })), (0, jsx_runtime_1.jsx)(material_1.IconButton, Object.assign({ "aria-label": "quick time select", "aria-controls": "quick-time-menu", "aria-haspopup": "true", onClick: handleQuickTimeClick, sx: {
|
|
61
|
+
position: 'absolute',
|
|
62
|
+
right: '-28px',
|
|
63
|
+
top: '50%',
|
|
64
|
+
transform: 'translateY(-50%)',
|
|
65
|
+
} }, { children: (0, jsx_runtime_1.jsx)(ExpandMore_1.default, {}) }))] })) })), (0, jsx_runtime_1.jsx)(Grid_1.default, Object.assign({ item: true, xs: 3 }, { children: (0, jsx_runtime_1.jsx)(FormControl_1.default, Object.assign({ fullWidth: true }, { children: (0, jsx_runtime_1.jsx)(x_date_pickers_1.DateTimePicker, { label: "End DateTime", value: new Date(searchParams.endIsoDateTime), onChange: handleEndDateChange }) })) })), (0, jsx_runtime_1.jsx)(Grid_1.default, Object.assign({ item: true, xs: 10 }, { children: (0, jsx_runtime_1.jsx)(FormControl_1.default, Object.assign({ fullWidth: true }, { children: (0, jsx_runtime_1.jsx)(TextField_1.default, { label: "Reason", value: searchParams.msgFilter, onChange: handleInfoFilterChange, InputLabelProps: {
|
|
66
|
+
shrink: true,
|
|
67
|
+
} }) })) })), (0, jsx_runtime_1.jsx)(Grid_1.default, Object.assign({ item: true, xs: 2 }, { children: (0, jsx_runtime_1.jsx)(components_1.AsyncButton, Object.assign({ onClick: () => onSearch() }, { children: "Search" })) }))] })), (0, jsx_runtime_1.jsxs)(material_1.Menu, Object.assign({ id: "quick-time-menu", anchorEl: anchorEl, keepMounted: true, open: Boolean(anchorEl), onClose: handleQuickTimeClose }, { children: [(0, jsx_runtime_1.jsx)(MenuItem_1.default, Object.assign({ onClick: () => handleQuickTimeSelect(5) }, { children: "Last 5 minutes" })), (0, jsx_runtime_1.jsx)(MenuItem_1.default, Object.assign({ onClick: () => handleQuickTimeSelect(30) }, { children: "Last 30 minutes" })), (0, jsx_runtime_1.jsx)(MenuItem_1.default, Object.assign({ onClick: () => handleQuickTimeSelect(1 * 60) }, { children: "Last hour" })), (0, jsx_runtime_1.jsx)(MenuItem_1.default, Object.assign({ onClick: () => handleQuickTimeSelect(3 * 60) }, { children: "Last 3 hours" })), (0, jsx_runtime_1.jsx)(MenuItem_1.default, Object.assign({ onClick: () => handleQuickTimeSelect(8 * 60) }, { children: "Last 8 hours" })), (0, jsx_runtime_1.jsx)(MenuItem_1.default, Object.assign({ onClick: () => handleQuickTimeSelect(16 * 60) }, { children: "Last 16 hours" })), (0, jsx_runtime_1.jsx)(MenuItem_1.default, Object.assign({ onClick: () => handleQuickTimeSelect(24 * 60) }, { children: "Last 24 hours" })), (0, jsx_runtime_1.jsx)(MenuItem_1.default, Object.assign({ onClick: () => handleQuickTimeSelect(7 * 24 * 60) }, { children: "Last 7 days" })), (0, jsx_runtime_1.jsx)(MenuItem_1.default, Object.assign({ onClick: () => handleQuickTimeSelect(30 * 24 * 60) }, { children: "Last month" }))] }))] })));
|
|
68
|
+
}
|
|
69
|
+
exports.AdminLogSearchBar = AdminLogSearchBar;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AdminLogSearchBar';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AdminLogSearchBar"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const AdminLogs: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AdminLogs = void 0;
|
|
4
|
+
const jsx_runtime_1 = require("react/jsx-runtime");
|
|
5
|
+
const components_1 = require("../../components");
|
|
6
|
+
const view_1 = require("../../view");
|
|
7
|
+
const AdminLogGrid_1 = require("./AdminLogGrid");
|
|
8
|
+
const AdminLogSearchBar_1 = require("./AdminLogSearchBar");
|
|
9
|
+
const hooks_1 = require("./hooks");
|
|
10
|
+
const AdminLogs = () => {
|
|
11
|
+
const { logLogs, searchParams, setSearchParams, searchProgress, onSearch } = (0, hooks_1.useLogLogSearch)();
|
|
12
|
+
const isLoading = (0, view_1.useIsLoading)();
|
|
13
|
+
return ((0, jsx_runtime_1.jsx)(components_1.TabViewBox, { header: () => (0, jsx_runtime_1.jsx)(AdminLogSearchBar_1.AdminLogSearchBar, { onSearch: onSearch, searchParams: searchParams, setLogLogSearchParams: setSearchParams }), body: () => (0, jsx_runtime_1.jsx)(AdminLogGrid_1.AdminLogGrid, { logs: logLogs, isLoading: isLoading, searchProgress: searchProgress }) }));
|
|
14
|
+
};
|
|
15
|
+
exports.AdminLogs = AdminLogs;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useLogLogMananagement"), exports);
|
|
18
|
+
__exportStar(require("./useLogLogSearch"), exports);
|
|
19
|
+
__exportStar(require("./useLogLogSearchRequest"), exports);
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { LogLevelEnum } from 'quidproquo-core';
|
|
2
|
+
import { LogLog } from 'quidproquo-webserver';
|
|
3
|
+
export declare const getLogLogs: (logLevel: LogLevelEnum, startIsoDateTime: string, endIsoDateTime: string, serviceFilter: string, msgFilter: string, apiBaseUrl: string, accessToken?: string) => Promise<LogLog[]>;
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.getLogLogs = void 0;
|
|
13
|
+
const logic_1 = require("../../../../logic");
|
|
14
|
+
const getLogLogs = (logLevel, startIsoDateTime, endIsoDateTime, serviceFilter, msgFilter, apiBaseUrl, accessToken) => __awaiter(void 0, void 0, void 0, function* () {
|
|
15
|
+
let logs = [];
|
|
16
|
+
let nextPageKey = undefined;
|
|
17
|
+
const requestSpan = {
|
|
18
|
+
startIsoDateTime,
|
|
19
|
+
endIsoDateTime,
|
|
20
|
+
logLevel,
|
|
21
|
+
serviceFilter,
|
|
22
|
+
msgFilter,
|
|
23
|
+
};
|
|
24
|
+
do {
|
|
25
|
+
let newLogs = yield (0, logic_1.apiRequestPost)(`/loglog/list`, Object.assign(Object.assign({}, requestSpan), { nextPageKey: nextPageKey }), apiBaseUrl, accessToken);
|
|
26
|
+
logs = [...logs, ...newLogs.items];
|
|
27
|
+
nextPageKey = newLogs.nextPageKey;
|
|
28
|
+
} while (nextPageKey);
|
|
29
|
+
return logs;
|
|
30
|
+
});
|
|
31
|
+
exports.getLogLogs = getLogLogs;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { LogLog } from 'quidproquo-webserver';
|
|
2
|
+
import { LogLogSearchParams } from '../types';
|
|
3
|
+
export declare const searchLogLogs: (searchParams: LogLogSearchParams, apiBaseUrl: string, accessToken?: string, callback?: ((progress: number) => void) | undefined) => Promise<LogLog[]>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.searchLogLogs = void 0;
|
|
13
|
+
const quidproquo_core_1 = require("quidproquo-core");
|
|
14
|
+
const getLogLogs_1 = require("./getLogLogs");
|
|
15
|
+
const searchLogLogs = (searchParams, apiBaseUrl, accessToken, callback) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
const logLevels = (0, quidproquo_core_1.resolveLookupValues)([searchParams.logLevelLookup], quidproquo_core_1.LogLevelEnum);
|
|
17
|
+
console.log('logLevels: ', logLevels);
|
|
18
|
+
let progress = 0;
|
|
19
|
+
const totalCount = logLevels.length;
|
|
20
|
+
callback === null || callback === void 0 ? void 0 : callback(0);
|
|
21
|
+
const allLogs = yield Promise.all(logLevels.flatMap((logLevel) => (0, getLogLogs_1.getLogLogs)(logLevel, searchParams.startIsoDateTime, searchParams.endIsoDateTime, searchParams.serviceFilter, searchParams.msgFilter, apiBaseUrl, accessToken).finally(() => {
|
|
22
|
+
progress = progress + 1;
|
|
23
|
+
callback === null || callback === void 0 ? void 0 : callback((progress / totalCount) * 100);
|
|
24
|
+
})));
|
|
25
|
+
const sortedLogs = allLogs.flat().sort((a, b) => {
|
|
26
|
+
const dateA = new Date(a.timestamp);
|
|
27
|
+
const dateB = new Date(b.timestamp);
|
|
28
|
+
// For descending order, use dateB - dateA
|
|
29
|
+
// For ascending order, use dateA - dateB
|
|
30
|
+
return dateB.getTime() - dateA.getTime();
|
|
31
|
+
});
|
|
32
|
+
return sortedLogs;
|
|
33
|
+
});
|
|
34
|
+
exports.searchLogLogs = searchLogLogs;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './LogLogSearchParams';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./LogLogSearchParams"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogLogMananagement';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useLogLogMananagement"), exports);
|
package/lib/commonjs/LogViewer/AdminLogs/hooks/useLogLogMananagement/useLogLogMananagement.d.ts
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { LogLog } from 'quidproquo-webserver';
|
|
2
|
+
export declare const useLogLogMananagement: () => {
|
|
3
|
+
selectedLogCorrelation: string;
|
|
4
|
+
setSelectedLogCorrelation: (correlation?: string) => void;
|
|
5
|
+
onRowClick: ({ row }: {
|
|
6
|
+
row: LogLog;
|
|
7
|
+
}) => void;
|
|
8
|
+
clearSelectedLogCorrelation: () => void;
|
|
9
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLogLogMananagement = void 0;
|
|
4
|
+
const react_router_dom_1 = require("react-router-dom");
|
|
5
|
+
const useLogLogMananagement = () => {
|
|
6
|
+
const [searchParams, setSearchParams] = (0, react_router_dom_1.useSearchParams)();
|
|
7
|
+
const selectedLogCorrelation = searchParams.get('correlation') || '';
|
|
8
|
+
const setSelectedLogCorrelation = (correlation) => {
|
|
9
|
+
if (correlation) {
|
|
10
|
+
setSearchParams({ correlation });
|
|
11
|
+
}
|
|
12
|
+
else {
|
|
13
|
+
setSearchParams({});
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
const onRowClick = ({ row }) => {
|
|
17
|
+
setSelectedLogCorrelation(row.fromCorrelation);
|
|
18
|
+
};
|
|
19
|
+
const clearSelectedLogCorrelation = () => {
|
|
20
|
+
setSelectedLogCorrelation();
|
|
21
|
+
};
|
|
22
|
+
return {
|
|
23
|
+
selectedLogCorrelation,
|
|
24
|
+
setSelectedLogCorrelation,
|
|
25
|
+
onRowClick,
|
|
26
|
+
clearSelectedLogCorrelation,
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
exports.useLogLogMananagement = useLogLogMananagement;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogLogSearch';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useLogLogSearch"), exports);
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import { LogLog } from 'quidproquo-webserver';
|
|
3
|
+
import { LogLogSearchParams } from '../types';
|
|
4
|
+
export declare const useLogLogSearch: () => {
|
|
5
|
+
logLogs: LogLog[];
|
|
6
|
+
searchParams: LogLogSearchParams;
|
|
7
|
+
setSearchParams: import("react").Dispatch<import("react").SetStateAction<LogLogSearchParams>>;
|
|
8
|
+
searchProgress: number;
|
|
9
|
+
onSearch: (newSearchParams?: LogLogSearchParams | undefined) => Promise<any[]>;
|
|
10
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLogLogSearch = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const useLogLogSearchRequest_1 = require("../useLogLogSearchRequest/useLogLogSearchRequest");
|
|
6
|
+
const useLogLogSearch = () => {
|
|
7
|
+
const [logLogs, setLogLogs] = (0, react_1.useState)([]);
|
|
8
|
+
const [searchParamsState, setSearchParamsState] = (0, react_1.useState)(() => {
|
|
9
|
+
const currentDate = new Date();
|
|
10
|
+
const threeHoursAgo = new Date(currentDate.getTime() - 3 * 60 * 60 * 1000);
|
|
11
|
+
const isoDateThreeHoursAgo = threeHoursAgo.toISOString();
|
|
12
|
+
const tomorrow = new Date(currentDate.getTime() + 24 * 60 * 60 * 1000);
|
|
13
|
+
const isoDateTomorrow = tomorrow.toISOString();
|
|
14
|
+
return {
|
|
15
|
+
logLevelLookup: 'All',
|
|
16
|
+
startIsoDateTime: isoDateThreeHoursAgo,
|
|
17
|
+
endIsoDateTime: isoDateTomorrow,
|
|
18
|
+
msgFilter: '',
|
|
19
|
+
serviceFilter: '',
|
|
20
|
+
};
|
|
21
|
+
});
|
|
22
|
+
const [searchProgress, onSearch] = (0, useLogLogSearchRequest_1.useLogLogSearchRequest)(searchParamsState, setLogLogs);
|
|
23
|
+
return {
|
|
24
|
+
logLogs,
|
|
25
|
+
searchParams: searchParamsState,
|
|
26
|
+
setSearchParams: setSearchParamsState,
|
|
27
|
+
searchProgress,
|
|
28
|
+
onSearch,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
exports.useLogLogSearch = useLogLogSearch;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './useLogLogSearchRequest';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./useLogLogSearchRequest"), exports);
|
package/lib/commonjs/LogViewer/AdminLogs/hooks/useLogLogSearchRequest/useLogLogSearchRequest.d.ts
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { LogLog } from 'quidproquo-webserver';
|
|
2
|
+
import { LogLogSearchParams } from '../types';
|
|
3
|
+
export declare const useLogLogSearchRequest: (searchParams: LogLogSearchParams, setLogLogs: (logs: LogLog[]) => void) => [number, (newSearchParams?: LogLogSearchParams) => Promise<any[]>];
|
package/lib/commonjs/LogViewer/AdminLogs/hooks/useLogLogSearchRequest/useLogLogSearchRequest.js
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.useLogLogSearchRequest = void 0;
|
|
13
|
+
const quidproquo_web_react_1 = require("quidproquo-web-react");
|
|
14
|
+
const react_1 = require("react");
|
|
15
|
+
const view_1 = require("../../../../view");
|
|
16
|
+
const searchLogLogs_1 = require("../logic/searchLogLogs");
|
|
17
|
+
const useLogLogSearchRequest = (searchParams, setLogLogs) => {
|
|
18
|
+
const [progress, setProgress] = (0, react_1.useState)(0);
|
|
19
|
+
const authTokens = (0, quidproquo_web_react_1.useAuthAccessToken)();
|
|
20
|
+
const baseUrlResolvers = (0, quidproquo_web_react_1.useBaseUrlResolvers)();
|
|
21
|
+
const onSearch = (0, quidproquo_web_react_1.useFastCallback)((newSearchParams) => __awaiter(void 0, void 0, void 0, function* () {
|
|
22
|
+
const newLogs = yield (0, searchLogLogs_1.searchLogLogs)(newSearchParams || searchParams, baseUrlResolvers.getApiUrl(), authTokens, setProgress);
|
|
23
|
+
setLogLogs(newLogs);
|
|
24
|
+
return newLogs;
|
|
25
|
+
}));
|
|
26
|
+
const onSearchWithLoading = (0, view_1.useAsyncLoading)(onSearch);
|
|
27
|
+
return [progress, onSearchWithLoading];
|
|
28
|
+
};
|
|
29
|
+
exports.useLogLogSearchRequest = useLogLogSearchRequest;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './AdminLogs';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./AdminLogs"), exports);
|