@elice/material-runbox 1.240718.0-trasncript.2 → 1.240718.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/assets/queue.gif.js +2 -1
- package/cjs/assets/runbox_logo.png.js +2 -1
- package/cjs/assets/terminated.png.js +2 -1
- package/cjs/components/material-runbox/MaterialRunbox.js +20 -24
- package/cjs/components/material-runbox/MaterialRunboxBody.js +4 -10
- package/cjs/components/material-runbox/MaterialRunboxContent.js +103 -132
- package/cjs/components/material-runbox/MaterialRunboxFooter.js +18 -27
- package/cjs/components/material-runbox/MaterialRunboxHeader.js +87 -103
- package/cjs/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +27 -31
- package/cjs/components/material-runbox/actions/MaterialRunboxActionGrade.js +159 -242
- package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.js +28 -32
- package/cjs/components/material-runbox/actions/MaterialRunboxActionReset.js +76 -125
- package/cjs/components/material-runbox/actions/MaterialRunboxActionRestart.js +53 -84
- package/cjs/components/material-runbox/actions/MaterialRunboxActionShare.js +28 -40
- package/cjs/components/material-runbox/contexts/MaterialRunboxApiContext.js +15 -27
- package/cjs/components/material-runbox/contexts/MaterialRunboxCommandContext.js +36 -52
- package/cjs/components/material-runbox/contexts/MaterialRunboxContext.js +8 -11
- package/cjs/components/material-runbox/hooks/useRunboxControl.js +38 -62
- package/cjs/components/material-runbox/runtime/Runtime.js +17 -25
- package/cjs/components/material-runbox/runtime/RuntimeOverlayAssigned.js +29 -33
- package/cjs/components/material-runbox/runtime/RuntimeOverlayQueued.js +39 -40
- package/cjs/components/material-runbox/runtime/RuntimeOverlayTerminated.js +57 -72
- package/es/assets/queue.gif.js +2 -1
- package/es/assets/runbox_logo.png.js +2 -1
- package/es/assets/terminated.png.js +2 -1
- package/es/components/material-runbox/MaterialRunbox.js +20 -24
- package/es/components/material-runbox/MaterialRunboxBody.js +4 -6
- package/es/components/material-runbox/MaterialRunboxContent.js +103 -128
- package/es/components/material-runbox/MaterialRunboxFooter.js +18 -23
- package/es/components/material-runbox/MaterialRunboxHeader.js +88 -99
- package/es/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +27 -27
- package/es/components/material-runbox/actions/MaterialRunboxActionGrade.js +159 -237
- package/es/components/material-runbox/actions/MaterialRunboxActionMenu.js +28 -28
- package/es/components/material-runbox/actions/MaterialRunboxActionReset.js +76 -121
- package/es/components/material-runbox/actions/MaterialRunboxActionRestart.js +53 -80
- package/es/components/material-runbox/actions/MaterialRunboxActionShare.js +28 -36
- package/es/components/material-runbox/contexts/MaterialRunboxApiContext.js +14 -22
- package/es/components/material-runbox/contexts/MaterialRunboxCommandContext.js +35 -47
- package/es/components/material-runbox/contexts/MaterialRunboxContext.js +7 -6
- package/es/components/material-runbox/hooks/useRunboxControl.js +38 -62
- package/es/components/material-runbox/runtime/Runtime.js +17 -21
- package/es/components/material-runbox/runtime/RuntimeOverlayAssigned.js +30 -34
- package/es/components/material-runbox/runtime/RuntimeOverlayQueued.js +40 -41
- package/es/components/material-runbox/runtime/RuntimeOverlayTerminated.js +58 -69
- package/package.json +11 -8
- package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -386
- package/cjs/components/material-runbox/contexts/index.js +0 -17
- package/cjs/components/material-runbox/hooks/index.js +0 -7
- package/cjs/components/material-runbox/index.js +0 -7
- package/cjs/components/material-runbox/locales/index.js +0 -13
- package/es/_virtual/_rollupPluginBabelHelpers.js +0 -377
- package/es/components/material-runbox/contexts/index.js +0 -3
- package/es/components/material-runbox/hooks/index.js +0 -1
- package/es/components/material-runbox/index.js +0 -1
- package/es/components/material-runbox/locales/index.js +0 -4
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
6
5
|
var React = require('react');
|
|
7
6
|
var runboxClient = require('@elice/runbox-client');
|
|
8
7
|
var material = require('@mui/material');
|
|
@@ -10,27 +9,25 @@ var MaterialRunboxActionReset = require('./MaterialRunboxActionReset.js');
|
|
|
10
9
|
var MaterialRunboxActionRestart = require('./MaterialRunboxActionRestart.js');
|
|
11
10
|
var MaterialRunboxActionShare = require('./MaterialRunboxActionShare.js');
|
|
12
11
|
|
|
13
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
14
|
-
|
|
15
|
-
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
16
|
-
|
|
17
12
|
//
|
|
18
13
|
//
|
|
19
14
|
//
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
15
|
+
const MaterialRunboxActionMenu = ({
|
|
16
|
+
runbox,
|
|
17
|
+
runtime,
|
|
18
|
+
courseId,
|
|
19
|
+
menuAnchorEl,
|
|
20
|
+
refetch,
|
|
21
|
+
handleMenuClose
|
|
22
|
+
}) => {
|
|
23
|
+
const {
|
|
24
|
+
status
|
|
25
|
+
} = runboxClient.useEliceRunboxRunning();
|
|
26
|
+
const isRunboxRunning = status === 'running';
|
|
30
27
|
//
|
|
31
28
|
//
|
|
32
29
|
//
|
|
33
|
-
|
|
30
|
+
React.useEffect(() => {
|
|
34
31
|
if (!isRunboxRunning) {
|
|
35
32
|
handleMenuClose();
|
|
36
33
|
}
|
|
@@ -38,7 +35,7 @@ var MaterialRunboxActionMenu = function MaterialRunboxActionMenu(_ref) {
|
|
|
38
35
|
//
|
|
39
36
|
//
|
|
40
37
|
//
|
|
41
|
-
return
|
|
38
|
+
return React.createElement(material.Menu, {
|
|
42
39
|
open: Boolean(menuAnchorEl),
|
|
43
40
|
anchorEl: menuAnchorEl,
|
|
44
41
|
anchorOrigin: {
|
|
@@ -49,21 +46,20 @@ var MaterialRunboxActionMenu = function MaterialRunboxActionMenu(_ref) {
|
|
|
49
46
|
vertical: 'top',
|
|
50
47
|
horizontal: 'right'
|
|
51
48
|
},
|
|
52
|
-
onClose: handleMenuClose
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
});
|
|
49
|
+
onClose: handleMenuClose
|
|
50
|
+
}, React.createElement(MaterialRunboxActionShare.default, {
|
|
51
|
+
handleMenuClose: handleMenuClose
|
|
52
|
+
}), React.createElement(MaterialRunboxActionRestart.default, {
|
|
53
|
+
runbox: runbox,
|
|
54
|
+
runtime: runtime,
|
|
55
|
+
courseId: courseId,
|
|
56
|
+
refetch: refetch,
|
|
57
|
+
handleMenuClose: handleMenuClose
|
|
58
|
+
}), React.createElement(MaterialRunboxActionReset.default, {
|
|
59
|
+
runtime: runtime,
|
|
60
|
+
courseId: courseId,
|
|
61
|
+
handleMenuClose: handleMenuClose
|
|
62
|
+
}));
|
|
67
63
|
};
|
|
68
64
|
|
|
69
65
|
exports.default = MaterialRunboxActionMenu;
|
|
@@ -2,8 +2,6 @@
|
|
|
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');
|
|
7
5
|
var React = require('react');
|
|
8
6
|
var intl = require('@elice/intl');
|
|
9
7
|
var muiElements = require('@elice/mui-elements');
|
|
@@ -16,158 +14,111 @@ var MaterialRunboxApiContext = require('../contexts/MaterialRunboxApiContext.js'
|
|
|
16
14
|
var MaterialRunboxCommandContext = require('../contexts/MaterialRunboxCommandContext.js');
|
|
17
15
|
require('../contexts/MaterialRunboxContext.js');
|
|
18
16
|
|
|
19
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
20
|
-
|
|
21
|
-
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
22
|
-
|
|
23
17
|
//
|
|
24
18
|
//
|
|
25
19
|
//
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
var _useMaterialRunboxCom = MaterialRunboxCommandContext.useMaterialRunboxCommandContext(),
|
|
43
|
-
isLastCommandRunning = _useMaterialRunboxCom.isLastCommandRunning,
|
|
44
|
-
setCommandIdToPing = _useMaterialRunboxCom.setCommandIdToPing;
|
|
20
|
+
const MaterialRunboxActionReset = ({
|
|
21
|
+
runtime,
|
|
22
|
+
courseId,
|
|
23
|
+
handleMenuClose
|
|
24
|
+
}) => {
|
|
25
|
+
const intl$1 = intl.useRawEliceIntl();
|
|
26
|
+
const {
|
|
27
|
+
enqueueSnackbar
|
|
28
|
+
} = muiXSnackbar.useSnackbar();
|
|
29
|
+
const materialRunboxApi = MaterialRunboxApiContext.useMaterialRunboxApiContext();
|
|
30
|
+
const [isLoading, setLoading] = React.useState(false);
|
|
31
|
+
const [isDialogOpened, setDialogOpened] = React.useState(false);
|
|
32
|
+
const {
|
|
33
|
+
isLastCommandRunning,
|
|
34
|
+
setCommandIdToPing
|
|
35
|
+
} = MaterialRunboxCommandContext.useMaterialRunboxCommandContext();
|
|
45
36
|
/**
|
|
46
37
|
*
|
|
47
38
|
*/
|
|
48
|
-
|
|
39
|
+
const handleDialogClose = () => {
|
|
49
40
|
setDialogOpened(false);
|
|
50
41
|
};
|
|
51
42
|
/**
|
|
52
43
|
*
|
|
53
44
|
*/
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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();
|
|
45
|
+
const handleReset = async () => {
|
|
46
|
+
setLoading(true);
|
|
47
|
+
try {
|
|
48
|
+
const runtimeId = runtime === null || runtime === void 0 ? void 0 : runtime.id;
|
|
49
|
+
const {
|
|
50
|
+
id: commentId
|
|
51
|
+
} = await materialRunboxApi.runtime.runtimeRuntimeIdCommandPost({
|
|
52
|
+
runtimeId,
|
|
53
|
+
eliceCourseId: courseId,
|
|
54
|
+
runboxCommandPostRequest: {
|
|
55
|
+
commandType: openapiClientMaterialRunbox.CommandType.ProjectFileReset
|
|
93
56
|
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
57
|
+
});
|
|
58
|
+
setCommandIdToPing(commentId);
|
|
59
|
+
handleDialogClose();
|
|
60
|
+
} catch (err) {
|
|
61
|
+
enqueueSnackbar(intl$1.formatMessage({
|
|
62
|
+
id: 'runbox.action.reset.noti.error'
|
|
63
|
+
}), {
|
|
64
|
+
variant: 'error'
|
|
65
|
+
});
|
|
66
|
+
} finally {
|
|
67
|
+
setLoading(false);
|
|
68
|
+
}
|
|
69
|
+
};
|
|
100
70
|
/**
|
|
101
71
|
*
|
|
102
72
|
*/
|
|
103
|
-
|
|
104
|
-
return
|
|
105
|
-
onClick:
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
})
|
|
113
|
-
}), jsxRuntime.jsx(material.ListItemText, {
|
|
114
|
-
children: intl$1.formatMessage({
|
|
115
|
-
id: 'runbox.action.reset.title'
|
|
116
|
-
})
|
|
117
|
-
})]
|
|
118
|
-
});
|
|
73
|
+
const renderResetMenuItem = () => {
|
|
74
|
+
return React.createElement(material.MenuItem, {
|
|
75
|
+
onClick: () => setDialogOpened(true),
|
|
76
|
+
disabled: isLastCommandRunning
|
|
77
|
+
}, React.createElement(material.ListItemIcon, null, React.createElement(muiElements.EliceIcon, {
|
|
78
|
+
icon: proSolidSvgIcons.faRefresh
|
|
79
|
+
})), React.createElement(material.ListItemText, null, intl$1.formatMessage({
|
|
80
|
+
id: 'runbox.action.reset.title'
|
|
81
|
+
})));
|
|
119
82
|
};
|
|
120
83
|
/**
|
|
121
84
|
*
|
|
122
85
|
*/
|
|
123
|
-
|
|
86
|
+
const renderConfirmDialog = () => {
|
|
124
87
|
if (!isDialogOpened) {
|
|
125
88
|
return null;
|
|
126
89
|
}
|
|
127
|
-
return
|
|
90
|
+
return React.createElement(material.Dialog, {
|
|
128
91
|
open: true,
|
|
129
92
|
maxWidth: "xs",
|
|
130
93
|
fullWidth: true,
|
|
131
|
-
onClose: handleDialogClose
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
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
|
-
});
|
|
94
|
+
onClose: handleDialogClose
|
|
95
|
+
}, React.createElement(material.DialogTitle, null, intl$1.formatMessage({
|
|
96
|
+
id: 'runbox.action.reset.title'
|
|
97
|
+
})), React.createElement(material.DialogContent, null, React.createElement(material.DialogContentText, {
|
|
98
|
+
sx: {
|
|
99
|
+
whiteSpace: 'pre-line'
|
|
100
|
+
}
|
|
101
|
+
}, intl$1.formatMessage({
|
|
102
|
+
id: 'runbox.action.reset.dialog.description'
|
|
103
|
+
}))), React.createElement(material.DialogActions, null, React.createElement(material.Button, {
|
|
104
|
+
color: "inherit",
|
|
105
|
+
disabled: isLoading,
|
|
106
|
+
onClick: handleDialogClose
|
|
107
|
+
}, intl$1.formatMessage({
|
|
108
|
+
id: 'runbox.common.close'
|
|
109
|
+
})), React.createElement(lab.LoadingButton, {
|
|
110
|
+
variant: "contained",
|
|
111
|
+
color: "warning",
|
|
112
|
+
loading: isLoading || isLastCommandRunning,
|
|
113
|
+
onClick: handleReset
|
|
114
|
+
}, intl$1.formatMessage({
|
|
115
|
+
id: 'runbox.action.reset.dialog.actions.confirm'
|
|
116
|
+
}))));
|
|
164
117
|
};
|
|
165
118
|
//
|
|
166
119
|
//
|
|
167
120
|
//
|
|
168
|
-
return
|
|
169
|
-
children: [renderResetMenuItem(), renderConfirmDialog()]
|
|
170
|
-
});
|
|
121
|
+
return React.createElement(React.Fragment, null, renderResetMenuItem(), renderConfirmDialog());
|
|
171
122
|
};
|
|
172
123
|
|
|
173
124
|
exports.default = MaterialRunboxActionReset;
|
|
@@ -2,8 +2,6 @@
|
|
|
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');
|
|
7
5
|
var React = require('react');
|
|
8
6
|
var intl = require('@elice/intl');
|
|
9
7
|
var muiElements = require('@elice/mui-elements');
|
|
@@ -12,48 +10,38 @@ var lab = require('@mui/lab');
|
|
|
12
10
|
var material = require('@mui/material');
|
|
13
11
|
var useRunboxControl = require('../hooks/useRunboxControl.js');
|
|
14
12
|
|
|
15
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
16
|
-
|
|
17
|
-
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
18
|
-
|
|
19
13
|
//
|
|
20
14
|
//
|
|
21
15
|
//
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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];
|
|
16
|
+
const MaterialRunboxActionRestart = ({
|
|
17
|
+
runbox,
|
|
18
|
+
courseId,
|
|
19
|
+
refetch,
|
|
20
|
+
handleMenuClose
|
|
21
|
+
}) => {
|
|
22
|
+
const intl$1 = intl.useRawEliceIntl();
|
|
23
|
+
const [isLoading, setIsLoading] = React.useState(false);
|
|
24
|
+
const [isDialogOpened, setDialogOpened] = React.useState(false);
|
|
36
25
|
// restart
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
26
|
+
const {
|
|
27
|
+
start
|
|
28
|
+
} = useRunboxControl.useRunboxControl({
|
|
29
|
+
runbox,
|
|
30
|
+
courseId,
|
|
31
|
+
refetch
|
|
32
|
+
});
|
|
43
33
|
/**
|
|
44
34
|
*
|
|
45
35
|
*/
|
|
46
|
-
|
|
36
|
+
const handleDialogClose = () => {
|
|
47
37
|
setDialogOpened(false);
|
|
48
38
|
};
|
|
49
39
|
/**
|
|
50
40
|
*
|
|
51
41
|
*/
|
|
52
|
-
|
|
42
|
+
const handleRestartAction = () => {
|
|
53
43
|
setIsLoading(true);
|
|
54
|
-
start(true).catch(
|
|
55
|
-
return void 0;
|
|
56
|
-
}).finally(function () {
|
|
44
|
+
start(true).catch(() => void 0).finally(() => {
|
|
57
45
|
handleDialogClose();
|
|
58
46
|
handleMenuClose();
|
|
59
47
|
setIsLoading(false);
|
|
@@ -62,73 +50,54 @@ var MaterialRunboxActionRestart = function MaterialRunboxActionRestart(_ref) {
|
|
|
62
50
|
/**
|
|
63
51
|
*
|
|
64
52
|
*/
|
|
65
|
-
|
|
66
|
-
return
|
|
67
|
-
onClick:
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
})
|
|
74
|
-
}), jsxRuntime.jsx(material.ListItemText, {
|
|
75
|
-
children: intl$1.formatMessage({
|
|
76
|
-
id: 'runbox.action.restart.title'
|
|
77
|
-
})
|
|
78
|
-
})]
|
|
79
|
-
});
|
|
53
|
+
const renderRestartMenuItem = () => {
|
|
54
|
+
return React.createElement(material.MenuItem, {
|
|
55
|
+
onClick: () => setDialogOpened(true)
|
|
56
|
+
}, React.createElement(material.ListItemIcon, null, React.createElement(muiElements.EliceIcon, {
|
|
57
|
+
icon: proSolidSvgIcons.faRotateRight
|
|
58
|
+
})), React.createElement(material.ListItemText, null, intl$1.formatMessage({
|
|
59
|
+
id: 'runbox.action.restart.title'
|
|
60
|
+
})));
|
|
80
61
|
};
|
|
81
62
|
/**
|
|
82
63
|
*
|
|
83
64
|
*/
|
|
84
|
-
|
|
65
|
+
const renderConfirmDialog = () => {
|
|
85
66
|
if (!isDialogOpened) {
|
|
86
67
|
return null;
|
|
87
68
|
}
|
|
88
|
-
return
|
|
69
|
+
return React.createElement(material.Dialog, {
|
|
89
70
|
maxWidth: "xs",
|
|
90
71
|
open: true,
|
|
91
72
|
fullWidth: true,
|
|
92
|
-
onClose: handleDialogClose
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
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
|
-
});
|
|
73
|
+
onClose: handleDialogClose
|
|
74
|
+
}, React.createElement(material.DialogTitle, null, intl$1.formatMessage({
|
|
75
|
+
id: 'runbox.action.restart.title'
|
|
76
|
+
})), React.createElement(material.DialogContent, null, React.createElement(material.DialogContentText, {
|
|
77
|
+
sx: {
|
|
78
|
+
whiteSpace: 'pre-line'
|
|
79
|
+
}
|
|
80
|
+
}, intl$1.formatMessage({
|
|
81
|
+
id: 'runbox.action.restart.dialog.description'
|
|
82
|
+
}))), React.createElement(material.DialogActions, null, React.createElement(material.Button, {
|
|
83
|
+
color: "inherit",
|
|
84
|
+
disabled: isLoading,
|
|
85
|
+
onClick: handleDialogClose
|
|
86
|
+
}, intl$1.formatMessage({
|
|
87
|
+
id: 'runbox.common.close'
|
|
88
|
+
})), React.createElement(lab.LoadingButton, {
|
|
89
|
+
variant: "contained",
|
|
90
|
+
color: "warning",
|
|
91
|
+
loading: isLoading,
|
|
92
|
+
onClick: handleRestartAction
|
|
93
|
+
}, intl$1.formatMessage({
|
|
94
|
+
id: 'runbox.action.restart.dialog.actions.confirm'
|
|
95
|
+
}))));
|
|
125
96
|
};
|
|
126
97
|
//
|
|
127
98
|
//
|
|
128
99
|
//
|
|
129
|
-
return
|
|
130
|
-
children: [renderRestartMenuItem(), renderConfirmDialog()]
|
|
131
|
-
});
|
|
100
|
+
return React.createElement(React.Fragment, null, renderRestartMenuItem(), renderConfirmDialog());
|
|
132
101
|
};
|
|
133
102
|
|
|
134
103
|
exports.default = MaterialRunboxActionRestart;
|
|
@@ -2,8 +2,6 @@
|
|
|
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');
|
|
7
5
|
var React = require('react');
|
|
8
6
|
var reactUse = require('react-use');
|
|
9
7
|
var intl = require('@elice/intl');
|
|
@@ -16,57 +14,47 @@ require('../contexts/MaterialRunboxApiContext.js');
|
|
|
16
14
|
require('../contexts/MaterialRunboxCommandContext.js');
|
|
17
15
|
var MaterialRunboxContext = require('../contexts/MaterialRunboxContext.js');
|
|
18
16
|
|
|
19
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
20
|
-
|
|
21
|
-
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
22
|
-
|
|
23
17
|
//
|
|
24
18
|
//
|
|
25
19
|
//
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
setClipboardCopied = _React$useState2[1];
|
|
20
|
+
const MaterialRunboxActionShare = ({
|
|
21
|
+
handleMenuClose
|
|
22
|
+
}) => {
|
|
23
|
+
const intl$1 = intl.useRawEliceIntl();
|
|
24
|
+
const {
|
|
25
|
+
enqueueSnackbar
|
|
26
|
+
} = muiXSnackbar.useSnackbar();
|
|
27
|
+
const {
|
|
28
|
+
enableUrlShare
|
|
29
|
+
} = MaterialRunboxContext.useMaterialRunboxContext();
|
|
30
|
+
const {
|
|
31
|
+
url
|
|
32
|
+
} = runboxClient.useEliceRunboxRunning();
|
|
33
|
+
const [{
|
|
34
|
+
value: clipboardValue,
|
|
35
|
+
error
|
|
36
|
+
}, copy] = reactUse.useCopyToClipboard();
|
|
37
|
+
const [isClipboardCopied, setClipboardCopied] = React.useState(false);
|
|
45
38
|
/**
|
|
46
39
|
*
|
|
47
40
|
*/
|
|
48
|
-
|
|
41
|
+
const renderShareMenuItem = () => {
|
|
49
42
|
if (!enableUrlShare) {
|
|
50
43
|
return null;
|
|
51
44
|
}
|
|
52
|
-
return
|
|
45
|
+
return React.createElement(material.MenuItem, {
|
|
53
46
|
disabled: !url,
|
|
54
|
-
onClick: handleShareAction
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
children: intl$1.formatMessage({
|
|
61
|
-
id: 'runbox.action.share.title'
|
|
62
|
-
})
|
|
63
|
-
})]
|
|
64
|
-
});
|
|
47
|
+
onClick: handleShareAction
|
|
48
|
+
}, React.createElement(material.ListItemIcon, null, React.createElement(muiElements.EliceIcon, {
|
|
49
|
+
icon: proSolidSvgIcons.faLinkSimple
|
|
50
|
+
})), React.createElement(material.ListItemText, null, intl$1.formatMessage({
|
|
51
|
+
id: 'runbox.action.share.title'
|
|
52
|
+
})));
|
|
65
53
|
};
|
|
66
54
|
/**
|
|
67
55
|
*
|
|
68
56
|
*/
|
|
69
|
-
|
|
57
|
+
const handleShareAction = () => {
|
|
70
58
|
if (url) {
|
|
71
59
|
copy(url);
|
|
72
60
|
if (!error) {
|
|
@@ -78,7 +66,7 @@ var MaterialRunboxActionShare = function MaterialRunboxActionShare(_ref) {
|
|
|
78
66
|
//
|
|
79
67
|
//
|
|
80
68
|
//
|
|
81
|
-
|
|
69
|
+
React.useEffect(() => {
|
|
82
70
|
if (!isClipboardCopied) {
|
|
83
71
|
return;
|
|
84
72
|
}
|