@elice/material-runbox 1.240718.0-trasncript.0 → 1.240718.0-trasncript.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/_virtual/_rollupPluginBabelHelpers.js +386 -0
- package/cjs/assets/queue.gif.js +1 -2
- package/cjs/assets/runbox_logo.png.js +1 -2
- package/cjs/assets/terminated.png.js +1 -2
- package/cjs/components/material-runbox/MaterialRunbox.js +24 -20
- package/cjs/components/material-runbox/MaterialRunboxBody.js +10 -4
- package/cjs/components/material-runbox/MaterialRunboxContent.js +132 -103
- package/cjs/components/material-runbox/MaterialRunboxFooter.js +27 -18
- package/cjs/components/material-runbox/MaterialRunboxHeader.js +103 -87
- package/cjs/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +31 -27
- package/cjs/components/material-runbox/actions/MaterialRunboxActionGrade.js +242 -159
- package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.js +32 -28
- package/cjs/components/material-runbox/actions/MaterialRunboxActionReset.js +125 -76
- package/cjs/components/material-runbox/actions/MaterialRunboxActionRestart.js +84 -53
- package/cjs/components/material-runbox/actions/MaterialRunboxActionShare.js +40 -28
- package/cjs/components/material-runbox/contexts/MaterialRunboxApiContext.js +27 -15
- package/cjs/components/material-runbox/contexts/MaterialRunboxCommandContext.js +52 -36
- package/cjs/components/material-runbox/contexts/MaterialRunboxContext.js +11 -8
- package/cjs/components/material-runbox/contexts/index.js +17 -0
- package/cjs/components/material-runbox/hooks/index.js +7 -0
- package/cjs/components/material-runbox/hooks/useRunboxControl.js +62 -38
- package/cjs/components/material-runbox/index.js +7 -0
- package/cjs/components/material-runbox/locales/index.js +13 -0
- package/cjs/components/material-runbox/runtime/Runtime.js +25 -17
- package/cjs/components/material-runbox/runtime/RuntimeOverlayAssigned.js +33 -29
- package/cjs/components/material-runbox/runtime/RuntimeOverlayQueued.js +40 -39
- package/cjs/components/material-runbox/runtime/RuntimeOverlayTerminated.js +72 -57
- package/es/_virtual/_rollupPluginBabelHelpers.js +377 -0
- package/es/assets/queue.gif.js +1 -2
- package/es/assets/runbox_logo.png.js +1 -2
- package/es/assets/terminated.png.js +1 -2
- package/es/components/material-runbox/MaterialRunbox.js +24 -20
- package/es/components/material-runbox/MaterialRunboxBody.js +6 -4
- package/es/components/material-runbox/MaterialRunboxContent.js +128 -103
- package/es/components/material-runbox/MaterialRunboxFooter.js +23 -18
- package/es/components/material-runbox/MaterialRunboxHeader.js +99 -88
- package/es/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +27 -27
- package/es/components/material-runbox/actions/MaterialRunboxActionGrade.js +237 -159
- package/es/components/material-runbox/actions/MaterialRunboxActionMenu.js +28 -28
- package/es/components/material-runbox/actions/MaterialRunboxActionReset.js +121 -76
- package/es/components/material-runbox/actions/MaterialRunboxActionRestart.js +80 -53
- package/es/components/material-runbox/actions/MaterialRunboxActionShare.js +36 -28
- package/es/components/material-runbox/contexts/MaterialRunboxApiContext.js +22 -14
- package/es/components/material-runbox/contexts/MaterialRunboxCommandContext.js +47 -35
- package/es/components/material-runbox/contexts/MaterialRunboxContext.js +6 -7
- package/es/components/material-runbox/contexts/index.js +3 -0
- package/es/components/material-runbox/hooks/index.js +1 -0
- package/es/components/material-runbox/hooks/useRunboxControl.js +62 -38
- package/es/components/material-runbox/index.js +1 -0
- package/es/components/material-runbox/locales/index.js +4 -0
- package/es/components/material-runbox/runtime/Runtime.js +21 -17
- package/es/components/material-runbox/runtime/RuntimeOverlayAssigned.js +34 -30
- package/es/components/material-runbox/runtime/RuntimeOverlayQueued.js +41 -40
- package/es/components/material-runbox/runtime/RuntimeOverlayTerminated.js +69 -58
- package/package.json +8 -11
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import React from 'react';
|
|
2
3
|
import { useEliceRunboxRunning } from '@elice/runbox-client';
|
|
3
4
|
import { Menu } from '@mui/material';
|
|
@@ -8,22 +9,20 @@ import MaterialRunboxActionShare from './MaterialRunboxActionShare.js';
|
|
|
8
9
|
//
|
|
9
10
|
//
|
|
10
11
|
//
|
|
11
|
-
|
|
12
|
-
runbox,
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
} = useEliceRunboxRunning();
|
|
22
|
-
const isRunboxRunning = status === 'running';
|
|
12
|
+
var MaterialRunboxActionMenu = function MaterialRunboxActionMenu(_ref) {
|
|
13
|
+
var runbox = _ref.runbox,
|
|
14
|
+
runtime = _ref.runtime,
|
|
15
|
+
courseId = _ref.courseId,
|
|
16
|
+
menuAnchorEl = _ref.menuAnchorEl,
|
|
17
|
+
refetch = _ref.refetch,
|
|
18
|
+
handleMenuClose = _ref.handleMenuClose;
|
|
19
|
+
var _useEliceRunboxRunnin = useEliceRunboxRunning(),
|
|
20
|
+
status = _useEliceRunboxRunnin.status;
|
|
21
|
+
var isRunboxRunning = status === 'running';
|
|
23
22
|
//
|
|
24
23
|
//
|
|
25
24
|
//
|
|
26
|
-
React.useEffect(()
|
|
25
|
+
React.useEffect(function () {
|
|
27
26
|
if (!isRunboxRunning) {
|
|
28
27
|
handleMenuClose();
|
|
29
28
|
}
|
|
@@ -31,7 +30,7 @@ const MaterialRunboxActionMenu = ({
|
|
|
31
30
|
//
|
|
32
31
|
//
|
|
33
32
|
//
|
|
34
|
-
return
|
|
33
|
+
return jsxs(Menu, {
|
|
35
34
|
open: Boolean(menuAnchorEl),
|
|
36
35
|
anchorEl: menuAnchorEl,
|
|
37
36
|
anchorOrigin: {
|
|
@@ -42,20 +41,21 @@ const MaterialRunboxActionMenu = ({
|
|
|
42
41
|
vertical: 'top',
|
|
43
42
|
horizontal: 'right'
|
|
44
43
|
},
|
|
45
|
-
onClose: handleMenuClose
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
44
|
+
onClose: handleMenuClose,
|
|
45
|
+
children: [jsx(MaterialRunboxActionShare, {
|
|
46
|
+
handleMenuClose: handleMenuClose
|
|
47
|
+
}), jsx(MaterialRunboxActionRestart, {
|
|
48
|
+
runbox: runbox,
|
|
49
|
+
runtime: runtime,
|
|
50
|
+
courseId: courseId,
|
|
51
|
+
refetch: refetch,
|
|
52
|
+
handleMenuClose: handleMenuClose
|
|
53
|
+
}), jsx(MaterialRunboxActionReset, {
|
|
54
|
+
runtime: runtime,
|
|
55
|
+
courseId: courseId,
|
|
56
|
+
handleMenuClose: handleMenuClose
|
|
57
|
+
})]
|
|
58
|
+
});
|
|
59
59
|
};
|
|
60
60
|
|
|
61
61
|
export { MaterialRunboxActionMenu as default };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { slicedToArray as _slicedToArray, asyncToGenerator as _asyncToGenerator, regeneratorRuntime as _regeneratorRuntime } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import { useRawEliceIntl } from '@elice/intl';
|
|
3
5
|
import { EliceIcon } from '@elice/mui-elements';
|
|
@@ -13,108 +15,151 @@ import '../contexts/MaterialRunboxContext.js';
|
|
|
13
15
|
//
|
|
14
16
|
//
|
|
15
17
|
//
|
|
16
|
-
|
|
17
|
-
runtime,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
18
|
+
var MaterialRunboxActionReset = function MaterialRunboxActionReset(_ref) {
|
|
19
|
+
var runtime = _ref.runtime,
|
|
20
|
+
courseId = _ref.courseId;
|
|
21
|
+
_ref.handleMenuClose;
|
|
22
|
+
var intl = useRawEliceIntl();
|
|
23
|
+
var _useSnackbar = useSnackbar(),
|
|
24
|
+
enqueueSnackbar = _useSnackbar.enqueueSnackbar;
|
|
25
|
+
var materialRunboxApi = useMaterialRunboxApiContext();
|
|
26
|
+
var _React$useState = React.useState(false),
|
|
27
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
28
|
+
isLoading = _React$useState2[0],
|
|
29
|
+
setLoading = _React$useState2[1];
|
|
30
|
+
var _React$useState3 = React.useState(false),
|
|
31
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
32
|
+
isDialogOpened = _React$useState4[0],
|
|
33
|
+
setDialogOpened = _React$useState4[1];
|
|
34
|
+
var _useMaterialRunboxCom = useMaterialRunboxCommandContext(),
|
|
35
|
+
isLastCommandRunning = _useMaterialRunboxCom.isLastCommandRunning,
|
|
36
|
+
setCommandIdToPing = _useMaterialRunboxCom.setCommandIdToPing;
|
|
32
37
|
/**
|
|
33
38
|
*
|
|
34
39
|
*/
|
|
35
|
-
|
|
40
|
+
var handleDialogClose = function handleDialogClose() {
|
|
36
41
|
setDialogOpened(false);
|
|
37
42
|
};
|
|
38
43
|
/**
|
|
39
44
|
*
|
|
40
45
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
46
|
+
var handleReset = /*#__PURE__*/function () {
|
|
47
|
+
var _ref2 = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
48
|
+
var runtimeId, _yield$materialRunbox, commentId;
|
|
49
|
+
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
50
|
+
while (1) switch (_context.prev = _context.next) {
|
|
51
|
+
case 0:
|
|
52
|
+
setLoading(true);
|
|
53
|
+
_context.prev = 1;
|
|
54
|
+
runtimeId = runtime === null || runtime === void 0 ? void 0 : runtime.id;
|
|
55
|
+
_context.next = 5;
|
|
56
|
+
return materialRunboxApi.runtime.runtimeRuntimeIdCommandPost({
|
|
57
|
+
runtimeId: runtimeId,
|
|
58
|
+
eliceCourseId: courseId,
|
|
59
|
+
runboxCommandPostRequest: {
|
|
60
|
+
commandType: CommandType.ProjectFileReset
|
|
61
|
+
}
|
|
62
|
+
});
|
|
63
|
+
case 5:
|
|
64
|
+
_yield$materialRunbox = _context.sent;
|
|
65
|
+
commentId = _yield$materialRunbox.id;
|
|
66
|
+
setCommandIdToPing(commentId);
|
|
67
|
+
handleDialogClose();
|
|
68
|
+
_context.next = 14;
|
|
69
|
+
break;
|
|
70
|
+
case 11:
|
|
71
|
+
_context.prev = 11;
|
|
72
|
+
_context.t0 = _context["catch"](1);
|
|
73
|
+
enqueueSnackbar(intl.formatMessage({
|
|
74
|
+
id: 'runbox.action.reset.noti.error'
|
|
75
|
+
}), {
|
|
76
|
+
variant: 'error'
|
|
77
|
+
});
|
|
78
|
+
case 14:
|
|
79
|
+
_context.prev = 14;
|
|
80
|
+
setLoading(false);
|
|
81
|
+
return _context.finish(14);
|
|
82
|
+
case 17:
|
|
83
|
+
case "end":
|
|
84
|
+
return _context.stop();
|
|
52
85
|
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}), {
|
|
60
|
-
variant: 'error'
|
|
61
|
-
});
|
|
62
|
-
} finally {
|
|
63
|
-
setLoading(false);
|
|
64
|
-
}
|
|
65
|
-
};
|
|
86
|
+
}, _callee, null, [[1, 11, 14, 17]]);
|
|
87
|
+
}));
|
|
88
|
+
return function handleReset() {
|
|
89
|
+
return _ref2.apply(this, arguments);
|
|
90
|
+
};
|
|
91
|
+
}();
|
|
66
92
|
/**
|
|
67
93
|
*
|
|
68
94
|
*/
|
|
69
|
-
|
|
70
|
-
return
|
|
71
|
-
onClick: ()
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
95
|
+
var renderResetMenuItem = function renderResetMenuItem() {
|
|
96
|
+
return jsxs(MenuItem, {
|
|
97
|
+
onClick: function onClick() {
|
|
98
|
+
return setDialogOpened(true);
|
|
99
|
+
},
|
|
100
|
+
disabled: isLastCommandRunning,
|
|
101
|
+
children: [jsx(ListItemIcon, {
|
|
102
|
+
children: jsx(EliceIcon, {
|
|
103
|
+
icon: faRefresh
|
|
104
|
+
})
|
|
105
|
+
}), jsx(ListItemText, {
|
|
106
|
+
children: intl.formatMessage({
|
|
107
|
+
id: 'runbox.action.reset.title'
|
|
108
|
+
})
|
|
109
|
+
})]
|
|
110
|
+
});
|
|
78
111
|
};
|
|
79
112
|
/**
|
|
80
113
|
*
|
|
81
114
|
*/
|
|
82
|
-
|
|
115
|
+
var renderConfirmDialog = function renderConfirmDialog() {
|
|
83
116
|
if (!isDialogOpened) {
|
|
84
117
|
return null;
|
|
85
118
|
}
|
|
86
|
-
return
|
|
119
|
+
return jsxs(Dialog, {
|
|
87
120
|
open: true,
|
|
88
121
|
maxWidth: "xs",
|
|
89
122
|
fullWidth: true,
|
|
90
|
-
onClose: handleDialogClose
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
123
|
+
onClose: handleDialogClose,
|
|
124
|
+
children: [jsx(DialogTitle, {
|
|
125
|
+
children: intl.formatMessage({
|
|
126
|
+
id: 'runbox.action.reset.title'
|
|
127
|
+
})
|
|
128
|
+
}), jsx(DialogContent, {
|
|
129
|
+
children: jsx(DialogContentText, {
|
|
130
|
+
sx: {
|
|
131
|
+
whiteSpace: 'pre-line'
|
|
132
|
+
},
|
|
133
|
+
children: intl.formatMessage({
|
|
134
|
+
id: 'runbox.action.reset.dialog.description'
|
|
135
|
+
})
|
|
136
|
+
})
|
|
137
|
+
}), jsxs(DialogActions, {
|
|
138
|
+
children: [jsx(Button, {
|
|
139
|
+
color: "inherit",
|
|
140
|
+
disabled: isLoading,
|
|
141
|
+
onClick: handleDialogClose,
|
|
142
|
+
children: intl.formatMessage({
|
|
143
|
+
id: 'runbox.common.close'
|
|
144
|
+
})
|
|
145
|
+
}), jsx(LoadingButton, {
|
|
146
|
+
variant: "contained",
|
|
147
|
+
color: "warning",
|
|
148
|
+
loading: isLoading || isLastCommandRunning,
|
|
149
|
+
onClick: handleReset,
|
|
150
|
+
children: intl.formatMessage({
|
|
151
|
+
id: 'runbox.action.reset.dialog.actions.confirm'
|
|
152
|
+
})
|
|
153
|
+
})]
|
|
154
|
+
})]
|
|
155
|
+
});
|
|
113
156
|
};
|
|
114
157
|
//
|
|
115
158
|
//
|
|
116
159
|
//
|
|
117
|
-
return
|
|
160
|
+
return jsxs(Fragment, {
|
|
161
|
+
children: [renderResetMenuItem(), renderConfirmDialog()]
|
|
162
|
+
});
|
|
118
163
|
};
|
|
119
164
|
|
|
120
165
|
export { MaterialRunboxActionReset as default };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import { useRawEliceIntl } from '@elice/intl';
|
|
3
5
|
import { EliceIcon } from '@elice/mui-elements';
|
|
@@ -9,35 +11,41 @@ import { useRunboxControl } from '../hooks/useRunboxControl.js';
|
|
|
9
11
|
//
|
|
10
12
|
//
|
|
11
13
|
//
|
|
12
|
-
|
|
13
|
-
runbox,
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
14
|
+
var MaterialRunboxActionRestart = function MaterialRunboxActionRestart(_ref) {
|
|
15
|
+
var runbox = _ref.runbox,
|
|
16
|
+
courseId = _ref.courseId,
|
|
17
|
+
refetch = _ref.refetch,
|
|
18
|
+
handleMenuClose = _ref.handleMenuClose;
|
|
19
|
+
var intl = useRawEliceIntl();
|
|
20
|
+
var _React$useState = React.useState(false),
|
|
21
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
22
|
+
isLoading = _React$useState2[0],
|
|
23
|
+
setIsLoading = _React$useState2[1];
|
|
24
|
+
var _React$useState3 = React.useState(false),
|
|
25
|
+
_React$useState4 = _slicedToArray(_React$useState3, 2),
|
|
26
|
+
isDialogOpened = _React$useState4[0],
|
|
27
|
+
setDialogOpened = _React$useState4[1];
|
|
21
28
|
// restart
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
29
|
+
var _useRunboxControl = useRunboxControl({
|
|
30
|
+
runbox: runbox,
|
|
31
|
+
courseId: courseId,
|
|
32
|
+
refetch: refetch
|
|
33
|
+
}),
|
|
34
|
+
start = _useRunboxControl.start;
|
|
29
35
|
/**
|
|
30
36
|
*
|
|
31
37
|
*/
|
|
32
|
-
|
|
38
|
+
var handleDialogClose = function handleDialogClose() {
|
|
33
39
|
setDialogOpened(false);
|
|
34
40
|
};
|
|
35
41
|
/**
|
|
36
42
|
*
|
|
37
43
|
*/
|
|
38
|
-
|
|
44
|
+
var handleRestartAction = function handleRestartAction() {
|
|
39
45
|
setIsLoading(true);
|
|
40
|
-
start(true).catch(
|
|
46
|
+
start(true).catch(function () {
|
|
47
|
+
return void 0;
|
|
48
|
+
}).finally(function () {
|
|
41
49
|
handleDialogClose();
|
|
42
50
|
handleMenuClose();
|
|
43
51
|
setIsLoading(false);
|
|
@@ -46,54 +54,73 @@ const MaterialRunboxActionRestart = ({
|
|
|
46
54
|
/**
|
|
47
55
|
*
|
|
48
56
|
*/
|
|
49
|
-
|
|
50
|
-
return
|
|
51
|
-
onClick: ()
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
+
var renderRestartMenuItem = function renderRestartMenuItem() {
|
|
58
|
+
return jsxs(MenuItem, {
|
|
59
|
+
onClick: function onClick() {
|
|
60
|
+
return setDialogOpened(true);
|
|
61
|
+
},
|
|
62
|
+
children: [jsx(ListItemIcon, {
|
|
63
|
+
children: jsx(EliceIcon, {
|
|
64
|
+
icon: faRotateRight
|
|
65
|
+
})
|
|
66
|
+
}), jsx(ListItemText, {
|
|
67
|
+
children: intl.formatMessage({
|
|
68
|
+
id: 'runbox.action.restart.title'
|
|
69
|
+
})
|
|
70
|
+
})]
|
|
71
|
+
});
|
|
57
72
|
};
|
|
58
73
|
/**
|
|
59
74
|
*
|
|
60
75
|
*/
|
|
61
|
-
|
|
76
|
+
var renderConfirmDialog = function renderConfirmDialog() {
|
|
62
77
|
if (!isDialogOpened) {
|
|
63
78
|
return null;
|
|
64
79
|
}
|
|
65
|
-
return
|
|
80
|
+
return jsxs(Dialog, {
|
|
66
81
|
maxWidth: "xs",
|
|
67
82
|
open: true,
|
|
68
83
|
fullWidth: true,
|
|
69
|
-
onClose: handleDialogClose
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
onClose: handleDialogClose,
|
|
85
|
+
children: [jsx(DialogTitle, {
|
|
86
|
+
children: intl.formatMessage({
|
|
87
|
+
id: 'runbox.action.restart.title'
|
|
88
|
+
})
|
|
89
|
+
}), jsx(DialogContent, {
|
|
90
|
+
children: jsx(DialogContentText, {
|
|
91
|
+
sx: {
|
|
92
|
+
whiteSpace: 'pre-line'
|
|
93
|
+
},
|
|
94
|
+
children: intl.formatMessage({
|
|
95
|
+
id: 'runbox.action.restart.dialog.description'
|
|
96
|
+
})
|
|
97
|
+
})
|
|
98
|
+
}), jsxs(DialogActions, {
|
|
99
|
+
children: [jsx(Button, {
|
|
100
|
+
color: "inherit",
|
|
101
|
+
disabled: isLoading,
|
|
102
|
+
onClick: handleDialogClose,
|
|
103
|
+
children: intl.formatMessage({
|
|
104
|
+
id: 'runbox.common.close'
|
|
105
|
+
})
|
|
106
|
+
}), jsx(LoadingButton, {
|
|
107
|
+
variant: "contained",
|
|
108
|
+
color: "warning",
|
|
109
|
+
loading: isLoading,
|
|
110
|
+
onClick: handleRestartAction,
|
|
111
|
+
children: intl.formatMessage({
|
|
112
|
+
id: 'runbox.action.restart.dialog.actions.confirm'
|
|
113
|
+
})
|
|
114
|
+
})]
|
|
115
|
+
})]
|
|
116
|
+
});
|
|
92
117
|
};
|
|
93
118
|
//
|
|
94
119
|
//
|
|
95
120
|
//
|
|
96
|
-
return
|
|
121
|
+
return jsxs(Fragment, {
|
|
122
|
+
children: [renderRestartMenuItem(), renderConfirmDialog()]
|
|
123
|
+
});
|
|
97
124
|
};
|
|
98
125
|
|
|
99
126
|
export { MaterialRunboxActionRestart as default };
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import { useCopyToClipboard } from 'react-use';
|
|
3
5
|
import { useRawEliceIntl } from '@elice/intl';
|
|
@@ -13,44 +15,50 @@ import { useMaterialRunboxContext } from '../contexts/MaterialRunboxContext.js';
|
|
|
13
15
|
//
|
|
14
16
|
//
|
|
15
17
|
//
|
|
16
|
-
|
|
17
|
-
handleMenuClose
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
18
|
+
var MaterialRunboxActionShare = function MaterialRunboxActionShare(_ref) {
|
|
19
|
+
var handleMenuClose = _ref.handleMenuClose;
|
|
20
|
+
var intl = useRawEliceIntl();
|
|
21
|
+
var _useSnackbar = useSnackbar(),
|
|
22
|
+
enqueueSnackbar = _useSnackbar.enqueueSnackbar;
|
|
23
|
+
var _useMaterialRunboxCon = useMaterialRunboxContext(),
|
|
24
|
+
enableUrlShare = _useMaterialRunboxCon.enableUrlShare;
|
|
25
|
+
var _useEliceRunboxRunnin = useEliceRunboxRunning(),
|
|
26
|
+
url = _useEliceRunboxRunnin.url;
|
|
27
|
+
var _useCopyToClipboard = useCopyToClipboard(),
|
|
28
|
+
_useCopyToClipboard2 = _slicedToArray(_useCopyToClipboard, 2),
|
|
29
|
+
_useCopyToClipboard2$ = _useCopyToClipboard2[0],
|
|
30
|
+
clipboardValue = _useCopyToClipboard2$.value,
|
|
31
|
+
error = _useCopyToClipboard2$.error,
|
|
32
|
+
copy = _useCopyToClipboard2[1];
|
|
33
|
+
var _React$useState = React.useState(false),
|
|
34
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
35
|
+
isClipboardCopied = _React$useState2[0],
|
|
36
|
+
setClipboardCopied = _React$useState2[1];
|
|
34
37
|
/**
|
|
35
38
|
*
|
|
36
39
|
*/
|
|
37
|
-
|
|
40
|
+
var renderShareMenuItem = function renderShareMenuItem() {
|
|
38
41
|
if (!enableUrlShare) {
|
|
39
42
|
return null;
|
|
40
43
|
}
|
|
41
|
-
return
|
|
44
|
+
return jsxs(MenuItem, {
|
|
42
45
|
disabled: !url,
|
|
43
|
-
onClick: handleShareAction
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
46
|
+
onClick: handleShareAction,
|
|
47
|
+
children: [jsx(ListItemIcon, {
|
|
48
|
+
children: jsx(EliceIcon, {
|
|
49
|
+
icon: faLinkSimple
|
|
50
|
+
})
|
|
51
|
+
}), jsx(ListItemText, {
|
|
52
|
+
children: intl.formatMessage({
|
|
53
|
+
id: 'runbox.action.share.title'
|
|
54
|
+
})
|
|
55
|
+
})]
|
|
56
|
+
});
|
|
49
57
|
};
|
|
50
58
|
/**
|
|
51
59
|
*
|
|
52
60
|
*/
|
|
53
|
-
|
|
61
|
+
var handleShareAction = function handleShareAction() {
|
|
54
62
|
if (url) {
|
|
55
63
|
copy(url);
|
|
56
64
|
if (!error) {
|
|
@@ -62,7 +70,7 @@ const MaterialRunboxActionShare = ({
|
|
|
62
70
|
//
|
|
63
71
|
//
|
|
64
72
|
//
|
|
65
|
-
React.useEffect(()
|
|
73
|
+
React.useEffect(function () {
|
|
66
74
|
if (!isClipboardCopied) {
|
|
67
75
|
return;
|
|
68
76
|
}
|
|
@@ -1,39 +1,47 @@
|
|
|
1
|
+
import { slicedToArray as _slicedToArray } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
3
|
import React from 'react';
|
|
2
4
|
import { RunboxApi, RuntimeApi, RuntimeTemplateApi } from '@elice/openapi-client-material-runbox';
|
|
3
5
|
|
|
4
6
|
//
|
|
5
7
|
//
|
|
6
8
|
//
|
|
7
|
-
|
|
8
|
-
|
|
9
|
+
var MaterialRunboxApiContext = React.createContext({});
|
|
10
|
+
var useMaterialRunboxApiContext = function useMaterialRunboxApiContext() {
|
|
9
11
|
return React.useContext(MaterialRunboxApiContext);
|
|
10
12
|
};
|
|
11
13
|
//
|
|
12
14
|
//
|
|
13
15
|
//
|
|
14
|
-
|
|
15
|
-
children,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
var MaterialRunboxApiContextProvider = function MaterialRunboxApiContextProvider(_ref) {
|
|
17
|
+
var children = _ref.children,
|
|
18
|
+
eliceMaterialRunboxApiConfiguration = _ref.eliceMaterialRunboxApiConfiguration;
|
|
19
|
+
var createMaterialRunboxApi = function createMaterialRunboxApi() {
|
|
20
|
+
return Object.freeze({
|
|
21
|
+
runbox: new RunboxApi(eliceMaterialRunboxApiConfiguration),
|
|
22
|
+
runtime: new RuntimeApi(eliceMaterialRunboxApiConfiguration),
|
|
23
|
+
runtimeTemplate: new RuntimeTemplateApi(eliceMaterialRunboxApiConfiguration)
|
|
24
|
+
});
|
|
25
|
+
};
|
|
23
26
|
//
|
|
24
27
|
//
|
|
25
28
|
//
|
|
26
|
-
|
|
29
|
+
var _React$useState = React.useState(createMaterialRunboxApi),
|
|
30
|
+
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
31
|
+
materialRunboxApi = _React$useState2[0],
|
|
32
|
+
setMaterialRunboxApi = _React$useState2[1];
|
|
27
33
|
//
|
|
28
34
|
//
|
|
29
35
|
//
|
|
30
|
-
React.useEffect(()
|
|
36
|
+
React.useEffect(function () {
|
|
37
|
+
return setMaterialRunboxApi(createMaterialRunboxApi);
|
|
38
|
+
},
|
|
31
39
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
32
40
|
[eliceMaterialRunboxApiConfiguration]);
|
|
33
41
|
//
|
|
34
42
|
//
|
|
35
43
|
//
|
|
36
|
-
return
|
|
44
|
+
return jsx(MaterialRunboxApiContext.Provider, {
|
|
37
45
|
children: children,
|
|
38
46
|
value: materialRunboxApi
|
|
39
47
|
});
|