@elice/material-runbox 1.231212.0 → 1.231228.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/cjs/assets/queue.gif.js +1 -1
  2. package/cjs/assets/runbox_logo.png.js +1 -1
  3. package/cjs/assets/terminated.png.js +1 -1
  4. package/cjs/components/material-runbox/MaterialRunbox.js +17 -19
  5. package/cjs/components/material-runbox/MaterialRunboxBody.js +15 -12
  6. package/cjs/components/material-runbox/MaterialRunboxContent.js +94 -101
  7. package/cjs/components/material-runbox/MaterialRunboxFooter.js +17 -22
  8. package/cjs/components/material-runbox/MaterialRunboxHeader.d.ts +3 -0
  9. package/cjs/components/material-runbox/MaterialRunboxHeader.js +77 -81
  10. package/cjs/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +26 -22
  11. package/cjs/components/material-runbox/actions/MaterialRunboxActionGrade.js +140 -180
  12. package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.d.ts +8 -0
  13. package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.js +65 -0
  14. package/cjs/components/material-runbox/actions/MaterialRunboxActionReset.d.ts +3 -1
  15. package/cjs/components/material-runbox/actions/MaterialRunboxActionReset.js +73 -110
  16. package/cjs/components/material-runbox/actions/MaterialRunboxActionRestart.d.ts +3 -1
  17. package/cjs/components/material-runbox/actions/MaterialRunboxActionRestart.js +54 -70
  18. package/cjs/components/material-runbox/actions/MaterialRunboxActionShare.d.ts +4 -1
  19. package/cjs/components/material-runbox/actions/MaterialRunboxActionShare.js +67 -41
  20. package/cjs/components/material-runbox/contexts/MaterialRunboxApiContext.js +16 -27
  21. package/cjs/components/material-runbox/contexts/MaterialRunboxCommandContext.js +38 -53
  22. package/cjs/components/material-runbox/contexts/MaterialRunboxContext.js +9 -11
  23. package/cjs/components/material-runbox/hooks/useRunboxControl.js +39 -65
  24. package/cjs/components/material-runbox/locales/en.json.js +2 -2
  25. package/cjs/components/material-runbox/locales/index.js +2 -4
  26. package/cjs/components/material-runbox/locales/ko.json.js +2 -2
  27. package/cjs/components/material-runbox/runtime/Runtime.js +18 -26
  28. package/cjs/components/material-runbox/runtime/RuntimeOverlayAssigned.js +10 -17
  29. package/cjs/components/material-runbox/runtime/RuntimeOverlayQueued.js +16 -18
  30. package/cjs/components/material-runbox/runtime/RuntimeOverlayTerminated.js +27 -33
  31. package/cjs/index.js +1 -3
  32. package/es/components/material-runbox/MaterialRunbox.js +11 -9
  33. package/es/components/material-runbox/MaterialRunboxBody.js +13 -5
  34. package/es/components/material-runbox/MaterialRunboxContent.js +80 -82
  35. package/es/components/material-runbox/MaterialRunboxFooter.js +11 -11
  36. package/es/components/material-runbox/MaterialRunboxHeader.d.ts +3 -0
  37. package/es/components/material-runbox/MaterialRunboxHeader.js +72 -71
  38. package/es/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +22 -13
  39. package/es/components/material-runbox/actions/MaterialRunboxActionGrade.js +120 -155
  40. package/es/components/material-runbox/actions/MaterialRunboxActionMenu.d.ts +8 -0
  41. package/es/components/material-runbox/actions/MaterialRunboxActionMenu.js +61 -0
  42. package/es/components/material-runbox/actions/MaterialRunboxActionReset.d.ts +3 -1
  43. package/es/components/material-runbox/actions/MaterialRunboxActionReset.js +65 -98
  44. package/es/components/material-runbox/actions/MaterialRunboxActionRestart.d.ts +3 -1
  45. package/es/components/material-runbox/actions/MaterialRunboxActionRestart.js +47 -59
  46. package/es/components/material-runbox/actions/MaterialRunboxActionShare.d.ts +4 -1
  47. package/es/components/material-runbox/actions/MaterialRunboxActionShare.js +68 -38
  48. package/es/components/material-runbox/contexts/MaterialRunboxApiContext.js +13 -20
  49. package/es/components/material-runbox/contexts/MaterialRunboxCommandContext.js +35 -46
  50. package/es/components/material-runbox/contexts/MaterialRunboxContext.js +6 -4
  51. package/es/components/material-runbox/hooks/useRunboxControl.js +39 -63
  52. package/es/components/material-runbox/locales/en.json.js +1 -1
  53. package/es/components/material-runbox/locales/ko.json.js +1 -1
  54. package/es/components/material-runbox/runtime/Runtime.js +14 -18
  55. package/es/components/material-runbox/runtime/RuntimeOverlayAssigned.js +3 -6
  56. package/es/components/material-runbox/runtime/RuntimeOverlayQueued.js +6 -4
  57. package/es/components/material-runbox/runtime/RuntimeOverlayTerminated.js +12 -14
  58. package/package.json +13 -9
  59. package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -399
  60. package/es/_virtual/_rollupPluginBabelHelpers.js +0 -387
@@ -2,104 +2,89 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
6
5
  var React = require('react');
7
6
  var reactIntl = require('react-intl');
7
+ var muiXSnackbar = require('@elice/mui-x-snackbar');
8
8
  var openapiClientMaterialRunbox = require('@elice/openapi-client-material-runbox');
9
- var notistack = require('notistack');
10
9
  var rxjs = require('rxjs');
11
10
  var operators = require('rxjs/operators');
12
11
  var MaterialRunboxApiContext = require('./MaterialRunboxApiContext.js');
13
12
 
14
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
-
16
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
17
-
18
13
  //
19
14
  //
20
15
  //
21
- var PING_INTERVAL = 2000;
22
- 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)
23
- var PING_MAX_TRY_COUNT = PING_MAX_TRY_SECOND * 1000 / PING_INTERVAL;
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;
24
19
  //
25
20
  //
26
21
  //
27
- var MaterialRunboxCommandContext = React__default["default"].createContext({});
28
- var useMaterialRunboxCommandContext = function useMaterialRunboxCommandContext() {
29
- return React__default["default"].useContext(MaterialRunboxCommandContext);
22
+ const MaterialRunboxCommandContext = React.createContext({});
23
+ const useMaterialRunboxCommandContext = () => {
24
+ return React.useContext(MaterialRunboxCommandContext);
30
25
  };
31
26
  //
32
27
  //
33
28
  //
34
- var MaterialRunboxCommandContextProvider = function MaterialRunboxCommandContextProvider(_ref) {
35
- var children = _ref.children,
36
- runtime = _ref.runtime,
37
- courseId = _ref.courseId;
38
- var _useSnackbar = notistack.useSnackbar(),
39
- enqueueSnackbar = _useSnackbar.enqueueSnackbar;
40
- var intl = reactIntl.useIntl();
41
- var runtimeId = runtime === null || runtime === void 0 ? void 0 : runtime.id;
42
- var materialRunboxApi = MaterialRunboxApiContext.useMaterialRunboxApiContext();
43
- var _React$useState = React__default["default"].useState(null),
44
- _React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
45
- pcmdId = _React$useState2[0],
46
- setPcmdId = _React$useState2[1]; // Ping Command ID
47
- var _React$useState3 = React__default["default"].useState(null),
48
- _React$useState4 = _rollupPluginBabelHelpers.slicedToArray(_React$useState3, 2),
49
- lastCommand = _React$useState4[0],
50
- setLastCommand = _React$useState4[1];
29
+ const MaterialRunboxCommandContextProvider = ({
30
+ children,
31
+ runtime,
32
+ courseId
33
+ }) => {
34
+ const intl = reactIntl.useIntl();
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);
51
42
  //
52
43
  // check whether running command exists or not on mount,
53
44
  // if running command exists, set `pcmdId` to start pinging
54
45
  //
55
- React__default["default"].useEffect(function () {
46
+ React.useEffect(() => {
56
47
  if (!runtimeId) {
57
48
  return;
58
49
  }
59
50
  materialRunboxApi.runtime.runtimeRuntimeIdCommandGet({
60
- runtimeId: runtimeId,
51
+ runtimeId,
61
52
  eliceCourseId: courseId
62
- }).then(function (res) {
53
+ }).then(res => {
63
54
  if (res.status !== openapiClientMaterialRunbox.CommandStatus.Terminated) {
64
55
  setLastCommand(res);
65
56
  setPcmdId(res.runboxCommandId);
66
57
  }
67
- }).catch(function () {
68
- return void 0;
69
- });
58
+ }).catch(() => void 0);
70
59
  },
71
60
  // eslint-disable-next-line react-hooks/exhaustive-deps
72
61
  [runtimeId, courseId]);
73
62
  //
74
63
  // ping command
75
64
  //
76
- React__default["default"].useEffect(function () {
65
+ React.useEffect(() => {
77
66
  if (!pcmdId || !runtimeId) {
78
67
  return;
79
68
  }
80
- var _pingobj = {};
81
- var subscription = rxjs.timer(0, PING_INTERVAL).pipe(operators.take(PING_MAX_TRY_COUNT), operators.switchMap(function () {
82
- return materialRunboxApi.runtime.runtimeRuntimeIdCommandGet({
83
- runtimeId: runtimeId,
84
- eliceCourseId: courseId
85
- });
86
- }), operators.takeWhile(function (res) {
87
- return res.status !== openapiClientMaterialRunbox.CommandStatus.Terminated;
88
- }, true)).subscribe({
89
- 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 => {
90
75
  _pingobj.res = res;
91
76
  setLastCommand(res);
92
77
  },
93
- error: function error() {
78
+ error: () => {
94
79
  enqueueSnackbar(intl.formatMessage({
95
80
  id: 'runbox.context.command.ping.error'
96
81
  }), {
97
82
  variant: 'error'
98
83
  });
99
84
  },
100
- complete: function complete() {
85
+ complete: () => {
101
86
  setPcmdId(null); // empty `pcmdId` to stop pinging
102
- var hasError = !_pingobj.res ||
87
+ const hasError = !_pingobj.res ||
103
88
  // max try count reached, but command is still running
104
89
  _pingobj.res.status !== openapiClientMaterialRunbox.CommandStatus.Terminated;
105
90
  if (hasError) {
@@ -112,7 +97,7 @@ var MaterialRunboxCommandContextProvider = function MaterialRunboxCommandContext
112
97
  }
113
98
  }
114
99
  });
115
- return function () {
100
+ return () => {
116
101
  subscription.unsubscribe();
117
102
  };
118
103
  },
@@ -121,10 +106,10 @@ var MaterialRunboxCommandContextProvider = function MaterialRunboxCommandContext
121
106
  //
122
107
  //
123
108
  //
124
- return React__default["default"].createElement(MaterialRunboxCommandContext.Provider, {
109
+ return React.createElement(MaterialRunboxCommandContext.Provider, {
125
110
  children: children,
126
111
  value: {
127
- lastCommand: lastCommand,
112
+ lastCommand,
128
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),
129
114
  setCommandIdToPing: setPcmdId
130
115
  }
@@ -132,5 +117,5 @@ var MaterialRunboxCommandContextProvider = function MaterialRunboxCommandContext
132
117
  };
133
118
 
134
119
  exports.MaterialRunboxCommandContext = MaterialRunboxCommandContext;
135
- exports["default"] = MaterialRunboxCommandContextProvider;
120
+ exports.default = MaterialRunboxCommandContextProvider;
136
121
  exports.useMaterialRunboxCommandContext = useMaterialRunboxCommandContext;
@@ -5,29 +5,27 @@ Object.defineProperty(exports, '__esModule', { value: true });
5
5
  var tslib = require('tslib');
6
6
  var React = require('react');
7
7
 
8
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
-
10
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
11
-
12
8
  //
13
9
  //
14
10
  //
15
- var MaterialRunboxContext = React__default["default"].createContext({});
16
- var useMaterialRunboxContext = function useMaterialRunboxContext() {
17
- return React__default["default"].useContext(MaterialRunboxContext);
11
+ const MaterialRunboxContext = React.createContext({});
12
+ const useMaterialRunboxContext = () => {
13
+ return React.useContext(MaterialRunboxContext);
18
14
  };
19
15
  //
20
16
  //
21
17
  //
22
- var MaterialRunboxContextProvider = function MaterialRunboxContextProvider(_a) {
23
- var children = _a.children,
18
+ const MaterialRunboxContextProvider = _a => {
19
+ var {
20
+ children
21
+ } = _a,
24
22
  props = tslib.__rest(_a, ["children"]);
25
- return React__default["default"].createElement(MaterialRunboxContext.Provider, {
23
+ return React.createElement(MaterialRunboxContext.Provider, {
26
24
  children: children,
27
25
  value: props
28
26
  });
29
27
  };
30
28
 
31
29
  exports.MaterialRunboxContext = MaterialRunboxContext;
32
- exports["default"] = MaterialRunboxContextProvider;
30
+ exports.default = MaterialRunboxContextProvider;
33
31
  exports.useMaterialRunboxContext = useMaterialRunboxContext;
@@ -1,12 +1,9 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
- var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
6
3
  var React = require('react');
7
4
  var reactIntl = require('react-intl');
5
+ var muiXSnackbar = require('@elice/mui-x-snackbar');
8
6
  var runboxClient = require('@elice/runbox-client');
9
- var notistack = require('notistack');
10
7
  var MaterialRunboxApiContext = require('../contexts/MaterialRunboxApiContext.js');
11
8
  require('../contexts/MaterialRunboxCommandContext.js');
12
9
  require('../contexts/MaterialRunboxContext.js');
@@ -17,76 +14,53 @@ require('../contexts/MaterialRunboxContext.js');
17
14
  /**
18
15
  * Hook for runbox control and status.
19
16
  */
20
- var useRunboxControl = function useRunboxControl(props) {
21
- var _return = React.useRef({});
22
- var intl = reactIntl.useIntl();
23
- var _useSnackbar = notistack.useSnackbar(),
24
- enqueueSnackbar = _useSnackbar.enqueueSnackbar;
25
- var materialRunboxApi = MaterialRunboxApiContext.useMaterialRunboxApiContext();
26
- var _useEliceRunboxRunnin = runboxClient.useEliceRunboxRunning(),
27
- runboxStart = _useEliceRunboxRunnin.start,
28
- runboxStop = _useEliceRunboxRunnin.stop;
17
+ const useRunboxControl = props => {
18
+ const _return = React.useRef({});
19
+ const intl = reactIntl.useIntl();
20
+ const {
21
+ enqueueSnackbar
22
+ } = muiXSnackbar.useSnackbar();
23
+ const materialRunboxApi = MaterialRunboxApiContext.useMaterialRunboxApiContext();
24
+ const {
25
+ start: runboxStart,
26
+ stop: runboxStop
27
+ } = runboxClient.useEliceRunboxRunning();
29
28
  /**
30
29
  * Start project.
31
30
  */
32
- var start = React.useCallback( /*#__PURE__*/_rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee() {
33
- var force,
34
- _args = arguments;
35
- return _rollupPluginBabelHelpers.regeneratorRuntime().wrap(function _callee$(_context) {
36
- while (1) switch (_context.prev = _context.next) {
37
- case 0:
38
- force = _args.length > 0 && _args[0] !== undefined ? _args[0] : false;
39
- return _context.abrupt("return", runboxStart(function (signal) {
40
- return materialRunboxApi.runbox.runboxRunboxIdStartPost({
41
- runboxId: props.runbox.id,
42
- eliceCourseId: props.courseId
43
- }, {
44
- signal: signal
45
- });
46
- }, force).then(function () {
47
- return void props.refetch();
48
- }).catch(function (err) {
49
- if (err.name !== 'AbortError') {
50
- enqueueSnackbar(intl.formatMessage({
51
- id: 'runbox.runtime.message.startError'
52
- }), {
53
- variant: 'error'
54
- });
55
- }
56
- }));
57
- case 2:
58
- case "end":
59
- 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.formatMessage({
40
+ id: 'runbox.runtime.message.startError'
41
+ }), {
42
+ variant: 'error'
43
+ });
60
44
  }
61
- }, _callee);
62
- })),
45
+ });
46
+ },
63
47
  // eslint-disable-next-line react-hooks/exhaustive-deps
64
48
  [props.runbox.id, props.courseId, runboxStart]);
65
49
  /**
66
50
  * Stop project.
67
51
  */
68
- var stop = React.useCallback( /*#__PURE__*/_rollupPluginBabelHelpers.asyncToGenerator( /*#__PURE__*/_rollupPluginBabelHelpers.regeneratorRuntime().mark(function _callee2() {
69
- return _rollupPluginBabelHelpers.regeneratorRuntime().wrap(function _callee2$(_context2) {
70
- while (1) switch (_context2.prev = _context2.next) {
71
- case 0:
72
- return _context2.abrupt("return", runboxStop(function (signal) {
73
- return materialRunboxApi.runbox.runboxRunboxIdStopPost({
74
- runboxId: props.runbox.id,
75
- eliceCourseId: props.courseId
76
- }, {
77
- signal: signal
78
- });
79
- }).then(function () {
80
- //
81
- }).catch(function (err) {
82
- if (err.name !== 'AbortError') ;
83
- }));
84
- case 1:
85
- case "end":
86
- return _context2.stop();
87
- }
88
- }, _callee2);
89
- })),
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
+ },
90
64
  // eslint-disable-next-line react-hooks/exhaustive-deps
91
65
  [props.runbox.id, props.courseId, runboxStop]);
92
66
  //
@@ -2,6 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var en = {"runbox.action.autoShutdown.title":"Always on","runbox.action.autoShutdown.tooltip.disabled":"This runtime automatically shuts down after {time}, which is set as the per-session usage time.","runbox.action.autoShutdown.tooltip.enabled":"If set to always on, the runtime will not shut down even if you leave the learning material. However, it will automatically shut down after {time}, which is set as the session-specific usage time of the runtime.","runbox.action.grade.dialog.description.error":"An error occurred while grading the code.","runbox.action.grade.dialog.description.success":"Grading completed successfully.","runbox.action.grade.dialog.title":"Grading result","runbox.action.grade.noti.error":"An error occurred while grading the code.","runbox.action.grade.title":"Submit","runbox.action.grade.tooltip.onProgress":"Grading is in progress. Please wait for a moment. Depending on the material, grading may take up to 3 minutes.","runbox.action.reset.dialog.actions.confirm":"Reset","runbox.action.reset.dialog.description":"Are you sure you want to reset the runbox code? Your codes will be overwritten to default code of material.\nAfter reset, the runbox session will be refreshed.","runbox.action.reset.noti.error":"An error occurred while initializing the runbox code.","runbox.action.reset.title":"Reset code","runbox.action.restart.dialog.actions.confirm":"Restart","runbox.action.restart.dialog.description":"Are you sure you want to restart the runbox?","runbox.action.restart.title":"Restart runbox","runbox.action.share.title":"Share runbox URL","runbox.action.share.tooltip.copied":"Runbox URL copied to clipboard.","runbox.action.submitCountInfo.dialog.title":"Limit the number of submissions","runbox.action.submitCountInfo.dialog.description":"You have exceeded the submission count limit","runbox.action.submitCountInfo.tooltip.disabled":"The submission count has been used up","runbox.common.close":"Close","runbox.common.retry":"Retry","runbox.common.support":"Support","runbox.context.command.ping.error":"An error occurred while processing task.","runbox.runtime.message.startError":"There was an error starting the runbox.","runbox.runtime.overlay.assigned.description":"(3 of 3)\nRunbox is running.\nPlease wait!","runbox.runtime.overlay.assigned.description_timeout":"(3 of 3)\nRunning the runbox is taking longer than we expected.\nPlease wait a little longer without refreshing!","runbox.runtime.overlay.queued.description":"(2 of 3)\nCurrently queued {waiters} times...","runbox.runtime.overlay.queued.description_zero":"(2 of 3)\nRunbox will run soon","runbox.runtime.overlay.terminated.description.default":"The runtime terminated due to an unexpected problem.\nClick the button below to reconnect to the runbox.","runbox.runtime.overlay.terminated.description.general":"The runtime connected to the runbox has ended.\nTo reconnect to the runbox, click the button below.","runbox.runtime.overlay.terminated.description.os_disk_is_full":"Runtime has ended because the disk is full.\nIf you have recently deleted a runbox, it may take some time to reflect.","runbox.runtime.overlay.terminated.description.quota_exceeded":"The runtime has ended because the runtime has expired.","runbox.runtime.overlay.terminated.description.quota_per_session_exceeded":"Runbox has been running for 24 hours and the runtime has ended.\nTo reconnect to the runbox, click the button below.","runbox.runtime.overlay.terminated.description.unexpected":"If the problem persists, please contact customer service.","runbox.runtime.overlay.terminated.restart":"Reconnect","runbox.runtime.overlay.terminated.title":"Runtime disconnected","runbox.header.submitInfo":"Team submission count | {remainCount}/{totalCount} times remaining"};
5
+ var en = {"runbox.action.autoShutdown.title":"Always on","runbox.action.autoShutdown.tooltip.disabled":"This runtime automatically shuts down after {time}, which is set as the per-session usage time.","runbox.action.autoShutdown.tooltip.enabled":"If set to always on, the runtime will not shut down even if you leave the learning material. However, it will automatically shut down after {time}, which is set as the session-specific usage time of the runtime.","runbox.action.grade.dialog.description.error":"An error occurred while grading the code.","runbox.action.grade.dialog.description.success":"Grading completed successfully.","runbox.action.grade.dialog.title":"Grading result","runbox.action.grade.noti.error":"An error occurred while grading the code.","runbox.action.grade.title":"Submit","runbox.action.grade.tooltip.onProgress":"Grading is in progress. Please wait for a moment. Depending on the material, grading may take up to 3 minutes.","runbox.action.reset.dialog.actions.confirm":"Reset","runbox.action.reset.dialog.description":"Are you sure you want to reset the runbox code? Your codes will be overwritten to default code of material.\nAfter reset, the runbox session will be refreshed.","runbox.action.reset.noti.error":"An error occurred while initializing the runbox code.","runbox.action.reset.title":"Reset code","runbox.action.restart.dialog.actions.confirm":"Restart","runbox.action.restart.dialog.description":"Are you sure you want to restart the runbox?","runbox.action.restart.title":"Restart runbox","runbox.action.share.title":"Share runbox URL","runbox.action.share.snackbar.copied.fail":"Copying the runbox URL failed, please try again","runbox.action.share.snackbar.copied.success":"The runbox URL was copied successfully.","runbox.action.submitCountInfo.dialog.title":"Limit the number of submissions","runbox.action.submitCountInfo.dialog.description":"You have exceeded the submission count limit","runbox.action.submitCountInfo.tooltip.disabled":"The submission count has been used up","runbox.common.close":"Close","runbox.common.retry":"Retry","runbox.common.support":"Support","runbox.context.command.ping.error":"An error occurred while processing task.","runbox.runtime.message.startError":"There was an error starting the runbox.","runbox.runtime.overlay.assigned.description":"(3 of 3)\nRunbox is running.\nPlease wait!","runbox.runtime.overlay.assigned.description_timeout":"(3 of 3)\nRunning the runbox is taking longer than we expected.\nPlease wait a little longer without refreshing!","runbox.runtime.overlay.queued.description":"(2 of 3)\nCurrently queued {waiters} times...","runbox.runtime.overlay.queued.description_zero":"(2 of 3)\nRunbox will run soon","runbox.runtime.overlay.terminated.description.default":"The runtime terminated due to an unexpected problem.\nClick the button below to reconnect to the runbox.","runbox.runtime.overlay.terminated.description.general":"The runtime connected to the runbox has ended.\nTo reconnect to the runbox, click the button below.","runbox.runtime.overlay.terminated.description.os_disk_is_full":"Runtime has ended because the disk is full.\nIf you have recently deleted a runbox, it may take some time to reflect.","runbox.runtime.overlay.terminated.description.quota_exceeded":"The runtime has ended because the runtime has expired.","runbox.runtime.overlay.terminated.description.quota_per_session_exceeded":"Runbox has been running for 24 hours and the runtime has ended.\nTo reconnect to the runbox, click the button below.","runbox.runtime.overlay.terminated.description.unexpected":"If the problem persists, please contact customer service.","runbox.runtime.overlay.terminated.restart":"Reconnect","runbox.runtime.overlay.terminated.title":"Runtime disconnected","runbox.header.submitInfo":"Team submission count | {remainCount}/{totalCount} times remaining"};
6
6
 
7
- exports["default"] = en;
7
+ exports.default = en;
@@ -1,11 +1,9 @@
1
1
  'use strict';
2
2
 
3
- Object.defineProperty(exports, '__esModule', { value: true });
4
-
5
3
  var en = require('./en.json.js');
6
4
  var ko = require('./ko.json.js');
7
5
 
8
6
 
9
7
 
10
- exports.en = en["default"];
11
- exports.ko = ko["default"];
8
+ exports.en = en.default;
9
+ exports.ko = ko.default;
@@ -2,6 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var ko = {"runbox.action.autoShutdown.title":"항상 켜두기","runbox.action.autoShutdown.tooltip.disabled":"해당 런타임은 세션별 사용 시간으로 설정된 {time}이 지나면 자동으로 종료됩니다.","runbox.action.autoShutdown.tooltip.enabled":"항상 켜두기를 설정하면 학습 자료 밖으로 나가도 런타임이 종료되지 않습니다. 다만, 해당 런타임의 세션별 사용 시간으로 설정된 {time}이 지나면 자동으로 종료됩니다.","runbox.action.grade.dialog.description.error":"채점 중에 오류가 발생했습니다.","runbox.action.grade.dialog.description.success":"채점이 완료되었습니다.","runbox.action.grade.dialog.title":"채점 결과","runbox.action.grade.noti.error":"코드를 채점하는 도중 오류가 발생했습니다.","runbox.action.grade.title":"제출","runbox.action.grade.tooltip.onProgress":"코드 채점이 진행 중 입니다. 잠시만 기다려 주세요. 실습에 따라 채점이 최대 3분까지 소요될 수 있습니다.","runbox.action.reset.dialog.actions.confirm":"초기화","runbox.action.reset.dialog.description":"런박스 코드를 초기화하시겠습니까? 초기화 시 학습자료의 코드가 기본 코드로 덮어씌워집니다.\n초기화 이후 런박스 세션이 새로고침 됩니다.","runbox.action.reset.noti.error":"런박스 코드를 초기화 하는 중에 오류가 발생했습니다.","runbox.action.reset.title":"코드 초기화","runbox.action.restart.dialog.actions.confirm":"재시작","runbox.action.restart.dialog.description":"런박스를 재시작 하시겠습니까?","runbox.action.restart.title":"런박스 재시작","runbox.action.share.title":"런박스 URL 복사","runbox.action.share.tooltip.copied":"런박스 URL을 복사하였습니다.","runbox.action.submitCountInfo.dialog.title":"제출 횟수 제한","runbox.action.submitCountInfo.dialog.description":"제출 횟수 제한을 초과했습니다.","runbox.action.submitCountInfo.tooltip.disabled":"제출 횟수를 모두 사용했습니다.","runbox.common.close":"닫기","runbox.common.retry":"재시도","runbox.common.support":"고객센터","runbox.context.command.ping.error":"런박스 작업을 수행하는 도중 오류가 발생했습니다.","runbox.runtime.message.startError":"런박스를 시작하는 중에 오류가 발생했습니다.","runbox.runtime.overlay.assigned.description":"(3 / 3)\n런박스가 실행 중입니다.\n잠시만 기다려주세요!","runbox.runtime.overlay.assigned.description_timeout":"(3 / 3)\n런박스를 실행하는데\n예상보다 시간이 소요되고 있습니다.\n새로고침하지 말고 조금만 더 기다려주세요!","runbox.runtime.overlay.queued.description":"(2 / 3)\n현재 {waiters}번째 대기 중입니다...","runbox.runtime.overlay.queued.description_zero":"(2 / 3)\n곧 런박스가 실행됩니다","runbox.runtime.overlay.terminated.description.default":"예상치 못한 문제로 런타임이 종료되었습니다.\n런박스를 재접속하려면 아래 버튼을 눌러주세요.","runbox.runtime.overlay.terminated.description.general":"런박스에 연결된 런타임이 종료되었습니다.\n런박스를 재접속하려면 아래 버튼을 눌러주세요.","runbox.runtime.overlay.terminated.description.os_disk_is_full":"디스크가 가득 차서 런타임이 종료되었습니다.\n최근 런박스를 삭제하셨다면 반영까지 시간이 소요될 수 있습니다.","runbox.runtime.overlay.terminated.description.quota_exceeded":"런타임 사용시간이 만료되어 런타임이 종료되었습니다.","runbox.runtime.overlay.terminated.description.quota_per_session_exceeded":"런박스를 실행한지 24시간이 경과하여 런타임이 종료되었습니다.\n런박스를 재접속하려면 아래 버튼을 눌러주세요.","runbox.runtime.overlay.terminated.description.unexpected":"문제가 지속되면 고객센터에 문의해주세요.","runbox.runtime.overlay.terminated.restart":"재접속","runbox.runtime.overlay.terminated.title":"런타임 연결 해제됨","runbox.header.submitInfo":"팀 제출 횟수 | {remainCount}/{totalCount}회 남음"};
5
+ var ko = {"runbox.action.autoShutdown.title":"항상 켜두기","runbox.action.autoShutdown.tooltip.disabled":"해당 런타임은 세션별 사용 시간으로 설정된 {time}이 지나면 자동으로 종료됩니다.","runbox.action.autoShutdown.tooltip.enabled":"항상 켜두기를 설정하면 학습 자료 밖으로 나가도 런타임이 종료되지 않습니다. 다만, 해당 런타임의 세션별 사용 시간으로 설정된 {time}이 지나면 자동으로 종료됩니다.","runbox.action.grade.dialog.description.error":"채점 중에 오류가 발생했습니다.","runbox.action.grade.dialog.description.success":"채점이 완료되었습니다.","runbox.action.grade.dialog.title":"채점 결과","runbox.action.grade.noti.error":"코드를 채점하는 도중 오류가 발생했습니다.","runbox.action.grade.title":"제출","runbox.action.grade.tooltip.onProgress":"코드 채점이 진행 중 입니다. 잠시만 기다려 주세요. 실습에 따라 채점이 최대 3분까지 소요될 수 있습니다.","runbox.action.reset.dialog.actions.confirm":"초기화","runbox.action.reset.dialog.description":"런박스 코드를 초기화하시겠습니까? 초기화 시 학습자료의 코드가 기본 코드로 덮어씌워집니다.\n초기화 이후 런박스 세션이 새로고침 됩니다.","runbox.action.reset.noti.error":"런박스 코드를 초기화 하는 중에 오류가 발생했습니다.","runbox.action.reset.title":"코드 초기화","runbox.action.restart.dialog.actions.confirm":"재시작","runbox.action.restart.dialog.description":"런박스를 재시작 하시겠습니까?","runbox.action.restart.title":"런박스 재시작","runbox.action.share.title":"런박스 URL 복사","runbox.action.share.snackbar.copied.fail":"런박스 URL을 복사에 실패했습니다. 다시 시도해주세요.","runbox.action.share.snackbar.copied.success":"런박스 URL을 복사하였습니다.","runbox.action.submitCountInfo.dialog.title":"제출 횟수 제한","runbox.action.submitCountInfo.dialog.description":"제출 횟수 제한을 초과했습니다.","runbox.action.submitCountInfo.tooltip.disabled":"제출 횟수를 모두 사용했습니다.","runbox.common.close":"닫기","runbox.common.retry":"재시도","runbox.common.support":"고객센터","runbox.context.command.ping.error":"런박스 작업을 수행하는 도중 오류가 발생했습니다.","runbox.runtime.message.startError":"런박스를 시작하는 중에 오류가 발생했습니다.","runbox.runtime.overlay.assigned.description":"(3 / 3)\n런박스가 실행 중입니다.\n잠시만 기다려주세요!","runbox.runtime.overlay.assigned.description_timeout":"(3 / 3)\n런박스를 실행하는데\n예상보다 시간이 소요되고 있습니다.\n새로고침하지 말고 조금만 더 기다려주세요!","runbox.runtime.overlay.queued.description":"(2 / 3)\n현재 {waiters}번째 대기 중입니다...","runbox.runtime.overlay.queued.description_zero":"(2 / 3)\n곧 런박스가 실행됩니다","runbox.runtime.overlay.terminated.description.default":"예상치 못한 문제로 런타임이 종료되었습니다.\n런박스를 재접속하려면 아래 버튼을 눌러주세요.","runbox.runtime.overlay.terminated.description.general":"런박스에 연결된 런타임이 종료되었습니다.\n런박스를 재접속하려면 아래 버튼을 눌러주세요.","runbox.runtime.overlay.terminated.description.os_disk_is_full":"디스크가 가득 차서 런타임이 종료되었습니다.\n최근 런박스를 삭제하셨다면 반영까지 시간이 소요될 수 있습니다.","runbox.runtime.overlay.terminated.description.quota_exceeded":"런타임 사용시간이 만료되어 런타임이 종료되었습니다.","runbox.runtime.overlay.terminated.description.quota_per_session_exceeded":"런박스를 실행한지 24시간이 경과하여 런타임이 종료되었습니다.\n런박스를 재접속하려면 아래 버튼을 눌러주세요.","runbox.runtime.overlay.terminated.description.unexpected":"문제가 지속되면 고객센터에 문의해주세요.","runbox.runtime.overlay.terminated.restart":"재접속","runbox.runtime.overlay.terminated.title":"런타임 연결 해제됨","runbox.header.submitInfo":"팀 제출 횟수 | {remainCount}/{totalCount}회 남음"};
6
6
 
7
- exports["default"] = ko;
7
+ exports.default = ko;
@@ -2,7 +2,6 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
6
5
  var React = require('react');
7
6
  var openapiClientMaterialRunbox = require('@elice/openapi-client-material-runbox');
8
7
  var runboxClient = require('@elice/runbox-client');
@@ -14,27 +13,22 @@ var RuntimeOverlayAssigned = require('./RuntimeOverlayAssigned.js');
14
13
  var RuntimeOverlayQueued = require('./RuntimeOverlayQueued.js');
15
14
  var RuntimeOverlayTerminated = require('./RuntimeOverlayTerminated.js');
16
15
 
17
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
18
-
19
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
20
-
21
16
  //
22
17
  //
23
18
  //
24
- var Runtime = function Runtime(props) {
25
- var _useMaterialRunboxCom = MaterialRunboxCommandContext.useMaterialRunboxCommandContext(),
26
- isLastCommandRunning = _useMaterialRunboxCom.isLastCommandRunning,
27
- lastCommand = _useMaterialRunboxCom.lastCommand;
28
- var _useRunboxControl = useRunboxControl.useRunboxControl(props),
29
- startRuntime = _useRunboxControl.start;
30
- var _React$useState = React__default["default"].useState(0),
31
- _React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
32
- viewRefreshTrigger = _React$useState2[0],
33
- 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);
34
28
  //
35
29
  //
36
30
  //
37
- React__default["default"].useEffect(function () {
31
+ React.useEffect(() => {
38
32
  if (!props.runbox.id) {
39
33
  return;
40
34
  }
@@ -55,7 +49,7 @@ var Runtime = function Runtime(props) {
55
49
  //
56
50
  // refresh view when `ProjectFileReset` command done.
57
51
  //
58
- React__default["default"].useEffect(function () {
52
+ React.useEffect(() => {
59
53
  if (isLastCommandRunning || !lastCommand) {
60
54
  return;
61
55
  }
@@ -71,16 +65,14 @@ var Runtime = function Runtime(props) {
71
65
  //
72
66
  //
73
67
  //
74
- return React__default["default"].createElement(runboxClient.EliceRunboxView, {
68
+ return React.createElement(runboxClient.EliceRunboxView, {
75
69
  key: viewRefreshTrigger,
76
- OverlayAssigned: RuntimeOverlayAssigned["default"],
77
- OverlayQueued: RuntimeOverlayQueued["default"],
78
- OverlayTerminated: function OverlayTerminated(props) {
79
- return React__default["default"].createElement(RuntimeOverlayTerminated["default"], Object.assign({}, props, {
80
- startRuntime: startRuntime
81
- }));
82
- }
70
+ OverlayAssigned: RuntimeOverlayAssigned.default,
71
+ OverlayQueued: RuntimeOverlayQueued.default,
72
+ OverlayTerminated: props => React.createElement(RuntimeOverlayTerminated.default, Object.assign({}, props, {
73
+ startRuntime: startRuntime
74
+ }))
83
75
  });
84
76
  };
85
77
 
86
- exports["default"] = Runtime;
78
+ exports.default = Runtime;
@@ -2,32 +2,25 @@
2
2
 
3
3
  Object.defineProperty(exports, '__esModule', { value: true });
4
4
 
5
- var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
6
5
  var React = require('react');
7
6
  var reactIntl = require('react-intl');
8
7
  var reactUse = require('react-use');
9
8
  var material = require('@mui/material');
10
9
  var queue = require('../../../assets/queue.gif.js');
11
10
 
12
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
13
-
14
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
15
-
16
11
  //
17
12
  //
18
13
  //
19
- var ASSIGNED_NORMAL_TIMEOUT = 30 * 1e3; // 30 sec
14
+ const ASSIGNED_NORMAL_TIMEOUT = 30 * 1e3; // 30 sec
20
15
  //
21
16
  //
22
17
  //
23
- var RuntimeOverlayAssigned = function RuntimeOverlayAssigned() {
24
- var _useTimeout = reactUse.useTimeout(ASSIGNED_NORMAL_TIMEOUT),
25
- _useTimeout2 = _rollupPluginBabelHelpers.slicedToArray(_useTimeout, 1),
26
- timeout = _useTimeout2[0];
18
+ const RuntimeOverlayAssigned = () => {
19
+ const [timeout] = reactUse.useTimeout(ASSIGNED_NORMAL_TIMEOUT);
27
20
  //
28
21
  //
29
22
  //
30
- return React__default["default"].createElement(material.Stack, {
23
+ return React.createElement(material.Stack, {
31
24
  gap: "1.5rem",
32
25
  sx: {
33
26
  display: 'flex',
@@ -36,27 +29,27 @@ var RuntimeOverlayAssigned = function RuntimeOverlayAssigned() {
36
29
  width: '100%',
37
30
  height: '100%'
38
31
  }
39
- }, React__default["default"].createElement(material.Box, {
32
+ }, React.createElement(material.Box, {
40
33
  component: "img",
41
- src: queue["default"],
34
+ src: queue.default,
42
35
  alt: "queue",
43
36
  sx: {
44
37
  width: '100%',
45
38
  height: 'auto',
46
39
  maxWidth: '13.375rem'
47
40
  }
48
- }), React__default["default"].createElement(material.Typography, {
41
+ }), React.createElement(material.Typography, {
49
42
  variant: "subtitle2",
50
43
  color: "text:secondary",
51
44
  sx: {
52
45
  whiteSpace: 'pre-wrap',
53
46
  textAlign: 'center'
54
47
  }
55
- }, timeout() ? React__default["default"].createElement(reactIntl.FormattedMessage, {
48
+ }, timeout() ? React.createElement(reactIntl.FormattedMessage, {
56
49
  id: "runbox.runtime.overlay.assigned.description_timeout"
57
- }) : React__default["default"].createElement(reactIntl.FormattedMessage, {
50
+ }) : React.createElement(reactIntl.FormattedMessage, {
58
51
  id: "runbox.runtime.overlay.assigned.description"
59
52
  })));
60
53
  };
61
54
 
62
- exports["default"] = RuntimeOverlayAssigned;
55
+ exports.default = RuntimeOverlayAssigned;
@@ -11,21 +11,19 @@ require('../contexts/MaterialRunboxCommandContext.js');
11
11
  var MaterialRunboxContext = require('../contexts/MaterialRunboxContext.js');
12
12
  var queue = require('../../../assets/queue.gif.js');
13
13
 
14
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
15
-
16
- var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
17
-
18
14
  //
19
15
  //
20
16
  //
21
- var RuntimeOverlayQueued = function RuntimeOverlayQueued(_ref) {
22
- var numWaiters = _ref.numWaiters;
23
- var _useMaterialRunboxCon = MaterialRunboxContext.useMaterialRunboxContext(),
24
- showMessenger = _useMaterialRunboxCon.showMessenger;
17
+ const RuntimeOverlayQueued = ({
18
+ numWaiters
19
+ }) => {
20
+ const {
21
+ showMessenger
22
+ } = MaterialRunboxContext.useMaterialRunboxContext();
25
23
  //
26
24
  //
27
25
  //
28
- return React__default["default"].createElement(material.Stack, {
26
+ return React.createElement(material.Stack, {
29
27
  gap: "1.5rem",
30
28
  sx: {
31
29
  display: 'flex',
@@ -34,36 +32,36 @@ var RuntimeOverlayQueued = function RuntimeOverlayQueued(_ref) {
34
32
  width: '100%',
35
33
  height: '100%'
36
34
  }
37
- }, React__default["default"].createElement(material.Box, {
35
+ }, React.createElement(material.Box, {
38
36
  component: "img",
39
- src: queue["default"],
37
+ src: queue.default,
40
38
  alt: "queue",
41
39
  sx: {
42
40
  width: '100%',
43
41
  height: 'auto',
44
42
  maxWidth: '13.375rem'
45
43
  }
46
- }), React__default["default"].createElement(material.Typography, {
44
+ }), React.createElement(material.Typography, {
47
45
  variant: "subtitle2",
48
46
  color: "text:secondary",
49
47
  sx: {
50
48
  whiteSpace: 'pre-wrap',
51
49
  textAlign: 'center'
52
50
  }
53
- }, numWaiters > 0 ? React__default["default"].createElement(reactIntl.FormattedMessage, {
51
+ }, numWaiters > 0 ? React.createElement(reactIntl.FormattedMessage, {
54
52
  id: "runbox.runtime.overlay.queued.description",
55
53
  values: {
56
54
  waiters: numWaiters
57
55
  }
58
- }) : React__default["default"].createElement(reactIntl.FormattedMessage, {
56
+ }) : React.createElement(reactIntl.FormattedMessage, {
59
57
  id: "runbox.runtime.overlay.queued.description_zero"
60
- })), typeof showMessenger === 'function' ? React__default["default"].createElement(material.Button, {
58
+ })), typeof showMessenger === 'function' ? React.createElement(material.Button, {
61
59
  variant: "outlined",
62
- startIcon: React__default["default"].createElement(iconsMaterial.QuestionAnswer, null),
60
+ startIcon: React.createElement(iconsMaterial.QuestionAnswer, null),
63
61
  onClick: showMessenger
64
- }, React__default["default"].createElement(reactIntl.FormattedMessage, {
62
+ }, React.createElement(reactIntl.FormattedMessage, {
65
63
  id: "runbox.common.support"
66
64
  })) : null);
67
65
  };
68
66
 
69
- exports["default"] = RuntimeOverlayQueued;
67
+ exports.default = RuntimeOverlayQueued;