@danikokonn/yarik-frontend-lib 2.0.49-test9 → 2.0.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Footer/Footer.d.ts.map +1 -1
- package/dist/components/Footer/Footer.js +2 -2
- package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInput.d.ts.map +1 -1
- package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInput.js +1 -1
- package/dist/components/Navigation/NavMenu.d.ts +2 -1
- package/dist/components/Navigation/NavMenu.d.ts.map +1 -1
- package/dist/components/Navigation/NavMenu.js +2 -2
- package/dist/components/Navigation/Navigation.d.ts.map +1 -1
- package/dist/components/Navigation/Navigation.js +4 -4
- package/dist/components/PageWrapper/PageWrapper.d.ts.map +1 -1
- package/dist/components/PageWrapper/PageWrapper.js +4 -3
- package/dist/components/RichFilterTextField/RichFilterTextField.d.ts.map +1 -1
- package/dist/components/RichFilterTextField/RichFilterTextField.js +13 -14
- package/dist/components/SmartTable/RowContent.d.ts +22 -6
- package/dist/components/SmartTable/RowContent.d.ts.map +1 -1
- package/dist/components/SmartTable/RowContent.js +45 -29
- package/dist/components/SmartTable/SmartTable.d.ts +7 -1
- package/dist/components/SmartTable/SmartTable.d.ts.map +1 -1
- package/dist/components/SmartTable/SmartTable.js +59 -48
- package/dist/components/SmartTable/SmartTableProps.d.ts +16 -7
- package/dist/components/SmartTable/SmartTableProps.d.ts.map +1 -1
- package/dist/components/SmartTable/TableHeader.d.ts.map +1 -1
- package/dist/components/SmartTable/TableHeader.js +3 -2
- package/dist/components/SubtaskItem/SubtaskItem.d.ts.map +1 -1
- package/dist/components/SubtaskItem/SubtaskItem.js +57 -11
- package/dist/components/TaskLoader/TaskLoader.d.ts +1 -1
- package/dist/components/TaskLoader/TaskLoader.d.ts.map +1 -1
- package/dist/components/TaskLoader/TaskLoader.js +24 -13
- package/dist/components/TaskLoader/TaskLoaderProps.d.ts +1 -0
- package/dist/components/TaskLoader/TaskLoaderProps.d.ts.map +1 -1
- package/dist/components/TaskStateDialog/TaskStateDialog.d.ts +1 -1
- package/dist/components/TaskStateDialog/TaskStateDialog.d.ts.map +1 -1
- package/dist/components/TaskStateDialog/TaskStateDialog.js +8 -5
- package/dist/components/TaskStateDialog/TaskStateDialogProps.d.ts +2 -1
- package/dist/components/TaskStateDialog/TaskStateDialogProps.d.ts.map +1 -1
- package/dist/components/icons/GenerateAndRunIcon.d.ts +1 -1
- package/dist/components/icons/GenerateAndRunIcon.d.ts.map +1 -1
- package/dist/components/icons/GenerateAndRunIcon.js +5 -2
- package/dist/components/icons/GenerateIcon.d.ts +1 -1
- package/dist/components/icons/GenerateIcon.d.ts.map +1 -1
- package/dist/components/icons/GenerateIcon.js +5 -2
- package/dist/components/icons/IntegerIcon.d.ts +1 -1
- package/dist/components/icons/IntegerIcon.d.ts.map +1 -1
- package/dist/components/icons/IntegerIcon.js +5 -2
- package/dist/components/icons/QueueIcon.d.ts +1 -1
- package/dist/components/icons/QueueIcon.d.ts.map +1 -1
- package/dist/components/icons/QueueIcon.js +5 -2
- package/dist/components/icons/RangeIcon.d.ts +1 -1
- package/dist/components/icons/RangeIcon.d.ts.map +1 -1
- package/dist/components/icons/RangeIcon.js +5 -2
- package/dist/components/icons/RunIcon.d.ts +1 -1
- package/dist/components/icons/RunIcon.d.ts.map +1 -1
- package/dist/components/icons/RunIcon.js +5 -2
- package/dist/http.d.ts +2 -2
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +4 -29
- package/dist/providers/AirflowProvider.d.ts +5 -4
- package/dist/providers/AirflowProvider.d.ts.map +1 -1
- package/dist/providers/AirflowProvider.js +41 -56
- package/dist/providers/DagStateProvider.d.ts +6 -5
- package/dist/providers/DagStateProvider.d.ts.map +1 -1
- package/dist/providers/DagStateProvider.js +35 -10
- package/dist/providers/SessionProvider.d.ts +3 -1
- package/dist/providers/SessionProvider.d.ts.map +1 -1
- package/dist/providers/SessionProvider.js +10 -4
- package/dist/providers/SnackBarProvider.d.ts +2 -2
- package/dist/providers/SnackBarProvider.d.ts.map +1 -1
- package/dist/providers/SnackBarProvider.js +1 -1
- package/dist/types.d.ts +14 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts +2 -2
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +2 -2
- package/package.json +10 -5
- package/dist/components/SmartTable/RuleRow.d.ts +0 -22
- package/dist/components/SmartTable/RuleRow.d.ts.map +0 -1
- package/dist/components/SmartTable/RuleRow.js +0 -35
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import TableHead from "@mui/material/TableHead";
|
|
3
2
|
import { useTheme } from "@mui/material";
|
|
3
|
+
import TableHead from "@mui/material/TableHead";
|
|
4
4
|
const TableHeader = ({ ref, ...props }) => {
|
|
5
5
|
const theme = useTheme();
|
|
6
6
|
return (React.createElement(TableHead, { sx: {
|
|
7
7
|
top: "0",
|
|
8
8
|
zIndex: 600,
|
|
9
9
|
position: "sticky",
|
|
10
|
-
backgroundColor: theme.palette.background.default
|
|
10
|
+
backgroundColor: theme.vars?.palette.background.default ||
|
|
11
|
+
theme.palette.background.default,
|
|
11
12
|
}, ...props, ref: ref }));
|
|
12
13
|
};
|
|
13
14
|
export default TableHeader;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubtaskItem.d.ts","sourceRoot":"","sources":["../../../src/components/SubtaskItem/SubtaskItem.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SubtaskItem.d.ts","sourceRoot":"","sources":["../../../src/components/SubtaskItem/SubtaskItem.tsx"],"names":[],"mappings":"AAYA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAGxC,OAAO,gBAAgB,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,OAAO,UAAU,WAAW,CAAC,EAClC,YAAY,EACZ,IAAI,EACJ,QAAQ,EACR,UAAU,EACV,uBAAuB,GACxB,EAAE,gBAAgB,qBAuJlB"}
|
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import AccessTimeSharpIcon from "@mui/icons-material/AccessTimeSharp";
|
|
2
|
+
import BlockSharpIcon from "@mui/icons-material/BlockSharp";
|
|
3
|
+
import CheckCircleOutlineRoundedIcon from "@mui/icons-material/CheckCircleOutlineRounded";
|
|
4
|
+
import DoneIcon from "@mui/icons-material/Done";
|
|
5
|
+
import ErrorOutlineSharpIcon from "@mui/icons-material/ErrorOutlineSharp";
|
|
6
|
+
import ExpandMore from "@mui/icons-material/ExpandMore";
|
|
7
|
+
import { Chip, useTheme } from "@mui/material";
|
|
3
8
|
import Accordion from "@mui/material/Accordion";
|
|
4
9
|
import AccordionDetails from "@mui/material/AccordionDetails";
|
|
5
10
|
import AccordionSummary from "@mui/material/AccordionSummary";
|
|
6
11
|
import CircularProgress from "@mui/material/CircularProgress";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import AccessTimeSharpIcon from "@mui/icons-material/AccessTimeSharp";
|
|
10
|
-
import BlockSharpIcon from "@mui/icons-material/BlockSharp";
|
|
11
|
-
import ExpandMore from "@mui/icons-material/ExpandMore";
|
|
12
|
-
import { useTheme } from "@mui/material";
|
|
12
|
+
import moment from "moment";
|
|
13
|
+
import React, { useState } from "react";
|
|
13
14
|
import { taskStateText } from "../../utils";
|
|
14
15
|
export default function SubtaskItem({ taskInstance, logs, expanded, onShowLogs, expandedLogContainerRef, }) {
|
|
16
|
+
const [copyVisible, setCopyVisible] = useState(false);
|
|
17
|
+
const [copyText, setCopyText] = useState("Копировать");
|
|
15
18
|
const theme = useTheme();
|
|
16
19
|
const subtaskState = (state) => {
|
|
17
20
|
switch (state) {
|
|
@@ -42,7 +45,20 @@ export default function SubtaskItem({ taskInstance, logs, expanded, onShowLogs,
|
|
|
42
45
|
precision: 1,
|
|
43
46
|
template: "h [ч], m [мин], s [сек]",
|
|
44
47
|
});
|
|
45
|
-
return (React.createElement(Accordion, { disableGutters: true, expanded: expanded, onChange: () => onShowLogs(taskInstance.taskId, taskInstance.tryNumber), disabled: !["running", "success", "failed"].includes(taskInstance.state || "")
|
|
48
|
+
return (React.createElement(Accordion, { disableGutters: true, expanded: expanded, onChange: () => onShowLogs(taskInstance.taskId, taskInstance.tryNumber), disabled: !["running", "success", "failed"].includes(taskInstance.state || ""), sx: {
|
|
49
|
+
position: "relative",
|
|
50
|
+
}, slotProps: {
|
|
51
|
+
transition: {
|
|
52
|
+
onEntered: () => {
|
|
53
|
+
setCopyVisible(true);
|
|
54
|
+
setCopyText("Копировать");
|
|
55
|
+
},
|
|
56
|
+
onExit: () => {
|
|
57
|
+
setCopyVisible(false);
|
|
58
|
+
setCopyText("Копировать");
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
} },
|
|
46
62
|
React.createElement(AccordionSummary, { expandIcon: React.createElement(ExpandMore, null) },
|
|
47
63
|
React.createElement("div", { style: { display: "flex", alignItems: "center", gap: "0.5rem" } },
|
|
48
64
|
subtaskState(taskInstance.state),
|
|
@@ -56,11 +72,41 @@ export default function SubtaskItem({ taskInstance, logs, expanded, onShowLogs,
|
|
|
56
72
|
" за " +
|
|
57
73
|
formatTaskDuration
|
|
58
74
|
: ""))),
|
|
59
|
-
React.createElement(
|
|
75
|
+
copyVisible && (React.createElement(Chip, { label: copyText, size: "small", variant: "outlined", icon: copyText === "Скопировано" ? (React.createElement(DoneIcon, { color: "success" })) : undefined, onClick: () => {
|
|
76
|
+
navigator.clipboard.writeText(logs);
|
|
77
|
+
setCopyText("Скопировано");
|
|
78
|
+
}, sx: {
|
|
79
|
+
position: "absolute",
|
|
80
|
+
bottom: "8%",
|
|
81
|
+
right: "3%",
|
|
82
|
+
opacity: "0.5",
|
|
83
|
+
} })),
|
|
84
|
+
React.createElement(AccordionDetails, { ref: expandedLogContainerRef, contentEditable: true, onKeyDown: (e) => {
|
|
85
|
+
if (e.ctrlKey && e.key.toLowerCase() === "a") {
|
|
86
|
+
e.preventDefault();
|
|
87
|
+
if (e.currentTarget) {
|
|
88
|
+
const range = document.createRange();
|
|
89
|
+
range.selectNodeContents(e.currentTarget);
|
|
90
|
+
const selection = window.getSelection();
|
|
91
|
+
if (selection != null) {
|
|
92
|
+
selection.removeAllRanges();
|
|
93
|
+
selection.addRange(range);
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
if (e.key.toLowerCase() === "backspace") {
|
|
98
|
+
e.preventDefault();
|
|
99
|
+
}
|
|
100
|
+
}, suppressContentEditableWarning: true, onBeforeInput: (e) => e.preventDefault(), onPaste: (e) => e.preventDefault(), onDrop: (e) => e.preventDefault(), sx: {
|
|
101
|
+
maxHeight: "32vh",
|
|
102
|
+
overflow: "auto",
|
|
103
|
+
} },
|
|
60
104
|
React.createElement("article", { style: {
|
|
61
105
|
padding: "1.5rem",
|
|
62
|
-
backgroundColor: theme.palette.background.paper
|
|
106
|
+
backgroundColor: theme.vars?.palette.background.paper ||
|
|
107
|
+
theme.palette.background.paper,
|
|
63
108
|
borderRadius: "0.5rem",
|
|
109
|
+
fontSize: "smaller",
|
|
64
110
|
fontFamily: "consolas",
|
|
65
111
|
} }, logs.split("\n").map((line, idx) => (React.createElement("p", { key: idx, style: { margin: 0 } }, line)))))));
|
|
66
112
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import TaskLoaderProps from "./TaskLoaderProps";
|
|
3
|
-
export default function TaskLoader({ style, subTitle }: TaskLoaderProps): React.JSX.Element;
|
|
3
|
+
export default function TaskLoader({ style, subTitle, onUnauthorized, }: TaskLoaderProps): React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=TaskLoader.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskLoader.d.ts","sourceRoot":"","sources":["../../../src/components/TaskLoader/TaskLoader.tsx"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TaskLoader.d.ts","sourceRoot":"","sources":["../../../src/components/TaskLoader/TaskLoader.tsx"],"names":[],"mappings":"AAUA,OAAO,KAAmB,MAAM,OAAO,CAAC;AAoBxC,OAAO,eAAe,MAAM,mBAAmB,CAAC;AAmBhD,MAAM,CAAC,OAAO,UAAU,UAAU,CAAC,EACjC,KAAK,EACL,QAAQ,EACR,cAAc,GACf,EAAE,eAAe,qBA4ZjB"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
|
-
import
|
|
1
|
+
import AccessTimeSharpIcon from "@mui/icons-material/AccessTimeSharp";
|
|
2
|
+
import BlockSharpIcon from "@mui/icons-material/BlockSharp";
|
|
3
|
+
import CheckCircleOutlineRoundedIcon from "@mui/icons-material/CheckCircleOutlineRounded";
|
|
4
|
+
import ErrorOutlineSharpIcon from "@mui/icons-material/ErrorOutlineSharp";
|
|
5
|
+
import RestartAltIcon from "@mui/icons-material/RestartAlt";
|
|
6
|
+
import StopRoundedIcon from "@mui/icons-material/StopRounded";
|
|
7
|
+
import SyncIcon from "@mui/icons-material/Sync";
|
|
2
8
|
import CircularProgress from "@mui/material/CircularProgress";
|
|
3
9
|
import IconButton from "@mui/material/IconButton";
|
|
4
10
|
import Typography from "@mui/material/Typography";
|
|
5
|
-
import
|
|
6
|
-
import RestartAltIcon from "@mui/icons-material/RestartAlt";
|
|
7
|
-
import StopRoundedIcon from "@mui/icons-material/StopRounded";
|
|
8
|
-
import CheckCircleOutlineRoundedIcon from "@mui/icons-material/CheckCircleOutlineRounded";
|
|
9
|
-
import ErrorOutlineSharpIcon from "@mui/icons-material/ErrorOutlineSharp";
|
|
10
|
-
import AccessTimeSharpIcon from "@mui/icons-material/AccessTimeSharp";
|
|
11
|
-
import BlockSharpIcon from "@mui/icons-material/BlockSharp";
|
|
12
|
-
import { formatDate, formatDuration, taskStateText, useDebounce, } from "../../utils";
|
|
13
|
-
import SubtaskItem from "../SubtaskItem/SubtaskItem";
|
|
11
|
+
import React, { useState } from "react";
|
|
14
12
|
import { getRequest, postRequest } from "../../http";
|
|
15
|
-
import { getCSRFToken } from "../../utils";
|
|
16
|
-
import { useDagRunStateContext } from "../../providers/DagStateProvider";
|
|
17
13
|
import { useAirflowContext } from "../../providers/AirflowProvider";
|
|
14
|
+
import { useDagRunStateContext } from "../../providers/DagStateProvider";
|
|
15
|
+
import { formatDate, formatDuration, getCSRFToken, taskStateText, useDebounce, } from "../../utils";
|
|
16
|
+
import SubtaskItem from "../SubtaskItem/SubtaskItem";
|
|
18
17
|
import ProcessingIcon from "../icons/ProcessingIcon";
|
|
19
18
|
const taskStateIcon = (taskState) => {
|
|
20
19
|
switch (taskState) {
|
|
@@ -30,7 +29,7 @@ const taskStateIcon = (taskState) => {
|
|
|
30
29
|
return React.createElement(BlockSharpIcon, { fontSize: "large" });
|
|
31
30
|
}
|
|
32
31
|
};
|
|
33
|
-
export default function TaskLoader({ style, subTitle }) {
|
|
32
|
+
export default function TaskLoader({ style, subTitle, onUnauthorized, }) {
|
|
34
33
|
const { airflowAvailable, onLostConnection } = useAirflowContext();
|
|
35
34
|
const { isActive, dagRun, taskInstances, onUpdateState, fetchState } = useDagRunStateContext();
|
|
36
35
|
const [activeTask, setActiveTask] = React.useState(taskInstances?.taskInstances.find((ti) => {
|
|
@@ -116,6 +115,9 @@ export default function TaskLoader({ style, subTitle }) {
|
|
|
116
115
|
setLogs(newLogs);
|
|
117
116
|
},
|
|
118
117
|
errorHandler: (resp) => {
|
|
118
|
+
if (resp?.status == 401) {
|
|
119
|
+
onUnauthorized();
|
|
120
|
+
}
|
|
119
121
|
console.log("Error while fetching logs");
|
|
120
122
|
if (resp && resp.status === 503) {
|
|
121
123
|
onLostConnection();
|
|
@@ -155,6 +157,9 @@ export default function TaskLoader({ style, subTitle }) {
|
|
|
155
157
|
setLogs(newLogs);
|
|
156
158
|
},
|
|
157
159
|
errorHandler: (resp) => {
|
|
160
|
+
if (resp?.status == 401) {
|
|
161
|
+
onUnauthorized();
|
|
162
|
+
}
|
|
158
163
|
console.log("Error while getting logs for subtask!");
|
|
159
164
|
if (resp && resp.status === 503) {
|
|
160
165
|
onLostConnection();
|
|
@@ -183,6 +188,9 @@ export default function TaskLoader({ style, subTitle }) {
|
|
|
183
188
|
setLogs([null, null, null]);
|
|
184
189
|
},
|
|
185
190
|
errorHandler: (resp) => {
|
|
191
|
+
if (resp?.status == 401) {
|
|
192
|
+
onUnauthorized();
|
|
193
|
+
}
|
|
186
194
|
console.log("Error restarting task!");
|
|
187
195
|
if (resp && resp.status === 503) {
|
|
188
196
|
onLostConnection();
|
|
@@ -212,6 +220,9 @@ export default function TaskLoader({ style, subTitle }) {
|
|
|
212
220
|
setBlockControls(false);
|
|
213
221
|
},
|
|
214
222
|
errorHandler: (resp) => {
|
|
223
|
+
if (resp?.status == 401) {
|
|
224
|
+
onUnauthorized();
|
|
225
|
+
}
|
|
215
226
|
console.log("Error aborting task!");
|
|
216
227
|
if (resp && resp.status === 503) {
|
|
217
228
|
onLostConnection();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskLoaderProps.d.ts","sourceRoot":"","sources":["../../../src/components/TaskLoader/TaskLoaderProps.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,eAAe;IACtC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"TaskLoaderProps.d.ts","sourceRoot":"","sources":["../../../src/components/TaskLoader/TaskLoaderProps.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,OAAO,WAAW,eAAe;IACtC,KAAK,CAAC,EAAE,KAAK,CAAC,aAAa,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,cAAc,IAAI,IAAI,CAAC;CACxB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import TaskStateDialogProps from "./TaskStateDialogProps";
|
|
3
|
-
export default function TaskStateDialog({ taskTitle, subTitle, appendedTitle, visible, mousePos, disableClosing, additionalControls, disableTransition, onClose, }: TaskStateDialogProps): React.JSX.Element;
|
|
3
|
+
export default function TaskStateDialog({ taskTitle, subTitle, appendedTitle, visible, mousePos, disableClosing, additionalControls, disableTransition, onClose, onUnauthorized, }: TaskStateDialogProps): React.JSX.Element;
|
|
4
4
|
//# sourceMappingURL=TaskStateDialog.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskStateDialog.d.ts","sourceRoot":"","sources":["../../../src/components/TaskStateDialog/TaskStateDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"TaskStateDialog.d.ts","sourceRoot":"","sources":["../../../src/components/TaskStateDialog/TaskStateDialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAuB1B,OAAO,oBAAoB,MAAM,wBAAwB,CAAC;AAW1D,MAAM,CAAC,OAAO,UAAU,eAAe,CAAC,EACtC,SAAS,EACT,QAAQ,EACR,aAAa,EACb,OAAO,EACP,QAAQ,EACR,cAAc,EACd,kBAAkB,EAClB,iBAAiB,EACjB,OAAO,EACP,cAAc,GACf,EAAE,oBAAoB,qBA8LtB"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import Dialog from "@mui/material/Dialog";
|
|
3
2
|
import { useTheme } from "@mui/material";
|
|
3
|
+
import Dialog from "@mui/material/Dialog";
|
|
4
4
|
import Zoom from "@mui/material/Zoom";
|
|
5
5
|
const AppBar = React.lazy(() => import("@mui/material/AppBar"));
|
|
6
6
|
const Stack = React.lazy(() => import("@mui/material/Stack"));
|
|
@@ -12,12 +12,12 @@ const Badge = React.lazy(() => import("@mui/material/Badge"));
|
|
|
12
12
|
const CloseIcon = React.lazy(() => import("@mui/icons-material/Close"));
|
|
13
13
|
const CircularProgress = React.lazy(() => import("@mui/material/CircularProgress"));
|
|
14
14
|
const TaskLoader = React.lazy(() => import("../TaskLoader/TaskLoader"));
|
|
15
|
-
import { useDagRunStateContext } from "../../providers/DagStateProvider";
|
|
16
15
|
import { useAirflowContext } from "../../providers/AirflowProvider";
|
|
16
|
+
import { useDagRunStateContext } from "../../providers/DagStateProvider";
|
|
17
17
|
const Transition = React.forwardRef(function Transition(props, ref) {
|
|
18
18
|
return React.createElement(Zoom, { ref: ref, ...props });
|
|
19
19
|
});
|
|
20
|
-
export default function TaskStateDialog({ taskTitle, subTitle, appendedTitle, visible, mousePos, disableClosing, additionalControls, disableTransition, onClose, }) {
|
|
20
|
+
export default function TaskStateDialog({ taskTitle, subTitle, appendedTitle, visible, mousePos, disableClosing, additionalControls, disableTransition, onClose, onUnauthorized, }) {
|
|
21
21
|
const theme = useTheme();
|
|
22
22
|
const [loading, setLoading] = React.useState(true);
|
|
23
23
|
const { airflowAvailable } = useAirflowContext();
|
|
@@ -52,7 +52,10 @@ export default function TaskStateDialog({ taskTitle, subTitle, appendedTitle, vi
|
|
|
52
52
|
transition: disableTransition ? undefined : Transition,
|
|
53
53
|
}, slotProps: {
|
|
54
54
|
paper: {
|
|
55
|
-
sx: {
|
|
55
|
+
sx: {
|
|
56
|
+
backgroundColor: theme.vars?.palette.background.default ||
|
|
57
|
+
theme.palette.background.default,
|
|
58
|
+
},
|
|
56
59
|
},
|
|
57
60
|
transition: {
|
|
58
61
|
sx: {
|
|
@@ -90,7 +93,7 @@ export default function TaskStateDialog({ taskTitle, subTitle, appendedTitle, vi
|
|
|
90
93
|
justifyContent: "space-between",
|
|
91
94
|
height: "-webkit-fill-available",
|
|
92
95
|
} },
|
|
93
|
-
React.createElement(TaskLoader, { subTitle: subTitle, style: {
|
|
96
|
+
React.createElement(TaskLoader, { subTitle: subTitle, onUnauthorized: onUnauthorized, style: {
|
|
94
97
|
margin: "3rem",
|
|
95
98
|
height: "-webkit-fill-available",
|
|
96
99
|
} }),
|
|
@@ -4,11 +4,12 @@ export default interface TaskStateModalProps extends TaskLoaderProps {
|
|
|
4
4
|
taskTitle: string;
|
|
5
5
|
appendedTitle?: string;
|
|
6
6
|
visible: boolean;
|
|
7
|
-
onClose(): void;
|
|
8
7
|
mousePos?: string;
|
|
9
8
|
disableClosing?: boolean;
|
|
10
9
|
additionalControls?: AdditionalTaskControl[];
|
|
11
10
|
disableTransition?: boolean;
|
|
11
|
+
onClose(): void;
|
|
12
|
+
onUnauthorized(): void;
|
|
12
13
|
}
|
|
13
14
|
export interface AdditionalTaskControl {
|
|
14
15
|
dagId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TaskStateDialogProps.d.ts","sourceRoot":"","sources":["../../../src/components/TaskStateDialog/TaskStateDialogProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAE5D,MAAM,CAAC,OAAO,WAAW,mBAAoB,SAAQ,eAAe;IAClE,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,
|
|
1
|
+
{"version":3,"file":"TaskStateDialogProps.d.ts","sourceRoot":"","sources":["../../../src/components/TaskStateDialog/TaskStateDialogProps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,eAAe,MAAM,+BAA+B,CAAC;AAE5D,MAAM,CAAC,OAAO,WAAW,mBAAoB,SAAQ,eAAe;IAClE,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,EAAE,OAAO,CAAC;IACjB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,kBAAkB,CAAC,EAAE,qBAAqB,EAAE,CAAC;IAC7C,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B,OAAO,IAAI,IAAI,CAAC;IAChB,cAAc,IAAI,IAAI,CAAC;CACxB;AAED,MAAM,WAAW,qBAAqB;IACpC,KAAK,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAAC,SAAS,CAAC;IAC3C,SAAS,CAAC,CACR,QAAQ,EAAE,MAAM,EAChB,KAAK,EAAE,MAAM,EACb,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,EAChB,UAAU,EAAE,MAAM,GACjB,KAAK,CAAC,SAAS,CAAC;CACpB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerateAndRunIcon.d.ts","sourceRoot":"","sources":["../../../src/components/icons/GenerateAndRunIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"GenerateAndRunIcon.d.ts","sourceRoot":"","sources":["../../../src/components/icons/GenerateAndRunIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAY,MAAM,eAAe,CAAC;AACzE,OAAO,KAAK,MAAM,OAAO,CAAC;AAoH1B,UAAU,uBAAwB,SAAQ,eAAe;IACvD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,kBAAkB,GAAI,wBAGzB,uBAAuB,sBAezB,CAAC;AAEF,eAAe,kBAAkB,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { createSvgIcon, useTheme } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
3
|
const GenerateAndRunSvgIcon = createSvgIcon(React.createElement("svg", { width: "38", height: "38", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 38 38", preserveAspectRatio: "xMidYMid", version: "1.1" },
|
|
4
4
|
React.createElement("g", { className: "layer", display: "inline" },
|
|
5
5
|
React.createElement("g", { id: "s", transform: "translate(-0.02 -0.02) matrix(1.63693 0 0 1.63225 -3.38016 7.32488)" },
|
|
@@ -24,6 +24,9 @@ const GenerateAndRunSvgIcon = createSvgIcon(React.createElement("svg", { width:
|
|
|
24
24
|
// todo: Обобщить, создать хук
|
|
25
25
|
const GenerateAndRunIcon = ({ disabled, ...props }) => {
|
|
26
26
|
const theme = useTheme();
|
|
27
|
-
return disabled ? (React.createElement(GenerateAndRunSvgIcon, { sx: {
|
|
27
|
+
return disabled ? (React.createElement(GenerateAndRunSvgIcon, { sx: {
|
|
28
|
+
"--disabled": theme.vars?.palette.action.disabled || theme.palette.action.disabled,
|
|
29
|
+
...props.sx,
|
|
30
|
+
}, ...props })) : (React.createElement(GenerateAndRunSvgIcon, { ...props }));
|
|
28
31
|
};
|
|
29
32
|
export default GenerateAndRunIcon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"GenerateIcon.d.ts","sourceRoot":"","sources":["../../../src/components/icons/GenerateIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"GenerateIcon.d.ts","sourceRoot":"","sources":["../../../src/components/icons/GenerateIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAY,MAAM,eAAe,CAAC;AACzE,OAAO,KAAK,MAAM,OAAO,CAAC;AAoG1B,UAAU,iBAAkB,SAAQ,eAAe;IACjD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,YAAY,GAAI,wBAAwB,iBAAiB,sBAe9D,CAAC;AAEF,eAAe,YAAY,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { createSvgIcon, useTheme } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
3
|
const GenerateSvgIcon = createSvgIcon(React.createElement("svg", { width: "38", height: "38", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 38 38", preserveAspectRatio: "xMidYMid", version: "1.1" },
|
|
4
4
|
React.createElement("g", { className: "layer", display: "inline" },
|
|
5
5
|
React.createElement("g", { id: "s", transform: "translate(-0.02 -0.02) matrix(1.63693 0 0 1.63225 -3.38016 7.32488)" },
|
|
@@ -22,6 +22,9 @@ const GenerateSvgIcon = createSvgIcon(React.createElement("svg", { width: "38",
|
|
|
22
22
|
// todo: Обобщить, создать хук
|
|
23
23
|
const GenerateIcon = ({ disabled, ...props }) => {
|
|
24
24
|
const theme = useTheme();
|
|
25
|
-
return disabled ? (React.createElement(GenerateSvgIcon, { sx: {
|
|
25
|
+
return disabled ? (React.createElement(GenerateSvgIcon, { sx: {
|
|
26
|
+
"--disabled": theme.vars?.palette.action.disabled || theme.palette.action.disabled,
|
|
27
|
+
...props.sx,
|
|
28
|
+
}, ...props })) : (React.createElement(GenerateSvgIcon, { ...props }));
|
|
26
29
|
};
|
|
27
30
|
export default GenerateIcon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IntegerIcon.d.ts","sourceRoot":"","sources":["../../../src/components/icons/IntegerIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"IntegerIcon.d.ts","sourceRoot":"","sources":["../../../src/components/icons/IntegerIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAY,MAAM,eAAe,CAAC;AACzE,OAAO,KAAK,MAAM,OAAO,CAAC;AAyB1B,UAAU,gBAAiB,SAAQ,eAAe;IAChD,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,WAAW,GAAI,wBAAwB,gBAAgB,sBAe5D,CAAC;AAEF,eAAe,WAAW,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { createSvgIcon, useTheme } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
3
|
const IntegerSvgIcon = createSvgIcon(React.createElement("svg", { fill: "var(--disabled, currentColor)", viewBox: "0 0 32 32", id: "icon", xmlns: "http://www.w3.org/2000/svg", stroke: "var(--disabled, currentColor)" },
|
|
4
4
|
React.createElement("g", { id: "SVGRepo_bgCarrier", strokeWidth: "0" }),
|
|
5
5
|
React.createElement("g", { id: "SVGRepo_tracerCarrier", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
@@ -10,6 +10,9 @@ const IntegerSvgIcon = createSvgIcon(React.createElement("svg", { fill: "var(--d
|
|
|
10
10
|
// todo: Обобщить, создать хук
|
|
11
11
|
const IntegerIcon = ({ disabled, ...props }) => {
|
|
12
12
|
const theme = useTheme();
|
|
13
|
-
return disabled ? (React.createElement(IntegerSvgIcon, { sx: {
|
|
13
|
+
return disabled ? (React.createElement(IntegerSvgIcon, { sx: {
|
|
14
|
+
"--disabled": theme.vars?.palette.action.disabled || theme.palette.action.disabled,
|
|
15
|
+
...props.sx,
|
|
16
|
+
}, ...props })) : (React.createElement(IntegerSvgIcon, { ...props }));
|
|
14
17
|
};
|
|
15
18
|
export default IntegerIcon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"QueueIcon.d.ts","sourceRoot":"","sources":["../../../src/components/icons/QueueIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"QueueIcon.d.ts","sourceRoot":"","sources":["../../../src/components/icons/QueueIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAY,MAAM,eAAe,CAAC;AACzE,OAAO,KAAK,MAAM,OAAO,CAAC;AA+B1B,UAAU,cAAe,SAAQ,eAAe;IAC9C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,SAAS,GAAI,wBAAwB,cAAc,sBAexD,CAAC;AAEF,eAAe,SAAS,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { createSvgIcon, useTheme } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
3
|
const QueueSvgIcon = createSvgIcon(React.createElement("svg", { viewBox: "0 0 24 24", xmlns: "http://www.w3.org/2000/svg", fill: "#000000" },
|
|
4
4
|
React.createElement("g", { id: "SVGRepo_bgCarrier", strokeWidth: "0" }),
|
|
5
5
|
React.createElement("g", { id: "SVGRepo_tracerCarrier", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
@@ -10,6 +10,9 @@ const QueueSvgIcon = createSvgIcon(React.createElement("svg", { viewBox: "0 0 24
|
|
|
10
10
|
// todo: Обобщить, создать хук
|
|
11
11
|
const QueueIcon = ({ disabled, ...props }) => {
|
|
12
12
|
const theme = useTheme();
|
|
13
|
-
return disabled ? (React.createElement(QueueSvgIcon, { sx: {
|
|
13
|
+
return disabled ? (React.createElement(QueueSvgIcon, { sx: {
|
|
14
|
+
"--disabled": theme.vars?.palette.action.disabled || theme.palette.action.disabled,
|
|
15
|
+
...props.sx,
|
|
16
|
+
}, ...props })) : (React.createElement(QueueSvgIcon, { ...props }));
|
|
14
17
|
};
|
|
15
18
|
export default QueueIcon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RangeIcon.d.ts","sourceRoot":"","sources":["../../../src/components/icons/RangeIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"RangeIcon.d.ts","sourceRoot":"","sources":["../../../src/components/icons/RangeIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAY,MAAM,eAAe,CAAC;AACzE,OAAO,KAAK,MAAM,OAAO,CAAC;AA8C1B,UAAU,WAAY,SAAQ,eAAe;IAC3C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,MAAM,GAAI,wBAAwB,WAAW,sBAelD,CAAC;AAEF,eAAe,MAAM,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { createSvgIcon, useTheme } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
3
|
const IpSVGIcon = createSvgIcon(React.createElement("svg", { viewBox: "0 0 48 48", xmlns: "http://www.w3.org/2000/svg", fill: "#000000", stroke: "#000000", strokeWidth: "4.176" },
|
|
4
4
|
React.createElement("g", { id: "SVGRepo_bgCarrier", strokeWidth: "0" }),
|
|
5
5
|
React.createElement("g", { id: "SVGRepo_tracerCarrier", strokeLinecap: "round", strokeLinejoin: "round" }),
|
|
@@ -10,6 +10,9 @@ const IpSVGIcon = createSvgIcon(React.createElement("svg", { viewBox: "0 0 48 48
|
|
|
10
10
|
// todo: Обобщить, создать хук
|
|
11
11
|
const IpIcon = ({ disabled, ...props }) => {
|
|
12
12
|
const theme = useTheme();
|
|
13
|
-
return disabled ? (React.createElement(IpSVGIcon, { sx: {
|
|
13
|
+
return disabled ? (React.createElement(IpSVGIcon, { sx: {
|
|
14
|
+
"--disabled": theme.vars?.palette.action.disabled || theme.palette.action.disabled,
|
|
15
|
+
...props.sx,
|
|
16
|
+
}, ...props })) : (React.createElement(IpSVGIcon, { ...props }));
|
|
14
17
|
};
|
|
15
18
|
export default IpIcon;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RunIcon.d.ts","sourceRoot":"","sources":["../../../src/components/icons/RunIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"RunIcon.d.ts","sourceRoot":"","sources":["../../../src/components/icons/RunIcon.tsx"],"names":[],"mappings":"AAAA,OAAO,EAAiB,eAAe,EAAY,MAAM,eAAe,CAAC;AACzE,OAAO,KAAK,MAAM,OAAO,CAAC;AAqD1B,UAAU,YAAa,SAAQ,eAAe;IAC5C,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED,QAAA,MAAM,OAAO,GAAI,wBAAwB,YAAY,sBAepD,CAAC;AAEF,eAAe,OAAO,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import React from "react";
|
|
2
1
|
import { createSvgIcon, useTheme } from "@mui/material";
|
|
2
|
+
import React from "react";
|
|
3
3
|
const RunSvgIcon = createSvgIcon(React.createElement("svg", { width: "38", height: "38", xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 38 38", preserveAspectRatio: "xMidYMid", version: "1.1" },
|
|
4
4
|
React.createElement("g", { className: "layer", display: "inline" },
|
|
5
5
|
React.createElement("g", { id: "s", transform: "translate(-0.02 -0.02) matrix(1.63693 0 0 1.63225 -3.38016 7.32488)" },
|
|
@@ -13,6 +13,9 @@ const RunSvgIcon = createSvgIcon(React.createElement("svg", { width: "38", heigh
|
|
|
13
13
|
// todo: Обобщить, создать хук
|
|
14
14
|
const RunIcon = ({ disabled, ...props }) => {
|
|
15
15
|
const theme = useTheme();
|
|
16
|
-
return disabled ? (React.createElement(RunSvgIcon, { sx: {
|
|
16
|
+
return disabled ? (React.createElement(RunSvgIcon, { sx: {
|
|
17
|
+
"--disabled": theme.vars?.palette.action.disabled || theme.palette.action.disabled,
|
|
18
|
+
...props.sx,
|
|
19
|
+
}, ...props })) : (React.createElement(RunSvgIcon, { ...props }));
|
|
17
20
|
};
|
|
18
21
|
export default RunIcon;
|
package/dist/http.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ interface BaseCallParamsPOST extends BaseCallParams {
|
|
|
6
6
|
headers?: HeadersInit;
|
|
7
7
|
}
|
|
8
8
|
interface ExtraCallParams<T, P> {
|
|
9
|
-
successHandler?: (resp
|
|
10
|
-
errorHandler?: (resp
|
|
9
|
+
successHandler?: (resp: T) => void;
|
|
10
|
+
errorHandler?: (resp: P & {
|
|
11
11
|
status: number;
|
|
12
12
|
}) => void;
|
|
13
13
|
}
|
package/dist/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,kBAAmB,SAAQ,cAAc;IACjD,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED,UAAU,eAAe,CAAC,CAAC,EAAE,CAAC;IAC5B,cAAc,CAAC,EAAE,CAAC,IAAI,
|
|
1
|
+
{"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../src/http.ts"],"names":[],"mappings":"AAAA,UAAU,cAAc;IACtB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED,UAAU,kBAAmB,SAAQ,cAAc;IACjD,OAAO,CAAC,EAAE,WAAW,CAAC;CACvB;AAED,UAAU,eAAe,CAAC,CAAC,EAAE,CAAC;IAC5B,cAAc,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,KAAK,IAAI,CAAC;IACnC,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG;QAAE,MAAM,EAAE,MAAM,CAAA;KAAE,KAAK,IAAI,CAAC;CACvD;AAED,KAAK,UAAU,CAAC,CAAC,EAAE,CAAC,IAAI,cAAc,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AAC/D,KAAK,cAAc,CAAC,CAAC,EAAE,CAAC,IAAI,kBAAkB,GAAG,eAAe,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AA2BvE,wBAAsB,iBAAiB,CAAC,CAAC,EAAE,CAAC,EAAE,EAC5C,GAAG,EACH,IAAI,GACL,EAAE,cAAc,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAYxD;AAED,wBAAsB,kBAAkB,CAAC,CAAC,EAAE,CAAC,EAAE,EAC7C,GAAG,EACH,IAAI,EACJ,OAAO,GACR,EAAE,kBAAkB,GAAG,OAAO,CAAC,CAAC,GAAG,CAAC,CAAC,GAAG;IAAE,MAAM,EAAE,MAAM,CAAA;CAAE,CAAC,CAAC,CAY5D;AAED,wBAAsB,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,EACrC,GAAG,EACH,IAAI,EACJ,cAAc,EACd,YAAY,GACb,EAAE,UAAU,CAAC,CAAC,EAAE,CAAC,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,CAgBlC;AAED,wBAAsB,WAAW,CAAC,CAAC,EAAE,CAAC,EAAE,EACtC,GAAG,EACH,IAAI,EACJ,OAAO,EACP,cAAc,EACd,YAAY,GACb,EAAE,cAAc,CAAC,CAAC,EAAE,CAAC,CAAC,iBActB"}
|
package/dist/http.js
CHANGED
|
@@ -20,13 +20,7 @@ async function _postRequest({ url, data, headers }) {
|
|
|
20
20
|
}
|
|
21
21
|
export async function getRequestPromise({ url, data, }) {
|
|
22
22
|
const resp = await _getRequest({ url, data });
|
|
23
|
-
if (resp.
|
|
24
|
-
// #NOTE
|
|
25
|
-
// На данный момент редирект - признак просроченной сессии,
|
|
26
|
-
// так как на json запрос нет явного ответа редиректом, только через декоратор логина,
|
|
27
|
-
// если же в будущем будет добавлен какой-то иной редирект в ответ за json запрос,
|
|
28
|
-
// то нужно будет поменять код в данном блоке
|
|
29
|
-
// location.reload();
|
|
23
|
+
if (resp.status === 401) {
|
|
30
24
|
console.log("Session expired");
|
|
31
25
|
}
|
|
32
26
|
if (resp.ok) {
|
|
@@ -38,13 +32,7 @@ export async function getRequestPromise({ url, data, }) {
|
|
|
38
32
|
}
|
|
39
33
|
export async function postRequestPromise({ url, data, headers, }) {
|
|
40
34
|
const resp = await _postRequest({ url, data, headers });
|
|
41
|
-
if (resp.
|
|
42
|
-
// #NOTE
|
|
43
|
-
// На данный момент редирект - признак просроченной сессии,
|
|
44
|
-
// так как на json запрос нет явного ответа редиректом, только через декоратор логина,
|
|
45
|
-
// если же в будущем будет добавлен какой-то иной редирект в ответ за json запрос,
|
|
46
|
-
// то нужно будет поменять код в данном блоке
|
|
47
|
-
// location.reload();
|
|
35
|
+
if (resp.status === 401) {
|
|
48
36
|
console.log("Session expired");
|
|
49
37
|
}
|
|
50
38
|
if (resp.ok) {
|
|
@@ -56,13 +44,7 @@ export async function postRequestPromise({ url, data, headers, }) {
|
|
|
56
44
|
}
|
|
57
45
|
export async function getRequest({ url, data, successHandler, errorHandler, }) {
|
|
58
46
|
const resp = await _getRequest({ url, data });
|
|
59
|
-
if (resp.
|
|
60
|
-
// #NOTE
|
|
61
|
-
// На данный момент редирект - признак просроченной сессии,
|
|
62
|
-
// так как на json запрос нет явного ответа редиректом, только через декоратор логина,
|
|
63
|
-
// если же в будущем будет добавлен какой-то иной редирект в ответ за json запрос,
|
|
64
|
-
// то нужно будет поменять код в данном блоке
|
|
65
|
-
// location.reload();
|
|
47
|
+
if (resp.status === 401) {
|
|
66
48
|
console.log("Session expired");
|
|
67
49
|
}
|
|
68
50
|
if (resp.ok) {
|
|
@@ -78,14 +60,7 @@ export async function getRequest({ url, data, successHandler, errorHandler, }) {
|
|
|
78
60
|
}
|
|
79
61
|
export async function postRequest({ url, data, headers, successHandler, errorHandler, }) {
|
|
80
62
|
const resp = await _postRequest({ url, data, headers });
|
|
81
|
-
if (resp.
|
|
82
|
-
// #NOTE
|
|
83
|
-
// На данный момент редирект - признак просроченной сессии,
|
|
84
|
-
// так как на json запрос нет явного ответа редиректом, только через декоратор логина,
|
|
85
|
-
// если же в будущем будет добавлен какой-то иной редирект в ответ за json запрос,
|
|
86
|
-
// то нужно будет поменять код в данном блоке
|
|
87
|
-
// location.reload();
|
|
88
|
-
// Надо продумать этот вопрос получше
|
|
63
|
+
if (resp.status === 401) {
|
|
89
64
|
console.log("Session expired");
|
|
90
65
|
}
|
|
91
66
|
if (resp.ok) {
|
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
interface AirflowProviderProps {
|
|
3
3
|
children?: React.ReactNode;
|
|
4
|
-
dagId
|
|
4
|
+
dagId?: string | null;
|
|
5
|
+
onUnauthorized(): void;
|
|
5
6
|
}
|
|
6
|
-
export declare const AirflowProvider: ({ children, dagId: _dagId, }: AirflowProviderProps) => React.JSX.Element;
|
|
7
|
+
export declare const AirflowProvider: ({ children, dagId: _dagId, onUnauthorized, }: AirflowProviderProps) => React.JSX.Element;
|
|
7
8
|
export declare const useAirflowContext: () => {
|
|
9
|
+
dagId?: string | null;
|
|
8
10
|
airflowAvailable: boolean;
|
|
9
|
-
dagId: string;
|
|
10
|
-
onChangeDagId(dagId: string): void;
|
|
11
|
+
onChangeDagId(dagId: string | null): void;
|
|
11
12
|
onLostConnection(): void;
|
|
12
13
|
};
|
|
13
14
|
export default AirflowProvider;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AirflowProvider.d.ts","sourceRoot":"","sources":["../../src/providers/AirflowProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"AirflowProvider.d.ts","sourceRoot":"","sources":["../../src/providers/AirflowProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAA2D,MAAM,OAAO,CAAC;AAgBhF,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,cAAc,IAAI,IAAI,CAAC;CACxB;AAED,eAAO,MAAM,eAAe,GAAI,8CAI7B,oBAAoB,sBAyEtB,CAAC;AAEF,eAAO,MAAM,iBAAiB;YAhGpB,MAAM,GAAG,IAAI;sBACH,OAAO;yBACJ,MAAM,GAAG,IAAI,GAAG,IAAI;wBACrB,IAAI;CA+FzB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|