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