@elice/material-runbox 1.240718.3 → 1.240719.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/_virtual/_rollupPluginBabelHelpers.js +386 -0
- package/cjs/assets/queue.gif.js +1 -2
- package/cjs/assets/runbox_logo.png.js +1 -2
- package/cjs/assets/terminated.png.js +1 -2
- package/cjs/components/material-runbox/MaterialRunbox.js +24 -20
- package/cjs/components/material-runbox/MaterialRunboxBody.js +10 -4
- package/cjs/components/material-runbox/MaterialRunboxContent.js +132 -103
- package/cjs/components/material-runbox/MaterialRunboxFooter.js +27 -18
- package/cjs/components/material-runbox/MaterialRunboxHeader.js +103 -87
- package/cjs/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +31 -27
- package/cjs/components/material-runbox/actions/MaterialRunboxActionGrade.js +242 -159
- package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.js +32 -28
- package/cjs/components/material-runbox/actions/MaterialRunboxActionReset.js +125 -76
- package/cjs/components/material-runbox/actions/MaterialRunboxActionRestart.js +84 -53
- package/cjs/components/material-runbox/actions/MaterialRunboxActionShare.js +40 -28
- package/cjs/components/material-runbox/contexts/MaterialRunboxApiContext.js +27 -15
- package/cjs/components/material-runbox/contexts/MaterialRunboxCommandContext.js +52 -36
- package/cjs/components/material-runbox/contexts/MaterialRunboxContext.js +11 -8
- package/cjs/components/material-runbox/contexts/index.js +17 -0
- package/cjs/components/material-runbox/hooks/index.js +7 -0
- package/cjs/components/material-runbox/hooks/useRunboxControl.js +62 -38
- package/cjs/components/material-runbox/index.js +7 -0
- package/cjs/components/material-runbox/locales/index.js +13 -0
- package/cjs/components/material-runbox/runtime/Runtime.js +25 -17
- package/cjs/components/material-runbox/runtime/RuntimeOverlayAssigned.js +33 -29
- package/cjs/components/material-runbox/runtime/RuntimeOverlayQueued.js +40 -39
- package/cjs/components/material-runbox/runtime/RuntimeOverlayTerminated.js +72 -57
- package/es/_virtual/_rollupPluginBabelHelpers.js +377 -0
- package/es/assets/queue.gif.js +1 -2
- package/es/assets/runbox_logo.png.js +1 -2
- package/es/assets/terminated.png.js +1 -2
- package/es/components/material-runbox/MaterialRunbox.js +24 -20
- package/es/components/material-runbox/MaterialRunboxBody.js +6 -4
- package/es/components/material-runbox/MaterialRunboxContent.js +128 -103
- package/es/components/material-runbox/MaterialRunboxFooter.js +23 -18
- package/es/components/material-runbox/MaterialRunboxHeader.js +99 -88
- package/es/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +27 -27
- package/es/components/material-runbox/actions/MaterialRunboxActionGrade.js +237 -159
- package/es/components/material-runbox/actions/MaterialRunboxActionMenu.js +28 -28
- package/es/components/material-runbox/actions/MaterialRunboxActionReset.js +121 -76
- package/es/components/material-runbox/actions/MaterialRunboxActionRestart.js +80 -53
- package/es/components/material-runbox/actions/MaterialRunboxActionShare.js +36 -28
- package/es/components/material-runbox/contexts/MaterialRunboxApiContext.js +22 -14
- package/es/components/material-runbox/contexts/MaterialRunboxCommandContext.js +47 -35
- package/es/components/material-runbox/contexts/MaterialRunboxContext.js +6 -7
- package/es/components/material-runbox/contexts/index.js +3 -0
- package/es/components/material-runbox/hooks/index.js +1 -0
- package/es/components/material-runbox/hooks/useRunboxControl.js +62 -38
- package/es/components/material-runbox/index.js +1 -0
- package/es/components/material-runbox/locales/index.js +4 -0
- package/es/components/material-runbox/runtime/Runtime.js +21 -17
- package/es/components/material-runbox/runtime/RuntimeOverlayAssigned.js +34 -30
- package/es/components/material-runbox/runtime/RuntimeOverlayQueued.js +41 -40
- package/es/components/material-runbox/runtime/RuntimeOverlayTerminated.js +69 -58
- package/package.json +8 -11
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import { useRawEliceIntl } from '@elice/intl';
|
|
3
5
|
import { useSnackbar } from '@elice/mui-x-snackbar';
|
|
@@ -9,78 +11,88 @@ import { useMaterialRunboxApiContext } from './MaterialRunboxApiContext.js';
|
|
|
9
11
|
//
|
|
10
12
|
//
|
|
11
13
|
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
14
|
+
var PING_INTERVAL = 2000;
|
|
15
|
+
var PING_MAX_TRY_SECOND = 3 * 60; // 3min (ref: https://teams.microsoft.com/l/message/19:aa082e4a9f6f456fbea872be532123d4@thread.tacv2/1689228421341?tenantId=5bb6f1f4-0b48-4496-9baf-f9fb7da5d352&groupId=27480e72-5fcb-4ac9-b4e7-5b92abb31a95&parentMessageId=1689217573531&teamName=div-CTO&channelName=issue-report&createdTime=1689228421341&allowXTenantAccess=false)
|
|
16
|
+
var PING_MAX_TRY_COUNT = PING_MAX_TRY_SECOND * 1000 / PING_INTERVAL;
|
|
15
17
|
//
|
|
16
18
|
//
|
|
17
19
|
//
|
|
18
|
-
|
|
19
|
-
|
|
20
|
+
var MaterialRunboxCommandContext = React.createContext({});
|
|
21
|
+
var useMaterialRunboxCommandContext = function useMaterialRunboxCommandContext() {
|
|
20
22
|
return React.useContext(MaterialRunboxCommandContext);
|
|
21
23
|
};
|
|
22
24
|
//
|
|
23
25
|
//
|
|
24
26
|
//
|
|
25
|
-
|
|
26
|
-
children,
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
27
|
+
var MaterialRunboxCommandContextProvider = function MaterialRunboxCommandContextProvider(_ref) {
|
|
28
|
+
var children = _ref.children,
|
|
29
|
+
runtime = _ref.runtime,
|
|
30
|
+
courseId = _ref.courseId;
|
|
31
|
+
var intl = useRawEliceIntl();
|
|
32
|
+
var _useSnackbar = useSnackbar(),
|
|
33
|
+
enqueueSnackbar = _useSnackbar.enqueueSnackbar;
|
|
34
|
+
var runtimeId = runtime === null || runtime === void 0 ? void 0 : runtime.id;
|
|
35
|
+
var materialRunboxApi = useMaterialRunboxApiContext();
|
|
36
|
+
var _React$useState = React.useState(null),
|
|
37
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
38
|
+
pcmdId = _React$useState2[0],
|
|
39
|
+
setPcmdId = _React$useState2[1]; // Ping Command ID
|
|
40
|
+
var _React$useState3 = React.useState(null),
|
|
41
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
42
|
+
lastCommand = _React$useState4[0],
|
|
43
|
+
setLastCommand = _React$useState4[1];
|
|
38
44
|
//
|
|
39
45
|
// check whether running command exists or not on mount,
|
|
40
46
|
// if running command exists, set `pcmdId` to start pinging
|
|
41
47
|
//
|
|
42
|
-
React.useEffect(()
|
|
48
|
+
React.useEffect(function () {
|
|
43
49
|
if (!runtimeId) {
|
|
44
50
|
return;
|
|
45
51
|
}
|
|
46
52
|
materialRunboxApi.runtime.runtimeRuntimeIdCommandGet({
|
|
47
|
-
runtimeId,
|
|
53
|
+
runtimeId: runtimeId,
|
|
48
54
|
eliceCourseId: courseId
|
|
49
|
-
}).then(res
|
|
55
|
+
}).then(function (res) {
|
|
50
56
|
if (res.status !== CommandStatus.Terminated) {
|
|
51
57
|
setLastCommand(res);
|
|
52
58
|
setPcmdId(res.runboxCommandId);
|
|
53
59
|
}
|
|
54
|
-
}).catch(()
|
|
60
|
+
}).catch(function () {
|
|
61
|
+
return void 0;
|
|
62
|
+
});
|
|
55
63
|
},
|
|
56
64
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
57
65
|
[runtimeId, courseId]);
|
|
58
66
|
//
|
|
59
67
|
// ping command
|
|
60
68
|
//
|
|
61
|
-
React.useEffect(()
|
|
69
|
+
React.useEffect(function () {
|
|
62
70
|
if (!pcmdId || !runtimeId) {
|
|
63
71
|
return;
|
|
64
72
|
}
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
73
|
+
var _pingobj = {};
|
|
74
|
+
var subscription = timer(0, PING_INTERVAL).pipe(take(PING_MAX_TRY_COUNT), switchMap(function () {
|
|
75
|
+
return materialRunboxApi.runtime.runtimeRuntimeIdCommandGet({
|
|
76
|
+
runtimeId: runtimeId,
|
|
77
|
+
eliceCourseId: courseId
|
|
78
|
+
});
|
|
79
|
+
}), takeWhile(function (res) {
|
|
80
|
+
return res.status !== CommandStatus.Terminated;
|
|
81
|
+
}, true)).subscribe({
|
|
82
|
+
next: function next(res) {
|
|
71
83
|
_pingobj.res = res;
|
|
72
84
|
setLastCommand(res);
|
|
73
85
|
},
|
|
74
|
-
error: ()
|
|
86
|
+
error: function error() {
|
|
75
87
|
enqueueSnackbar(intl.formatMessage({
|
|
76
88
|
id: 'runbox.context.command.ping.error'
|
|
77
89
|
}), {
|
|
78
90
|
variant: 'error'
|
|
79
91
|
});
|
|
80
92
|
},
|
|
81
|
-
complete: ()
|
|
93
|
+
complete: function complete() {
|
|
82
94
|
setPcmdId(null); // empty `pcmdId` to stop pinging
|
|
83
|
-
|
|
95
|
+
var hasError = !_pingobj.res ||
|
|
84
96
|
// max try count reached, but command is still running
|
|
85
97
|
_pingobj.res.status !== CommandStatus.Terminated;
|
|
86
98
|
if (hasError) {
|
|
@@ -93,7 +105,7 @@ const MaterialRunboxCommandContextProvider = ({
|
|
|
93
105
|
}
|
|
94
106
|
}
|
|
95
107
|
});
|
|
96
|
-
return ()
|
|
108
|
+
return function () {
|
|
97
109
|
subscription.unsubscribe();
|
|
98
110
|
};
|
|
99
111
|
},
|
|
@@ -102,10 +114,10 @@ const MaterialRunboxCommandContextProvider = ({
|
|
|
102
114
|
//
|
|
103
115
|
//
|
|
104
116
|
//
|
|
105
|
-
return
|
|
117
|
+
return jsx(MaterialRunboxCommandContext.Provider, {
|
|
106
118
|
children: children,
|
|
107
119
|
value: {
|
|
108
|
-
lastCommand,
|
|
120
|
+
lastCommand: lastCommand,
|
|
109
121
|
isLastCommandRunning: Boolean((lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.status) === CommandStatus.Queued || (lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.status) === CommandStatus.Started),
|
|
110
122
|
setCommandIdToPing: setPcmdId
|
|
111
123
|
}
|
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
import { __rest } from 'tslib';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
3
|
import React from 'react';
|
|
3
4
|
|
|
4
5
|
//
|
|
5
6
|
//
|
|
6
7
|
//
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
var MaterialRunboxContext = React.createContext({});
|
|
9
|
+
var useMaterialRunboxContext = function useMaterialRunboxContext() {
|
|
9
10
|
return React.useContext(MaterialRunboxContext);
|
|
10
11
|
};
|
|
11
12
|
//
|
|
12
13
|
//
|
|
13
14
|
//
|
|
14
|
-
|
|
15
|
-
var
|
|
16
|
-
children
|
|
17
|
-
} = _a,
|
|
15
|
+
var MaterialRunboxContextProvider = function MaterialRunboxContextProvider(_a) {
|
|
16
|
+
var children = _a.children,
|
|
18
17
|
props = __rest(_a, ["children"]);
|
|
19
|
-
return
|
|
18
|
+
return jsx(MaterialRunboxContext.Provider, {
|
|
20
19
|
children: children,
|
|
21
20
|
value: props
|
|
22
21
|
});
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
export { MaterialRunboxApiContext, default as MaterialRunboxApiContextProvider, useMaterialRunboxApiContext } from './MaterialRunboxApiContext.js';
|
|
2
|
+
export { MaterialRunboxCommandContext, default as MaterialRunboxCommandContextProvider, useMaterialRunboxCommandContext } from './MaterialRunboxCommandContext.js';
|
|
3
|
+
export { MaterialRunboxContext, default as MaterialRunboxContextProvider, useMaterialRunboxContext } from './MaterialRunboxContext.js';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { useRunboxControl } from './useRunboxControl.js';
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
1
2
|
import { useRef, useCallback } from 'react';
|
|
2
3
|
import { useRawEliceIntl } from '@elice/intl';
|
|
3
4
|
import { useSnackbar } from '@elice/mui-x-snackbar';
|
|
@@ -12,53 +13,76 @@ import '../contexts/MaterialRunboxContext.js';
|
|
|
12
13
|
/**
|
|
13
14
|
* Hook for runbox control and status.
|
|
14
15
|
*/
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
enqueueSnackbar
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
stop: runboxStop
|
|
25
|
-
} = useEliceRunboxRunning();
|
|
16
|
+
var useRunboxControl = function useRunboxControl(props) {
|
|
17
|
+
var _return = useRef({});
|
|
18
|
+
var intl = useRawEliceIntl();
|
|
19
|
+
var _useSnackbar = useSnackbar(),
|
|
20
|
+
enqueueSnackbar = _useSnackbar.enqueueSnackbar;
|
|
21
|
+
var materialRunboxApi = useMaterialRunboxApiContext();
|
|
22
|
+
var _useEliceRunboxRunnin = useEliceRunboxRunning(),
|
|
23
|
+
runboxStart = _useEliceRunboxRunnin.start,
|
|
24
|
+
runboxStop = _useEliceRunboxRunnin.stop;
|
|
26
25
|
/**
|
|
27
26
|
* Start project.
|
|
28
27
|
*/
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
28
|
+
var start = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
29
|
+
var force,
|
|
30
|
+
_args = arguments;
|
|
31
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
32
|
+
while (1) switch (_context.prev = _context.next) {
|
|
33
|
+
case 0:
|
|
34
|
+
force = _args.length > 0 && _args[0] !== undefined ? _args[0] : false;
|
|
35
|
+
return _context.abrupt("return", runboxStart(function (signal) {
|
|
36
|
+
return materialRunboxApi.runbox.runboxRunboxIdStartPost({
|
|
37
|
+
runboxId: props.runbox.id,
|
|
38
|
+
eliceCourseId: props.courseId
|
|
39
|
+
}, {
|
|
40
|
+
signal: signal
|
|
41
|
+
});
|
|
42
|
+
}, force).then(function () {
|
|
43
|
+
return void props.refetch();
|
|
44
|
+
}).catch(function (err) {
|
|
45
|
+
if (err.name !== 'AbortError') {
|
|
46
|
+
enqueueSnackbar(intl.formatMessage({
|
|
47
|
+
id: 'runbox.runtime.message.startError'
|
|
48
|
+
}), {
|
|
49
|
+
variant: 'error'
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
}));
|
|
53
|
+
case 2:
|
|
54
|
+
case "end":
|
|
55
|
+
return _context.stop();
|
|
42
56
|
}
|
|
43
|
-
});
|
|
44
|
-
},
|
|
57
|
+
}, _callee);
|
|
58
|
+
})),
|
|
45
59
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
46
60
|
[props.runbox.id, props.courseId, runboxStart]);
|
|
47
61
|
/**
|
|
48
62
|
* Stop project.
|
|
49
63
|
*/
|
|
50
|
-
|
|
51
|
-
return
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
64
|
+
var stop = useCallback( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
65
|
+
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
66
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
67
|
+
case 0:
|
|
68
|
+
return _context2.abrupt("return", runboxStop(function (signal) {
|
|
69
|
+
return materialRunboxApi.runbox.runboxRunboxIdStopPost({
|
|
70
|
+
runboxId: props.runbox.id,
|
|
71
|
+
eliceCourseId: props.courseId
|
|
72
|
+
}, {
|
|
73
|
+
signal: signal
|
|
74
|
+
});
|
|
75
|
+
}).then(function () {
|
|
76
|
+
//
|
|
77
|
+
}).catch(function (err) {
|
|
78
|
+
if (err.name !== 'AbortError') ;
|
|
79
|
+
}));
|
|
80
|
+
case 1:
|
|
81
|
+
case "end":
|
|
82
|
+
return _context2.stop();
|
|
83
|
+
}
|
|
84
|
+
}, _callee2);
|
|
85
|
+
})),
|
|
62
86
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
63
87
|
[props.runbox.id, props.courseId, runboxStop]);
|
|
64
88
|
//
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as MaterialRunbox } from './MaterialRunbox.js';
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import { CommandType } from '@elice/openapi-client-material-runbox';
|
|
3
5
|
import { EliceRunboxView } from '@elice/runbox-client';
|
|
@@ -12,19 +14,20 @@ import RuntimeOverlayTerminated from './RuntimeOverlayTerminated.js';
|
|
|
12
14
|
//
|
|
13
15
|
//
|
|
14
16
|
//
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
isLastCommandRunning,
|
|
18
|
-
lastCommand
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
17
|
+
var Runtime = function Runtime(props) {
|
|
18
|
+
var _useMaterialRunboxCom = useMaterialRunboxCommandContext(),
|
|
19
|
+
isLastCommandRunning = _useMaterialRunboxCom.isLastCommandRunning,
|
|
20
|
+
lastCommand = _useMaterialRunboxCom.lastCommand;
|
|
21
|
+
var _useRunboxControl = useRunboxControl(props),
|
|
22
|
+
startRuntime = _useRunboxControl.start;
|
|
23
|
+
var _React$useState = React.useState(0),
|
|
24
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
25
|
+
viewRefreshTrigger = _React$useState2[0],
|
|
26
|
+
setViewRefreshTrigger = _React$useState2[1];
|
|
24
27
|
//
|
|
25
28
|
//
|
|
26
29
|
//
|
|
27
|
-
React.useEffect(()
|
|
30
|
+
React.useEffect(function () {
|
|
28
31
|
if (!props.runbox.id) {
|
|
29
32
|
return;
|
|
30
33
|
}
|
|
@@ -45,7 +48,7 @@ const Runtime = props => {
|
|
|
45
48
|
//
|
|
46
49
|
// refresh view when `ProjectFileReset` command done.
|
|
47
50
|
//
|
|
48
|
-
React.useEffect(()
|
|
51
|
+
React.useEffect(function () {
|
|
49
52
|
if (isLastCommandRunning || !lastCommand) {
|
|
50
53
|
return;
|
|
51
54
|
}
|
|
@@ -61,14 +64,15 @@ const Runtime = props => {
|
|
|
61
64
|
//
|
|
62
65
|
//
|
|
63
66
|
//
|
|
64
|
-
return
|
|
65
|
-
key: viewRefreshTrigger,
|
|
67
|
+
return jsx(EliceRunboxView, {
|
|
66
68
|
OverlayAssigned: RuntimeOverlayAssigned,
|
|
67
69
|
OverlayQueued: RuntimeOverlayQueued,
|
|
68
|
-
OverlayTerminated:
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
70
|
+
OverlayTerminated: function OverlayTerminated(props) {
|
|
71
|
+
return jsx(RuntimeOverlayTerminated, Object.assign({}, props, {
|
|
72
|
+
startRuntime: startRuntime
|
|
73
|
+
}));
|
|
74
|
+
}
|
|
75
|
+
}, viewRefreshTrigger);
|
|
72
76
|
};
|
|
73
77
|
|
|
74
78
|
export { Runtime as default };
|
|
@@ -1,26 +1,28 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
3
|
import { useTimeout } from 'react-use';
|
|
3
4
|
import { IntlComponentBuilder } from '@elice/intl';
|
|
4
5
|
import { Stack, Box, Typography } from '@mui/material';
|
|
5
6
|
import messageEn from '../locales/en.json.js';
|
|
6
7
|
import messageKo from '../locales/ko.json.js';
|
|
7
|
-
import
|
|
8
|
+
import img from '../../../assets/queue.gif.js';
|
|
8
9
|
|
|
9
10
|
//
|
|
10
11
|
//
|
|
11
12
|
//
|
|
12
|
-
|
|
13
|
+
var ASSIGNED_NORMAL_TIMEOUT = 30 * 1e3; // 30 sec
|
|
13
14
|
//
|
|
14
15
|
//
|
|
15
16
|
//
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
var RuntimeOverlayAssigned = function RuntimeOverlayAssigned(_ref) {
|
|
18
|
+
var intl = _ref.__intl;
|
|
19
|
+
var _useTimeout = useTimeout(ASSIGNED_NORMAL_TIMEOUT),
|
|
20
|
+
_useTimeout2 = _slicedToArray(_useTimeout, 1),
|
|
21
|
+
timeout = _useTimeout2[0];
|
|
20
22
|
//
|
|
21
23
|
//
|
|
22
24
|
//
|
|
23
|
-
return
|
|
25
|
+
return jsxs(Stack, {
|
|
24
26
|
gap: "1.5rem",
|
|
25
27
|
sx: {
|
|
26
28
|
display: 'flex',
|
|
@@ -28,28 +30,30 @@ const RuntimeOverlayAssigned = ({
|
|
|
28
30
|
alignItems: 'center',
|
|
29
31
|
width: '100%',
|
|
30
32
|
height: '100%'
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
33
|
+
},
|
|
34
|
+
children: [jsx(Box, {
|
|
35
|
+
component: "img",
|
|
36
|
+
src: img,
|
|
37
|
+
alt: "queue",
|
|
38
|
+
sx: {
|
|
39
|
+
width: '100%',
|
|
40
|
+
height: 'auto',
|
|
41
|
+
maxWidth: '13.375rem'
|
|
42
|
+
}
|
|
43
|
+
}), jsx(Typography, {
|
|
44
|
+
variant: "subtitle2",
|
|
45
|
+
color: "text:secondary",
|
|
46
|
+
sx: {
|
|
47
|
+
whiteSpace: 'pre-wrap',
|
|
48
|
+
textAlign: 'center'
|
|
49
|
+
},
|
|
50
|
+
children: timeout() ? intl.formatMessage({
|
|
51
|
+
id: 'runbox.runtime.overlay.assigned.description_timeout'
|
|
52
|
+
}) : intl.formatMessage({
|
|
53
|
+
id: 'runbox.runtime.overlay.assigned.description'
|
|
54
|
+
})
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
53
57
|
};
|
|
54
58
|
var RuntimeOverlayAssigned$1 = new IntlComponentBuilder(RuntimeOverlayAssigned).add('en', messageEn).add('ko', messageKo).addAsync('th', import('../locales/th.json.js')).addAsync('ja', import('../locales/ja.json.js')).build();
|
|
55
59
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { IntlComponentBuilder } from '@elice/intl';
|
|
3
3
|
import { QuestionAnswer } from '@mui/icons-material';
|
|
4
4
|
import { Stack, Box, Typography, Button } from '@mui/material';
|
|
@@ -7,22 +7,20 @@ import '../contexts/MaterialRunboxCommandContext.js';
|
|
|
7
7
|
import { useMaterialRunboxContext } from '../contexts/MaterialRunboxContext.js';
|
|
8
8
|
import messageEn from '../locales/en.json.js';
|
|
9
9
|
import messageKo from '../locales/ko.json.js';
|
|
10
|
-
import
|
|
10
|
+
import img from '../../../assets/queue.gif.js';
|
|
11
11
|
|
|
12
12
|
//
|
|
13
13
|
//
|
|
14
14
|
//
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
showMessenger
|
|
21
|
-
} = useMaterialRunboxContext();
|
|
15
|
+
var RuntimeOverlayQueued = function RuntimeOverlayQueued(_ref) {
|
|
16
|
+
var intl = _ref.__intl,
|
|
17
|
+
numWaiters = _ref.numWaiters;
|
|
18
|
+
var _useMaterialRunboxCon = useMaterialRunboxContext(),
|
|
19
|
+
showMessenger = _useMaterialRunboxCon.showMessenger;
|
|
22
20
|
//
|
|
23
21
|
//
|
|
24
22
|
//
|
|
25
|
-
return
|
|
23
|
+
return jsxs(Stack, {
|
|
26
24
|
gap: "1.5rem",
|
|
27
25
|
sx: {
|
|
28
26
|
display: 'flex',
|
|
@@ -30,36 +28,39 @@ const RuntimeOverlayQueued = ({
|
|
|
30
28
|
alignItems: 'center',
|
|
31
29
|
width: '100%',
|
|
32
30
|
height: '100%'
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
31
|
+
},
|
|
32
|
+
children: [jsx(Box, {
|
|
33
|
+
component: "img",
|
|
34
|
+
src: img,
|
|
35
|
+
alt: "queue",
|
|
36
|
+
sx: {
|
|
37
|
+
width: '100%',
|
|
38
|
+
height: 'auto',
|
|
39
|
+
maxWidth: '13.375rem'
|
|
40
|
+
}
|
|
41
|
+
}), jsx(Typography, {
|
|
42
|
+
variant: "subtitle2",
|
|
43
|
+
color: "text:secondary",
|
|
44
|
+
sx: {
|
|
45
|
+
whiteSpace: 'pre-wrap',
|
|
46
|
+
textAlign: 'center'
|
|
47
|
+
},
|
|
48
|
+
children: numWaiters > 0 ? intl.formatMessage({
|
|
49
|
+
id: 'runbox.runtime.overlay.queued.description'
|
|
50
|
+
}, {
|
|
51
|
+
waiters: numWaiters
|
|
52
|
+
}) : intl.formatMessage({
|
|
53
|
+
id: 'runbox.runtime.overlay.queued.description_zero'
|
|
54
|
+
})
|
|
55
|
+
}), typeof showMessenger === 'function' ? jsx(Button, {
|
|
56
|
+
variant: "outlined",
|
|
57
|
+
startIcon: jsx(QuestionAnswer, {}),
|
|
58
|
+
onClick: showMessenger,
|
|
59
|
+
children: intl.formatMessage({
|
|
60
|
+
id: 'runbox.common.support'
|
|
61
|
+
})
|
|
62
|
+
}) : null]
|
|
63
|
+
});
|
|
63
64
|
};
|
|
64
65
|
var RuntimeOverlayQueued$1 = new IntlComponentBuilder(RuntimeOverlayQueued).add('en', messageEn).add('ko', messageKo).addAsync('th', import('../locales/th.json.js')).addAsync('ja', import('../locales/ja.json.js')).build();
|
|
65
66
|
|