@elice/material-runbox 1.260825.0-runboxusability.7 → 1.260825.0-runboxusability.9
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/components/material-runbox/MaterialRunbox.js +15 -10
- package/cjs/components/material-runbox/MaterialRunboxContent.js +88 -69
- package/cjs/components/material-runbox/MaterialRunboxHeader.js +1 -16
- package/cjs/components/material-runbox/actions/MaterialRunboxActionDisconnect.d.ts +1 -4
- package/cjs/components/material-runbox/actions/MaterialRunboxActionDisconnect.js +4 -2
- package/cjs/components/material-runbox/actions/MaterialRunboxActionDisconnectMenuItem.d.ts +1 -4
- package/cjs/components/material-runbox/actions/MaterialRunboxActionDisconnectMenuItem.js +13 -19
- package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.d.ts +0 -1
- package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.js +1 -9
- package/cjs/components/material-runbox/actions/MaterialRunboxActionRestart.d.ts +1 -2
- package/cjs/components/material-runbox/actions/MaterialRunboxActionRestart.js +9 -26
- package/cjs/components/material-runbox/contexts/MaterialRunboxControlContext.d.ts +14 -0
- package/cjs/components/material-runbox/contexts/MaterialRunboxControlContext.js +56 -0
- package/cjs/components/material-runbox/contexts/index.d.ts +2 -0
- package/cjs/components/material-runbox/contexts/index.js +4 -0
- package/cjs/components/material-runbox/disk/MaterialRunboxEnvResetButton.d.ts +2 -2
- package/cjs/components/material-runbox/disk/MaterialRunboxEnvResetButton.js +107 -24
- package/cjs/components/material-runbox/disk/MaterialRunboxEnvResetDialog.d.ts +0 -1
- package/cjs/components/material-runbox/disk/MaterialRunboxEnvResetDialog.js +1 -6
- package/cjs/components/material-runbox/hooks/index.d.ts +0 -1
- package/cjs/components/material-runbox/hooks/index.js +0 -2
- package/cjs/components/material-runbox/hooks/useRunboxControl.d.ts +4 -3
- package/cjs/components/material-runbox/hooks/useRunboxControl.js +43 -14
- package/cjs/components/material-runbox/locales/en.json.js +1 -1
- package/cjs/components/material-runbox/locales/ja.json.js +1 -1
- package/cjs/components/material-runbox/locales/ko.json.js +1 -1
- package/cjs/components/material-runbox/locales/th.json.js +1 -1
- package/cjs/components/material-runbox/runtime/Runtime.js +7 -15
- package/cjs/components/material-runbox/runtime/RuntimeChangeMaterialDialog.d.ts +0 -1
- package/cjs/components/material-runbox/runtime/RuntimeChangeMaterialDialog.js +9 -3
- package/cjs/components/material-runbox/runtime/RuntimeOverlayConflicted.d.ts +0 -1
- package/cjs/components/material-runbox/runtime/RuntimeOverlayConflicted.js +68 -64
- package/cjs/components/material-runbox/runtime/RuntimeOverlayLoading.js +183 -178
- package/cjs/components/material-runbox/runtime/RuntimeOverlayTerminated.d.ts +0 -1
- package/cjs/components/material-runbox/runtime/RuntimeOverlayTerminated.js +57 -55
- package/cjs/components/material-runbox/status/MaterialRunboxStatusPopover.js +2 -1
- package/cjs/components/material-runbox/theme.d.ts +2 -0
- package/cjs/components/material-runbox/theme.js +15 -0
- package/cjs/components/material-runbox/timer/MaterialRunboxTimer.d.ts +0 -1
- package/cjs/components/material-runbox/timer/MaterialRunboxTimer.js +3 -1
- package/es/components/material-runbox/MaterialRunbox.js +15 -10
- package/es/components/material-runbox/MaterialRunboxContent.js +89 -70
- package/es/components/material-runbox/MaterialRunboxHeader.js +1 -16
- package/es/components/material-runbox/actions/MaterialRunboxActionDisconnect.d.ts +1 -4
- package/es/components/material-runbox/actions/MaterialRunboxActionDisconnect.js +4 -2
- package/es/components/material-runbox/actions/MaterialRunboxActionDisconnectMenuItem.d.ts +1 -4
- package/es/components/material-runbox/actions/MaterialRunboxActionDisconnectMenuItem.js +13 -19
- package/es/components/material-runbox/actions/MaterialRunboxActionMenu.d.ts +0 -1
- package/es/components/material-runbox/actions/MaterialRunboxActionMenu.js +1 -9
- package/es/components/material-runbox/actions/MaterialRunboxActionRestart.d.ts +1 -2
- package/es/components/material-runbox/actions/MaterialRunboxActionRestart.js +9 -26
- package/es/components/material-runbox/contexts/MaterialRunboxControlContext.d.ts +14 -0
- package/es/components/material-runbox/contexts/MaterialRunboxControlContext.js +46 -0
- package/es/components/material-runbox/contexts/index.d.ts +2 -0
- package/es/components/material-runbox/contexts/index.js +1 -0
- package/es/components/material-runbox/disk/MaterialRunboxEnvResetButton.d.ts +2 -2
- package/es/components/material-runbox/disk/MaterialRunboxEnvResetButton.js +109 -26
- package/es/components/material-runbox/disk/MaterialRunboxEnvResetDialog.d.ts +0 -1
- package/es/components/material-runbox/disk/MaterialRunboxEnvResetDialog.js +1 -6
- package/es/components/material-runbox/hooks/index.d.ts +0 -1
- package/es/components/material-runbox/hooks/index.js +0 -1
- package/es/components/material-runbox/hooks/useRunboxControl.d.ts +4 -3
- package/es/components/material-runbox/hooks/useRunboxControl.js +43 -14
- package/es/components/material-runbox/locales/en.json.js +1 -1
- package/es/components/material-runbox/locales/ja.json.js +1 -1
- package/es/components/material-runbox/locales/ko.json.js +1 -1
- package/es/components/material-runbox/locales/th.json.js +1 -1
- package/es/components/material-runbox/runtime/Runtime.js +8 -16
- package/es/components/material-runbox/runtime/RuntimeChangeMaterialDialog.d.ts +0 -1
- package/es/components/material-runbox/runtime/RuntimeChangeMaterialDialog.js +9 -3
- package/es/components/material-runbox/runtime/RuntimeOverlayConflicted.d.ts +0 -1
- package/es/components/material-runbox/runtime/RuntimeOverlayConflicted.js +69 -65
- package/es/components/material-runbox/runtime/RuntimeOverlayLoading.js +185 -180
- package/es/components/material-runbox/runtime/RuntimeOverlayTerminated.d.ts +0 -1
- package/es/components/material-runbox/runtime/RuntimeOverlayTerminated.js +58 -56
- package/es/components/material-runbox/status/MaterialRunboxStatusPopover.js +2 -1
- package/es/components/material-runbox/theme.d.ts +2 -0
- package/es/components/material-runbox/theme.js +12 -0
- package/es/components/material-runbox/timer/MaterialRunboxTimer.d.ts +0 -1
- package/es/components/material-runbox/timer/MaterialRunboxTimer.js +3 -1
- package/package.json +6 -6
- package/cjs/components/material-runbox/hooks/useRunboxEnvReset.d.ts +0 -16
- package/cjs/components/material-runbox/hooks/useRunboxEnvReset.js +0 -95
- package/es/components/material-runbox/hooks/useRunboxEnvReset.d.ts +0 -16
- package/es/components/material-runbox/hooks/useRunboxEnvReset.js +0 -89
|
@@ -5,7 +5,9 @@ Object.defineProperty(exports, '__esModule', { value: true });
|
|
|
5
5
|
var tslib = require('tslib');
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var intl = require('@elice/intl');
|
|
8
|
+
var material = require('@mui/material');
|
|
8
9
|
var MaterialRunboxContent = require('./MaterialRunboxContent.js');
|
|
10
|
+
var theme = require('./theme.js');
|
|
9
11
|
var en = require('./locales/en.json.js');
|
|
10
12
|
var ko = require('./locales/ko.json.js');
|
|
11
13
|
var MaterialRunboxContext = require('./contexts/MaterialRunboxContext.js');
|
|
@@ -28,16 +30,19 @@ var MaterialRunbox = function MaterialRunbox(_a) {
|
|
|
28
30
|
eliceMaterialRunboxApiConfiguration = _a.eliceMaterialRunboxApiConfiguration,
|
|
29
31
|
__intl = _a.__intl,
|
|
30
32
|
contentProps = tslib.__rest(_a, ["enableAutoShutdownToggle", "enableUrlShare", "locale", "showMessenger", "eliceMaterialRunboxApiConfiguration", "__intl"]);
|
|
31
|
-
return jsxRuntime.jsx(
|
|
32
|
-
|
|
33
|
-
children: jsxRuntime.jsx(
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
children: jsxRuntime.jsx(
|
|
33
|
+
return jsxRuntime.jsx(material.ThemeProvider, {
|
|
34
|
+
theme: theme.runboxDarkTheme,
|
|
35
|
+
children: jsxRuntime.jsx(intl.RawEliceIntlProvider, {
|
|
36
|
+
value: __intl,
|
|
37
|
+
children: jsxRuntime.jsx(MaterialRunboxContext.default, {
|
|
38
|
+
enableAutoShutdownToggle: enableAutoShutdownToggle,
|
|
39
|
+
enableUrlShare: enableUrlShare,
|
|
40
|
+
locale: locale,
|
|
41
|
+
showMessenger: showMessenger,
|
|
42
|
+
children: jsxRuntime.jsx(MaterialRunboxApiContext.default, {
|
|
43
|
+
eliceMaterialRunboxApiConfiguration: eliceMaterialRunboxApiConfiguration,
|
|
44
|
+
children: jsxRuntime.jsx(MaterialRunboxContent.default, Object.assign({}, contentProps))
|
|
45
|
+
})
|
|
41
46
|
})
|
|
42
47
|
})
|
|
43
48
|
});
|
|
@@ -16,9 +16,11 @@ var MaterialAdminRunboxConfirmDialog = require('./MaterialAdminRunboxConfirmDial
|
|
|
16
16
|
var MaterialRunboxAlert = require('./MaterialRunboxAlert.js');
|
|
17
17
|
var MaterialRunboxBody = require('./MaterialRunboxBody.js');
|
|
18
18
|
var MaterialRunboxHeader = require('./MaterialRunboxHeader.js');
|
|
19
|
+
var theme = require('./theme.js');
|
|
19
20
|
var MaterialRunboxContext = require('./contexts/MaterialRunboxContext.js');
|
|
20
21
|
var MaterialRunboxApiContext = require('./contexts/MaterialRunboxApiContext.js');
|
|
21
22
|
var MaterialRunboxCommandContext = require('./contexts/MaterialRunboxCommandContext.js');
|
|
23
|
+
var MaterialRunboxControlContext = require('./contexts/MaterialRunboxControlContext.js');
|
|
22
24
|
var MaterialRunboxDiskUsageAlert = require('./disk/MaterialRunboxDiskUsageAlert.js');
|
|
23
25
|
var MaterialRunboxDiskUsageDialog = require('./disk/MaterialRunboxDiskUsageDialog.js');
|
|
24
26
|
var useMaterialRunboxRunboxIdStarterGet = require('./hooks/useMaterialRunboxRunboxIdStarterGet.js');
|
|
@@ -159,66 +161,81 @@ var MaterialRunboxContent = function MaterialRunboxContent(_ref) {
|
|
|
159
161
|
//
|
|
160
162
|
//
|
|
161
163
|
if (isInitialLoading || starterEnabled && isLoading) {
|
|
162
|
-
return jsxRuntime.jsx(
|
|
163
|
-
|
|
164
|
+
return jsxRuntime.jsx(material.ThemeProvider, {
|
|
165
|
+
theme: theme.runboxLightTheme,
|
|
166
|
+
children: jsxRuntime.jsx(StyledRunboxContainer, {
|
|
167
|
+
sx: {
|
|
168
|
+
backgroundColor: 'background.paper'
|
|
169
|
+
},
|
|
170
|
+
children: jsxRuntime.jsx(material.CircularProgress, {})
|
|
171
|
+
})
|
|
164
172
|
});
|
|
165
173
|
}
|
|
166
174
|
if (isError) {
|
|
167
|
-
return jsxRuntime.jsx(
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
startIcon: jsxRuntime.jsx(iconsMaterial.Refresh, {}),
|
|
179
|
-
onClick: function onClick() {
|
|
180
|
-
return refetch();
|
|
181
|
-
},
|
|
182
|
-
children: intl$1.formatMessage({
|
|
183
|
-
id: 'runbox.common.retry'
|
|
184
|
-
})
|
|
185
|
-
}), typeof showMessenger === 'function' ? jsxRuntime.jsx(material.Button, {
|
|
186
|
-
variant: "outlined",
|
|
187
|
-
onClick: function onClick() {
|
|
188
|
-
return showMessenger();
|
|
189
|
-
},
|
|
175
|
+
return jsxRuntime.jsx(material.ThemeProvider, {
|
|
176
|
+
theme: theme.runboxLightTheme,
|
|
177
|
+
children: jsxRuntime.jsx(StyledRunboxContainer, {
|
|
178
|
+
sx: {
|
|
179
|
+
backgroundColor: 'background.paper',
|
|
180
|
+
color: 'text.primary'
|
|
181
|
+
},
|
|
182
|
+
children: jsxRuntime.jsxs(material.Stack, {
|
|
183
|
+
gap: "1.5rem",
|
|
184
|
+
children: [jsxRuntime.jsx(material.Typography, {
|
|
185
|
+
variant: "h6",
|
|
190
186
|
children: intl$1.formatMessage({
|
|
191
|
-
id: 'runbox.
|
|
187
|
+
id: 'runbox.runtime.message.startError'
|
|
192
188
|
})
|
|
193
|
-
})
|
|
194
|
-
|
|
189
|
+
}), jsxRuntime.jsxs(material.Stack, {
|
|
190
|
+
gap: "0.5rem",
|
|
191
|
+
children: [jsxRuntime.jsx(material.Button, {
|
|
192
|
+
startIcon: jsxRuntime.jsx(iconsMaterial.Refresh, {}),
|
|
193
|
+
onClick: function onClick() {
|
|
194
|
+
return refetch();
|
|
195
|
+
},
|
|
196
|
+
children: intl$1.formatMessage({
|
|
197
|
+
id: 'runbox.common.retry'
|
|
198
|
+
})
|
|
199
|
+
}), typeof showMessenger === 'function' ? jsxRuntime.jsx(material.Button, {
|
|
200
|
+
variant: "outlined",
|
|
201
|
+
onClick: function onClick() {
|
|
202
|
+
return showMessenger();
|
|
203
|
+
},
|
|
204
|
+
children: intl$1.formatMessage({
|
|
205
|
+
id: 'runbox.common.support'
|
|
206
|
+
})
|
|
207
|
+
}) : null]
|
|
208
|
+
})]
|
|
209
|
+
})
|
|
195
210
|
})
|
|
196
211
|
});
|
|
197
212
|
}
|
|
198
213
|
if (!enabledLxpPlan) {
|
|
199
|
-
return jsxRuntime.jsx(
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
214
|
+
return jsxRuntime.jsx(material.ThemeProvider, {
|
|
215
|
+
theme: theme.runboxLightTheme,
|
|
216
|
+
children: jsxRuntime.jsx(StyledRunboxContainer, {
|
|
217
|
+
sx: {
|
|
218
|
+
backgroundColor: 'background.paper',
|
|
219
|
+
color: 'text.primary'
|
|
220
|
+
},
|
|
221
|
+
children: jsxRuntime.jsxs(material.Stack, {
|
|
222
|
+
gap: "0.5rem",
|
|
223
|
+
textAlign: "center",
|
|
224
|
+
children: [jsxRuntime.jsx(material.Typography, {
|
|
225
|
+
variant: "h6",
|
|
226
|
+
color: "text.secondary",
|
|
227
|
+
children: intl$1.formatMessage({
|
|
228
|
+
id: 'runbox.runtime.message.runbox_unavailable'
|
|
229
|
+
})
|
|
230
|
+
}), jsxRuntime.jsx(material.Typography, {
|
|
231
|
+
variant: "body1",
|
|
232
|
+
whiteSpace: "pre-line",
|
|
233
|
+
color: "text.tertiary",
|
|
234
|
+
children: intl$1.formatMessage({
|
|
235
|
+
id: 'runbox.runtime.message.lxp_plan_required'
|
|
236
|
+
})
|
|
237
|
+
})]
|
|
238
|
+
})
|
|
222
239
|
})
|
|
223
240
|
});
|
|
224
241
|
}
|
|
@@ -277,28 +294,30 @@ var MaterialRunboxContent = function MaterialRunboxContent(_ref) {
|
|
|
277
294
|
},
|
|
278
295
|
onRunboxRefetchRequest: refetch,
|
|
279
296
|
children: jsxRuntime.jsx(StyledRunboxContainer, {
|
|
280
|
-
children: jsxRuntime.
|
|
297
|
+
children: jsxRuntime.jsx(muiXSnackbar.SnackbarProvider, {
|
|
281
298
|
domRoot: snackbarRoot !== null && snackbarRoot !== void 0 ? snackbarRoot : document.body,
|
|
282
299
|
classes: {
|
|
283
300
|
containerRoot: SNACKBAR_CONTAINER_CLASS
|
|
284
301
|
},
|
|
285
|
-
children:
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
+
children: jsxRuntime.jsxs(MaterialRunboxControlContext.default, Object.assign({}, props, {
|
|
303
|
+
children: [jsxRuntime.jsx(MaterialRunboxHeader.default, Object.assign({}, props, {
|
|
304
|
+
hideTimerPopover: hideTimerPopover
|
|
305
|
+
})), jsxRuntime.jsx(MaterialRunboxAlert.default, {
|
|
306
|
+
runbox: runbox,
|
|
307
|
+
courseId: courseId,
|
|
308
|
+
studentUserId: studentUserId,
|
|
309
|
+
userId: userId,
|
|
310
|
+
isTutoring: isTutoring
|
|
311
|
+
}), jsxRuntime.jsx(MaterialRunboxDiskUsageAlert.default, {
|
|
312
|
+
runtimeTemplateId: runtimeTemplate.id,
|
|
313
|
+
courseId: courseId,
|
|
314
|
+
userId: studentUserId
|
|
315
|
+
}), jsxRuntime.jsx(MaterialRunboxDiskUsageDialog.default, {
|
|
316
|
+
runboxId: runbox.id
|
|
317
|
+
}), jsxRuntime.jsx(MaterialRunboxBody.default, Object.assign({
|
|
318
|
+
setSnackbarRoot: setSnackbarRoot
|
|
319
|
+
}, props))]
|
|
320
|
+
}))
|
|
302
321
|
})
|
|
303
322
|
})
|
|
304
323
|
})
|
|
@@ -23,7 +23,6 @@ var MaterialRunboxApiContext = require('./contexts/MaterialRunboxApiContext.js')
|
|
|
23
23
|
var MaterialRunboxTimer = require('./timer/MaterialRunboxTimer.js');
|
|
24
24
|
var MaterialRunboxStatusButton = require('./status/MaterialRunboxStatusButton.js');
|
|
25
25
|
var useBreakpoint = require('../shared/hooks/useBreakpoint.js');
|
|
26
|
-
var useRunboxControl = require('./hooks/useRunboxControl.js');
|
|
27
26
|
|
|
28
27
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
29
28
|
|
|
@@ -71,16 +70,6 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref4) {
|
|
|
71
70
|
var _useEliceRunboxRunnin = runboxClient.useEliceRunboxRunning(),
|
|
72
71
|
status = _useEliceRunboxRunnin.status;
|
|
73
72
|
var isRunboxRunning = status === 'running';
|
|
74
|
-
var _useRunboxControl = useRunboxControl.useRunboxControl({
|
|
75
|
-
runbox: runbox,
|
|
76
|
-
runtime: runtime,
|
|
77
|
-
courseId: courseId,
|
|
78
|
-
refetch: refetch,
|
|
79
|
-
userId: userId,
|
|
80
|
-
studentUserId: studentUserId,
|
|
81
|
-
isTutoring: isTutoring
|
|
82
|
-
}),
|
|
83
|
-
stopRuntime = _useRunboxControl.stop;
|
|
84
73
|
//
|
|
85
74
|
var _useQuery = reactQuery.useQuery({
|
|
86
75
|
queryKey: ['getGlobalOrganizationGet', orgNameShort],
|
|
@@ -211,7 +200,6 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref4) {
|
|
|
211
200
|
studentUserId: studentUserId,
|
|
212
201
|
isTutoring: isTutoring,
|
|
213
202
|
enableAutoShutdown: enableAutoShutdown,
|
|
214
|
-
stopRuntime: stopRuntime,
|
|
215
203
|
menuAnchorEl: menuAnchorEl,
|
|
216
204
|
refetch: refetch,
|
|
217
205
|
handleMenuClose: handleMenuClose,
|
|
@@ -226,9 +214,7 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref4) {
|
|
|
226
214
|
if (isTutoring) {
|
|
227
215
|
return null;
|
|
228
216
|
}
|
|
229
|
-
return jsxRuntime.jsx(MaterialRunboxActionDisconnect.default, {
|
|
230
|
-
stopRuntime: stopRuntime
|
|
231
|
-
});
|
|
217
|
+
return jsxRuntime.jsx(MaterialRunboxActionDisconnect.default, {});
|
|
232
218
|
};
|
|
233
219
|
//
|
|
234
220
|
//
|
|
@@ -239,7 +225,6 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref4) {
|
|
|
239
225
|
runboxId: runbox.id,
|
|
240
226
|
userId: userId,
|
|
241
227
|
headerElement: headerRef.current,
|
|
242
|
-
stopRuntime: stopRuntime,
|
|
243
228
|
hideTimerPopover: hideTimerPopover,
|
|
244
229
|
isTutoring: isTutoring
|
|
245
230
|
}) : null, jsxRuntime.jsx(MaterialRunboxStatusButton.default, {
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
stopRuntime: () => Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
declare const MaterialRunboxActionDisconnect: React.FC<MaterialRunboxActionDisconnectProps>;
|
|
2
|
+
declare const MaterialRunboxActionDisconnect: React.FC;
|
|
6
3
|
export default MaterialRunboxActionDisconnect;
|
|
@@ -12,6 +12,7 @@ var proSolidSvgIcons = require('@fortawesome/pro-solid-svg-icons');
|
|
|
12
12
|
var material = require('@mui/material');
|
|
13
13
|
var MaterialRunboxActionDisconnectDialog = require('./MaterialRunboxActionDisconnectDialog.js');
|
|
14
14
|
var useBreakpoint = require('../../shared/hooks/useBreakpoint.js');
|
|
15
|
+
var MaterialRunboxControlContext = require('../contexts/MaterialRunboxControlContext.js');
|
|
15
16
|
|
|
16
17
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
17
18
|
|
|
@@ -20,14 +21,15 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
20
21
|
//
|
|
21
22
|
//
|
|
22
23
|
//
|
|
23
|
-
var MaterialRunboxActionDisconnect = function MaterialRunboxActionDisconnect(
|
|
24
|
-
var stopRuntime = _ref.stopRuntime;
|
|
24
|
+
var MaterialRunboxActionDisconnect = function MaterialRunboxActionDisconnect() {
|
|
25
25
|
var intl$1 = intl.useRawEliceIntl();
|
|
26
26
|
var isSmallTabletOrSmaller = useBreakpoint.useBreakpoint('md', 'down');
|
|
27
27
|
var isMobileOrSmaller = useBreakpoint.useBreakpoint('sm', 'down');
|
|
28
28
|
var _useEliceRunboxRunnin = runboxClient.useEliceRunboxRunning(),
|
|
29
29
|
status = _useEliceRunboxRunnin.status;
|
|
30
30
|
var isRunboxTerminated = status === 'terminated';
|
|
31
|
+
var _useMaterialRunboxCon = MaterialRunboxControlContext.useMaterialRunboxControlContext(),
|
|
32
|
+
stopRuntime = _useMaterialRunboxCon.stop;
|
|
31
33
|
var _React$useState = React__default.default.useState(false),
|
|
32
34
|
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
33
35
|
isDisconnectDialogOpen = _React$useState2[0],
|
|
@@ -1,6 +1,3 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
3
|
-
stopRuntime: () => Promise<void>;
|
|
4
|
-
}
|
|
5
|
-
declare const MaterialRunboxActionDisconnectMenuItem: React.FC<MaterialRunboxActionDisconnectMenuItemProps>;
|
|
2
|
+
declare const MaterialRunboxActionDisconnectMenuItem: React.FC;
|
|
6
3
|
export default MaterialRunboxActionDisconnectMenuItem;
|
|
@@ -12,6 +12,7 @@ var proSolidSvgIcons = require('@fortawesome/pro-solid-svg-icons');
|
|
|
12
12
|
var lab = require('@mui/lab');
|
|
13
13
|
var material = require('@mui/material');
|
|
14
14
|
var MaterialRunboxActionDisconnectDialog = require('./MaterialRunboxActionDisconnectDialog.js');
|
|
15
|
+
var MaterialRunboxControlContext = require('../contexts/MaterialRunboxControlContext.js');
|
|
15
16
|
|
|
16
17
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
17
18
|
|
|
@@ -20,44 +21,36 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
20
21
|
//
|
|
21
22
|
//
|
|
22
23
|
//
|
|
23
|
-
var MaterialRunboxActionDisconnectMenuItem = function MaterialRunboxActionDisconnectMenuItem(
|
|
24
|
-
var stopRuntime = _ref.stopRuntime;
|
|
24
|
+
var MaterialRunboxActionDisconnectMenuItem = function MaterialRunboxActionDisconnectMenuItem() {
|
|
25
25
|
var intl$1 = intl.useRawEliceIntl();
|
|
26
26
|
var _useEliceRunboxRunnin = runboxClient.useEliceRunboxRunning(),
|
|
27
27
|
status = _useEliceRunboxRunnin.status;
|
|
28
28
|
var isRunboxTerminated = status === 'terminated';
|
|
29
|
+
var _useMaterialRunboxCon = MaterialRunboxControlContext.useMaterialRunboxControlContext(),
|
|
30
|
+
stopRuntime = _useMaterialRunboxCon.stop,
|
|
31
|
+
isStopping = _useMaterialRunboxCon.isStopping;
|
|
29
32
|
var _React$useState = React__default.default.useState(false),
|
|
30
33
|
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
31
34
|
isDisconnectDialogOpen = _React$useState2[0],
|
|
32
35
|
setDisconnectDialogOpen = _React$useState2[1];
|
|
33
|
-
var _React$useState3 = React__default.default.useState(false),
|
|
34
|
-
_React$useState4 = _rollupPluginBabelHelpers.slicedToArray(_React$useState3, 2),
|
|
35
|
-
isStopRuntimeLoading = _React$useState4[0],
|
|
36
|
-
setStopRuntimeLoading = _React$useState4[1];
|
|
37
36
|
/**
|
|
38
37
|
*
|
|
39
38
|
*/
|
|
40
39
|
var handleConfirmDisconnect = /*#__PURE__*/function () {
|
|
41
|
-
var
|
|
40
|
+
var _ref = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee() {
|
|
42
41
|
return _rollupPluginBabelHelpers.regenerator().w(function (_context) {
|
|
43
|
-
while (1) switch (_context.
|
|
42
|
+
while (1) switch (_context.n) {
|
|
44
43
|
case 0:
|
|
45
44
|
setDisconnectDialogOpen(false);
|
|
46
|
-
|
|
47
|
-
_context.p = 1;
|
|
48
|
-
_context.n = 2;
|
|
45
|
+
_context.n = 1;
|
|
49
46
|
return stopRuntime();
|
|
50
|
-
case
|
|
51
|
-
_context.p = 2;
|
|
52
|
-
setStopRuntimeLoading(false);
|
|
53
|
-
return _context.f(2);
|
|
54
|
-
case 3:
|
|
47
|
+
case 1:
|
|
55
48
|
return _context.a(2);
|
|
56
49
|
}
|
|
57
|
-
}, _callee
|
|
50
|
+
}, _callee);
|
|
58
51
|
}));
|
|
59
52
|
return function handleConfirmDisconnect() {
|
|
60
|
-
return
|
|
53
|
+
return _ref.apply(this, arguments);
|
|
61
54
|
};
|
|
62
55
|
}();
|
|
63
56
|
//
|
|
@@ -65,9 +58,10 @@ var MaterialRunboxActionDisconnectMenuItem = function MaterialRunboxActionDiscon
|
|
|
65
58
|
//
|
|
66
59
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
67
60
|
children: [jsxRuntime.jsxs(material.MenuItem, {
|
|
61
|
+
fullWidth: true,
|
|
68
62
|
component: lab.LoadingButton,
|
|
69
63
|
color: "inherit",
|
|
70
|
-
loading:
|
|
64
|
+
loading: isStopping,
|
|
71
65
|
disabled: isRunboxTerminated,
|
|
72
66
|
onClick: function onClick() {
|
|
73
67
|
return setDisconnectDialogOpen(true);
|
|
@@ -4,7 +4,6 @@ type MaterialRunboxActionMenuProps = Pick<RuntimeProps, 'runbox' | 'runtime' | '
|
|
|
4
4
|
menuAnchorEl: null | HTMLButtonElement;
|
|
5
5
|
/** Whether the auto-shutdown toggle is available. Decided by the header. */
|
|
6
6
|
enableAutoShutdown?: boolean;
|
|
7
|
-
stopRuntime: () => Promise<void>;
|
|
8
7
|
handleMenuClose: () => void;
|
|
9
8
|
};
|
|
10
9
|
declare const MaterialRunboxActionMenu: React.FC<MaterialRunboxActionMenuProps>;
|
|
@@ -34,7 +34,6 @@ var MaterialRunboxActionMenu = function MaterialRunboxActionMenu(_ref) {
|
|
|
34
34
|
isTutoring = _ref.isTutoring,
|
|
35
35
|
_ref$enableAutoShutdo = _ref.enableAutoShutdown,
|
|
36
36
|
enableAutoShutdown = _ref$enableAutoShutdo === void 0 ? false : _ref$enableAutoShutdo,
|
|
37
|
-
stopRuntime = _ref.stopRuntime,
|
|
38
37
|
menuAnchorEl = _ref.menuAnchorEl,
|
|
39
38
|
refetch = _ref.refetch,
|
|
40
39
|
getAchievementColor = _ref.getAchievementColor,
|
|
@@ -116,12 +115,7 @@ var MaterialRunboxActionMenu = function MaterialRunboxActionMenu(_ref) {
|
|
|
116
115
|
}) : null, jsxRuntime.jsx(MaterialRunboxActionShare.default, {
|
|
117
116
|
handleMenuClose: handleMenuClose
|
|
118
117
|
}), jsxRuntime.jsx(MaterialRunboxActionRestart.default, {
|
|
119
|
-
runbox: runbox,
|
|
120
|
-
runtime: runtime,
|
|
121
|
-
courseId: courseId,
|
|
122
118
|
envMode: envMode,
|
|
123
|
-
studentUserId: studentUserId,
|
|
124
|
-
refetch: refetch,
|
|
125
119
|
handleMenuClose: handleMenuClose
|
|
126
120
|
}), isTutoring && studentUserId ? jsxRuntime.jsx(MaterialRunboxActionSubmitLog.default, {
|
|
127
121
|
runboxId: runbox === null || runbox === void 0 ? void 0 : runbox.id,
|
|
@@ -134,9 +128,7 @@ var MaterialRunboxActionMenu = function MaterialRunboxActionMenu(_ref) {
|
|
|
134
128
|
courseId: courseId,
|
|
135
129
|
envMode: envMode,
|
|
136
130
|
handleMenuClose: handleMenuClose
|
|
137
|
-
}), isMobileOrSmaller && !isTutoring ? jsxRuntime.jsx(MaterialRunboxActionDisconnectMenuItem.default, {
|
|
138
|
-
stopRuntime: stopRuntime
|
|
139
|
-
}) : null]
|
|
131
|
+
}), isMobileOrSmaller && !isTutoring ? jsxRuntime.jsx(MaterialRunboxActionDisconnectMenuItem.default, {}) : null]
|
|
140
132
|
});
|
|
141
133
|
};
|
|
142
134
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { enums } from '@elice/types';
|
|
3
|
-
|
|
4
|
-
type MaterialRunboxActionRestartProps = Pick<RuntimeProps, 'runbox' | 'runtime' | 'courseId' | 'refetch' | 'studentUserId'> & {
|
|
3
|
+
type MaterialRunboxActionRestartProps = {
|
|
5
4
|
envMode: enums.LeaderboardEnvModeType;
|
|
6
5
|
handleMenuClose: () => void;
|
|
7
6
|
};
|
|
@@ -11,7 +11,7 @@ var types = require('@elice/types');
|
|
|
11
11
|
var proSolidSvgIcons = require('@fortawesome/pro-solid-svg-icons');
|
|
12
12
|
var lab = require('@mui/lab');
|
|
13
13
|
var material = require('@mui/material');
|
|
14
|
-
var
|
|
14
|
+
var MaterialRunboxControlContext = require('../contexts/MaterialRunboxControlContext.js');
|
|
15
15
|
|
|
16
16
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
17
17
|
|
|
@@ -21,31 +21,16 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
21
21
|
//
|
|
22
22
|
//
|
|
23
23
|
var MaterialRunboxActionRestart = function MaterialRunboxActionRestart(_ref) {
|
|
24
|
-
var
|
|
25
|
-
runtime = _ref.runtime,
|
|
26
|
-
courseId = _ref.courseId,
|
|
27
|
-
refetch = _ref.refetch,
|
|
28
|
-
studentUserId = _ref.studentUserId,
|
|
29
|
-
envMode = _ref.envMode,
|
|
24
|
+
var envMode = _ref.envMode,
|
|
30
25
|
handleMenuClose = _ref.handleMenuClose;
|
|
31
26
|
var intl$1 = intl.useRawEliceIntl();
|
|
32
27
|
var _React$useState = React__default.default.useState(false),
|
|
33
28
|
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
setDialogOpened = _React$useState4[1];
|
|
40
|
-
// restart
|
|
41
|
-
var _useRunboxControl = useRunboxControl.useRunboxControl({
|
|
42
|
-
runbox: runbox,
|
|
43
|
-
runtime: runtime,
|
|
44
|
-
courseId: courseId,
|
|
45
|
-
refetch: refetch,
|
|
46
|
-
userId: studentUserId
|
|
47
|
-
}),
|
|
48
|
-
start = _useRunboxControl.start;
|
|
29
|
+
isDialogOpened = _React$useState2[0],
|
|
30
|
+
setDialogOpened = _React$useState2[1];
|
|
31
|
+
var _useMaterialRunboxCon = MaterialRunboxControlContext.useMaterialRunboxControlContext(),
|
|
32
|
+
start = _useMaterialRunboxCon.start,
|
|
33
|
+
isStarting = _useMaterialRunboxCon.isStarting;
|
|
49
34
|
/**
|
|
50
35
|
*
|
|
51
36
|
*/
|
|
@@ -56,7 +41,6 @@ var MaterialRunboxActionRestart = function MaterialRunboxActionRestart(_ref) {
|
|
|
56
41
|
*
|
|
57
42
|
*/
|
|
58
43
|
var handleRestartAction = function handleRestartAction() {
|
|
59
|
-
setIsLoading(true);
|
|
60
44
|
start({
|
|
61
45
|
force: true
|
|
62
46
|
})["catch"](function () {
|
|
@@ -64,7 +48,6 @@ var MaterialRunboxActionRestart = function MaterialRunboxActionRestart(_ref) {
|
|
|
64
48
|
})["finally"](function () {
|
|
65
49
|
handleDialogClose();
|
|
66
50
|
handleMenuClose();
|
|
67
|
-
setIsLoading(false);
|
|
68
51
|
});
|
|
69
52
|
};
|
|
70
53
|
/**
|
|
@@ -116,7 +99,7 @@ var MaterialRunboxActionRestart = function MaterialRunboxActionRestart(_ref) {
|
|
|
116
99
|
}), jsxRuntime.jsxs(material.DialogActions, {
|
|
117
100
|
children: [jsxRuntime.jsx(material.Button, {
|
|
118
101
|
color: "inherit",
|
|
119
|
-
disabled:
|
|
102
|
+
disabled: isStarting,
|
|
120
103
|
onClick: handleDialogClose,
|
|
121
104
|
children: intl$1.formatMessage({
|
|
122
105
|
id: 'runbox.common.close'
|
|
@@ -124,7 +107,7 @@ var MaterialRunboxActionRestart = function MaterialRunboxActionRestart(_ref) {
|
|
|
124
107
|
}), jsxRuntime.jsx(lab.LoadingButton, {
|
|
125
108
|
variant: "contained",
|
|
126
109
|
color: "warning",
|
|
127
|
-
loading:
|
|
110
|
+
loading: isStarting,
|
|
128
111
|
onClick: handleRestartAction,
|
|
129
112
|
children: intl$1.formatMessage({
|
|
130
113
|
id: 'runbox.action.restart.dialog.actions.confirm'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { UseRunboxControlProps, UseRunboxControlReturn } from '../hooks/useRunboxControl';
|
|
3
|
+
export type MaterialRunboxControlContextValue = UseRunboxControlReturn;
|
|
4
|
+
export interface MaterialRunboxControlContextProps extends UseRunboxControlProps {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const MaterialRunboxControlContext: React.Context<UseRunboxControlReturn>;
|
|
8
|
+
export declare const useMaterialRunboxControlContext: () => UseRunboxControlReturn;
|
|
9
|
+
/**
|
|
10
|
+
* Owns the single `useRunboxControl` instance for one runbox, so every consumer
|
|
11
|
+
* shares one abort controller and one pre-check result.
|
|
12
|
+
*/
|
|
13
|
+
declare const MaterialRunboxControlContextProvider: React.FC<MaterialRunboxControlContextProps>;
|
|
14
|
+
export default MaterialRunboxControlContextProvider;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var useRunboxControl = require('../hooks/useRunboxControl.js');
|
|
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
|
+
|
|
14
|
+
//
|
|
15
|
+
//
|
|
16
|
+
//
|
|
17
|
+
var MaterialRunboxControlContext = React__default.default.createContext({});
|
|
18
|
+
var useMaterialRunboxControlContext = function useMaterialRunboxControlContext() {
|
|
19
|
+
return React__default.default.useContext(MaterialRunboxControlContext);
|
|
20
|
+
};
|
|
21
|
+
//
|
|
22
|
+
//
|
|
23
|
+
//
|
|
24
|
+
/**
|
|
25
|
+
* Owns the single `useRunboxControl` instance for one runbox, so every consumer
|
|
26
|
+
* shares one abort controller and one pre-check result.
|
|
27
|
+
*/
|
|
28
|
+
var MaterialRunboxControlContextProvider = function MaterialRunboxControlContextProvider(_a) {
|
|
29
|
+
var children = _a.children,
|
|
30
|
+
props = tslib.__rest(_a, ["children"]);
|
|
31
|
+
var _useRunboxControl = useRunboxControl.useRunboxControl(props),
|
|
32
|
+
start = _useRunboxControl.start,
|
|
33
|
+
stop = _useRunboxControl.stop,
|
|
34
|
+
isStarting = _useRunboxControl.isStarting,
|
|
35
|
+
isStopping = _useRunboxControl.isStopping,
|
|
36
|
+
preCheckStatus = _useRunboxControl.preCheckStatus;
|
|
37
|
+
// The hook hands back one mutated ref, so a stable value would leave
|
|
38
|
+
// consumers reading stale fields once anything below here is memoized.
|
|
39
|
+
var value = React__default.default.useMemo(function () {
|
|
40
|
+
return {
|
|
41
|
+
start: start,
|
|
42
|
+
stop: stop,
|
|
43
|
+
isStarting: isStarting,
|
|
44
|
+
isStopping: isStopping,
|
|
45
|
+
preCheckStatus: preCheckStatus
|
|
46
|
+
};
|
|
47
|
+
}, [start, stop, isStarting, isStopping, preCheckStatus]);
|
|
48
|
+
return jsxRuntime.jsx(MaterialRunboxControlContext.Provider, {
|
|
49
|
+
children: children,
|
|
50
|
+
value: value
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
exports.MaterialRunboxControlContext = MaterialRunboxControlContext;
|
|
55
|
+
exports.default = MaterialRunboxControlContextProvider;
|
|
56
|
+
exports.useMaterialRunboxControlContext = useMaterialRunboxControlContext;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { default as MaterialRunboxApiContextProvider, MaterialRunboxApiContext, useMaterialRunboxApiContext, } from './MaterialRunboxApiContext';
|
|
2
2
|
export { default as MaterialRunboxCommandContextProvider, MaterialRunboxCommandContext, useMaterialRunboxCommandContext, } from './MaterialRunboxCommandContext';
|
|
3
|
+
export { default as MaterialRunboxControlContextProvider, MaterialRunboxControlContext, useMaterialRunboxControlContext, } from './MaterialRunboxControlContext';
|
|
3
4
|
export { default as MaterialRunboxContextProvider, MaterialRunboxContext, useMaterialRunboxContext, } from './MaterialRunboxContext';
|
|
4
5
|
export type { MaterialRunboxApiContextProps, MaterialRunboxApiContextValue, } from './MaterialRunboxApiContext';
|
|
5
6
|
export type { MaterialRunboxCommandContextProps, MaterialRunboxCommandContextValue, } from './MaterialRunboxCommandContext';
|
|
6
7
|
export type { MaterialRunboxContextProps, MaterialRunboxContextValue, } from './MaterialRunboxContext';
|
|
8
|
+
export type { MaterialRunboxControlContextProps, MaterialRunboxControlContextValue, } from './MaterialRunboxControlContext';
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var MaterialRunboxApiContext = require('./MaterialRunboxApiContext.js');
|
|
4
4
|
var MaterialRunboxCommandContext = require('./MaterialRunboxCommandContext.js');
|
|
5
|
+
var MaterialRunboxControlContext = require('./MaterialRunboxControlContext.js');
|
|
5
6
|
var MaterialRunboxContext = require('./MaterialRunboxContext.js');
|
|
6
7
|
|
|
7
8
|
|
|
@@ -12,6 +13,9 @@ exports.useMaterialRunboxApiContext = MaterialRunboxApiContext.useMaterialRunbox
|
|
|
12
13
|
exports.MaterialRunboxCommandContext = MaterialRunboxCommandContext.MaterialRunboxCommandContext;
|
|
13
14
|
exports.MaterialRunboxCommandContextProvider = MaterialRunboxCommandContext.default;
|
|
14
15
|
exports.useMaterialRunboxCommandContext = MaterialRunboxCommandContext.useMaterialRunboxCommandContext;
|
|
16
|
+
exports.MaterialRunboxControlContext = MaterialRunboxControlContext.MaterialRunboxControlContext;
|
|
17
|
+
exports.MaterialRunboxControlContextProvider = MaterialRunboxControlContext.default;
|
|
18
|
+
exports.useMaterialRunboxControlContext = MaterialRunboxControlContext.useMaterialRunboxControlContext;
|
|
15
19
|
exports.MaterialRunboxContext = MaterialRunboxContext.MaterialRunboxContext;
|
|
16
20
|
exports.MaterialRunboxContextProvider = MaterialRunboxContext.default;
|
|
17
21
|
exports.useMaterialRunboxContext = MaterialRunboxContext.useMaterialRunboxContext;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import type {
|
|
3
|
-
export interface MaterialRunboxEnvResetButtonProps extends Omit<
|
|
2
|
+
import type { LoadingButtonProps } from '@mui/lab';
|
|
3
|
+
export interface MaterialRunboxEnvResetButtonProps extends Omit<LoadingButtonProps, 'onClick' | 'loading'> {
|
|
4
4
|
runtimeTemplateId: string;
|
|
5
5
|
courseId: number;
|
|
6
6
|
userId?: number;
|