@elice/material-runbox 1.240718.3 → 1.240719.1
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
|
@@ -2,42 +2,54 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
7
|
var React = require('react');
|
|
6
8
|
var openapiClientMaterialRunbox = require('@elice/openapi-client-material-runbox');
|
|
7
9
|
|
|
10
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
11
|
+
|
|
12
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
13
|
+
|
|
8
14
|
//
|
|
9
15
|
//
|
|
10
16
|
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return
|
|
17
|
+
var MaterialRunboxApiContext = React__default.default.createContext({});
|
|
18
|
+
var useMaterialRunboxApiContext = function useMaterialRunboxApiContext() {
|
|
19
|
+
return React__default.default.useContext(MaterialRunboxApiContext);
|
|
14
20
|
};
|
|
15
21
|
//
|
|
16
22
|
//
|
|
17
23
|
//
|
|
18
|
-
|
|
19
|
-
children,
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
24
|
+
var MaterialRunboxApiContextProvider = function MaterialRunboxApiContextProvider(_ref) {
|
|
25
|
+
var children = _ref.children,
|
|
26
|
+
eliceMaterialRunboxApiConfiguration = _ref.eliceMaterialRunboxApiConfiguration;
|
|
27
|
+
var createMaterialRunboxApi = function createMaterialRunboxApi() {
|
|
28
|
+
return Object.freeze({
|
|
29
|
+
runbox: new openapiClientMaterialRunbox.RunboxApi(eliceMaterialRunboxApiConfiguration),
|
|
30
|
+
runtime: new openapiClientMaterialRunbox.RuntimeApi(eliceMaterialRunboxApiConfiguration),
|
|
31
|
+
runtimeTemplate: new openapiClientMaterialRunbox.RuntimeTemplateApi(eliceMaterialRunboxApiConfiguration)
|
|
32
|
+
});
|
|
33
|
+
};
|
|
27
34
|
//
|
|
28
35
|
//
|
|
29
36
|
//
|
|
30
|
-
|
|
37
|
+
var _React$useState = React__default.default.useState(createMaterialRunboxApi),
|
|
38
|
+
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
39
|
+
materialRunboxApi = _React$useState2[0],
|
|
40
|
+
setMaterialRunboxApi = _React$useState2[1];
|
|
31
41
|
//
|
|
32
42
|
//
|
|
33
43
|
//
|
|
34
|
-
|
|
44
|
+
React__default.default.useEffect(function () {
|
|
45
|
+
return setMaterialRunboxApi(createMaterialRunboxApi);
|
|
46
|
+
},
|
|
35
47
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
36
48
|
[eliceMaterialRunboxApiConfiguration]);
|
|
37
49
|
//
|
|
38
50
|
//
|
|
39
51
|
//
|
|
40
|
-
return
|
|
52
|
+
return jsxRuntime.jsx(MaterialRunboxApiContext.Provider, {
|
|
41
53
|
children: children,
|
|
42
54
|
value: materialRunboxApi
|
|
43
55
|
});
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
7
|
var React = require('react');
|
|
6
8
|
var intl = require('@elice/intl');
|
|
7
9
|
var muiXSnackbar = require('@elice/mui-x-snackbar');
|
|
@@ -10,81 +12,95 @@ var rxjs = require('rxjs');
|
|
|
10
12
|
var operators = require('rxjs/operators');
|
|
11
13
|
var MaterialRunboxApiContext = require('./MaterialRunboxApiContext.js');
|
|
12
14
|
|
|
15
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
16
|
+
|
|
17
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
18
|
+
|
|
13
19
|
//
|
|
14
20
|
//
|
|
15
21
|
//
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
22
|
+
var PING_INTERVAL = 2000;
|
|
23
|
+
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)
|
|
24
|
+
var PING_MAX_TRY_COUNT = PING_MAX_TRY_SECOND * 1000 / PING_INTERVAL;
|
|
19
25
|
//
|
|
20
26
|
//
|
|
21
27
|
//
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return
|
|
28
|
+
var MaterialRunboxCommandContext = React__default.default.createContext({});
|
|
29
|
+
var useMaterialRunboxCommandContext = function useMaterialRunboxCommandContext() {
|
|
30
|
+
return React__default.default.useContext(MaterialRunboxCommandContext);
|
|
25
31
|
};
|
|
26
32
|
//
|
|
27
33
|
//
|
|
28
34
|
//
|
|
29
|
-
|
|
30
|
-
children,
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
35
|
+
var MaterialRunboxCommandContextProvider = function MaterialRunboxCommandContextProvider(_ref) {
|
|
36
|
+
var children = _ref.children,
|
|
37
|
+
runtime = _ref.runtime,
|
|
38
|
+
courseId = _ref.courseId;
|
|
39
|
+
var intl$1 = intl.useRawEliceIntl();
|
|
40
|
+
var _useSnackbar = muiXSnackbar.useSnackbar(),
|
|
41
|
+
enqueueSnackbar = _useSnackbar.enqueueSnackbar;
|
|
42
|
+
var runtimeId = runtime === null || runtime === void 0 ? void 0 : runtime.id;
|
|
43
|
+
var materialRunboxApi = MaterialRunboxApiContext.useMaterialRunboxApiContext();
|
|
44
|
+
var _React$useState = React__default.default.useState(null),
|
|
45
|
+
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
46
|
+
pcmdId = _React$useState2[0],
|
|
47
|
+
setPcmdId = _React$useState2[1]; // Ping Command ID
|
|
48
|
+
var _React$useState3 = React__default.default.useState(null),
|
|
49
|
+
_React$useState4 = _rollupPluginBabelHelpers.slicedToArray(_React$useState3, 2),
|
|
50
|
+
lastCommand = _React$useState4[0],
|
|
51
|
+
setLastCommand = _React$useState4[1];
|
|
42
52
|
//
|
|
43
53
|
// check whether running command exists or not on mount,
|
|
44
54
|
// if running command exists, set `pcmdId` to start pinging
|
|
45
55
|
//
|
|
46
|
-
|
|
56
|
+
React__default.default.useEffect(function () {
|
|
47
57
|
if (!runtimeId) {
|
|
48
58
|
return;
|
|
49
59
|
}
|
|
50
60
|
materialRunboxApi.runtime.runtimeRuntimeIdCommandGet({
|
|
51
|
-
runtimeId,
|
|
61
|
+
runtimeId: runtimeId,
|
|
52
62
|
eliceCourseId: courseId
|
|
53
|
-
}).then(res
|
|
63
|
+
}).then(function (res) {
|
|
54
64
|
if (res.status !== openapiClientMaterialRunbox.CommandStatus.Terminated) {
|
|
55
65
|
setLastCommand(res);
|
|
56
66
|
setPcmdId(res.runboxCommandId);
|
|
57
67
|
}
|
|
58
|
-
}).catch(()
|
|
68
|
+
}).catch(function () {
|
|
69
|
+
return void 0;
|
|
70
|
+
});
|
|
59
71
|
},
|
|
60
72
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
61
73
|
[runtimeId, courseId]);
|
|
62
74
|
//
|
|
63
75
|
// ping command
|
|
64
76
|
//
|
|
65
|
-
|
|
77
|
+
React__default.default.useEffect(function () {
|
|
66
78
|
if (!pcmdId || !runtimeId) {
|
|
67
79
|
return;
|
|
68
80
|
}
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
81
|
+
var _pingobj = {};
|
|
82
|
+
var subscription = rxjs.timer(0, PING_INTERVAL).pipe(operators.take(PING_MAX_TRY_COUNT), operators.switchMap(function () {
|
|
83
|
+
return materialRunboxApi.runtime.runtimeRuntimeIdCommandGet({
|
|
84
|
+
runtimeId: runtimeId,
|
|
85
|
+
eliceCourseId: courseId
|
|
86
|
+
});
|
|
87
|
+
}), operators.takeWhile(function (res) {
|
|
88
|
+
return res.status !== openapiClientMaterialRunbox.CommandStatus.Terminated;
|
|
89
|
+
}, true)).subscribe({
|
|
90
|
+
next: function next(res) {
|
|
75
91
|
_pingobj.res = res;
|
|
76
92
|
setLastCommand(res);
|
|
77
93
|
},
|
|
78
|
-
error: ()
|
|
94
|
+
error: function error() {
|
|
79
95
|
enqueueSnackbar(intl$1.formatMessage({
|
|
80
96
|
id: 'runbox.context.command.ping.error'
|
|
81
97
|
}), {
|
|
82
98
|
variant: 'error'
|
|
83
99
|
});
|
|
84
100
|
},
|
|
85
|
-
complete: ()
|
|
101
|
+
complete: function complete() {
|
|
86
102
|
setPcmdId(null); // empty `pcmdId` to stop pinging
|
|
87
|
-
|
|
103
|
+
var hasError = !_pingobj.res ||
|
|
88
104
|
// max try count reached, but command is still running
|
|
89
105
|
_pingobj.res.status !== openapiClientMaterialRunbox.CommandStatus.Terminated;
|
|
90
106
|
if (hasError) {
|
|
@@ -97,7 +113,7 @@ const MaterialRunboxCommandContextProvider = ({
|
|
|
97
113
|
}
|
|
98
114
|
}
|
|
99
115
|
});
|
|
100
|
-
return ()
|
|
116
|
+
return function () {
|
|
101
117
|
subscription.unsubscribe();
|
|
102
118
|
};
|
|
103
119
|
},
|
|
@@ -106,10 +122,10 @@ const MaterialRunboxCommandContextProvider = ({
|
|
|
106
122
|
//
|
|
107
123
|
//
|
|
108
124
|
//
|
|
109
|
-
return
|
|
125
|
+
return jsxRuntime.jsx(MaterialRunboxCommandContext.Provider, {
|
|
110
126
|
children: children,
|
|
111
127
|
value: {
|
|
112
|
-
lastCommand,
|
|
128
|
+
lastCommand: lastCommand,
|
|
113
129
|
isLastCommandRunning: Boolean((lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.status) === openapiClientMaterialRunbox.CommandStatus.Queued || (lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.status) === openapiClientMaterialRunbox.CommandStatus.Started),
|
|
114
130
|
setCommandIdToPing: setPcmdId
|
|
115
131
|
}
|
|
@@ -3,24 +3,27 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
7
|
var React = require('react');
|
|
7
8
|
|
|
9
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
12
|
+
|
|
8
13
|
//
|
|
9
14
|
//
|
|
10
15
|
//
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
return
|
|
16
|
+
var MaterialRunboxContext = React__default.default.createContext({});
|
|
17
|
+
var useMaterialRunboxContext = function useMaterialRunboxContext() {
|
|
18
|
+
return React__default.default.useContext(MaterialRunboxContext);
|
|
14
19
|
};
|
|
15
20
|
//
|
|
16
21
|
//
|
|
17
22
|
//
|
|
18
|
-
|
|
19
|
-
var
|
|
20
|
-
children
|
|
21
|
-
} = _a,
|
|
23
|
+
var MaterialRunboxContextProvider = function MaterialRunboxContextProvider(_a) {
|
|
24
|
+
var children = _a.children,
|
|
22
25
|
props = tslib.__rest(_a, ["children"]);
|
|
23
|
-
return
|
|
26
|
+
return jsxRuntime.jsx(MaterialRunboxContext.Provider, {
|
|
24
27
|
children: children,
|
|
25
28
|
value: props
|
|
26
29
|
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var MaterialRunboxApiContext = require('./MaterialRunboxApiContext.js');
|
|
4
|
+
var MaterialRunboxCommandContext = require('./MaterialRunboxCommandContext.js');
|
|
5
|
+
var MaterialRunboxContext = require('./MaterialRunboxContext.js');
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
exports.MaterialRunboxApiContext = MaterialRunboxApiContext.MaterialRunboxApiContext;
|
|
10
|
+
exports.MaterialRunboxApiContextProvider = MaterialRunboxApiContext.default;
|
|
11
|
+
exports.useMaterialRunboxApiContext = MaterialRunboxApiContext.useMaterialRunboxApiContext;
|
|
12
|
+
exports.MaterialRunboxCommandContext = MaterialRunboxCommandContext.MaterialRunboxCommandContext;
|
|
13
|
+
exports.MaterialRunboxCommandContextProvider = MaterialRunboxCommandContext.default;
|
|
14
|
+
exports.useMaterialRunboxCommandContext = MaterialRunboxCommandContext.useMaterialRunboxCommandContext;
|
|
15
|
+
exports.MaterialRunboxContext = MaterialRunboxContext.MaterialRunboxContext;
|
|
16
|
+
exports.MaterialRunboxContextProvider = MaterialRunboxContext.default;
|
|
17
|
+
exports.useMaterialRunboxContext = MaterialRunboxContext.useMaterialRunboxContext;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
3
4
|
var React = require('react');
|
|
4
5
|
var intl = require('@elice/intl');
|
|
5
6
|
var muiXSnackbar = require('@elice/mui-x-snackbar');
|
|
@@ -14,53 +15,76 @@ require('../contexts/MaterialRunboxContext.js');
|
|
|
14
15
|
/**
|
|
15
16
|
* Hook for runbox control and status.
|
|
16
17
|
*/
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
enqueueSnackbar
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
stop: runboxStop
|
|
27
|
-
} = runboxClient.useEliceRunboxRunning();
|
|
18
|
+
var useRunboxControl = function useRunboxControl(props) {
|
|
19
|
+
var _return = React.useRef({});
|
|
20
|
+
var intl$1 = intl.useRawEliceIntl();
|
|
21
|
+
var _useSnackbar = muiXSnackbar.useSnackbar(),
|
|
22
|
+
enqueueSnackbar = _useSnackbar.enqueueSnackbar;
|
|
23
|
+
var materialRunboxApi = MaterialRunboxApiContext.useMaterialRunboxApiContext();
|
|
24
|
+
var _useEliceRunboxRunnin = runboxClient.useEliceRunboxRunning(),
|
|
25
|
+
runboxStart = _useEliceRunboxRunnin.start,
|
|
26
|
+
runboxStop = _useEliceRunboxRunnin.stop;
|
|
28
27
|
/**
|
|
29
28
|
* Start project.
|
|
30
29
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
30
|
+
var start = React.useCallback( /*#__PURE__*/_rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee() {
|
|
31
|
+
var force,
|
|
32
|
+
_args = arguments;
|
|
33
|
+
return _rollupPluginBabelHelpers.regeneratorRuntime().wrap(function _callee$(_context) {
|
|
34
|
+
while (1) switch (_context.prev = _context.next) {
|
|
35
|
+
case 0:
|
|
36
|
+
force = _args.length > 0 && _args[0] !== undefined ? _args[0] : false;
|
|
37
|
+
return _context.abrupt("return", runboxStart(function (signal) {
|
|
38
|
+
return materialRunboxApi.runbox.runboxRunboxIdStartPost({
|
|
39
|
+
runboxId: props.runbox.id,
|
|
40
|
+
eliceCourseId: props.courseId
|
|
41
|
+
}, {
|
|
42
|
+
signal: signal
|
|
43
|
+
});
|
|
44
|
+
}, force).then(function () {
|
|
45
|
+
return void props.refetch();
|
|
46
|
+
}).catch(function (err) {
|
|
47
|
+
if (err.name !== 'AbortError') {
|
|
48
|
+
enqueueSnackbar(intl$1.formatMessage({
|
|
49
|
+
id: 'runbox.runtime.message.startError'
|
|
50
|
+
}), {
|
|
51
|
+
variant: 'error'
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
}));
|
|
55
|
+
case 2:
|
|
56
|
+
case "end":
|
|
57
|
+
return _context.stop();
|
|
44
58
|
}
|
|
45
|
-
});
|
|
46
|
-
},
|
|
59
|
+
}, _callee);
|
|
60
|
+
})),
|
|
47
61
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
48
62
|
[props.runbox.id, props.courseId, runboxStart]);
|
|
49
63
|
/**
|
|
50
64
|
* Stop project.
|
|
51
65
|
*/
|
|
52
|
-
|
|
53
|
-
return
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
66
|
+
var stop = React.useCallback( /*#__PURE__*/_rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee2() {
|
|
67
|
+
return _rollupPluginBabelHelpers.regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
68
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
69
|
+
case 0:
|
|
70
|
+
return _context2.abrupt("return", runboxStop(function (signal) {
|
|
71
|
+
return materialRunboxApi.runbox.runboxRunboxIdStopPost({
|
|
72
|
+
runboxId: props.runbox.id,
|
|
73
|
+
eliceCourseId: props.courseId
|
|
74
|
+
}, {
|
|
75
|
+
signal: signal
|
|
76
|
+
});
|
|
77
|
+
}).then(function () {
|
|
78
|
+
//
|
|
79
|
+
}).catch(function (err) {
|
|
80
|
+
if (err.name !== 'AbortError') ;
|
|
81
|
+
}));
|
|
82
|
+
case 1:
|
|
83
|
+
case "end":
|
|
84
|
+
return _context2.stop();
|
|
85
|
+
}
|
|
86
|
+
}, _callee2);
|
|
87
|
+
})),
|
|
64
88
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
65
89
|
[props.runbox.id, props.courseId, runboxStop]);
|
|
66
90
|
//
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var en = require('./en.json.js');
|
|
4
|
+
var ko = require('./ko.json.js');
|
|
5
|
+
var th = require('./th.json.js');
|
|
6
|
+
var ja = require('./ja.json.js');
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
|
|
10
|
+
exports.messageEn = en.default;
|
|
11
|
+
exports.messageKo = ko.default;
|
|
12
|
+
exports.messageTh = th.default;
|
|
13
|
+
exports.messageJa = ja.default;
|
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
5
7
|
var React = require('react');
|
|
6
8
|
var openapiClientMaterialRunbox = require('@elice/openapi-client-material-runbox');
|
|
7
9
|
var runboxClient = require('@elice/runbox-client');
|
|
@@ -13,22 +15,27 @@ var RuntimeOverlayAssigned = require('./RuntimeOverlayAssigned.js');
|
|
|
13
15
|
var RuntimeOverlayQueued = require('./RuntimeOverlayQueued.js');
|
|
14
16
|
var RuntimeOverlayTerminated = require('./RuntimeOverlayTerminated.js');
|
|
15
17
|
|
|
18
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
19
|
+
|
|
20
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
21
|
+
|
|
16
22
|
//
|
|
17
23
|
//
|
|
18
24
|
//
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
isLastCommandRunning,
|
|
22
|
-
lastCommand
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
25
|
+
var Runtime = function Runtime(props) {
|
|
26
|
+
var _useMaterialRunboxCom = MaterialRunboxCommandContext.useMaterialRunboxCommandContext(),
|
|
27
|
+
isLastCommandRunning = _useMaterialRunboxCom.isLastCommandRunning,
|
|
28
|
+
lastCommand = _useMaterialRunboxCom.lastCommand;
|
|
29
|
+
var _useRunboxControl = useRunboxControl.useRunboxControl(props),
|
|
30
|
+
startRuntime = _useRunboxControl.start;
|
|
31
|
+
var _React$useState = React__default.default.useState(0),
|
|
32
|
+
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
33
|
+
viewRefreshTrigger = _React$useState2[0],
|
|
34
|
+
setViewRefreshTrigger = _React$useState2[1];
|
|
28
35
|
//
|
|
29
36
|
//
|
|
30
37
|
//
|
|
31
|
-
|
|
38
|
+
React__default.default.useEffect(function () {
|
|
32
39
|
if (!props.runbox.id) {
|
|
33
40
|
return;
|
|
34
41
|
}
|
|
@@ -49,7 +56,7 @@ const Runtime = props => {
|
|
|
49
56
|
//
|
|
50
57
|
// refresh view when `ProjectFileReset` command done.
|
|
51
58
|
//
|
|
52
|
-
|
|
59
|
+
React__default.default.useEffect(function () {
|
|
53
60
|
if (isLastCommandRunning || !lastCommand) {
|
|
54
61
|
return;
|
|
55
62
|
}
|
|
@@ -65,14 +72,15 @@ const Runtime = props => {
|
|
|
65
72
|
//
|
|
66
73
|
//
|
|
67
74
|
//
|
|
68
|
-
return
|
|
69
|
-
key: viewRefreshTrigger,
|
|
75
|
+
return jsxRuntime.jsx(runboxClient.EliceRunboxView, {
|
|
70
76
|
OverlayAssigned: RuntimeOverlayAssigned.default,
|
|
71
77
|
OverlayQueued: RuntimeOverlayQueued.default,
|
|
72
|
-
OverlayTerminated:
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
78
|
+
OverlayTerminated: function OverlayTerminated(props) {
|
|
79
|
+
return jsxRuntime.jsx(RuntimeOverlayTerminated.default, Object.assign({}, props, {
|
|
80
|
+
startRuntime: startRuntime
|
|
81
|
+
}));
|
|
82
|
+
}
|
|
83
|
+
}, viewRefreshTrigger);
|
|
76
84
|
};
|
|
77
85
|
|
|
78
86
|
exports.default = Runtime;
|
|
@@ -2,7 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
7
|
var reactUse = require('react-use');
|
|
7
8
|
var intl = require('@elice/intl');
|
|
8
9
|
var material = require('@mui/material');
|
|
@@ -13,18 +14,19 @@ var queue = require('../../../assets/queue.gif.js');
|
|
|
13
14
|
//
|
|
14
15
|
//
|
|
15
16
|
//
|
|
16
|
-
|
|
17
|
+
var ASSIGNED_NORMAL_TIMEOUT = 30 * 1e3; // 30 sec
|
|
17
18
|
//
|
|
18
19
|
//
|
|
19
20
|
//
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
var RuntimeOverlayAssigned = function RuntimeOverlayAssigned(_ref) {
|
|
22
|
+
var intl = _ref.__intl;
|
|
23
|
+
var _useTimeout = reactUse.useTimeout(ASSIGNED_NORMAL_TIMEOUT),
|
|
24
|
+
_useTimeout2 = _rollupPluginBabelHelpers.slicedToArray(_useTimeout, 1),
|
|
25
|
+
timeout = _useTimeout2[0];
|
|
24
26
|
//
|
|
25
27
|
//
|
|
26
28
|
//
|
|
27
|
-
return
|
|
29
|
+
return jsxRuntime.jsxs(material.Stack, {
|
|
28
30
|
gap: "1.5rem",
|
|
29
31
|
sx: {
|
|
30
32
|
display: 'flex',
|
|
@@ -32,28 +34,30 @@ const RuntimeOverlayAssigned = ({
|
|
|
32
34
|
alignItems: 'center',
|
|
33
35
|
width: '100%',
|
|
34
36
|
height: '100%'
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
37
|
+
},
|
|
38
|
+
children: [jsxRuntime.jsx(material.Box, {
|
|
39
|
+
component: "img",
|
|
40
|
+
src: queue.default,
|
|
41
|
+
alt: "queue",
|
|
42
|
+
sx: {
|
|
43
|
+
width: '100%',
|
|
44
|
+
height: 'auto',
|
|
45
|
+
maxWidth: '13.375rem'
|
|
46
|
+
}
|
|
47
|
+
}), jsxRuntime.jsx(material.Typography, {
|
|
48
|
+
variant: "subtitle2",
|
|
49
|
+
color: "text:secondary",
|
|
50
|
+
sx: {
|
|
51
|
+
whiteSpace: 'pre-wrap',
|
|
52
|
+
textAlign: 'center'
|
|
53
|
+
},
|
|
54
|
+
children: timeout() ? intl.formatMessage({
|
|
55
|
+
id: 'runbox.runtime.overlay.assigned.description_timeout'
|
|
56
|
+
}) : intl.formatMessage({
|
|
57
|
+
id: 'runbox.runtime.overlay.assigned.description'
|
|
58
|
+
})
|
|
59
|
+
})]
|
|
60
|
+
});
|
|
57
61
|
};
|
|
58
62
|
var RuntimeOverlayAssigned$1 = new intl.IntlComponentBuilder(RuntimeOverlayAssigned).add('en', en.default).add('ko', ko.default).addAsync('th', Promise.resolve().then(function () { return require('../locales/th.json.js'); })).addAsync('ja', Promise.resolve().then(function () { return require('../locales/ja.json.js'); })).build();
|
|
59
63
|
|