@elice/material-runbox 1.240718.0-trasncript.2 → 1.240718.2
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
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
import { slicedToArray as _slicedToArray, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
1
|
import _styled from '@emotion/styled/base';
|
|
3
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
4
2
|
import React from 'react';
|
|
5
3
|
import { Transition } from 'react-transition-group';
|
|
6
4
|
import { useRawEliceIntl } from '@elice/intl';
|
|
@@ -19,8 +17,8 @@ function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringif
|
|
|
19
17
|
//
|
|
20
18
|
//
|
|
21
19
|
//
|
|
22
|
-
|
|
23
|
-
|
|
20
|
+
const TRANSITION_DURATION = 300;
|
|
21
|
+
const TRANSITION_STYLE_MAP = {
|
|
24
22
|
entering: {
|
|
25
23
|
maxWidth: 0
|
|
26
24
|
},
|
|
@@ -40,7 +38,7 @@ var TRANSITION_STYLE_MAP = {
|
|
|
40
38
|
//
|
|
41
39
|
//
|
|
42
40
|
//
|
|
43
|
-
|
|
41
|
+
const StyledMainActionButton = /*#__PURE__*/_styled(LoadingButton, {
|
|
44
42
|
target: "eae460y2"
|
|
45
43
|
})("production" === "production" ? {
|
|
46
44
|
name: "tssn5p",
|
|
@@ -50,184 +48,139 @@ var StyledMainActionButton = /*#__PURE__*/_styled(LoadingButton, {
|
|
|
50
48
|
styles: "min-width:4rem!important",
|
|
51
49
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__
|
|
52
50
|
});
|
|
53
|
-
|
|
51
|
+
const StyledSubActionButton = /*#__PURE__*/_styled(Button, {
|
|
54
52
|
target: "eae460y1"
|
|
55
53
|
})("transition:max-width ", TRANSITION_DURATION, "ms cubic-bezier(0.25, 0.46, 0.45, 1);");
|
|
56
|
-
|
|
54
|
+
const StyledTerminal = /*#__PURE__*/_styled("textarea", {
|
|
57
55
|
target: "eae460y0"
|
|
58
|
-
})("padding:1rem;width:100%;color:",
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
}, ";
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
}, ";line-height:", function (_ref4) {
|
|
68
|
-
var theme = _ref4.theme;
|
|
69
|
-
return theme.typography.body2.lineHeight;
|
|
70
|
-
}, ";outline:none;resize:none;");
|
|
56
|
+
})("padding:1rem;width:100%;color:", ({
|
|
57
|
+
theme
|
|
58
|
+
}) => theme.palette.common.white, ";background-color:", ({
|
|
59
|
+
theme
|
|
60
|
+
}) => theme.palette.common.black, ";border:none;border-radius:0.5rem;font-family:'Elice Digital Coding',monospace;font-size:", ({
|
|
61
|
+
theme
|
|
62
|
+
}) => theme.typography.body2.fontSize, ";line-height:", ({
|
|
63
|
+
theme
|
|
64
|
+
}) => theme.typography.body2.lineHeight, ";outline:none;resize:none;");
|
|
71
65
|
//
|
|
72
66
|
//
|
|
73
67
|
//
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
68
|
+
const MaterialRunboxActionGrade = ({
|
|
69
|
+
runtime,
|
|
70
|
+
courseId
|
|
71
|
+
}) => {
|
|
77
72
|
var _a;
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
enqueueSnackbar
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
73
|
+
const intl = useRawEliceIntl();
|
|
74
|
+
const {
|
|
75
|
+
enqueueSnackbar
|
|
76
|
+
} = useSnackbar();
|
|
77
|
+
const materialRunboxApi = useMaterialRunboxApiContext();
|
|
78
|
+
const {
|
|
79
|
+
isLastCommandRunning,
|
|
80
|
+
lastCommand,
|
|
81
|
+
setCommandIdToPing
|
|
82
|
+
} = useMaterialRunboxCommandContext();
|
|
83
|
+
const {
|
|
84
|
+
status
|
|
85
|
+
} = useEliceRunboxRunning();
|
|
86
|
+
const leaderboardSubmitInfoQuery = useQuery({
|
|
89
87
|
queryKey: ['eliceMaterialRunboxRunboxApi.runboxRunboxIdSubmitInfoGet', {
|
|
90
|
-
courseId
|
|
91
|
-
runtime
|
|
88
|
+
courseId,
|
|
89
|
+
runtime
|
|
92
90
|
}],
|
|
93
|
-
queryFn:
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
},
|
|
91
|
+
queryFn: ({
|
|
92
|
+
signal
|
|
93
|
+
}) => materialRunboxApi.runbox.runboxRunboxIdSubmitInfoGet({
|
|
94
|
+
eliceCourseId: courseId,
|
|
95
|
+
runboxId: runtime === null || runtime === void 0 ? void 0 : runtime.runboxId
|
|
96
|
+
}, {
|
|
97
|
+
signal
|
|
98
|
+
}),
|
|
102
99
|
enabled: Boolean(runtime === null || runtime === void 0 ? void 0 : runtime.runboxId),
|
|
103
100
|
retry: false
|
|
104
101
|
});
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
isGradeResultDialogOpen = _React$useState4[0],
|
|
113
|
-
setGradeResultDialogOpen = _React$useState4[1];
|
|
114
|
-
var _React$useState5 = React.useState(false),
|
|
115
|
-
_React$useState6 = _slicedToArray(_React$useState5, 2),
|
|
116
|
-
isSubmitCountInfoDialogOpen = _React$useState6[0],
|
|
117
|
-
setSubmitCountInfoDialogOpen = _React$useState6[1];
|
|
118
|
-
var _React$useState7 = React.useState(false),
|
|
119
|
-
_React$useState8 = _slicedToArray(_React$useState7, 2),
|
|
120
|
-
hasUnreadResult = _React$useState8[0],
|
|
121
|
-
setHasUnreadResult = _React$useState8[1];
|
|
122
|
-
var isRunboxRunning = status === 'running';
|
|
123
|
-
var isGradeDoneWithOutput = !isLastCommandRunning && (lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.commandType) === CommandType.Grade && Boolean(lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.output);
|
|
102
|
+
const isSubmitCountRemained = ((_a = leaderboardSubmitInfoQuery.data) === null || _a === void 0 ? void 0 : _a.remainSubmitCount) !== 0;
|
|
103
|
+
const [isActionLoading, setActionLoading] = React.useState(false);
|
|
104
|
+
const [isGradeResultDialogOpen, setGradeResultDialogOpen] = React.useState(false);
|
|
105
|
+
const [isSubmitCountInfoDialogOpen, setSubmitCountInfoDialogOpen] = React.useState(false);
|
|
106
|
+
const [hasUnreadResult, setHasUnreadResult] = React.useState(false);
|
|
107
|
+
const isRunboxRunning = status === 'running';
|
|
108
|
+
const isGradeDoneWithOutput = !isLastCommandRunning && (lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.commandType) === CommandType.Grade && Boolean(lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.output);
|
|
124
109
|
/**
|
|
125
110
|
*
|
|
126
111
|
*/
|
|
127
|
-
|
|
112
|
+
const handleGradeResultDialogOpen = () => {
|
|
128
113
|
setGradeResultDialogOpen(true);
|
|
129
114
|
};
|
|
130
115
|
/**
|
|
131
116
|
*
|
|
132
117
|
*/
|
|
133
|
-
|
|
118
|
+
const handleGradeResultDialogClose = () => {
|
|
134
119
|
setGradeResultDialogOpen(false);
|
|
135
120
|
};
|
|
136
121
|
/**
|
|
137
122
|
*
|
|
138
123
|
*/
|
|
139
|
-
|
|
124
|
+
const handleSubmitCountInfoDialogClose = () => {
|
|
140
125
|
setSubmitCountInfoDialogOpen(false);
|
|
141
126
|
};
|
|
142
127
|
/**
|
|
143
128
|
*
|
|
144
129
|
*/
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
return _context.abrupt("return");
|
|
165
|
-
case 10:
|
|
166
|
-
runtimeId = runtime === null || runtime === void 0 ? void 0 : runtime.id;
|
|
167
|
-
_context.next = 13;
|
|
168
|
-
return materialRunboxApi.runtime.runtimeRuntimeIdCommandPost({
|
|
169
|
-
runtimeId: runtimeId,
|
|
170
|
-
eliceCourseId: courseId,
|
|
171
|
-
runboxCommandPostRequest: {
|
|
172
|
-
commandType: CommandType.Grade
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
case 13:
|
|
176
|
-
_yield$materialRunbox = _context.sent;
|
|
177
|
-
commandId = _yield$materialRunbox.id;
|
|
178
|
-
setCommandIdToPing(commandId);
|
|
179
|
-
_context.next = 21;
|
|
180
|
-
break;
|
|
181
|
-
case 18:
|
|
182
|
-
_context.prev = 18;
|
|
183
|
-
_context.t0 = _context["catch"](1);
|
|
184
|
-
enqueueSnackbar(intl.formatMessage({
|
|
185
|
-
id: 'runbox.action.grade.noti.error'
|
|
186
|
-
}), {
|
|
187
|
-
variant: 'error'
|
|
188
|
-
});
|
|
189
|
-
case 21:
|
|
190
|
-
_context.prev = 21;
|
|
191
|
-
setActionLoading(false);
|
|
192
|
-
return _context.finish(21);
|
|
193
|
-
case 24:
|
|
194
|
-
case "end":
|
|
195
|
-
return _context.stop();
|
|
130
|
+
const handleAction = async () => {
|
|
131
|
+
setActionLoading(true);
|
|
132
|
+
try {
|
|
133
|
+
const {
|
|
134
|
+
data: currentLeaderboardSubmitInfo
|
|
135
|
+
} = await leaderboardSubmitInfoQuery.refetch();
|
|
136
|
+
const isCurrentSubmitCountEmpty = (currentLeaderboardSubmitInfo === null || currentLeaderboardSubmitInfo === void 0 ? void 0 : currentLeaderboardSubmitInfo.remainSubmitCount) === 0;
|
|
137
|
+
if (isCurrentSubmitCountEmpty) {
|
|
138
|
+
setSubmitCountInfoDialogOpen(true);
|
|
139
|
+
return;
|
|
140
|
+
}
|
|
141
|
+
const runtimeId = runtime === null || runtime === void 0 ? void 0 : runtime.id;
|
|
142
|
+
const {
|
|
143
|
+
id: commandId
|
|
144
|
+
} = await materialRunboxApi.runtime.runtimeRuntimeIdCommandPost({
|
|
145
|
+
runtimeId,
|
|
146
|
+
eliceCourseId: courseId,
|
|
147
|
+
runboxCommandPostRequest: {
|
|
148
|
+
commandType: CommandType.Grade
|
|
196
149
|
}
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
150
|
+
});
|
|
151
|
+
setCommandIdToPing(commandId);
|
|
152
|
+
} catch (err) {
|
|
153
|
+
enqueueSnackbar(intl.formatMessage({
|
|
154
|
+
id: 'runbox.action.grade.noti.error'
|
|
155
|
+
}), {
|
|
156
|
+
variant: 'error'
|
|
157
|
+
});
|
|
158
|
+
} finally {
|
|
159
|
+
setActionLoading(false);
|
|
160
|
+
}
|
|
161
|
+
};
|
|
203
162
|
//
|
|
204
163
|
// set `hasUnreadResult` when last command output exists
|
|
205
164
|
//
|
|
206
|
-
React.useEffect(
|
|
207
|
-
return setHasUnreadResult(isGradeDoneWithOutput);
|
|
208
|
-
}, [isGradeDoneWithOutput]);
|
|
165
|
+
React.useEffect(() => setHasUnreadResult(isGradeDoneWithOutput), [isGradeDoneWithOutput]);
|
|
209
166
|
//
|
|
210
167
|
// reset `hasUnreadResult` when dialog state toggled
|
|
211
168
|
//
|
|
212
|
-
React.useEffect(
|
|
213
|
-
return setHasUnreadResult(false);
|
|
214
|
-
}, [isGradeResultDialogOpen]);
|
|
169
|
+
React.useEffect(() => setHasUnreadResult(false), [isGradeResultDialogOpen]);
|
|
215
170
|
//
|
|
216
171
|
// toggle dialog state when last command output exists
|
|
217
172
|
//
|
|
218
|
-
React.useEffect(
|
|
219
|
-
return setGradeResultDialogOpen(isGradeDoneWithOutput);
|
|
220
|
-
}, [isGradeDoneWithOutput]);
|
|
173
|
+
React.useEffect(() => setGradeResultDialogOpen(isGradeDoneWithOutput), [isGradeDoneWithOutput]);
|
|
221
174
|
/**
|
|
222
175
|
*
|
|
223
176
|
*/
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
177
|
+
const renderActionButton = () => {
|
|
178
|
+
const isGradeType = (lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.commandType) === CommandType.Grade;
|
|
179
|
+
const isGrading = isActionLoading || isLastCommandRunning && isGradeType;
|
|
227
180
|
/**
|
|
228
181
|
*
|
|
229
182
|
*/
|
|
230
|
-
|
|
183
|
+
const getActionTooltipMessage = () => {
|
|
231
184
|
if (!isSubmitCountRemained) {
|
|
232
185
|
return intl.formatMessage({
|
|
233
186
|
id: 'runbox.action.submitCountInfo.tooltip.disabled'
|
|
@@ -240,128 +193,97 @@ var MaterialRunboxActionGrade = function MaterialRunboxActionGrade(_ref5) {
|
|
|
240
193
|
}
|
|
241
194
|
return '';
|
|
242
195
|
};
|
|
243
|
-
return
|
|
196
|
+
return React.createElement(Tooltip, {
|
|
244
197
|
title: getActionTooltipMessage(),
|
|
245
|
-
placement: "bottom-end"
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
fontSize: "small"
|
|
274
|
-
})
|
|
275
|
-
})
|
|
276
|
-
});
|
|
277
|
-
}
|
|
278
|
-
}) : null]
|
|
279
|
-
})
|
|
280
|
-
});
|
|
198
|
+
placement: "bottom-end"
|
|
199
|
+
}, React.createElement(ButtonGroup, {
|
|
200
|
+
variant: "contained"
|
|
201
|
+
}, React.createElement(StyledMainActionButton, {
|
|
202
|
+
variant: "contained",
|
|
203
|
+
loading: isGrading,
|
|
204
|
+
disabled: !isRunboxRunning || isLastCommandRunning || !isSubmitCountRemained,
|
|
205
|
+
size: "small",
|
|
206
|
+
onClick: handleAction
|
|
207
|
+
}, intl.formatMessage({
|
|
208
|
+
id: 'runbox.action.grade.title'
|
|
209
|
+
})), isGradeDoneWithOutput ? React.createElement(Transition, {
|
|
210
|
+
in: isGradeDoneWithOutput,
|
|
211
|
+
timeout: 0,
|
|
212
|
+
mountOnEnter: true,
|
|
213
|
+
unmountOnExit: true
|
|
214
|
+
}, state => React.createElement(StyledSubActionButton, {
|
|
215
|
+
size: "small",
|
|
216
|
+
disabled: isLastCommandRunning,
|
|
217
|
+
onClick: handleGradeResultDialogOpen,
|
|
218
|
+
style: TRANSITION_STYLE_MAP[state]
|
|
219
|
+
}, React.createElement(Badge, {
|
|
220
|
+
color: "error",
|
|
221
|
+
variant: "dot",
|
|
222
|
+
invisible: !hasUnreadResult
|
|
223
|
+
}, React.createElement(Terminal, {
|
|
224
|
+
fontSize: "small"
|
|
225
|
+
})))) : null));
|
|
281
226
|
};
|
|
282
227
|
/**
|
|
283
228
|
*
|
|
284
229
|
*/
|
|
285
|
-
|
|
230
|
+
const renderActionGradeResultDialog = () => {
|
|
286
231
|
if ((lastCommand === null || lastCommand === void 0 ? void 0 : lastCommand.commandType) !== CommandType.Grade) {
|
|
287
232
|
return null;
|
|
288
233
|
}
|
|
289
|
-
return
|
|
234
|
+
return React.createElement(Dialog, {
|
|
290
235
|
open: isGradeResultDialogOpen,
|
|
291
236
|
maxWidth: "md",
|
|
292
237
|
fullWidth: true,
|
|
293
|
-
onClose: handleGradeResultDialogClose
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
}), jsx(DialogActions, {
|
|
318
|
-
children: jsx(Button, {
|
|
319
|
-
color: "inherit",
|
|
320
|
-
disabled: isActionLoading,
|
|
321
|
-
onClick: handleGradeResultDialogClose,
|
|
322
|
-
children: intl.formatMessage({
|
|
323
|
-
id: 'runbox.common.close'
|
|
324
|
-
})
|
|
325
|
-
})
|
|
326
|
-
})]
|
|
327
|
-
});
|
|
238
|
+
onClose: handleGradeResultDialogClose
|
|
239
|
+
}, React.createElement(DialogTitle, null, intl.formatMessage({
|
|
240
|
+
id: 'runbox.action.grade.dialog.title'
|
|
241
|
+
})), React.createElement(DialogContent, null, React.createElement(Stack, {
|
|
242
|
+
gap: "0.75rem"
|
|
243
|
+
}, lastCommand.terminatedReason === 'done' ? React.createElement(Alert, {
|
|
244
|
+
severity: "success"
|
|
245
|
+
}, intl.formatMessage({
|
|
246
|
+
id: 'runbox.action.grade.dialog.description.success'
|
|
247
|
+
})) : React.createElement(Alert, {
|
|
248
|
+
severity: "error"
|
|
249
|
+
}, intl.formatMessage({
|
|
250
|
+
id: 'runbox.action.grade.dialog.description.error'
|
|
251
|
+
})), React.createElement(StyledTerminal, {
|
|
252
|
+
value: lastCommand.output,
|
|
253
|
+
readOnly: true,
|
|
254
|
+
rows: 20
|
|
255
|
+
}))), React.createElement(DialogActions, null, React.createElement(Button, {
|
|
256
|
+
color: "inherit",
|
|
257
|
+
disabled: isActionLoading,
|
|
258
|
+
onClick: handleGradeResultDialogClose
|
|
259
|
+
}, intl.formatMessage({
|
|
260
|
+
id: 'runbox.common.close'
|
|
261
|
+
}))));
|
|
328
262
|
};
|
|
329
263
|
/**
|
|
330
264
|
*
|
|
331
265
|
*/
|
|
332
|
-
|
|
333
|
-
return
|
|
266
|
+
const renderActionSubmitCountInfoDialog = () => {
|
|
267
|
+
return React.createElement(Dialog, {
|
|
334
268
|
fullWidth: true,
|
|
335
269
|
maxWidth: "xs",
|
|
336
270
|
open: isSubmitCountInfoDialogOpen,
|
|
337
|
-
onClick: handleSubmitCountInfoDialogClose
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}), jsx(DialogActions, {
|
|
349
|
-
children: jsx(Button, {
|
|
350
|
-
color: "inherit",
|
|
351
|
-
onClick: handleSubmitCountInfoDialogClose,
|
|
352
|
-
children: intl.formatMessage({
|
|
353
|
-
id: 'runbox.common.close'
|
|
354
|
-
})
|
|
355
|
-
})
|
|
356
|
-
})]
|
|
357
|
-
});
|
|
271
|
+
onClick: handleSubmitCountInfoDialogClose
|
|
272
|
+
}, React.createElement(DialogTitle, null, intl.formatMessage({
|
|
273
|
+
id: 'runbtox.action.submitCountInfo.dialog.title'
|
|
274
|
+
})), React.createElement(DialogContent, null, React.createElement(Typography, null, intl.formatMessage({
|
|
275
|
+
id: 'runbox.action.submitCountInfo.dialog.description'
|
|
276
|
+
}))), React.createElement(DialogActions, null, React.createElement(Button, {
|
|
277
|
+
color: "inherit",
|
|
278
|
+
onClick: handleSubmitCountInfoDialogClose
|
|
279
|
+
}, intl.formatMessage({
|
|
280
|
+
id: 'runbox.common.close'
|
|
281
|
+
}))));
|
|
358
282
|
};
|
|
359
283
|
//
|
|
360
284
|
//
|
|
361
285
|
//
|
|
362
|
-
return
|
|
363
|
-
children: [renderActionButton(), renderActionGradeResultDialog(), renderActionSubmitCountInfoDialog()]
|
|
364
|
-
});
|
|
286
|
+
return React.createElement(React.Fragment, null, renderActionButton(), renderActionGradeResultDialog(), renderActionSubmitCountInfoDialog());
|
|
365
287
|
};
|
|
366
288
|
|
|
367
289
|
export { MaterialRunboxActionGrade as default };
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
1
|
import React from 'react';
|
|
3
2
|
import { useEliceRunboxRunning } from '@elice/runbox-client';
|
|
4
3
|
import { Menu } from '@mui/material';
|
|
@@ -9,20 +8,22 @@ import MaterialRunboxActionShare from './MaterialRunboxActionShare.js';
|
|
|
9
8
|
//
|
|
10
9
|
//
|
|
11
10
|
//
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
11
|
+
const MaterialRunboxActionMenu = ({
|
|
12
|
+
runbox,
|
|
13
|
+
runtime,
|
|
14
|
+
courseId,
|
|
15
|
+
menuAnchorEl,
|
|
16
|
+
refetch,
|
|
17
|
+
handleMenuClose
|
|
18
|
+
}) => {
|
|
19
|
+
const {
|
|
20
|
+
status
|
|
21
|
+
} = useEliceRunboxRunning();
|
|
22
|
+
const isRunboxRunning = status === 'running';
|
|
22
23
|
//
|
|
23
24
|
//
|
|
24
25
|
//
|
|
25
|
-
React.useEffect(
|
|
26
|
+
React.useEffect(() => {
|
|
26
27
|
if (!isRunboxRunning) {
|
|
27
28
|
handleMenuClose();
|
|
28
29
|
}
|
|
@@ -30,7 +31,7 @@ var MaterialRunboxActionMenu = function MaterialRunboxActionMenu(_ref) {
|
|
|
30
31
|
//
|
|
31
32
|
//
|
|
32
33
|
//
|
|
33
|
-
return
|
|
34
|
+
return React.createElement(Menu, {
|
|
34
35
|
open: Boolean(menuAnchorEl),
|
|
35
36
|
anchorEl: menuAnchorEl,
|
|
36
37
|
anchorOrigin: {
|
|
@@ -41,21 +42,20 @@ var MaterialRunboxActionMenu = function MaterialRunboxActionMenu(_ref) {
|
|
|
41
42
|
vertical: 'top',
|
|
42
43
|
horizontal: 'right'
|
|
43
44
|
},
|
|
44
|
-
onClose: handleMenuClose
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
});
|
|
45
|
+
onClose: handleMenuClose
|
|
46
|
+
}, React.createElement(MaterialRunboxActionShare, {
|
|
47
|
+
handleMenuClose: handleMenuClose
|
|
48
|
+
}), React.createElement(MaterialRunboxActionRestart, {
|
|
49
|
+
runbox: runbox,
|
|
50
|
+
runtime: runtime,
|
|
51
|
+
courseId: courseId,
|
|
52
|
+
refetch: refetch,
|
|
53
|
+
handleMenuClose: handleMenuClose
|
|
54
|
+
}), React.createElement(MaterialRunboxActionReset, {
|
|
55
|
+
runtime: runtime,
|
|
56
|
+
courseId: courseId,
|
|
57
|
+
handleMenuClose: handleMenuClose
|
|
58
|
+
}));
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
export { MaterialRunboxActionMenu as default };
|