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