@danikokonn/yarik-frontend-lib 2.0.55-test → 2.0.55
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/ActionDialog/ActionDialog.d.ts +1 -2
- package/dist/components/ActionDialog/ActionDialog.d.ts.map +1 -1
- package/dist/components/ActionDialog/ActionDialog.js +7 -18
- package/dist/components/ActionDialog/ActionDialogProps.d.ts +1 -1
- package/dist/components/ActionDialog/ActionDialogProps.d.ts.map +1 -1
- package/dist/components/ActionDialog/index.d.ts +2 -2
- package/dist/components/ActionDialog/index.d.ts.map +1 -1
- package/dist/components/ActionDialog/index.js +1 -1
- package/dist/components/ColumnSearchInput/ColumnSearchInput.d.ts +1 -2
- package/dist/components/ColumnSearchInput/ColumnSearchInput.d.ts.map +1 -1
- package/dist/components/ColumnSearchInput/ColumnSearchInput.js +5 -5
- package/dist/components/ColumnSearchInput/index.d.ts +2 -2
- package/dist/components/ColumnSearchInput/index.d.ts.map +1 -1
- package/dist/components/ColumnSearchInput/index.js +1 -1
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts +2 -3
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.d.ts.map +1 -1
- package/dist/components/DateTimeRangePicker/DateTimeRangePicker.js +39 -41
- package/dist/components/DateTimeRangePicker/index.d.ts +2 -2
- package/dist/components/DateTimeRangePicker/index.d.ts.map +1 -1
- package/dist/components/DateTimeRangePicker/index.js +1 -1
- package/dist/components/DatetimeRangeInput/DatetimeRangeInput.d.ts +1 -0
- package/dist/components/DatetimeRangeInput/DatetimeRangeInput.d.ts.map +1 -1
- package/dist/components/DatetimeRangeInput/DatetimeRangeInput.js +38 -44
- package/dist/components/DatetimeRangeInput/index.d.ts +2 -2
- package/dist/components/DatetimeRangeInput/index.d.ts.map +1 -1
- package/dist/components/DatetimeRangeInput/index.js +1 -1
- package/dist/components/Footer/Footer.d.ts +1 -2
- package/dist/components/Footer/Footer.d.ts.map +1 -1
- package/dist/components/Footer/Footer.js +5 -13
- package/dist/components/Footer/index.d.ts +1 -1
- package/dist/components/Footer/index.d.ts.map +1 -1
- package/dist/components/Footer/index.js +1 -1
- package/dist/components/IpAddressInput/IpAddressInput.d.ts +1 -2
- package/dist/components/IpAddressInput/IpAddressInput.d.ts.map +1 -1
- package/dist/components/IpAddressInput/IpAddressInput.js +5 -6
- package/dist/components/IpAddressInput/index.d.ts +2 -2
- package/dist/components/IpAddressInput/index.d.ts.map +1 -1
- package/dist/components/IpAddressInput/index.js +1 -1
- package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInput.d.ts +1 -2
- package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInput.d.ts.map +1 -1
- package/dist/components/IpAddressSwitchableInput/IpAddressSwitchableInput.js +3 -2
- package/dist/components/IpAddressSwitchableInput/index.d.ts +2 -2
- package/dist/components/IpAddressSwitchableInput/index.d.ts.map +1 -1
- package/dist/components/IpAddressSwitchableInput/index.js +1 -1
- package/dist/components/LocalizedDatetimePicker/LocalizedDatetimePicker.d.ts +1 -2
- package/dist/components/LocalizedDatetimePicker/LocalizedDatetimePicker.d.ts.map +1 -1
- package/dist/components/LocalizedDatetimePicker/LocalizedDatetimePicker.js +6 -6
- package/dist/components/LocalizedDatetimePicker/index.d.ts +2 -2
- package/dist/components/LocalizedDatetimePicker/index.d.ts.map +1 -1
- package/dist/components/LocalizedDatetimePicker/index.js +1 -1
- package/dist/components/Navigation/NavMenu.d.ts +4 -3
- package/dist/components/Navigation/NavMenu.d.ts.map +1 -1
- package/dist/components/Navigation/NavMenu.js +23 -27
- package/dist/components/Navigation/Navigation.d.ts +1 -2
- package/dist/components/Navigation/Navigation.d.ts.map +1 -1
- package/dist/components/Navigation/Navigation.js +122 -147
- package/dist/components/Navigation/NavigationProps.d.ts +2 -1
- package/dist/components/Navigation/NavigationProps.d.ts.map +1 -1
- package/dist/components/Navigation/index.d.ts +2 -2
- package/dist/components/Navigation/index.d.ts.map +1 -1
- package/dist/components/Navigation/index.js +1 -1
- package/dist/components/NumberRangeInput/NumberRangeInput.d.ts +1 -2
- package/dist/components/NumberRangeInput/NumberRangeInput.d.ts.map +1 -1
- package/dist/components/NumberRangeInput/NumberRangeInput.js +34 -39
- package/dist/components/NumberRangeInput/index.d.ts +2 -2
- package/dist/components/NumberRangeInput/index.d.ts.map +1 -1
- package/dist/components/NumberRangeInput/index.js +1 -1
- package/dist/components/PageWrapper/PageWrapper.d.ts +2 -2
- package/dist/components/PageWrapper/PageWrapper.d.ts.map +1 -1
- package/dist/components/PageWrapper/PageWrapper.js +11 -14
- package/dist/components/PageWrapper/index.d.ts +2 -2
- package/dist/components/PageWrapper/index.d.ts.map +1 -1
- package/dist/components/PageWrapper/index.js +1 -1
- package/dist/components/RichFilterTextField/FilterHistoryMenu.d.ts +1 -2
- package/dist/components/RichFilterTextField/FilterHistoryMenu.d.ts.map +1 -1
- package/dist/components/RichFilterTextField/FilterHistoryMenu.js +17 -31
- package/dist/components/RichFilterTextField/HintOptionsMenu.d.ts +4 -4
- package/dist/components/RichFilterTextField/HintOptionsMenu.d.ts.map +1 -1
- package/dist/components/RichFilterTextField/HintOptionsMenu.js +8 -10
- package/dist/components/RichFilterTextField/RichFilterTextField.d.ts +1 -2
- package/dist/components/RichFilterTextField/RichFilterTextField.d.ts.map +1 -1
- package/dist/components/RichFilterTextField/RichFilterTextField.js +106 -79
- package/dist/components/RichFilterTextField/index.d.ts +2 -2
- package/dist/components/RichFilterTextField/index.d.ts.map +1 -1
- package/dist/components/RichFilterTextField/index.js +1 -1
- package/dist/components/RichFilterTextField/utils.d.ts.map +1 -1
- package/dist/components/RichFilterTextField/utils.js +13 -5
- package/dist/components/SmartTable/RowContent.d.ts +29 -9
- package/dist/components/SmartTable/RowContent.d.ts.map +1 -1
- package/dist/components/SmartTable/RowContent.js +59 -20
- package/dist/components/SmartTable/SmartTable.d.ts +9 -2
- package/dist/components/SmartTable/SmartTable.d.ts.map +1 -1
- package/dist/components/SmartTable/SmartTable.js +97 -109
- package/dist/components/SmartTable/SmartTableProps.d.ts +20 -10
- package/dist/components/SmartTable/SmartTableProps.d.ts.map +1 -1
- package/dist/components/SmartTable/TableHeader.d.ts +1 -2
- package/dist/components/SmartTable/TableHeader.d.ts.map +1 -1
- package/dist/components/SmartTable/TableHeader.js +5 -4
- package/dist/components/SmartTable/index.d.ts +2 -2
- package/dist/components/SmartTable/index.d.ts.map +1 -1
- package/dist/components/SmartTable/index.js +1 -1
- package/dist/components/SortBtn/SortBtn.d.ts +1 -2
- package/dist/components/SortBtn/SortBtn.d.ts.map +1 -1
- package/dist/components/SortBtn/SortBtn.js +3 -2
- package/dist/components/SortBtn/index.d.ts +2 -2
- package/dist/components/SortBtn/index.d.ts.map +1 -1
- package/dist/components/SortBtn/index.js +1 -1
- package/dist/components/SubtaskItem/SubtaskItem.d.ts +1 -2
- package/dist/components/SubtaskItem/SubtaskItem.d.ts.map +1 -1
- package/dist/components/SubtaskItem/SubtaskItem.js +79 -43
- package/dist/components/SubtaskItem/SubtaskItemProps.d.ts +1 -1
- package/dist/components/SubtaskItem/SubtaskItemProps.d.ts.map +1 -1
- package/dist/components/SubtaskItem/index.d.ts +2 -2
- package/dist/components/SubtaskItem/index.d.ts.map +1 -1
- package/dist/components/SubtaskItem/index.js +1 -1
- package/dist/components/TaskLoader/TaskLoader.d.ts +2 -2
- package/dist/components/TaskLoader/TaskLoader.d.ts.map +1 -1
- package/dist/components/TaskLoader/TaskLoader.js +112 -117
- package/dist/components/TaskLoader/TaskLoaderProps.d.ts +1 -0
- package/dist/components/TaskLoader/TaskLoaderProps.d.ts.map +1 -1
- package/dist/components/TaskLoader/index.d.ts +2 -2
- package/dist/components/TaskLoader/index.d.ts.map +1 -1
- package/dist/components/TaskLoader/index.js +1 -1
- package/dist/components/TaskStateDialog/TaskStateDialog.d.ts +1 -2
- package/dist/components/TaskStateDialog/TaskStateDialog.d.ts.map +1 -1
- package/dist/components/TaskStateDialog/TaskStateDialog.js +33 -47
- package/dist/components/TaskStateDialog/TaskStateDialogProps.d.ts +2 -1
- package/dist/components/TaskStateDialog/TaskStateDialogProps.d.ts.map +1 -1
- package/dist/components/TaskStateDialog/index.d.ts +2 -2
- package/dist/components/TaskStateDialog/index.d.ts.map +1 -1
- package/dist/components/TaskStateDialog/index.js +1 -1
- package/dist/components/icons/GenerateAndRunIcon.d.ts +1 -2
- package/dist/components/icons/GenerateAndRunIcon.d.ts.map +1 -1
- package/dist/components/icons/GenerateAndRunIcon.js +6 -23
- package/dist/components/icons/GenerateIcon.d.ts +1 -2
- package/dist/components/icons/GenerateIcon.d.ts.map +1 -1
- package/dist/components/icons/GenerateIcon.js +6 -21
- package/dist/components/icons/IntegerIcon.d.ts +1 -2
- package/dist/components/icons/IntegerIcon.d.ts.map +1 -1
- package/dist/components/icons/IntegerIcon.js +6 -9
- package/dist/components/icons/ProcessingIcon.d.ts +1 -2
- package/dist/components/icons/ProcessingIcon.d.ts.map +1 -1
- package/dist/components/icons/ProcessingIcon.js +2 -12
- package/dist/components/icons/QueueIcon.d.ts +1 -2
- package/dist/components/icons/QueueIcon.d.ts.map +1 -1
- package/dist/components/icons/QueueIcon.js +6 -9
- package/dist/components/icons/RangeIcon.d.ts +1 -2
- package/dist/components/icons/RangeIcon.d.ts.map +1 -1
- package/dist/components/icons/RangeIcon.js +6 -9
- package/dist/components/icons/RunIcon.d.ts +1 -2
- package/dist/components/icons/RunIcon.d.ts.map +1 -1
- package/dist/components/icons/RunIcon.js +6 -12
- package/dist/components/icons/TextModeIcon.d.ts.map +1 -1
- package/dist/components/icons/TextModeIcon.js +2 -6
- package/dist/components/icons/TreeModeIcon.d.ts.map +1 -1
- package/dist/components/icons/TreeModeIcon.js +2 -6
- package/dist/components/icons/index.d.ts +1 -1
- package/dist/components/icons/index.js +1 -1
- package/dist/http.d.ts +2 -2
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +4 -29
- package/dist/index.d.ts +2 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/providers/AirflowProvider.d.ts +5 -4
- package/dist/providers/AirflowProvider.d.ts.map +1 -1
- package/dist/providers/AirflowProvider.js +44 -58
- package/dist/providers/DagStateProvider.d.ts +6 -5
- package/dist/providers/DagStateProvider.d.ts.map +1 -1
- package/dist/providers/DagStateProvider.js +39 -13
- package/dist/providers/SessionProvider.d.ts +3 -1
- package/dist/providers/SessionProvider.d.ts.map +1 -1
- package/dist/providers/SessionProvider.js +14 -7
- package/dist/providers/SnackBarProvider.d.ts +2 -2
- package/dist/providers/SnackBarProvider.d.ts.map +1 -1
- package/dist/providers/SnackBarProvider.js +8 -9
- package/dist/providers/index.d.ts +4 -4
- package/dist/providers/index.d.ts.map +1 -1
- package/dist/providers/index.js +4 -4
- package/dist/types.d.ts +17 -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 +30 -21
- 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
|
@@ -6,5 +6,5 @@ export { default as QueueIcon } from "./QueueIcon";
|
|
|
6
6
|
export { default as RangeIcon } from "./RangeIcon";
|
|
7
7
|
export { default as RunIcon } from "./RunIcon";
|
|
8
8
|
export { default as TextModeIcon } from "./TextModeIcon";
|
|
9
|
-
export { default as TreeModeIcon } from "./
|
|
9
|
+
export { default as TreeModeIcon } from "./TreeModeIcon";
|
|
10
10
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -6,4 +6,4 @@ export { default as QueueIcon } from "./QueueIcon";
|
|
|
6
6
|
export { default as RangeIcon } from "./RangeIcon";
|
|
7
7
|
export { default as RunIcon } from "./RunIcon";
|
|
8
8
|
export { default as TextModeIcon } from "./TextModeIcon";
|
|
9
|
-
export { default as TreeModeIcon } from "./
|
|
9
|
+
export { default as TreeModeIcon } from "./TreeModeIcon";
|
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) {
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,cAAc,CAAC;AAC7B,cAAc,QAAQ,CAAC;AACvB,cAAc,aAAa,CAAC;AAC5B,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -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) =>
|
|
7
|
+
export declare const AirflowProvider: ({ children, dagId: _dagId, onUnauthorized, }: AirflowProviderProps) => import("react/jsx-runtime").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,4CAyEtB,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"}
|
|
@@ -1,78 +1,64 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useState } from "react";
|
|
3
|
+
import useSWR from "swr";
|
|
3
4
|
import { useSnackbarContext } from "./SnackBarProvider";
|
|
4
5
|
const AirflowContext = createContext({
|
|
5
|
-
airflowAvailable: false,
|
|
6
6
|
dagId: "",
|
|
7
|
+
airflowAvailable: false,
|
|
7
8
|
onChangeDagId: () => { },
|
|
8
9
|
onLostConnection: () => { },
|
|
9
10
|
});
|
|
10
|
-
export const AirflowProvider = ({ children, dagId: _dagId, }) => {
|
|
11
|
-
const
|
|
11
|
+
export const AirflowProvider = ({ children, dagId: _dagId, onUnauthorized, }) => {
|
|
12
|
+
const fetcher = async (url) => {
|
|
13
|
+
const res = await fetch(url);
|
|
14
|
+
if (res.status === 401) {
|
|
15
|
+
onUnauthorized();
|
|
16
|
+
}
|
|
17
|
+
if (!res.ok && res.status !== 404) {
|
|
18
|
+
const error = new Error("An error occurred while fetching the data.");
|
|
19
|
+
throw { ...error, info: await res.json(), status: res.status };
|
|
20
|
+
}
|
|
21
|
+
return res.json();
|
|
22
|
+
};
|
|
23
|
+
const { enqueueSnackbar } = useSnackbarContext();
|
|
12
24
|
const [dagId, setDagId] = useState(_dagId);
|
|
13
25
|
const [firstRun, setFirstRun] = useState(true);
|
|
14
|
-
const
|
|
15
|
-
const
|
|
26
|
+
const [previousAirflowAvailable, setPreviousAirflowAvailable] = useState(false);
|
|
27
|
+
const { error, mutate } = useSWR("airflow/check_connection", fetcher, {
|
|
28
|
+
refreshInterval: 10000,
|
|
29
|
+
onSuccess: () => {
|
|
30
|
+
if (firstRun) {
|
|
31
|
+
setFirstRun(false);
|
|
32
|
+
}
|
|
33
|
+
else if (!previousAirflowAvailable) {
|
|
34
|
+
enqueueSnackbar("Соединение с Airflow установлено!", "info");
|
|
35
|
+
}
|
|
36
|
+
setPreviousAirflowAvailable(true);
|
|
37
|
+
},
|
|
38
|
+
onError: () => {
|
|
39
|
+
if (firstRun) {
|
|
40
|
+
enqueueSnackbar(`Не удалось установить соединение с Airflow!`, "warning");
|
|
41
|
+
setFirstRun(false);
|
|
42
|
+
}
|
|
43
|
+
else if (previousAirflowAvailable) {
|
|
44
|
+
enqueueSnackbar(`Потеряно соединение с Airflow!`, "warning");
|
|
45
|
+
}
|
|
46
|
+
setPreviousAirflowAvailable(false);
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
const airflowAvailable = error == null;
|
|
16
50
|
const setContext = useCallback((dagId) => {
|
|
17
51
|
setDagId(dagId);
|
|
18
52
|
}, [dagId, setDagId]);
|
|
19
|
-
const checkConnection = () => {
|
|
20
|
-
setChannelBusy(true);
|
|
21
|
-
getRequest({
|
|
22
|
-
url: "airflow/check_connection",
|
|
23
|
-
data: {},
|
|
24
|
-
successHandler: (_resp) => {
|
|
25
|
-
if (!airflowAvailable) {
|
|
26
|
-
setAirflowAvailable(true);
|
|
27
|
-
if (firstRun) {
|
|
28
|
-
setFirstRun(false);
|
|
29
|
-
setChannelBusy(false);
|
|
30
|
-
return;
|
|
31
|
-
}
|
|
32
|
-
enqueueSnackbar("Соединение с Airflow установлено!", "info");
|
|
33
|
-
}
|
|
34
|
-
setChannelBusy(false);
|
|
35
|
-
},
|
|
36
|
-
errorHandler: (resp) => {
|
|
37
|
-
if (!airflowAvailable && firstRun) {
|
|
38
|
-
setFirstRun(false);
|
|
39
|
-
enqueueSnackbar(`Не удалось установить соединение с Airflow!${(resp?.status == 401 && " Ошибка авторизации.") || ""}`, "warning");
|
|
40
|
-
}
|
|
41
|
-
if (airflowAvailable) {
|
|
42
|
-
setAirflowAvailable(false);
|
|
43
|
-
enqueueSnackbar(`Потеряно соединение с Airflow!${(resp?.status == 401 && " Ошибка авторизации.") || ""}`, "warning");
|
|
44
|
-
}
|
|
45
|
-
setChannelBusy(false);
|
|
46
|
-
},
|
|
47
|
-
}).catch((e) => {
|
|
48
|
-
if (e)
|
|
49
|
-
console.log(e);
|
|
50
|
-
setChannelBusy(false);
|
|
51
|
-
});
|
|
52
|
-
};
|
|
53
|
-
useEffect(() => {
|
|
54
|
-
if (firstRun) {
|
|
55
|
-
checkConnection();
|
|
56
|
-
}
|
|
57
|
-
const interval = setInterval(() => {
|
|
58
|
-
if (channelBusy)
|
|
59
|
-
return;
|
|
60
|
-
checkConnection();
|
|
61
|
-
}, 10000);
|
|
62
|
-
return () => {
|
|
63
|
-
clearInterval(interval);
|
|
64
|
-
};
|
|
65
|
-
}, [firstRun, airflowAvailable, dagId, channelBusy]);
|
|
66
53
|
const onLostConnection = () => {
|
|
67
|
-
|
|
68
|
-
enqueueSnackbar("Потеряно соединение с Airflow!", "warning");
|
|
54
|
+
mutate();
|
|
69
55
|
};
|
|
70
|
-
return (
|
|
56
|
+
return (_jsx(AirflowContext.Provider, { value: {
|
|
71
57
|
airflowAvailable,
|
|
72
58
|
dagId,
|
|
73
59
|
onChangeDagId: setContext,
|
|
74
60
|
onLostConnection,
|
|
75
|
-
}
|
|
61
|
+
}, children: children }));
|
|
76
62
|
};
|
|
77
63
|
export const useAirflowContext = () => {
|
|
78
64
|
return useContext(AirflowContext);
|
|
@@ -5,21 +5,22 @@ interface DagRunStateProviderProps {
|
|
|
5
5
|
dagRun?: DagRun;
|
|
6
6
|
autorun?: boolean;
|
|
7
7
|
poolingByUser?: boolean;
|
|
8
|
-
autorunHandler?(dagRun: DagRun | null, autorun: boolean): void;
|
|
9
8
|
taskInstances?: TaskInstances;
|
|
10
|
-
|
|
9
|
+
autorunHandler?(dagRun: DagRun | null, autorun: boolean): void;
|
|
10
|
+
onUnauthorized(): void;
|
|
11
11
|
}
|
|
12
|
-
|
|
12
|
+
declare const DagRunStateProvider: ({ children, dagRun: _dagRun, autorun: _autorun, poolingByUser, taskInstances: _taskInstances, autorunHandler, onUnauthorized, }: DagRunStateProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export declare const useDagRunStateContext: () => {
|
|
14
14
|
isActive: boolean;
|
|
15
15
|
autorun: boolean;
|
|
16
16
|
dagRun: DagRun | null;
|
|
17
17
|
taskInstances: TaskInstances | null;
|
|
18
|
-
|
|
18
|
+
dagStartedOnce: boolean;
|
|
19
|
+
onUpdateState(isActive: boolean, dagRun: DagRun | null, taskInstances: TaskInstances | null): void;
|
|
20
|
+
onDagStarted: () => void;
|
|
19
21
|
activate(): void;
|
|
20
22
|
fetchState(): void;
|
|
21
23
|
setAutorun(autorun: boolean): void;
|
|
22
|
-
scanInterval: number;
|
|
23
24
|
};
|
|
24
25
|
export default DagRunStateProvider;
|
|
25
26
|
//# sourceMappingURL=DagStateProvider.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DagStateProvider.d.ts","sourceRoot":"","sources":["../../src/providers/DagStateProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DagStateProvider.d.ts","sourceRoot":"","sources":["../../src/providers/DagStateProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAMN,MAAM,OAAO,CAAC;AAEf,OAAO,EAAE,MAAM,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAgCjD,UAAU,wBAAwB;IAChC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,aAAa,CAAC,EAAE,aAAa,CAAC;IAC9B,cAAc,CAAC,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,OAAO,EAAE,OAAO,GAAG,IAAI,CAAC;IAC/D,cAAc,IAAI,IAAI,CAAC;CACxB;AAED,QAAA,MAAM,mBAAmB,GAAI,iIAQ1B,wBAAwB,4CAuJ1B,CAAC;AAEF,eAAO,MAAM,qBAAqB;cAtMtB,OAAO;aACR,OAAO;YACR,MAAM,GAAG,IAAI;mBACN,aAAa,GAAG,IAAI;oBACnB,OAAO;4BAEX,OAAO,UACT,MAAM,GAAG,IAAI,iBACN,aAAa,GAAG,IAAI,GAClC,IAAI;kBACO,MAAM,IAAI;gBACZ,IAAI;kBACF,IAAI;wBACE,OAAO,GAAG,IAAI;CA2LnC,CAAC;AAEF,eAAe,mBAAmB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useCallback, useContext, useEffect, useState, } from "react";
|
|
2
3
|
import { getRequest } from "../http";
|
|
3
4
|
import { useAirflowContext } from "./AirflowProvider";
|
|
4
5
|
import { useSnackbarContext } from "./SnackBarProvider";
|
|
@@ -7,15 +8,18 @@ const DagRunStateContext = createContext({
|
|
|
7
8
|
autorun: false,
|
|
8
9
|
dagRun: null,
|
|
9
10
|
taskInstances: null,
|
|
11
|
+
dagStartedOnce: false,
|
|
10
12
|
onUpdateState: () => { },
|
|
13
|
+
onDagStarted: () => { },
|
|
11
14
|
fetchState: () => { },
|
|
12
15
|
activate: () => { },
|
|
13
16
|
setAutorun: () => { },
|
|
14
|
-
scanInterval: 300,
|
|
15
17
|
});
|
|
16
|
-
|
|
18
|
+
const DagRunStateProvider = ({ children, dagRun: _dagRun, autorun: _autorun, poolingByUser, taskInstances: _taskInstances, autorunHandler, onUnauthorized, }) => {
|
|
17
19
|
const { airflowAvailable, dagId, onLostConnection } = useAirflowContext();
|
|
18
|
-
const [isActive, setIsActive] = useState(
|
|
20
|
+
const [isActive, setIsActive] = useState(Boolean(_dagRun
|
|
21
|
+
? ["queued", "running"].includes(_dagRun.state)
|
|
22
|
+
: dagId && dagId?.length > 0));
|
|
19
23
|
const [channelBusy, setChannelBusy] = useState(false);
|
|
20
24
|
const [autorun, setAutorun] = useState(_autorun || false);
|
|
21
25
|
const activate = useCallback(() => {
|
|
@@ -23,11 +27,15 @@ export const DagRunStateProvider = ({ children, dagRun: _dagRun, autorun: _autor
|
|
|
23
27
|
}, [isActive, setIsActive]);
|
|
24
28
|
const [dagRun, setDagRun] = useState(_dagRun || null);
|
|
25
29
|
const [taskInstances, setTaskInstances] = useState(_taskInstances || null);
|
|
30
|
+
const [dagStartedOnce, setDagStartedOnce] = useState(false);
|
|
26
31
|
const { enqueueSnackbar } = useSnackbarContext();
|
|
32
|
+
// При изменении пропса dagId надо сбросить текущее состояние
|
|
27
33
|
useEffect(() => {
|
|
28
34
|
setDagRun(null);
|
|
35
|
+
setIsActive(true);
|
|
29
36
|
setTaskInstances(null);
|
|
30
37
|
}, [dagId]);
|
|
38
|
+
// Запрос ревалидации
|
|
31
39
|
const updateState = () => {
|
|
32
40
|
setChannelBusy(true);
|
|
33
41
|
getRequest({
|
|
@@ -50,6 +58,9 @@ export const DagRunStateProvider = ({ children, dagRun: _dagRun, autorun: _autor
|
|
|
50
58
|
setChannelBusy(false);
|
|
51
59
|
},
|
|
52
60
|
errorHandler: (resp) => {
|
|
61
|
+
if (resp?.status === 401) {
|
|
62
|
+
onUnauthorized();
|
|
63
|
+
}
|
|
53
64
|
if (resp?.status !== 404) {
|
|
54
65
|
enqueueSnackbar(`Ошибка при обновлении состояния задачи${(dagId && " ") || ""}${dagId || ""}!`, "error");
|
|
55
66
|
}
|
|
@@ -62,10 +73,14 @@ export const DagRunStateProvider = ({ children, dagRun: _dagRun, autorun: _autor
|
|
|
62
73
|
setChannelBusy(false);
|
|
63
74
|
},
|
|
64
75
|
}).catch((e) => {
|
|
76
|
+
if (e?.status === 401) {
|
|
77
|
+
onUnauthorized();
|
|
78
|
+
}
|
|
65
79
|
console.log(e);
|
|
66
80
|
setChannelBusy(false);
|
|
67
81
|
});
|
|
68
82
|
};
|
|
83
|
+
// Подписка на ревалидацию
|
|
69
84
|
useEffect(() => {
|
|
70
85
|
const interval = setInterval(() => {
|
|
71
86
|
if (!airflowAvailable && !isActive)
|
|
@@ -80,10 +95,11 @@ export const DagRunStateProvider = ({ children, dagRun: _dagRun, autorun: _autor
|
|
|
80
95
|
clearInterval(interval);
|
|
81
96
|
};
|
|
82
97
|
}, [airflowAvailable, isActive, dagRun, dagId, autorun, channelBusy]);
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}, [dagRun]);
|
|
98
|
+
// Вроде как ненужный эффект
|
|
99
|
+
// useEffect(() => {
|
|
100
|
+
// if (dagRun == null) setIsActive(true);
|
|
101
|
+
// }, [dagRun]);
|
|
102
|
+
// Запуск autorunHandler при завершении dagRun
|
|
87
103
|
useEffect(() => {
|
|
88
104
|
if (!airflowAvailable)
|
|
89
105
|
return;
|
|
@@ -92,22 +108,32 @@ export const DagRunStateProvider = ({ children, dagRun: _dagRun, autorun: _autor
|
|
|
92
108
|
if (autorunHandler)
|
|
93
109
|
autorunHandler(dagRun, autorun);
|
|
94
110
|
}, [airflowAvailable, isActive, dagRun, autorun]);
|
|
95
|
-
const onUpdateState = (isActive,
|
|
111
|
+
const onUpdateState = (isActive, newDagRun, taskInstances) => {
|
|
96
112
|
setIsActive(isActive);
|
|
97
|
-
setDagRun(
|
|
113
|
+
setDagRun(newDagRun);
|
|
114
|
+
if (newDagRun == null)
|
|
115
|
+
setIsActive(true);
|
|
98
116
|
setTaskInstances(taskInstances);
|
|
99
117
|
};
|
|
100
|
-
|
|
118
|
+
/**Вызывать сразу после запуска дага*/
|
|
119
|
+
const onDagStarted = () => {
|
|
120
|
+
setIsActive(true);
|
|
121
|
+
setDagRun(null);
|
|
122
|
+
setTaskInstances(null);
|
|
123
|
+
setDagStartedOnce(true);
|
|
124
|
+
};
|
|
125
|
+
return (_jsx(DagRunStateContext.Provider, { value: {
|
|
101
126
|
isActive,
|
|
102
127
|
autorun,
|
|
103
128
|
dagRun,
|
|
104
129
|
taskInstances,
|
|
130
|
+
dagStartedOnce,
|
|
105
131
|
onUpdateState,
|
|
132
|
+
onDagStarted,
|
|
106
133
|
activate,
|
|
107
134
|
fetchState: updateState,
|
|
108
135
|
setAutorun: (autorun) => setAutorun(autorun),
|
|
109
|
-
|
|
110
|
-
} }, children));
|
|
136
|
+
}, children: children }));
|
|
111
137
|
};
|
|
112
138
|
export const useDagRunStateContext = () => {
|
|
113
139
|
return useContext(DagRunStateContext);
|
|
@@ -2,8 +2,10 @@ import React from "react";
|
|
|
2
2
|
interface SessionProviderProps {
|
|
3
3
|
children?: React.ReactNode;
|
|
4
4
|
pollingInterval: number;
|
|
5
|
+
autoRedirect?: boolean;
|
|
6
|
+
onUnauthorized?(): void;
|
|
5
7
|
}
|
|
6
|
-
|
|
8
|
+
declare const SessionProvider: ({ children, pollingInterval, autoRedirect, onUnauthorized, }: SessionProviderProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
9
|
export declare const useSessionContext: () => {
|
|
8
10
|
expiresIn: number;
|
|
9
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SessionProvider.d.ts","sourceRoot":"","sources":["../../src/providers/SessionProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAU9E,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;CACzB;AAED,
|
|
1
|
+
{"version":3,"file":"SessionProvider.d.ts","sourceRoot":"","sources":["../../src/providers/SessionProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAyD,MAAM,OAAO,CAAC;AAU9E,UAAU,oBAAoB;IAC5B,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;IAC3B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,cAAc,CAAC,IAAI,IAAI,CAAC;CACzB;AAED,QAAA,MAAM,eAAe,GAAI,8DAKtB,oBAAoB,4CA8CtB,CAAC;AAEF,eAAO,MAAM,iBAAiB;eAjEjB,MAAM;CAmElB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
|
@@ -1,21 +1,28 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext, useEffect, useState } from "react";
|
|
3
3
|
import { getRequest } from "../http";
|
|
4
|
+
import { useSnackbarContext } from "./SnackBarProvider";
|
|
4
5
|
const SessionContext = createContext({
|
|
5
6
|
expiresIn: 0,
|
|
6
7
|
});
|
|
7
|
-
|
|
8
|
+
const SessionProvider = ({ children, pollingInterval, autoRedirect, onUnauthorized, }) => {
|
|
8
9
|
const { enqueueSnackbar } = useSnackbarContext();
|
|
9
10
|
const [expires, setExpires] = useState(false);
|
|
10
11
|
const alertExpire = () => enqueueSnackbar("Сессия завершилась, перезагрузите страницу!", "default");
|
|
11
12
|
const fetchSessionExpiryAge = () => getRequest({
|
|
12
13
|
url: "base/check_session",
|
|
13
14
|
successHandler: (_resp) => { },
|
|
14
|
-
errorHandler: (
|
|
15
|
+
errorHandler: (e) => {
|
|
16
|
+
if (e?.status === 401 && autoRedirect && onUnauthorized) {
|
|
17
|
+
onUnauthorized();
|
|
18
|
+
}
|
|
15
19
|
setExpires(true);
|
|
16
20
|
alertExpire();
|
|
17
21
|
},
|
|
18
|
-
}).catch(() => {
|
|
22
|
+
}).catch((e) => {
|
|
23
|
+
if (e?.status === 401 && autoRedirect && onUnauthorized) {
|
|
24
|
+
onUnauthorized();
|
|
25
|
+
}
|
|
19
26
|
setExpires(true);
|
|
20
27
|
alertExpire();
|
|
21
28
|
});
|
|
@@ -27,9 +34,9 @@ export const SessionProvider = ({ children, pollingInterval, }) => {
|
|
|
27
34
|
}, pollingInterval * 1000);
|
|
28
35
|
return () => clearInterval(interval);
|
|
29
36
|
}, [expires]);
|
|
30
|
-
return (
|
|
37
|
+
return (_jsx(SessionContext.Provider, { value: {
|
|
31
38
|
expiresIn: pollingInterval,
|
|
32
|
-
}
|
|
39
|
+
}, children: children }));
|
|
33
40
|
};
|
|
34
41
|
export const useSessionContext = () => {
|
|
35
42
|
return useContext(SessionContext);
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
interface SnackBarProps {
|
|
3
|
-
children?: React.ReactNode;
|
|
3
|
+
children?: React.ReactNode | React.ReactNode[];
|
|
4
4
|
}
|
|
5
|
-
|
|
5
|
+
declare const SnackBarProvider: ({ children }: SnackBarProps) => import("react/jsx-runtime").JSX.Element;
|
|
6
6
|
export declare const useSnackbarContext: () => {
|
|
7
7
|
enqueueSnackbar(message: string, variant: "default" | "error" | "success" | "warning" | "info"): void;
|
|
8
8
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SnackBarProvider.d.ts","sourceRoot":"","sources":["../../src/providers/SnackBarProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAezD,UAAU,aAAa;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"SnackBarProvider.d.ts","sourceRoot":"","sources":["../../src/providers/SnackBarProvider.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAoC,MAAM,OAAO,CAAC;AAezD,UAAU,aAAa;IACrB,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,SAAS,EAAE,CAAC;CAChD;AA8CD,QAAA,MAAM,gBAAgB,GAAI,cAAc,aAAa,4CAMpD,CAAC;AAEF,eAAO,MAAM,kBAAkB;6BA/DlB,MAAM,WACN,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,SAAS,GAAG,MAAM,GAC5D,IAAI;CA+DR,CAAC;AAEF,eAAe,gBAAgB,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx as _jsx, Fragment as _Fragment } from "react/jsx-runtime";
|
|
2
|
+
import { createContext, useContext } from "react";
|
|
2
3
|
import Button from "@mui/material/Button";
|
|
3
4
|
import { SnackbarProvider, useSnackbar } from "notistack";
|
|
4
5
|
const SnackBarContext = createContext({
|
|
@@ -6,10 +7,9 @@ const SnackBarContext = createContext({
|
|
|
6
7
|
});
|
|
7
8
|
const SnackBarProviderUtilities = ({ children }) => {
|
|
8
9
|
const { enqueueSnackbar, closeSnackbar } = useSnackbar();
|
|
9
|
-
const action = (snackbarId) => (
|
|
10
|
-
React.createElement(Button, { size: "small", variant: "text", color: "inherit", onClick: () => {
|
|
10
|
+
const action = (snackbarId) => (_jsx(_Fragment, { children: _jsx(Button, { size: "small", variant: "text", color: "inherit", onClick: () => {
|
|
11
11
|
closeSnackbar(snackbarId);
|
|
12
|
-
}
|
|
12
|
+
}, children: "\u0417\u0430\u043A\u0440\u044B\u0442\u044C" }) }));
|
|
13
13
|
function handleEnqueueSnackbar(message, variant) {
|
|
14
14
|
enqueueSnackbar(message, {
|
|
15
15
|
variant: variant,
|
|
@@ -21,13 +21,12 @@ const SnackBarProviderUtilities = ({ children }) => {
|
|
|
21
21
|
},
|
|
22
22
|
});
|
|
23
23
|
}
|
|
24
|
-
return (
|
|
24
|
+
return (_jsx(SnackBarContext.Provider, { value: {
|
|
25
25
|
enqueueSnackbar: handleEnqueueSnackbar,
|
|
26
|
-
}
|
|
26
|
+
}, children: children }));
|
|
27
27
|
};
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
React.createElement(SnackBarProviderUtilities, null, children)));
|
|
28
|
+
const SnackBarProvider = ({ children }) => {
|
|
29
|
+
return (_jsx(SnackbarProvider, { maxSnack: 5, autoHideDuration: 5000, preventDuplicate: true, children: _jsx(SnackBarProviderUtilities, { children: children }) }));
|
|
31
30
|
};
|
|
32
31
|
export const useSnackbarContext = () => {
|
|
33
32
|
return useContext(SnackBarContext);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export { default as DagStateProvider } from "./DagStateProvider";
|
|
2
1
|
export * from "./DagStateProvider";
|
|
3
|
-
export { default as
|
|
2
|
+
export { default as DagStateProvider } from "./DagStateProvider";
|
|
4
3
|
export * from "./SessionProvider";
|
|
5
|
-
export { default as
|
|
4
|
+
export { default as SessionProvider } from "./SessionProvider";
|
|
6
5
|
export * from "./SnackBarProvider";
|
|
7
|
-
export { default as
|
|
6
|
+
export { default as SnackBarProvider } from "./SnackBarProvider";
|
|
8
7
|
export * from "./AirflowProvider";
|
|
8
|
+
export { default as AirflowProvider } from "./AirflowProvider";
|
|
9
9
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/providers/index.ts"],"names":[],"mappings":"AAAA,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAE/D,cAAc,oBAAoB,CAAC;AACnC,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,oBAAoB,CAAC;AAEjE,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,OAAO,IAAI,eAAe,EAAE,MAAM,mBAAmB,CAAC"}
|
package/dist/providers/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { default as DagStateProvider } from "./DagStateProvider";
|
|
2
1
|
export * from "./DagStateProvider";
|
|
3
|
-
export { default as
|
|
2
|
+
export { default as DagStateProvider } from "./DagStateProvider";
|
|
4
3
|
export * from "./SessionProvider";
|
|
5
|
-
export { default as
|
|
4
|
+
export { default as SessionProvider } from "./SessionProvider";
|
|
6
5
|
export * from "./SnackBarProvider";
|
|
7
|
-
export { default as
|
|
6
|
+
export { default as SnackBarProvider } from "./SnackBarProvider";
|
|
8
7
|
export * from "./AirflowProvider";
|
|
8
|
+
export { default as AirflowProvider } from "./AirflowProvider";
|
package/dist/types.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ReactNode } from "react";
|
|
2
1
|
import { SxProps } from "@mui/material";
|
|
2
|
+
import { ComponentType } from "react";
|
|
3
3
|
export type DagState = "queued" | "running" | "success" | "failed";
|
|
4
4
|
export type TaskState = "success" | "running" | "failed" | "upstream_failed" | "skipped" | "up_for_retry" | "up_for_reschedule" | "queued" | "none" | "scheduled" | "deferred" | "removed" | "restarting";
|
|
5
5
|
export interface Dag {
|
|
@@ -44,6 +44,7 @@ export interface DagRun {
|
|
|
44
44
|
end_date: string;
|
|
45
45
|
username: string;
|
|
46
46
|
filename?: string;
|
|
47
|
+
compress?: boolean;
|
|
47
48
|
};
|
|
48
49
|
}
|
|
49
50
|
export interface TaskInstance {
|
|
@@ -63,7 +64,15 @@ export interface Logs {
|
|
|
63
64
|
continuationToken: string;
|
|
64
65
|
content: string;
|
|
65
66
|
}
|
|
66
|
-
export interface Column<T
|
|
67
|
+
export interface Column<T extends {
|
|
68
|
+
id: string | number;
|
|
69
|
+
} = {
|
|
70
|
+
id: string | number;
|
|
71
|
+
}, P extends {
|
|
72
|
+
row: T;
|
|
73
|
+
} = {
|
|
74
|
+
row: T;
|
|
75
|
+
}, S extends object = object> {
|
|
67
76
|
name: string;
|
|
68
77
|
displayName: string;
|
|
69
78
|
fieldName: string;
|
|
@@ -74,7 +83,11 @@ export interface Column<T> {
|
|
|
74
83
|
searchStr?: string | (() => string);
|
|
75
84
|
colSx?: SxProps;
|
|
76
85
|
resizable?: boolean;
|
|
77
|
-
|
|
78
|
-
|
|
86
|
+
type?: "datetime" | "bool" | "text" | "number";
|
|
87
|
+
SearchComponent?: ComponentType<S>;
|
|
88
|
+
SearchComponentProps?: S;
|
|
89
|
+
CellContentComponent?: ComponentType<P>;
|
|
90
|
+
CellContentComponentProps?: Omit<P, "row">;
|
|
91
|
+
onClick?(row: T): void;
|
|
79
92
|
}
|
|
80
93
|
//# sourceMappingURL=types.d.ts.map
|