@elice/material-runbox 1.260908.0 → 1.260910.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 +16 -0
- package/cjs/assets/runbox-loading.svg.js +7 -0
- package/cjs/components/material-runbox/MaterialRunbox.js +16 -11
- package/cjs/components/material-runbox/MaterialRunboxContent.d.ts +2 -0
- package/cjs/components/material-runbox/MaterialRunboxContent.js +93 -65
- package/cjs/components/material-runbox/MaterialRunboxHeader.js +55 -69
- package/cjs/components/material-runbox/actions/MaterialRunboxActionDisconnect.d.ts +1 -4
- package/cjs/components/material-runbox/actions/MaterialRunboxActionDisconnect.js +29 -2
- package/cjs/components/material-runbox/actions/MaterialRunboxActionDisconnectMenuItem.d.ts +3 -0
- package/cjs/components/material-runbox/actions/MaterialRunboxActionDisconnectMenuItem.js +90 -0
- package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.d.ts +3 -1
- package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.js +26 -7
- package/cjs/components/material-runbox/actions/MaterialRunboxActionRestart.d.ts +1 -2
- package/cjs/components/material-runbox/actions/MaterialRunboxActionRestart.js +9 -26
- package/cjs/components/material-runbox/contexts/MaterialRunboxControlContext.d.ts +14 -0
- package/cjs/components/material-runbox/contexts/MaterialRunboxControlContext.js +56 -0
- package/cjs/components/material-runbox/contexts/index.d.ts +2 -0
- package/cjs/components/material-runbox/contexts/index.js +4 -0
- package/cjs/components/material-runbox/disk/MaterialRunboxDiskUsageAlert.d.ts +13 -0
- package/cjs/components/material-runbox/disk/MaterialRunboxDiskUsageAlert.js +71 -0
- package/cjs/components/material-runbox/disk/MaterialRunboxDiskUsageDialog.d.ts +10 -0
- package/cjs/components/material-runbox/disk/MaterialRunboxDiskUsageDialog.js +98 -0
- package/cjs/components/material-runbox/disk/MaterialRunboxEnvResetButton.d.ts +10 -0
- package/cjs/components/material-runbox/disk/MaterialRunboxEnvResetButton.js +151 -0
- package/cjs/components/material-runbox/disk/MaterialRunboxEnvResetDialog.d.ts +13 -0
- package/cjs/components/material-runbox/disk/MaterialRunboxEnvResetDialog.js +98 -0
- package/cjs/components/material-runbox/disk/index.d.ts +8 -1
- package/cjs/components/material-runbox/disk/index.js +8 -2
- package/cjs/components/material-runbox/hooks/index.d.ts +3 -0
- package/cjs/components/material-runbox/hooks/index.js +14 -0
- package/cjs/components/material-runbox/hooks/useRunboxControl.d.ts +4 -3
- package/cjs/components/material-runbox/hooks/useRunboxControl.js +43 -14
- package/cjs/components/material-runbox/hooks/useRunboxDiskUsage.d.ts +16 -0
- package/cjs/components/material-runbox/hooks/useRunboxDiskUsage.js +50 -0
- package/cjs/components/material-runbox/hooks/useRunboxNetworkStatus.d.ts +14 -0
- package/cjs/components/material-runbox/hooks/useRunboxNetworkStatus.js +65 -0
- package/cjs/components/material-runbox/hooks/useRunboxSessionEndWarning.d.ts +18 -0
- package/cjs/components/material-runbox/hooks/useRunboxSessionEndWarning.js +67 -0
- package/cjs/components/material-runbox/locales/en.json.js +1 -1
- package/cjs/components/material-runbox/locales/ja.json.js +1 -1
- package/cjs/components/material-runbox/locales/ko.json.js +1 -1
- package/cjs/components/material-runbox/locales/th.json.js +1 -1
- package/cjs/components/material-runbox/runtime/Runtime.js +21 -18
- package/cjs/components/material-runbox/runtime/RuntimeChangeMaterialDialog.d.ts +0 -1
- package/cjs/components/material-runbox/runtime/RuntimeChangeMaterialDialog.js +9 -3
- package/cjs/components/material-runbox/runtime/RuntimeOverlayAssigned.d.ts +5 -3
- package/cjs/components/material-runbox/runtime/RuntimeOverlayAssigned.js +6 -54
- package/cjs/components/material-runbox/runtime/RuntimeOverlayConflicted.d.ts +0 -1
- package/cjs/components/material-runbox/runtime/RuntimeOverlayConflicted.js +68 -64
- package/cjs/components/material-runbox/runtime/RuntimeOverlayLoading.d.ts +9 -0
- package/cjs/components/material-runbox/runtime/RuntimeOverlayLoading.js +283 -0
- package/cjs/components/material-runbox/runtime/RuntimeOverlayQueued.d.ts +5 -3
- package/cjs/components/material-runbox/runtime/RuntimeOverlayQueued.js +6 -64
- package/cjs/components/material-runbox/runtime/RuntimeOverlayTerminated.d.ts +4 -1
- package/cjs/components/material-runbox/runtime/RuntimeOverlayTerminated.js +92 -70
- package/cjs/components/material-runbox/runtime/runtime-loading-tips.d.ts +7 -0
- package/cjs/components/material-runbox/runtime/runtime-loading-tips.js +148 -0
- package/cjs/components/material-runbox/status/MaterialRunboxStatusButton.d.ts +15 -0
- package/cjs/components/material-runbox/status/MaterialRunboxStatusButton.js +117 -0
- package/cjs/components/material-runbox/status/MaterialRunboxStatusConnectionItem.d.ts +12 -0
- package/cjs/components/material-runbox/status/MaterialRunboxStatusConnectionItem.js +35 -0
- package/cjs/components/material-runbox/status/MaterialRunboxStatusPopover.d.ts +14 -0
- package/cjs/components/material-runbox/status/MaterialRunboxStatusPopover.js +161 -0
- package/cjs/components/material-runbox/status/MaterialRunboxStatusResourceItem.d.ts +11 -0
- package/cjs/components/material-runbox/status/MaterialRunboxStatusResourceItem.js +41 -0
- package/cjs/components/material-runbox/status/index.d.ts +4 -0
- package/cjs/components/material-runbox/status/index.js +9 -0
- package/cjs/components/material-runbox/theme.d.ts +2 -0
- package/cjs/components/material-runbox/theme.js +15 -0
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaAlmostEndDialog.d.ts +11 -0
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaAlmostEndDialog.js +125 -0
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaAmount.d.ts +13 -0
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaAmount.js +56 -0
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.d.ts +12 -0
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.js +126 -0
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaTimePart.d.ts +15 -0
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaTimePart.js +50 -0
- package/cjs/components/material-runbox/timer/MaterialRunboxTimer.d.ts +6 -1
- package/cjs/components/material-runbox/timer/MaterialRunboxTimer.js +26 -18
- package/cjs/components/material-runbox/timer/MaterialRunboxTimerDetailPopover.js +21 -81
- package/cjs/components/shared/hooks/index.d.ts +1 -0
- package/cjs/components/shared/hooks/index.js +7 -0
- package/cjs/components/shared/hooks/useBreakpoint.d.ts +4 -0
- package/cjs/components/shared/hooks/useBreakpoint.js +12 -0
- package/es/_virtual/_rollupPluginBabelHelpers.js +13 -1
- package/es/assets/runbox-loading.svg.js +3 -0
- package/es/components/material-runbox/MaterialRunbox.js +16 -11
- package/es/components/material-runbox/MaterialRunboxContent.d.ts +2 -0
- package/es/components/material-runbox/MaterialRunboxContent.js +94 -66
- package/es/components/material-runbox/MaterialRunboxHeader.js +56 -70
- package/es/components/material-runbox/actions/MaterialRunboxActionDisconnect.d.ts +1 -4
- package/es/components/material-runbox/actions/MaterialRunboxActionDisconnect.js +30 -3
- package/es/components/material-runbox/actions/MaterialRunboxActionDisconnectMenuItem.d.ts +3 -0
- package/es/components/material-runbox/actions/MaterialRunboxActionDisconnectMenuItem.js +82 -0
- package/es/components/material-runbox/actions/MaterialRunboxActionMenu.d.ts +3 -1
- package/es/components/material-runbox/actions/MaterialRunboxActionMenu.js +28 -9
- package/es/components/material-runbox/actions/MaterialRunboxActionRestart.d.ts +1 -2
- package/es/components/material-runbox/actions/MaterialRunboxActionRestart.js +9 -26
- package/es/components/material-runbox/contexts/MaterialRunboxControlContext.d.ts +14 -0
- package/es/components/material-runbox/contexts/MaterialRunboxControlContext.js +46 -0
- package/es/components/material-runbox/contexts/index.d.ts +2 -0
- package/es/components/material-runbox/contexts/index.js +1 -0
- package/es/components/material-runbox/disk/MaterialRunboxDiskUsageAlert.d.ts +13 -0
- package/es/components/material-runbox/disk/MaterialRunboxDiskUsageAlert.js +67 -0
- package/es/components/material-runbox/disk/MaterialRunboxDiskUsageDialog.d.ts +10 -0
- package/es/components/material-runbox/disk/MaterialRunboxDiskUsageDialog.js +94 -0
- package/es/components/material-runbox/disk/MaterialRunboxEnvResetButton.d.ts +10 -0
- package/es/components/material-runbox/disk/MaterialRunboxEnvResetButton.js +143 -0
- package/es/components/material-runbox/disk/MaterialRunboxEnvResetDialog.d.ts +13 -0
- package/es/components/material-runbox/disk/MaterialRunboxEnvResetDialog.js +90 -0
- package/es/components/material-runbox/disk/index.d.ts +8 -1
- package/es/components/material-runbox/disk/index.js +4 -1
- package/es/components/material-runbox/hooks/index.d.ts +3 -0
- package/es/components/material-runbox/hooks/index.js +3 -0
- package/es/components/material-runbox/hooks/useRunboxControl.d.ts +4 -3
- package/es/components/material-runbox/hooks/useRunboxControl.js +43 -14
- package/es/components/material-runbox/hooks/useRunboxDiskUsage.d.ts +16 -0
- package/es/components/material-runbox/hooks/useRunboxDiskUsage.js +42 -0
- package/es/components/material-runbox/hooks/useRunboxNetworkStatus.d.ts +14 -0
- package/es/components/material-runbox/hooks/useRunboxNetworkStatus.js +59 -0
- package/es/components/material-runbox/hooks/useRunboxSessionEndWarning.d.ts +18 -0
- package/es/components/material-runbox/hooks/useRunboxSessionEndWarning.js +63 -0
- package/es/components/material-runbox/locales/en.json.js +1 -1
- package/es/components/material-runbox/locales/ja.json.js +1 -1
- package/es/components/material-runbox/locales/ko.json.js +1 -1
- package/es/components/material-runbox/locales/th.json.js +1 -1
- package/es/components/material-runbox/runtime/Runtime.js +22 -19
- package/es/components/material-runbox/runtime/RuntimeChangeMaterialDialog.d.ts +0 -1
- package/es/components/material-runbox/runtime/RuntimeChangeMaterialDialog.js +9 -3
- package/es/components/material-runbox/runtime/RuntimeOverlayAssigned.d.ts +5 -3
- package/es/components/material-runbox/runtime/RuntimeOverlayAssigned.js +7 -55
- package/es/components/material-runbox/runtime/RuntimeOverlayConflicted.d.ts +0 -1
- package/es/components/material-runbox/runtime/RuntimeOverlayConflicted.js +69 -65
- package/es/components/material-runbox/runtime/RuntimeOverlayLoading.d.ts +9 -0
- package/es/components/material-runbox/runtime/RuntimeOverlayLoading.js +275 -0
- package/es/components/material-runbox/runtime/RuntimeOverlayQueued.d.ts +5 -3
- package/es/components/material-runbox/runtime/RuntimeOverlayQueued.js +7 -65
- package/es/components/material-runbox/runtime/RuntimeOverlayTerminated.d.ts +4 -1
- package/es/components/material-runbox/runtime/RuntimeOverlayTerminated.js +82 -60
- package/es/components/material-runbox/runtime/runtime-loading-tips.d.ts +7 -0
- package/es/components/material-runbox/runtime/runtime-loading-tips.js +146 -0
- package/es/components/material-runbox/status/MaterialRunboxStatusButton.d.ts +15 -0
- package/es/components/material-runbox/status/MaterialRunboxStatusButton.js +109 -0
- package/es/components/material-runbox/status/MaterialRunboxStatusConnectionItem.d.ts +12 -0
- package/es/components/material-runbox/status/MaterialRunboxStatusConnectionItem.js +31 -0
- package/es/components/material-runbox/status/MaterialRunboxStatusPopover.d.ts +14 -0
- package/es/components/material-runbox/status/MaterialRunboxStatusPopover.js +157 -0
- package/es/components/material-runbox/status/MaterialRunboxStatusResourceItem.d.ts +11 -0
- package/es/components/material-runbox/status/MaterialRunboxStatusResourceItem.js +37 -0
- package/es/components/material-runbox/status/index.d.ts +4 -0
- package/es/components/material-runbox/status/index.js +2 -0
- package/es/components/material-runbox/theme.d.ts +2 -0
- package/es/components/material-runbox/theme.js +12 -0
- package/es/components/material-runbox/timer/MaterialRunboxQuotaAlmostEndDialog.d.ts +11 -0
- package/es/components/material-runbox/timer/MaterialRunboxQuotaAlmostEndDialog.js +121 -0
- package/es/components/material-runbox/timer/MaterialRunboxQuotaAmount.d.ts +13 -0
- package/es/components/material-runbox/timer/MaterialRunboxQuotaAmount.js +52 -0
- package/es/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.d.ts +12 -0
- package/es/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.js +122 -0
- package/es/components/material-runbox/timer/MaterialRunboxQuotaTimePart.d.ts +15 -0
- package/es/components/material-runbox/timer/MaterialRunboxQuotaTimePart.js +46 -0
- package/es/components/material-runbox/timer/MaterialRunboxTimer.d.ts +6 -1
- package/es/components/material-runbox/timer/MaterialRunboxTimer.js +25 -17
- package/es/components/material-runbox/timer/MaterialRunboxTimerDetailPopover.js +18 -78
- package/es/components/shared/hooks/index.d.ts +1 -0
- package/es/components/shared/hooks/index.js +1 -0
- package/es/components/shared/hooks/useBreakpoint.d.ts +4 -0
- package/es/components/shared/hooks/useBreakpoint.js +10 -0
- package/package.json +7 -7
- package/cjs/assets/queue.gif.js +0 -7
- package/cjs/assets/runbox_logo.png.js +0 -7
- package/cjs/components/material-runbox/MaterialRunboxFooter.d.ts +0 -4
- package/cjs/components/material-runbox/MaterialRunboxFooter.js +0 -64
- package/cjs/components/material-runbox/disk/MaterialRunboxDiskAlmostFullSnackbar.d.ts +0 -5
- package/cjs/components/material-runbox/disk/MaterialRunboxDiskAlmostFullSnackbar.js +0 -98
- package/cjs/components/material-runbox/timer/MaterialRunboxAlmostEndSnackbars.d.ts +0 -6
- package/cjs/components/material-runbox/timer/MaterialRunboxAlmostEndSnackbars.js +0 -90
- package/es/assets/queue.gif.js +0 -3
- package/es/assets/runbox_logo.png.js +0 -3
- package/es/components/material-runbox/MaterialRunboxFooter.d.ts +0 -4
- package/es/components/material-runbox/MaterialRunboxFooter.js +0 -56
- package/es/components/material-runbox/disk/MaterialRunboxDiskAlmostFullSnackbar.d.ts +0 -5
- package/es/components/material-runbox/disk/MaterialRunboxDiskAlmostFullSnackbar.js +0 -94
- package/es/components/material-runbox/timer/MaterialRunboxAlmostEndSnackbars.d.ts +0 -6
- package/es/components/material-runbox/timer/MaterialRunboxAlmostEndSnackbars.js +0 -86
|
@@ -6,9 +6,13 @@ var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHel
|
|
|
6
6
|
var jsxRuntime = require('react/jsx-runtime');
|
|
7
7
|
var React = require('react');
|
|
8
8
|
var intl = require('@elice/intl');
|
|
9
|
+
var muiElements = require('@elice/mui-elements');
|
|
9
10
|
var runboxClient = require('@elice/runbox-client');
|
|
11
|
+
var proSolidSvgIcons = require('@fortawesome/pro-solid-svg-icons');
|
|
10
12
|
var material = require('@mui/material');
|
|
11
13
|
var MaterialRunboxActionDisconnectDialog = require('./MaterialRunboxActionDisconnectDialog.js');
|
|
14
|
+
var useBreakpoint = require('../../shared/hooks/useBreakpoint.js');
|
|
15
|
+
var MaterialRunboxControlContext = require('../contexts/MaterialRunboxControlContext.js');
|
|
12
16
|
|
|
13
17
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
14
18
|
|
|
@@ -17,12 +21,15 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
17
21
|
//
|
|
18
22
|
//
|
|
19
23
|
//
|
|
20
|
-
var MaterialRunboxActionDisconnect = function MaterialRunboxActionDisconnect(
|
|
21
|
-
var stopRuntime = _ref.stopRuntime;
|
|
24
|
+
var MaterialRunboxActionDisconnect = function MaterialRunboxActionDisconnect() {
|
|
22
25
|
var intl$1 = intl.useRawEliceIntl();
|
|
26
|
+
var isSmallTabletOrSmaller = useBreakpoint.useBreakpoint('md', 'down');
|
|
27
|
+
var isMobileOrSmaller = useBreakpoint.useBreakpoint('sm', 'down');
|
|
23
28
|
var _useEliceRunboxRunnin = runboxClient.useEliceRunboxRunning(),
|
|
24
29
|
status = _useEliceRunboxRunnin.status;
|
|
25
30
|
var isRunboxTerminated = status === 'terminated';
|
|
31
|
+
var _useMaterialRunboxCon = MaterialRunboxControlContext.useMaterialRunboxControlContext(),
|
|
32
|
+
stopRuntime = _useMaterialRunboxCon.stop;
|
|
26
33
|
var _React$useState = React__default.default.useState(false),
|
|
27
34
|
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
28
35
|
isDisconnectDialogOpen = _React$useState2[0],
|
|
@@ -44,6 +51,23 @@ var MaterialRunboxActionDisconnect = function MaterialRunboxActionDisconnect(_re
|
|
|
44
51
|
*
|
|
45
52
|
*/
|
|
46
53
|
var renderActionButton = function renderActionButton() {
|
|
54
|
+
if (isSmallTabletOrSmaller) {
|
|
55
|
+
return jsxRuntime.jsx(material.Tooltip, {
|
|
56
|
+
title: intl$1.formatMessage({
|
|
57
|
+
id: 'runbox.action.disconnect.title'
|
|
58
|
+
}),
|
|
59
|
+
children: jsxRuntime.jsx("span", {
|
|
60
|
+
children: jsxRuntime.jsx(material.IconButton, {
|
|
61
|
+
size: "small",
|
|
62
|
+
disabled: isRunboxTerminated,
|
|
63
|
+
onClick: handleClickAction,
|
|
64
|
+
children: jsxRuntime.jsx(muiElements.EliceIcon, {
|
|
65
|
+
icon: proSolidSvgIcons.faLinkSlash
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
})
|
|
69
|
+
});
|
|
70
|
+
}
|
|
47
71
|
return jsxRuntime.jsx(material.Button, {
|
|
48
72
|
disabled: isRunboxTerminated,
|
|
49
73
|
variant: "contained",
|
|
@@ -73,6 +97,9 @@ var MaterialRunboxActionDisconnect = function MaterialRunboxActionDisconnect(_re
|
|
|
73
97
|
//
|
|
74
98
|
//
|
|
75
99
|
//
|
|
100
|
+
if (isMobileOrSmaller) {
|
|
101
|
+
return null;
|
|
102
|
+
}
|
|
76
103
|
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
77
104
|
children: [renderActionButton(), renderDisconnectDialog()]
|
|
78
105
|
});
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var intl = require('@elice/intl');
|
|
9
|
+
var muiElements = require('@elice/mui-elements');
|
|
10
|
+
var runboxClient = require('@elice/runbox-client');
|
|
11
|
+
var proSolidSvgIcons = require('@fortawesome/pro-solid-svg-icons');
|
|
12
|
+
var lab = require('@mui/lab');
|
|
13
|
+
var material = require('@mui/material');
|
|
14
|
+
var MaterialRunboxActionDisconnectDialog = require('./MaterialRunboxActionDisconnectDialog.js');
|
|
15
|
+
var MaterialRunboxControlContext = require('../contexts/MaterialRunboxControlContext.js');
|
|
16
|
+
|
|
17
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
18
|
+
|
|
19
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
20
|
+
|
|
21
|
+
//
|
|
22
|
+
//
|
|
23
|
+
//
|
|
24
|
+
var MaterialRunboxActionDisconnectMenuItem = function MaterialRunboxActionDisconnectMenuItem() {
|
|
25
|
+
var intl$1 = intl.useRawEliceIntl();
|
|
26
|
+
var _useEliceRunboxRunnin = runboxClient.useEliceRunboxRunning(),
|
|
27
|
+
status = _useEliceRunboxRunnin.status;
|
|
28
|
+
var isRunboxTerminated = status === 'terminated';
|
|
29
|
+
var _useMaterialRunboxCon = MaterialRunboxControlContext.useMaterialRunboxControlContext(),
|
|
30
|
+
stopRuntime = _useMaterialRunboxCon.stop,
|
|
31
|
+
isStopping = _useMaterialRunboxCon.isStopping;
|
|
32
|
+
var _React$useState = React__default.default.useState(false),
|
|
33
|
+
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
34
|
+
isDisconnectDialogOpen = _React$useState2[0],
|
|
35
|
+
setDisconnectDialogOpen = _React$useState2[1];
|
|
36
|
+
/**
|
|
37
|
+
*
|
|
38
|
+
*/
|
|
39
|
+
var handleConfirmDisconnect = /*#__PURE__*/function () {
|
|
40
|
+
var _ref = _rollupPluginBabelHelpers.asyncToGenerator(/*#__PURE__*/_rollupPluginBabelHelpers.regenerator().m(function _callee() {
|
|
41
|
+
return _rollupPluginBabelHelpers.regenerator().w(function (_context) {
|
|
42
|
+
while (1) switch (_context.n) {
|
|
43
|
+
case 0:
|
|
44
|
+
setDisconnectDialogOpen(false);
|
|
45
|
+
_context.n = 1;
|
|
46
|
+
return stopRuntime();
|
|
47
|
+
case 1:
|
|
48
|
+
return _context.a(2);
|
|
49
|
+
}
|
|
50
|
+
}, _callee);
|
|
51
|
+
}));
|
|
52
|
+
return function handleConfirmDisconnect() {
|
|
53
|
+
return _ref.apply(this, arguments);
|
|
54
|
+
};
|
|
55
|
+
}();
|
|
56
|
+
//
|
|
57
|
+
//
|
|
58
|
+
//
|
|
59
|
+
return jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
60
|
+
children: [jsxRuntime.jsxs(material.MenuItem, {
|
|
61
|
+
fullWidth: true,
|
|
62
|
+
component: lab.LoadingButton,
|
|
63
|
+
color: "inherit",
|
|
64
|
+
loading: isStopping,
|
|
65
|
+
disabled: isRunboxTerminated,
|
|
66
|
+
onClick: function onClick() {
|
|
67
|
+
return setDisconnectDialogOpen(true);
|
|
68
|
+
},
|
|
69
|
+
children: [jsxRuntime.jsx(material.ListItemIcon, {
|
|
70
|
+
children: jsxRuntime.jsx(muiElements.EliceIcon, {
|
|
71
|
+
icon: proSolidSvgIcons.faLinkSlash
|
|
72
|
+
})
|
|
73
|
+
}), jsxRuntime.jsx(material.ListItemText, {
|
|
74
|
+
children: intl$1.formatMessage({
|
|
75
|
+
id: 'runbox.action.disconnect.title'
|
|
76
|
+
})
|
|
77
|
+
})]
|
|
78
|
+
}), jsxRuntime.jsx(MaterialRunboxActionDisconnectDialog.default, {
|
|
79
|
+
open: isDisconnectDialogOpen,
|
|
80
|
+
onClose: function onClose() {
|
|
81
|
+
return setDisconnectDialogOpen(false);
|
|
82
|
+
},
|
|
83
|
+
onConfirm: function onConfirm() {
|
|
84
|
+
return void handleConfirmDisconnect();
|
|
85
|
+
}
|
|
86
|
+
})]
|
|
87
|
+
});
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
exports.default = MaterialRunboxActionDisconnectMenuItem;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { RuntimeProps } from '../runtime/Runtime';
|
|
3
|
-
type MaterialRunboxActionMenuProps = Pick<RuntimeProps, 'runbox' | 'runtime' | 'courseId' | 'refetch' | 'studentUserId' | 'isTutoring' | 'getAchievementColor'> & {
|
|
3
|
+
type MaterialRunboxActionMenuProps = Pick<RuntimeProps, 'runbox' | 'runtime' | 'runtimeTemplate' | 'courseId' | 'refetch' | 'studentUserId' | 'isTutoring' | 'getAchievementColor'> & {
|
|
4
4
|
menuAnchorEl: null | HTMLButtonElement;
|
|
5
|
+
/** Whether the auto-shutdown toggle is available. Decided by the header. */
|
|
6
|
+
enableAutoShutdown?: boolean;
|
|
5
7
|
handleMenuClose: () => void;
|
|
6
8
|
};
|
|
7
9
|
declare const MaterialRunboxActionMenu: React.FC<MaterialRunboxActionMenuProps>;
|
|
@@ -10,10 +10,13 @@ var runboxClient = require('@elice/runbox-client');
|
|
|
10
10
|
var types = require('@elice/types');
|
|
11
11
|
var material = require('@mui/material');
|
|
12
12
|
var reactQuery = require('@tanstack/react-query');
|
|
13
|
+
var MaterialRunboxActionAutoShutdown = require('./MaterialRunboxActionAutoShutdown.js');
|
|
14
|
+
var MaterialRunboxActionDisconnectMenuItem = require('./MaterialRunboxActionDisconnectMenuItem.js');
|
|
13
15
|
var MaterialRunboxActionReset = require('./MaterialRunboxActionReset.js');
|
|
14
16
|
var MaterialRunboxActionRestart = require('./MaterialRunboxActionRestart.js');
|
|
15
17
|
var MaterialRunboxActionShare = require('./MaterialRunboxActionShare.js');
|
|
16
18
|
var MaterialRunboxActionSubmitLog = require('./MaterialRunboxActionSubmitLog.js');
|
|
19
|
+
var useBreakpoint = require('../../shared/hooks/useBreakpoint.js');
|
|
17
20
|
|
|
18
21
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
19
22
|
|
|
@@ -25,9 +28,12 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
25
28
|
var MaterialRunboxActionMenu = function MaterialRunboxActionMenu(_ref) {
|
|
26
29
|
var runbox = _ref.runbox,
|
|
27
30
|
runtime = _ref.runtime,
|
|
31
|
+
runtimeTemplate = _ref.runtimeTemplate,
|
|
28
32
|
courseId = _ref.courseId,
|
|
29
33
|
studentUserId = _ref.studentUserId,
|
|
30
34
|
isTutoring = _ref.isTutoring,
|
|
35
|
+
_ref$enableAutoShutdo = _ref.enableAutoShutdown,
|
|
36
|
+
enableAutoShutdown = _ref$enableAutoShutdo === void 0 ? false : _ref$enableAutoShutdo,
|
|
31
37
|
menuAnchorEl = _ref.menuAnchorEl,
|
|
32
38
|
refetch = _ref.refetch,
|
|
33
39
|
getAchievementColor = _ref.getAchievementColor,
|
|
@@ -35,6 +41,7 @@ var MaterialRunboxActionMenu = function MaterialRunboxActionMenu(_ref) {
|
|
|
35
41
|
var _a, _b;
|
|
36
42
|
var _useEliceRunboxRunnin = runboxClient.useEliceRunboxRunning(),
|
|
37
43
|
status = _useEliceRunboxRunnin.status;
|
|
44
|
+
var isMobileOrSmaller = useBreakpoint.useBreakpoint('sm', 'down');
|
|
38
45
|
var isRunboxRunning = status === 'running';
|
|
39
46
|
//
|
|
40
47
|
//
|
|
@@ -87,16 +94,28 @@ var MaterialRunboxActionMenu = function MaterialRunboxActionMenu(_ref) {
|
|
|
87
94
|
vertical: 'top',
|
|
88
95
|
horizontal: 'right'
|
|
89
96
|
},
|
|
97
|
+
TransitionComponent: material.Fade,
|
|
90
98
|
onClose: handleMenuClose,
|
|
91
|
-
children: [jsxRuntime.
|
|
99
|
+
children: [enableAutoShutdown ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
100
|
+
children: [jsxRuntime.jsx(material.Stack, {
|
|
101
|
+
direction: "row",
|
|
102
|
+
alignItems: "center",
|
|
103
|
+
padding: "0.25rem 0.5rem",
|
|
104
|
+
children: jsxRuntime.jsx(MaterialRunboxActionAutoShutdown.default, {
|
|
105
|
+
runtime: runtime,
|
|
106
|
+
runtimeTemplate: runtimeTemplate,
|
|
107
|
+
courseId: courseId,
|
|
108
|
+
refetch: refetch
|
|
109
|
+
})
|
|
110
|
+
}), jsxRuntime.jsx(material.Divider, {
|
|
111
|
+
sx: {
|
|
112
|
+
margin: '0.5rem 0'
|
|
113
|
+
}
|
|
114
|
+
})]
|
|
115
|
+
}) : null, jsxRuntime.jsx(MaterialRunboxActionShare.default, {
|
|
92
116
|
handleMenuClose: handleMenuClose
|
|
93
117
|
}), jsxRuntime.jsx(MaterialRunboxActionRestart.default, {
|
|
94
|
-
runbox: runbox,
|
|
95
|
-
runtime: runtime,
|
|
96
|
-
courseId: courseId,
|
|
97
118
|
envMode: envMode,
|
|
98
|
-
studentUserId: studentUserId,
|
|
99
|
-
refetch: refetch,
|
|
100
119
|
handleMenuClose: handleMenuClose
|
|
101
120
|
}), isTutoring && studentUserId ? jsxRuntime.jsx(MaterialRunboxActionSubmitLog.default, {
|
|
102
121
|
runboxId: runbox === null || runbox === void 0 ? void 0 : runbox.id,
|
|
@@ -109,7 +128,7 @@ var MaterialRunboxActionMenu = function MaterialRunboxActionMenu(_ref) {
|
|
|
109
128
|
courseId: courseId,
|
|
110
129
|
envMode: envMode,
|
|
111
130
|
handleMenuClose: handleMenuClose
|
|
112
|
-
})]
|
|
131
|
+
}), isMobileOrSmaller && !isTutoring ? jsxRuntime.jsx(MaterialRunboxActionDisconnectMenuItem.default, {}) : null]
|
|
113
132
|
});
|
|
114
133
|
};
|
|
115
134
|
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { enums } from '@elice/types';
|
|
3
|
-
|
|
4
|
-
type MaterialRunboxActionRestartProps = Pick<RuntimeProps, 'runbox' | 'runtime' | 'courseId' | 'refetch' | 'studentUserId'> & {
|
|
3
|
+
type MaterialRunboxActionRestartProps = {
|
|
5
4
|
envMode: enums.LeaderboardEnvModeType;
|
|
6
5
|
handleMenuClose: () => void;
|
|
7
6
|
};
|
|
@@ -11,7 +11,7 @@ var types = require('@elice/types');
|
|
|
11
11
|
var proSolidSvgIcons = require('@fortawesome/pro-solid-svg-icons');
|
|
12
12
|
var lab = require('@mui/lab');
|
|
13
13
|
var material = require('@mui/material');
|
|
14
|
-
var
|
|
14
|
+
var MaterialRunboxControlContext = require('../contexts/MaterialRunboxControlContext.js');
|
|
15
15
|
|
|
16
16
|
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
17
17
|
|
|
@@ -21,31 +21,16 @@ var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
|
21
21
|
//
|
|
22
22
|
//
|
|
23
23
|
var MaterialRunboxActionRestart = function MaterialRunboxActionRestart(_ref) {
|
|
24
|
-
var
|
|
25
|
-
runtime = _ref.runtime,
|
|
26
|
-
courseId = _ref.courseId,
|
|
27
|
-
refetch = _ref.refetch,
|
|
28
|
-
studentUserId = _ref.studentUserId,
|
|
29
|
-
envMode = _ref.envMode,
|
|
24
|
+
var envMode = _ref.envMode,
|
|
30
25
|
handleMenuClose = _ref.handleMenuClose;
|
|
31
26
|
var intl$1 = intl.useRawEliceIntl();
|
|
32
27
|
var _React$useState = React__default.default.useState(false),
|
|
33
28
|
_React$useState2 = _rollupPluginBabelHelpers.slicedToArray(_React$useState, 2),
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
setDialogOpened = _React$useState4[1];
|
|
40
|
-
// restart
|
|
41
|
-
var _useRunboxControl = useRunboxControl.useRunboxControl({
|
|
42
|
-
runbox: runbox,
|
|
43
|
-
runtime: runtime,
|
|
44
|
-
courseId: courseId,
|
|
45
|
-
refetch: refetch,
|
|
46
|
-
userId: studentUserId
|
|
47
|
-
}),
|
|
48
|
-
start = _useRunboxControl.start;
|
|
29
|
+
isDialogOpened = _React$useState2[0],
|
|
30
|
+
setDialogOpened = _React$useState2[1];
|
|
31
|
+
var _useMaterialRunboxCon = MaterialRunboxControlContext.useMaterialRunboxControlContext(),
|
|
32
|
+
start = _useMaterialRunboxCon.start,
|
|
33
|
+
isStarting = _useMaterialRunboxCon.isStarting;
|
|
49
34
|
/**
|
|
50
35
|
*
|
|
51
36
|
*/
|
|
@@ -56,7 +41,6 @@ var MaterialRunboxActionRestart = function MaterialRunboxActionRestart(_ref) {
|
|
|
56
41
|
*
|
|
57
42
|
*/
|
|
58
43
|
var handleRestartAction = function handleRestartAction() {
|
|
59
|
-
setIsLoading(true);
|
|
60
44
|
start({
|
|
61
45
|
force: true
|
|
62
46
|
})["catch"](function () {
|
|
@@ -64,7 +48,6 @@ var MaterialRunboxActionRestart = function MaterialRunboxActionRestart(_ref) {
|
|
|
64
48
|
})["finally"](function () {
|
|
65
49
|
handleDialogClose();
|
|
66
50
|
handleMenuClose();
|
|
67
|
-
setIsLoading(false);
|
|
68
51
|
});
|
|
69
52
|
};
|
|
70
53
|
/**
|
|
@@ -116,7 +99,7 @@ var MaterialRunboxActionRestart = function MaterialRunboxActionRestart(_ref) {
|
|
|
116
99
|
}), jsxRuntime.jsxs(material.DialogActions, {
|
|
117
100
|
children: [jsxRuntime.jsx(material.Button, {
|
|
118
101
|
color: "inherit",
|
|
119
|
-
disabled:
|
|
102
|
+
disabled: isStarting,
|
|
120
103
|
onClick: handleDialogClose,
|
|
121
104
|
children: intl$1.formatMessage({
|
|
122
105
|
id: 'runbox.common.close'
|
|
@@ -124,7 +107,7 @@ var MaterialRunboxActionRestart = function MaterialRunboxActionRestart(_ref) {
|
|
|
124
107
|
}), jsxRuntime.jsx(lab.LoadingButton, {
|
|
125
108
|
variant: "contained",
|
|
126
109
|
color: "warning",
|
|
127
|
-
loading:
|
|
110
|
+
loading: isStarting,
|
|
128
111
|
onClick: handleRestartAction,
|
|
129
112
|
children: intl$1.formatMessage({
|
|
130
113
|
id: 'runbox.action.restart.dialog.actions.confirm'
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { UseRunboxControlProps, UseRunboxControlReturn } from '../hooks/useRunboxControl';
|
|
3
|
+
export type MaterialRunboxControlContextValue = UseRunboxControlReturn;
|
|
4
|
+
export interface MaterialRunboxControlContextProps extends UseRunboxControlProps {
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
export declare const MaterialRunboxControlContext: React.Context<UseRunboxControlReturn>;
|
|
8
|
+
export declare const useMaterialRunboxControlContext: () => UseRunboxControlReturn;
|
|
9
|
+
/**
|
|
10
|
+
* Owns the single `useRunboxControl` instance for one runbox, so every consumer
|
|
11
|
+
* shares one abort controller and one pre-check result.
|
|
12
|
+
*/
|
|
13
|
+
declare const MaterialRunboxControlContextProvider: React.FC<MaterialRunboxControlContextProps>;
|
|
14
|
+
export default MaterialRunboxControlContextProvider;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var tslib = require('tslib');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var React = require('react');
|
|
8
|
+
var useRunboxControl = require('../hooks/useRunboxControl.js');
|
|
9
|
+
|
|
10
|
+
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
11
|
+
|
|
12
|
+
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
13
|
+
|
|
14
|
+
//
|
|
15
|
+
//
|
|
16
|
+
//
|
|
17
|
+
var MaterialRunboxControlContext = React__default.default.createContext({});
|
|
18
|
+
var useMaterialRunboxControlContext = function useMaterialRunboxControlContext() {
|
|
19
|
+
return React__default.default.useContext(MaterialRunboxControlContext);
|
|
20
|
+
};
|
|
21
|
+
//
|
|
22
|
+
//
|
|
23
|
+
//
|
|
24
|
+
/**
|
|
25
|
+
* Owns the single `useRunboxControl` instance for one runbox, so every consumer
|
|
26
|
+
* shares one abort controller and one pre-check result.
|
|
27
|
+
*/
|
|
28
|
+
var MaterialRunboxControlContextProvider = function MaterialRunboxControlContextProvider(_a) {
|
|
29
|
+
var children = _a.children,
|
|
30
|
+
props = tslib.__rest(_a, ["children"]);
|
|
31
|
+
var _useRunboxControl = useRunboxControl.useRunboxControl(props),
|
|
32
|
+
start = _useRunboxControl.start,
|
|
33
|
+
stop = _useRunboxControl.stop,
|
|
34
|
+
isStarting = _useRunboxControl.isStarting,
|
|
35
|
+
isStopping = _useRunboxControl.isStopping,
|
|
36
|
+
preCheckStatus = _useRunboxControl.preCheckStatus;
|
|
37
|
+
// The hook hands back one mutated ref, so a stable value would leave
|
|
38
|
+
// consumers reading stale fields once anything below here is memoized.
|
|
39
|
+
var value = React__default.default.useMemo(function () {
|
|
40
|
+
return {
|
|
41
|
+
start: start,
|
|
42
|
+
stop: stop,
|
|
43
|
+
isStarting: isStarting,
|
|
44
|
+
isStopping: isStopping,
|
|
45
|
+
preCheckStatus: preCheckStatus
|
|
46
|
+
};
|
|
47
|
+
}, [start, stop, isStarting, isStopping, preCheckStatus]);
|
|
48
|
+
return jsxRuntime.jsx(MaterialRunboxControlContext.Provider, {
|
|
49
|
+
children: children,
|
|
50
|
+
value: value
|
|
51
|
+
});
|
|
52
|
+
};
|
|
53
|
+
|
|
54
|
+
exports.MaterialRunboxControlContext = MaterialRunboxControlContext;
|
|
55
|
+
exports.default = MaterialRunboxControlContextProvider;
|
|
56
|
+
exports.useMaterialRunboxControlContext = useMaterialRunboxControlContext;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export { default as MaterialRunboxApiContextProvider, MaterialRunboxApiContext, useMaterialRunboxApiContext, } from './MaterialRunboxApiContext';
|
|
2
2
|
export { default as MaterialRunboxCommandContextProvider, MaterialRunboxCommandContext, useMaterialRunboxCommandContext, } from './MaterialRunboxCommandContext';
|
|
3
|
+
export { default as MaterialRunboxControlContextProvider, MaterialRunboxControlContext, useMaterialRunboxControlContext, } from './MaterialRunboxControlContext';
|
|
3
4
|
export { default as MaterialRunboxContextProvider, MaterialRunboxContext, useMaterialRunboxContext, } from './MaterialRunboxContext';
|
|
4
5
|
export type { MaterialRunboxApiContextProps, MaterialRunboxApiContextValue, } from './MaterialRunboxApiContext';
|
|
5
6
|
export type { MaterialRunboxCommandContextProps, MaterialRunboxCommandContextValue, } from './MaterialRunboxCommandContext';
|
|
6
7
|
export type { MaterialRunboxContextProps, MaterialRunboxContextValue, RunningRunboxLinkProps, } from './MaterialRunboxContext';
|
|
8
|
+
export type { MaterialRunboxControlContextProps, MaterialRunboxControlContextValue, } from './MaterialRunboxControlContext';
|
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var MaterialRunboxApiContext = require('./MaterialRunboxApiContext.js');
|
|
4
4
|
var MaterialRunboxCommandContext = require('./MaterialRunboxCommandContext.js');
|
|
5
|
+
var MaterialRunboxControlContext = require('./MaterialRunboxControlContext.js');
|
|
5
6
|
var MaterialRunboxContext = require('./MaterialRunboxContext.js');
|
|
6
7
|
|
|
7
8
|
|
|
@@ -12,6 +13,9 @@ exports.useMaterialRunboxApiContext = MaterialRunboxApiContext.useMaterialRunbox
|
|
|
12
13
|
exports.MaterialRunboxCommandContext = MaterialRunboxCommandContext.MaterialRunboxCommandContext;
|
|
13
14
|
exports.MaterialRunboxCommandContextProvider = MaterialRunboxCommandContext.default;
|
|
14
15
|
exports.useMaterialRunboxCommandContext = MaterialRunboxCommandContext.useMaterialRunboxCommandContext;
|
|
16
|
+
exports.MaterialRunboxControlContext = MaterialRunboxControlContext.MaterialRunboxControlContext;
|
|
17
|
+
exports.MaterialRunboxControlContextProvider = MaterialRunboxControlContext.default;
|
|
18
|
+
exports.useMaterialRunboxControlContext = MaterialRunboxControlContext.useMaterialRunboxControlContext;
|
|
15
19
|
exports.MaterialRunboxContext = MaterialRunboxContext.MaterialRunboxContext;
|
|
16
20
|
exports.MaterialRunboxContextProvider = MaterialRunboxContext.default;
|
|
17
21
|
exports.useMaterialRunboxContext = MaterialRunboxContext.useMaterialRunboxContext;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export interface MaterialRunboxDiskUsageAlertProps {
|
|
3
|
+
runtimeTemplateId: string;
|
|
4
|
+
courseId: number;
|
|
5
|
+
/** User ID for tutoring. */
|
|
6
|
+
userId?: number;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Persistent bar under the header once disk usage passes 80%. Unlike the notice
|
|
10
|
+
* dialog it stays put, because it carries the only way out — the reset CTA.
|
|
11
|
+
*/
|
|
12
|
+
declare const MaterialRunboxDiskUsageAlert: React.FC<MaterialRunboxDiskUsageAlertProps>;
|
|
13
|
+
export default MaterialRunboxDiskUsageAlert;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var intl = require('@elice/intl');
|
|
7
|
+
var muiElements = require('@elice/mui-elements');
|
|
8
|
+
var proSolidSvgIcons = require('@fortawesome/pro-solid-svg-icons');
|
|
9
|
+
var material = require('@mui/material');
|
|
10
|
+
var MaterialRunboxEnvResetButton = require('./MaterialRunboxEnvResetButton.js');
|
|
11
|
+
var useRunboxDiskUsage = require('../hooks/useRunboxDiskUsage.js');
|
|
12
|
+
|
|
13
|
+
//
|
|
14
|
+
//
|
|
15
|
+
//
|
|
16
|
+
/**
|
|
17
|
+
* Persistent bar under the header once disk usage passes 80%. Unlike the notice
|
|
18
|
+
* dialog it stays put, because it carries the only way out — the reset CTA.
|
|
19
|
+
*/
|
|
20
|
+
var MaterialRunboxDiskUsageAlert = function MaterialRunboxDiskUsageAlert(_ref) {
|
|
21
|
+
var runtimeTemplateId = _ref.runtimeTemplateId,
|
|
22
|
+
courseId = _ref.courseId,
|
|
23
|
+
userId = _ref.userId;
|
|
24
|
+
var intl$1 = intl.useRawEliceIntl();
|
|
25
|
+
var _useRunboxDiskUsage = useRunboxDiskUsage.useRunboxDiskUsage(),
|
|
26
|
+
severity = _useRunboxDiskUsage.severity,
|
|
27
|
+
diskCurrent = _useRunboxDiskUsage.diskCurrent,
|
|
28
|
+
diskTotal = _useRunboxDiskUsage.diskTotal;
|
|
29
|
+
if (!severity) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
//
|
|
33
|
+
//
|
|
34
|
+
//
|
|
35
|
+
return jsxRuntime.jsx(material.Alert, {
|
|
36
|
+
severity: severity,
|
|
37
|
+
sx: {
|
|
38
|
+
width: '100%',
|
|
39
|
+
borderRadius: '0',
|
|
40
|
+
alignItems: 'center'
|
|
41
|
+
},
|
|
42
|
+
action: jsxRuntime.jsx(MaterialRunboxEnvResetButton.default, {
|
|
43
|
+
variant: "text",
|
|
44
|
+
size: "small",
|
|
45
|
+
color: "inherit",
|
|
46
|
+
startIcon: jsxRuntime.jsx(muiElements.EliceIcon, {
|
|
47
|
+
icon: proSolidSvgIcons.faArrowsRotate
|
|
48
|
+
}),
|
|
49
|
+
runtimeTemplateId: runtimeTemplateId,
|
|
50
|
+
courseId: courseId,
|
|
51
|
+
userId: userId
|
|
52
|
+
}),
|
|
53
|
+
children: jsxRuntime.jsx(material.Typography, {
|
|
54
|
+
variant: "body2",
|
|
55
|
+
children: intl$1.formatMessage({
|
|
56
|
+
id: "runbox.disk.usage.alert.".concat(severity)
|
|
57
|
+
}, {
|
|
58
|
+
used: intl$1.formatDataSize(diskCurrent, {
|
|
59
|
+
unitSystem: 'iec',
|
|
60
|
+
maximumFractionDigits: 2
|
|
61
|
+
}),
|
|
62
|
+
total: intl$1.formatDataSize(diskTotal, {
|
|
63
|
+
unitSystem: 'iec',
|
|
64
|
+
maximumFractionDigits: 2
|
|
65
|
+
})
|
|
66
|
+
})
|
|
67
|
+
})
|
|
68
|
+
});
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
exports.default = MaterialRunboxDiskUsageAlert;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export interface MaterialRunboxDiskUsageDialogProps {
|
|
3
|
+
runboxId: string;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Notice shown once per severity per runbox for the browser session. The reset
|
|
7
|
+
* CTA lives in the alert bar, so this only has to be acknowledged.
|
|
8
|
+
*/
|
|
9
|
+
declare const MaterialRunboxDiskUsageDialog: React.FC<MaterialRunboxDiskUsageDialogProps>;
|
|
10
|
+
export default MaterialRunboxDiskUsageDialog;
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
7
|
+
var reactUse = require('react-use');
|
|
8
|
+
var intl = require('@elice/intl');
|
|
9
|
+
var muiElements = require('@elice/mui-elements');
|
|
10
|
+
var proSolidSvgIcons = require('@fortawesome/pro-solid-svg-icons');
|
|
11
|
+
var material = require('@mui/material');
|
|
12
|
+
var useRunboxDiskUsage = require('../hooks/useRunboxDiskUsage.js');
|
|
13
|
+
|
|
14
|
+
//
|
|
15
|
+
//
|
|
16
|
+
//
|
|
17
|
+
var SEEN_STORAGE_KEY = 'MaterialRunboxDiskUsage.seenNotice';
|
|
18
|
+
//
|
|
19
|
+
//
|
|
20
|
+
//
|
|
21
|
+
/**
|
|
22
|
+
* Notice shown once per severity per runbox for the browser session. The reset
|
|
23
|
+
* CTA lives in the alert bar, so this only has to be acknowledged.
|
|
24
|
+
*/
|
|
25
|
+
var MaterialRunboxDiskUsageDialog = function MaterialRunboxDiskUsageDialog(_ref) {
|
|
26
|
+
var runboxId = _ref.runboxId;
|
|
27
|
+
var _a;
|
|
28
|
+
var intl$1 = intl.useRawEliceIntl();
|
|
29
|
+
var _useRunboxDiskUsage = useRunboxDiskUsage.useRunboxDiskUsage(),
|
|
30
|
+
severity = _useRunboxDiskUsage.severity,
|
|
31
|
+
diskCurrent = _useRunboxDiskUsage.diskCurrent,
|
|
32
|
+
diskTotal = _useRunboxDiskUsage.diskTotal;
|
|
33
|
+
var _useSessionStorage = reactUse.useSessionStorage(SEEN_STORAGE_KEY, {}),
|
|
34
|
+
_useSessionStorage2 = _rollupPluginBabelHelpers.slicedToArray(_useSessionStorage, 2),
|
|
35
|
+
seen = _useSessionStorage2[0],
|
|
36
|
+
setSeen = _useSessionStorage2[1];
|
|
37
|
+
var seenSeverities = (_a = seen === null || seen === void 0 ? void 0 : seen[runboxId]) !== null && _a !== void 0 ? _a : [];
|
|
38
|
+
/**
|
|
39
|
+
*
|
|
40
|
+
*/
|
|
41
|
+
var handleClose = function handleClose() {
|
|
42
|
+
if (!severity) {
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
setSeen(Object.assign(Object.assign({}, seen), _rollupPluginBabelHelpers.defineProperty({}, runboxId, [].concat(_rollupPluginBabelHelpers.toConsumableArray(seenSeverities), [severity]))));
|
|
46
|
+
};
|
|
47
|
+
//
|
|
48
|
+
//
|
|
49
|
+
//
|
|
50
|
+
if (!severity) {
|
|
51
|
+
return null;
|
|
52
|
+
}
|
|
53
|
+
return jsxRuntime.jsxs(material.Dialog, {
|
|
54
|
+
fullWidth: true,
|
|
55
|
+
open: !seenSeverities.includes(severity),
|
|
56
|
+
maxWidth: "xs",
|
|
57
|
+
onClose: handleClose,
|
|
58
|
+
children: [jsxRuntime.jsx(material.DialogTitle, {
|
|
59
|
+
children: jsxRuntime.jsxs(material.Stack, {
|
|
60
|
+
direction: "row",
|
|
61
|
+
alignItems: "center",
|
|
62
|
+
gap: "0.5rem",
|
|
63
|
+
children: [jsxRuntime.jsx(muiElements.EliceIcon, {
|
|
64
|
+
icon: severity === 'error' ? proSolidSvgIcons.faCircleExclamation : proSolidSvgIcons.faTriangleExclamation,
|
|
65
|
+
color: severity
|
|
66
|
+
}), intl$1.formatMessage({
|
|
67
|
+
id: 'runbox.disk.usage.dialog.title'
|
|
68
|
+
})]
|
|
69
|
+
})
|
|
70
|
+
}), jsxRuntime.jsx(material.DialogContent, {
|
|
71
|
+
children: jsxRuntime.jsx(material.DialogContentText, {
|
|
72
|
+
whiteSpace: "pre-line",
|
|
73
|
+
children: intl$1.formatMessage({
|
|
74
|
+
id: "runbox.disk.usage.dialog.description.".concat(severity)
|
|
75
|
+
}, {
|
|
76
|
+
used: intl$1.formatDataSize(diskCurrent, {
|
|
77
|
+
unitSystem: 'iec',
|
|
78
|
+
maximumFractionDigits: 2
|
|
79
|
+
}),
|
|
80
|
+
total: intl$1.formatDataSize(diskTotal, {
|
|
81
|
+
unitSystem: 'iec',
|
|
82
|
+
maximumFractionDigits: 2
|
|
83
|
+
})
|
|
84
|
+
})
|
|
85
|
+
})
|
|
86
|
+
}), jsxRuntime.jsx(material.DialogActions, {
|
|
87
|
+
children: jsxRuntime.jsx(material.Button, {
|
|
88
|
+
color: "inherit",
|
|
89
|
+
onClick: handleClose,
|
|
90
|
+
children: intl$1.formatMessage({
|
|
91
|
+
id: 'runbox.disk.usage.dialog.actions.close'
|
|
92
|
+
})
|
|
93
|
+
})
|
|
94
|
+
})]
|
|
95
|
+
});
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
exports.default = MaterialRunboxDiskUsageDialog;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import type { LoadingButtonProps } from '@mui/lab';
|
|
3
|
+
export interface MaterialRunboxEnvResetButtonProps extends Omit<LoadingButtonProps, 'onClick' | 'loading'> {
|
|
4
|
+
runtimeTemplateId: string;
|
|
5
|
+
courseId: number;
|
|
6
|
+
userId?: number;
|
|
7
|
+
onSuccess?: () => void;
|
|
8
|
+
}
|
|
9
|
+
declare const MaterialRunboxEnvResetButton: React.FC<MaterialRunboxEnvResetButtonProps>;
|
|
10
|
+
export default MaterialRunboxEnvResetButton;
|