@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
|
@@ -0,0 +1,161 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var _rollupPluginBabelHelpers = require('../../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
|
+
var tslib = require('tslib');
|
|
7
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
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 material = require('@mui/material');
|
|
13
|
+
var MaterialRunboxStatusConnectionItem = require('./MaterialRunboxStatusConnectionItem.js');
|
|
14
|
+
var MaterialRunboxStatusResourceItem = require('./MaterialRunboxStatusResourceItem.js');
|
|
15
|
+
var useRunboxNetworkStatus = require('../hooks/useRunboxNetworkStatus.js');
|
|
16
|
+
var MaterialRunboxEnvResetButton = require('../disk/MaterialRunboxEnvResetButton.js');
|
|
17
|
+
|
|
18
|
+
//
|
|
19
|
+
//
|
|
20
|
+
//
|
|
21
|
+
var POPOVER_WIDTH = '15.25rem'; // 244px
|
|
22
|
+
var NETWORK_ICON = Object.freeze(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, useRunboxNetworkStatus.RunboxNetworkStatus.Good, proSolidSvgIcons.faWifi), useRunboxNetworkStatus.RunboxNetworkStatus.NotGood, proSolidSvgIcons.faWifiFair), useRunboxNetworkStatus.RunboxNetworkStatus.Bad, proSolidSvgIcons.faWifiSlash));
|
|
23
|
+
var NETWORK_COLOR = Object.freeze(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty(_rollupPluginBabelHelpers.defineProperty({}, useRunboxNetworkStatus.RunboxNetworkStatus.Good, 'success.main'), useRunboxNetworkStatus.RunboxNetworkStatus.NotGood, 'warning.main'), useRunboxNetworkStatus.RunboxNetworkStatus.Bad, 'error.main'));
|
|
24
|
+
//
|
|
25
|
+
//
|
|
26
|
+
//
|
|
27
|
+
var MaterialRunboxStatusPopover = function MaterialRunboxStatusPopover(_a) {
|
|
28
|
+
var open = _a.open,
|
|
29
|
+
onClose = _a.onClose,
|
|
30
|
+
runtimeTemplateId = _a.runtimeTemplateId,
|
|
31
|
+
courseId = _a.courseId,
|
|
32
|
+
userId = _a.userId,
|
|
33
|
+
props = tslib.__rest(_a, ["open", "onClose", "runtimeTemplateId", "courseId", "userId"]);
|
|
34
|
+
var intl$1 = intl.useRawEliceIntl();
|
|
35
|
+
var _useEliceRunboxRunnin = runboxClient.useEliceRunboxRunning(),
|
|
36
|
+
status = _useEliceRunboxRunnin.status;
|
|
37
|
+
var _useRunboxNetworkStat = useRunboxNetworkStatus.useRunboxNetworkStatus(),
|
|
38
|
+
networkStatus = _useRunboxNetworkStat.status;
|
|
39
|
+
var contStats = runboxClient.useEliceRunboxContainerStats();
|
|
40
|
+
var stats = contStats ? contStats[contStats.length - 1] : null;
|
|
41
|
+
var isRunboxConnecting = status === 'queued' || status === 'assigned';
|
|
42
|
+
var isRunboxRunning = status === 'running';
|
|
43
|
+
// No numbers to show while the runtime comes back up.
|
|
44
|
+
var preparing = intl$1.formatMessage({
|
|
45
|
+
id: 'runbox.status.resource.preparing'
|
|
46
|
+
});
|
|
47
|
+
//
|
|
48
|
+
//
|
|
49
|
+
//
|
|
50
|
+
return jsxRuntime.jsx(material.Popover, Object.assign({
|
|
51
|
+
open: open,
|
|
52
|
+
TransitionComponent: material.Fade,
|
|
53
|
+
onClose: onClose
|
|
54
|
+
}, props, {
|
|
55
|
+
children: jsxRuntime.jsxs(material.Stack, {
|
|
56
|
+
direction: "column",
|
|
57
|
+
gap: "0.75rem",
|
|
58
|
+
padding: "0.75rem",
|
|
59
|
+
width: POPOVER_WIDTH,
|
|
60
|
+
bgcolor: "background.paper",
|
|
61
|
+
children: [jsxRuntime.jsxs(material.Stack, {
|
|
62
|
+
direction: "column",
|
|
63
|
+
children: [networkStatus ? jsxRuntime.jsx(MaterialRunboxStatusConnectionItem.default, {
|
|
64
|
+
icon: jsxRuntime.jsx(muiElements.EliceIcon, {
|
|
65
|
+
icon: NETWORK_ICON[networkStatus],
|
|
66
|
+
fontSize: "small"
|
|
67
|
+
}),
|
|
68
|
+
label: intl$1.formatMessage({
|
|
69
|
+
id: 'runbox.status.network'
|
|
70
|
+
}),
|
|
71
|
+
color: NETWORK_COLOR[networkStatus]
|
|
72
|
+
}) : null, jsxRuntime.jsx(MaterialRunboxStatusConnectionItem.default, {
|
|
73
|
+
icon: isRunboxConnecting ? jsxRuntime.jsx(material.CircularProgress, {
|
|
74
|
+
color: "inherit",
|
|
75
|
+
size: "1rem"
|
|
76
|
+
}) : jsxRuntime.jsx(muiElements.EliceIcon, {
|
|
77
|
+
icon: isRunboxRunning ? proSolidSvgIcons.faLinkSimple : proSolidSvgIcons.faLinkSimpleSlash,
|
|
78
|
+
fontSize: "small"
|
|
79
|
+
}),
|
|
80
|
+
label: intl$1.formatMessage({
|
|
81
|
+
id: isRunboxConnecting ? 'runbox.status.runtime.connecting' : isRunboxRunning ? 'runbox.status.runtime.connected' : 'runbox.status.runtime.disconnected'
|
|
82
|
+
}),
|
|
83
|
+
color: isRunboxRunning ? 'success.main' : 'text.disabled'
|
|
84
|
+
})]
|
|
85
|
+
}), stats || isRunboxConnecting ? jsxRuntime.jsxs(jsxRuntime.Fragment, {
|
|
86
|
+
children: [jsxRuntime.jsx(material.Divider, {}), jsxRuntime.jsxs(material.Stack, {
|
|
87
|
+
direction: "column",
|
|
88
|
+
children: [jsxRuntime.jsx(MaterialRunboxStatusResourceItem.default, {
|
|
89
|
+
icon: jsxRuntime.jsx(muiElements.EliceIcon, {
|
|
90
|
+
icon: proSolidSvgIcons.faMicrochip,
|
|
91
|
+
fontSize: "small"
|
|
92
|
+
}),
|
|
93
|
+
label: "CPU",
|
|
94
|
+
value: stats ? intl$1.formatNumber(stats.avgCpu, {
|
|
95
|
+
style: 'percent',
|
|
96
|
+
maximumFractionDigits: 2
|
|
97
|
+
}) : preparing
|
|
98
|
+
}), jsxRuntime.jsx(MaterialRunboxStatusResourceItem.default, {
|
|
99
|
+
icon: jsxRuntime.jsx(muiElements.EliceIcon, {
|
|
100
|
+
icon: proSolidSvgIcons.faMemory,
|
|
101
|
+
fontSize: "small"
|
|
102
|
+
}),
|
|
103
|
+
label: "Memory",
|
|
104
|
+
value: stats ? "".concat(intl$1.formatDataSize(stats.memCurrent, {
|
|
105
|
+
unitSystem: 'iec',
|
|
106
|
+
maximumFractionDigits: 2
|
|
107
|
+
}), " / ").concat(intl$1.formatDataSize(stats.memTotal, {
|
|
108
|
+
unitSystem: 'iec',
|
|
109
|
+
maximumFractionDigits: 2
|
|
110
|
+
})) : preparing
|
|
111
|
+
}), jsxRuntime.jsx(MaterialRunboxStatusResourceItem.default, {
|
|
112
|
+
icon: jsxRuntime.jsx(muiElements.EliceIcon, {
|
|
113
|
+
icon: proSolidSvgIcons.faArrowUpRight,
|
|
114
|
+
fontSize: "small"
|
|
115
|
+
}),
|
|
116
|
+
label: "UP",
|
|
117
|
+
value: stats ? "".concat(intl$1.formatDataSize(stats.netOutPsec, {
|
|
118
|
+
unitSystem: 'iec'
|
|
119
|
+
}), "/s") : preparing
|
|
120
|
+
}), jsxRuntime.jsx(MaterialRunboxStatusResourceItem.default, {
|
|
121
|
+
icon: jsxRuntime.jsx(muiElements.EliceIcon, {
|
|
122
|
+
icon: proSolidSvgIcons.faArrowDownLeft,
|
|
123
|
+
fontSize: "small"
|
|
124
|
+
}),
|
|
125
|
+
label: "DOWN",
|
|
126
|
+
value: stats ? "".concat(intl$1.formatDataSize(stats.netInPsec, {
|
|
127
|
+
unitSystem: 'iec'
|
|
128
|
+
}), "/s") : preparing
|
|
129
|
+
}), jsxRuntime.jsx(MaterialRunboxStatusResourceItem.default, {
|
|
130
|
+
icon: jsxRuntime.jsx(muiElements.EliceIcon, {
|
|
131
|
+
icon: proSolidSvgIcons.faDiscDrive,
|
|
132
|
+
fontSize: "small"
|
|
133
|
+
}),
|
|
134
|
+
label: "DISK",
|
|
135
|
+
value: stats ? "".concat(intl$1.formatDataSize(stats.diskCurrent, {
|
|
136
|
+
unitSystem: 'iec',
|
|
137
|
+
maximumFractionDigits: 2
|
|
138
|
+
}), " / ").concat(intl$1.formatDataSize(stats.diskTotal, {
|
|
139
|
+
unitSystem: 'iec',
|
|
140
|
+
maximumFractionDigits: 2
|
|
141
|
+
})) : preparing
|
|
142
|
+
})]
|
|
143
|
+
})]
|
|
144
|
+
}) : null, jsxRuntime.jsx(MaterialRunboxEnvResetButton.default, {
|
|
145
|
+
fullWidth: true,
|
|
146
|
+
variant: "contained",
|
|
147
|
+
color: "error",
|
|
148
|
+
disabled: !isRunboxRunning,
|
|
149
|
+
startIcon: jsxRuntime.jsx(muiElements.EliceIcon, {
|
|
150
|
+
icon: proSolidSvgIcons.faArrowsRotate
|
|
151
|
+
}),
|
|
152
|
+
runtimeTemplateId: runtimeTemplateId,
|
|
153
|
+
courseId: courseId,
|
|
154
|
+
userId: userId,
|
|
155
|
+
onSuccess: onClose
|
|
156
|
+
})]
|
|
157
|
+
})
|
|
158
|
+
}));
|
|
159
|
+
};
|
|
160
|
+
|
|
161
|
+
exports.default = MaterialRunboxStatusPopover;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type React from 'react';
|
|
2
|
+
export interface MaterialRunboxStatusResourceItemProps {
|
|
3
|
+
/** Leading icon element. */
|
|
4
|
+
icon: React.ReactNode;
|
|
5
|
+
/** Resource label, e.g. `CPU`. */
|
|
6
|
+
label: React.ReactNode;
|
|
7
|
+
/** Formatted value, e.g. `438.33 MiB / 4 GiB`. */
|
|
8
|
+
value: React.ReactNode;
|
|
9
|
+
}
|
|
10
|
+
declare const MaterialRunboxStatusResourceItem: React.FC<MaterialRunboxStatusResourceItemProps>;
|
|
11
|
+
export default MaterialRunboxStatusResourceItem;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var jsxRuntime = require('react/jsx-runtime');
|
|
6
|
+
var material = require('@mui/material');
|
|
7
|
+
|
|
8
|
+
//
|
|
9
|
+
//
|
|
10
|
+
//
|
|
11
|
+
var MaterialRunboxStatusResourceItem = function MaterialRunboxStatusResourceItem(_ref) {
|
|
12
|
+
var icon = _ref.icon,
|
|
13
|
+
label = _ref.label,
|
|
14
|
+
value = _ref.value;
|
|
15
|
+
return jsxRuntime.jsxs(material.Stack, {
|
|
16
|
+
direction: "row",
|
|
17
|
+
alignItems: "center",
|
|
18
|
+
gap: "0.75rem",
|
|
19
|
+
padding: "0.375rem 0.75rem",
|
|
20
|
+
children: [jsxRuntime.jsx(material.Typography, {
|
|
21
|
+
component: "span",
|
|
22
|
+
display: "inline-flex",
|
|
23
|
+
color: "text.tertiary",
|
|
24
|
+
children: icon
|
|
25
|
+
}), jsxRuntime.jsxs(material.Stack, {
|
|
26
|
+
direction: "column",
|
|
27
|
+
children: [jsxRuntime.jsx(material.Typography, {
|
|
28
|
+
variant: "body2",
|
|
29
|
+
color: "text.tertiary",
|
|
30
|
+
children: label
|
|
31
|
+
}), jsxRuntime.jsx(material.Typography, {
|
|
32
|
+
variant: "caption",
|
|
33
|
+
color: "text.tertiary",
|
|
34
|
+
fontFamily: "'JetBrains Mono', monospace",
|
|
35
|
+
children: value
|
|
36
|
+
})]
|
|
37
|
+
})]
|
|
38
|
+
});
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
exports.default = MaterialRunboxStatusResourceItem;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as MaterialRunboxStatusButton } from './MaterialRunboxStatusButton';
|
|
2
|
+
export { default as MaterialRunboxStatusPopover } from './MaterialRunboxStatusPopover';
|
|
3
|
+
export type { MaterialRunboxStatusButtonProps } from './MaterialRunboxStatusButton';
|
|
4
|
+
export type { MaterialRunboxStatusPopoverProps } from './MaterialRunboxStatusPopover';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var MaterialRunboxStatusButton = require('./MaterialRunboxStatusButton.js');
|
|
4
|
+
var MaterialRunboxStatusPopover = require('./MaterialRunboxStatusPopover.js');
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
exports.MaterialRunboxStatusButton = MaterialRunboxStatusButton.default;
|
|
9
|
+
exports.MaterialRunboxStatusPopover = MaterialRunboxStatusPopover.default;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var muiSystem = require('@elice/mui-system');
|
|
4
|
+
|
|
5
|
+
var runboxDarkTheme = muiSystem.createEliceTheme({
|
|
6
|
+
paletteName: 'purple',
|
|
7
|
+
paletteMode: 'dark'
|
|
8
|
+
});
|
|
9
|
+
var runboxLightTheme = muiSystem.createEliceTheme({
|
|
10
|
+
paletteName: 'purple',
|
|
11
|
+
paletteMode: 'light'
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
exports.runboxDarkTheme = runboxDarkTheme;
|
|
15
|
+
exports.runboxLightTheme = runboxLightTheme;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
interface MaterialRunboxQuotaAlmostEndDialogProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Warns the learner that the *total* available time is about to run out.
|
|
7
|
+
*
|
|
8
|
+
* Once it does, the practice ends for good — there is no reconnecting.
|
|
9
|
+
*/
|
|
10
|
+
declare const MaterialRunboxQuotaAlmostEndDialog: React.FC<MaterialRunboxQuotaAlmostEndDialogProps>;
|
|
11
|
+
export default MaterialRunboxQuotaAlmostEndDialog;
|
|
@@ -0,0 +1,125 @@
|
|
|
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 runboxClient = require('@elice/runbox-client');
|
|
8
|
+
var material = require('@mui/material');
|
|
9
|
+
var useRunboxSessionEndWarning = require('../hooks/useRunboxSessionEndWarning.js');
|
|
10
|
+
var MaterialRunboxQuotaAmount = require('./MaterialRunboxQuotaAmount.js');
|
|
11
|
+
var time = require('../../../utils/time.js');
|
|
12
|
+
|
|
13
|
+
//
|
|
14
|
+
//
|
|
15
|
+
//
|
|
16
|
+
/**
|
|
17
|
+
* Warns the learner that the *total* available time is about to run out.
|
|
18
|
+
*
|
|
19
|
+
* Once it does, the practice ends for good — there is no reconnecting.
|
|
20
|
+
*/
|
|
21
|
+
var MaterialRunboxQuotaAlmostEndDialog = function MaterialRunboxQuotaAlmostEndDialog(_ref) {
|
|
22
|
+
var open = _ref.open,
|
|
23
|
+
onClose = _ref.onClose;
|
|
24
|
+
var intl$1 = intl.useRawEliceIntl();
|
|
25
|
+
var _useEliceRunboxQuota = runboxClient.useEliceRunboxQuota(),
|
|
26
|
+
quotaInfo = _useEliceRunboxQuota.quotaInfo,
|
|
27
|
+
quotaPerSessionInfo = _useEliceRunboxQuota.quotaPerSessionInfo;
|
|
28
|
+
if (quotaInfo.isUnlimited) {
|
|
29
|
+
return null;
|
|
30
|
+
}
|
|
31
|
+
var _getTimeParts = time.getTimeParts(quotaInfo.remainingQuota * 60),
|
|
32
|
+
remainingHours = _getTimeParts.hours,
|
|
33
|
+
remainingMinutes = _getTimeParts.minutes;
|
|
34
|
+
var isQuotaAlmostEnd = quotaInfo.remainingQuota <= useRunboxSessionEndWarning.QUOTA_ALMOST_END_MINUTES;
|
|
35
|
+
var isQuotaPerSessionAlmostEnd = !quotaPerSessionInfo.isUnlimited && quotaPerSessionInfo.remainingQuota <= useRunboxSessionEndWarning.QUOTA_PER_SESSION_ALMOST_END_MINUTES;
|
|
36
|
+
return jsxRuntime.jsxs(material.Dialog, {
|
|
37
|
+
fullWidth: true,
|
|
38
|
+
maxWidth: "xs",
|
|
39
|
+
open: open,
|
|
40
|
+
onClose: onClose,
|
|
41
|
+
children: [jsxRuntime.jsx(material.DialogTitle, {
|
|
42
|
+
children: intl$1.formatMessage({
|
|
43
|
+
id: 'runbox.timer.almost_end.dialog.quota.title'
|
|
44
|
+
}, {
|
|
45
|
+
time: [remainingHours > 0 ? intl$1.formatNumber(remainingHours, {
|
|
46
|
+
style: 'unit',
|
|
47
|
+
unit: 'hour',
|
|
48
|
+
unitDisplay: 'short'
|
|
49
|
+
}) : null, remainingMinutes > 0 || remainingHours === 0 ? intl$1.formatNumber(remainingMinutes, {
|
|
50
|
+
style: 'unit',
|
|
51
|
+
unit: 'minute',
|
|
52
|
+
unitDisplay: 'short'
|
|
53
|
+
}) : null].filter(Boolean).join(' ')
|
|
54
|
+
})
|
|
55
|
+
}), jsxRuntime.jsx(material.DialogContent, {
|
|
56
|
+
children: jsxRuntime.jsxs(material.Stack, {
|
|
57
|
+
direction: "column",
|
|
58
|
+
gap: "1.5rem",
|
|
59
|
+
children: [jsxRuntime.jsxs(material.Card, {
|
|
60
|
+
elevation: 0,
|
|
61
|
+
sx: {
|
|
62
|
+
bgcolor: 'background.neutral'
|
|
63
|
+
},
|
|
64
|
+
children: [jsxRuntime.jsxs(material.Stack, {
|
|
65
|
+
direction: "column",
|
|
66
|
+
gap: "0.5rem",
|
|
67
|
+
padding: "1rem",
|
|
68
|
+
bgcolor: isQuotaAlmostEnd ? 'warning.opacity03' : undefined,
|
|
69
|
+
children: [jsxRuntime.jsx(material.Typography, {
|
|
70
|
+
variant: "body2",
|
|
71
|
+
fontWeight: "bold",
|
|
72
|
+
children: intl$1.formatMessage({
|
|
73
|
+
id: 'runbox.timer.popover.quota.title'
|
|
74
|
+
})
|
|
75
|
+
}), jsxRuntime.jsx(MaterialRunboxQuotaAmount.default, {
|
|
76
|
+
remainingQuota: quotaInfo.remainingQuota,
|
|
77
|
+
quota: quotaInfo.quota,
|
|
78
|
+
color: isQuotaAlmostEnd ? 'warning.main' : 'success.main'
|
|
79
|
+
})]
|
|
80
|
+
}), jsxRuntime.jsx(material.Divider, {}), jsxRuntime.jsxs(material.Stack, {
|
|
81
|
+
direction: "column",
|
|
82
|
+
gap: "0.5rem",
|
|
83
|
+
padding: "1rem",
|
|
84
|
+
bgcolor: isQuotaPerSessionAlmostEnd ? 'warning.opacity03' : undefined,
|
|
85
|
+
children: [jsxRuntime.jsx(material.Typography, {
|
|
86
|
+
variant: "body2",
|
|
87
|
+
fontWeight: "bold",
|
|
88
|
+
children: intl$1.formatMessage({
|
|
89
|
+
id: 'runbox.timer.popover.quota_per_session.title'
|
|
90
|
+
})
|
|
91
|
+
}), quotaPerSessionInfo.isUnlimited ? jsxRuntime.jsx(material.Typography, {
|
|
92
|
+
component: "span",
|
|
93
|
+
variant: "h5",
|
|
94
|
+
fontWeight: "extraBold",
|
|
95
|
+
children: intl$1.formatMessage({
|
|
96
|
+
id: 'runbox.timer.unlimited'
|
|
97
|
+
})
|
|
98
|
+
}) : jsxRuntime.jsx(MaterialRunboxQuotaAmount.default, {
|
|
99
|
+
remainingQuota: quotaPerSessionInfo.remainingQuota,
|
|
100
|
+
quota: quotaPerSessionInfo.quota,
|
|
101
|
+
color: isQuotaPerSessionAlmostEnd ? 'warning.main' : 'success.main'
|
|
102
|
+
})]
|
|
103
|
+
})]
|
|
104
|
+
}), jsxRuntime.jsx(material.Typography, {
|
|
105
|
+
variant: "body2",
|
|
106
|
+
whiteSpace: "pre-line",
|
|
107
|
+
children: intl$1.formatMessage({
|
|
108
|
+
id: 'runbox.timer.almost_end.dialog.quota.description'
|
|
109
|
+
})
|
|
110
|
+
})]
|
|
111
|
+
})
|
|
112
|
+
}), jsxRuntime.jsx(material.DialogActions, {
|
|
113
|
+
children: jsxRuntime.jsx(material.Button, {
|
|
114
|
+
variant: "contained",
|
|
115
|
+
color: "inherit",
|
|
116
|
+
onClick: onClose,
|
|
117
|
+
children: intl$1.formatMessage({
|
|
118
|
+
id: 'runbox.timer.almost_end.dialog.confirm'
|
|
119
|
+
})
|
|
120
|
+
})
|
|
121
|
+
})]
|
|
122
|
+
});
|
|
123
|
+
};
|
|
124
|
+
|
|
125
|
+
exports.default = MaterialRunboxQuotaAlmostEndDialog;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export interface MaterialRunboxQuotaAmountProps {
|
|
2
|
+
/** Remaining time, in minutes. */
|
|
3
|
+
remainingQuota: number;
|
|
4
|
+
/** Total granted time, in minutes. */
|
|
5
|
+
quota: number;
|
|
6
|
+
/** Color of the remaining time. */
|
|
7
|
+
color?: string;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Renders `<remaining> / <total>`, e.g. `4시간 11분 / 5시간`.
|
|
11
|
+
*/
|
|
12
|
+
declare const MaterialRunboxQuotaAmount: React.FC<MaterialRunboxQuotaAmountProps>;
|
|
13
|
+
export default MaterialRunboxQuotaAmount;
|
|
@@ -0,0 +1,56 @@
|
|
|
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 material = require('@mui/material');
|
|
8
|
+
var MaterialRunboxQuotaTimePart = require('./MaterialRunboxQuotaTimePart.js');
|
|
9
|
+
var time = require('../../../utils/time.js');
|
|
10
|
+
|
|
11
|
+
//
|
|
12
|
+
//
|
|
13
|
+
//
|
|
14
|
+
/**
|
|
15
|
+
* Renders `<remaining> / <total>`, e.g. `4시간 11분 / 5시간`.
|
|
16
|
+
*/
|
|
17
|
+
var MaterialRunboxQuotaAmount = function MaterialRunboxQuotaAmount(_ref) {
|
|
18
|
+
var remainingQuota = _ref.remainingQuota,
|
|
19
|
+
quota = _ref.quota,
|
|
20
|
+
color = _ref.color;
|
|
21
|
+
var intl$1 = intl.useRawEliceIntl();
|
|
22
|
+
var _getTimeParts = time.getTimeParts(remainingQuota * 60),
|
|
23
|
+
remainingHours = _getTimeParts.hours,
|
|
24
|
+
remainingMinutes = _getTimeParts.minutes;
|
|
25
|
+
var _getTimeParts2 = time.getTimeParts(quota * 60),
|
|
26
|
+
totalHours = _getTimeParts2.hours,
|
|
27
|
+
totalMinutes = _getTimeParts2.minutes;
|
|
28
|
+
return jsxRuntime.jsxs(material.Typography, {
|
|
29
|
+
variant: "body2",
|
|
30
|
+
children: [jsxRuntime.jsxs(material.Stack, {
|
|
31
|
+
component: "span",
|
|
32
|
+
display: "inline-flex",
|
|
33
|
+
direction: "row",
|
|
34
|
+
gap: "0.25rem",
|
|
35
|
+
children: [jsxRuntime.jsx(MaterialRunboxQuotaTimePart.default, {
|
|
36
|
+
value: remainingHours,
|
|
37
|
+
unit: "hour",
|
|
38
|
+
color: color
|
|
39
|
+
}), jsxRuntime.jsx(MaterialRunboxQuotaTimePart.default, {
|
|
40
|
+
value: remainingMinutes,
|
|
41
|
+
unit: "minute",
|
|
42
|
+
color: color
|
|
43
|
+
})]
|
|
44
|
+
}), " / ", [totalHours > 0 ? intl$1.formatNumber(totalHours, {
|
|
45
|
+
style: 'unit',
|
|
46
|
+
unit: 'hour',
|
|
47
|
+
unitDisplay: 'short'
|
|
48
|
+
}) : null, totalMinutes > 0 ? intl$1.formatNumber(totalMinutes, {
|
|
49
|
+
style: 'unit',
|
|
50
|
+
unit: 'minute',
|
|
51
|
+
unitDisplay: 'short'
|
|
52
|
+
}) : null].filter(Boolean).join(' ')]
|
|
53
|
+
});
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
exports.default = MaterialRunboxQuotaAmount;
|
package/cjs/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.d.ts
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
interface MaterialRunboxQuotaPerSessionAlmostEndDialogProps {
|
|
2
|
+
open: boolean;
|
|
3
|
+
onClose: () => void;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* Warns the learner that the time granted to *this connection* is about to run out.
|
|
7
|
+
*
|
|
8
|
+
* Unlike the total quota, the learner can reconnect and keep going as long as total
|
|
9
|
+
* time is left — so this dialog is about saving work, not about the practice ending.
|
|
10
|
+
*/
|
|
11
|
+
declare const MaterialRunboxQuotaPerSessionAlmostEndDialog: React.FC<MaterialRunboxQuotaPerSessionAlmostEndDialogProps>;
|
|
12
|
+
export default MaterialRunboxQuotaPerSessionAlmostEndDialog;
|
|
@@ -0,0 +1,126 @@
|
|
|
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 runboxClient = require('@elice/runbox-client');
|
|
8
|
+
var material = require('@mui/material');
|
|
9
|
+
var useRunboxSessionEndWarning = require('../hooks/useRunboxSessionEndWarning.js');
|
|
10
|
+
var MaterialRunboxQuotaAmount = require('./MaterialRunboxQuotaAmount.js');
|
|
11
|
+
var time = require('../../../utils/time.js');
|
|
12
|
+
|
|
13
|
+
//
|
|
14
|
+
//
|
|
15
|
+
//
|
|
16
|
+
/**
|
|
17
|
+
* Warns the learner that the time granted to *this connection* is about to run out.
|
|
18
|
+
*
|
|
19
|
+
* Unlike the total quota, the learner can reconnect and keep going as long as total
|
|
20
|
+
* time is left — so this dialog is about saving work, not about the practice ending.
|
|
21
|
+
*/
|
|
22
|
+
var MaterialRunboxQuotaPerSessionAlmostEndDialog = function MaterialRunboxQuotaPerSessionAlmostEndDialog(_ref) {
|
|
23
|
+
var open = _ref.open,
|
|
24
|
+
onClose = _ref.onClose;
|
|
25
|
+
var intl$1 = intl.useRawEliceIntl();
|
|
26
|
+
var _useEliceRunboxQuota = runboxClient.useEliceRunboxQuota(),
|
|
27
|
+
quotaInfo = _useEliceRunboxQuota.quotaInfo,
|
|
28
|
+
quotaPerSessionInfo = _useEliceRunboxQuota.quotaPerSessionInfo;
|
|
29
|
+
if (quotaPerSessionInfo.isUnlimited) {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
var _getTimeParts = time.getTimeParts(quotaPerSessionInfo.remainingQuota * 60),
|
|
33
|
+
remainingHours = _getTimeParts.hours,
|
|
34
|
+
remainingMinutes = _getTimeParts.minutes;
|
|
35
|
+
var isQuotaAlmostEnd = !quotaInfo.isUnlimited && quotaInfo.remainingQuota <= useRunboxSessionEndWarning.QUOTA_ALMOST_END_MINUTES;
|
|
36
|
+
var isQuotaPerSessionAlmostEnd = quotaPerSessionInfo.remainingQuota <= useRunboxSessionEndWarning.QUOTA_PER_SESSION_ALMOST_END_MINUTES;
|
|
37
|
+
return jsxRuntime.jsxs(material.Dialog, {
|
|
38
|
+
fullWidth: true,
|
|
39
|
+
maxWidth: "xs",
|
|
40
|
+
open: open,
|
|
41
|
+
onClose: onClose,
|
|
42
|
+
children: [jsxRuntime.jsx(material.DialogTitle, {
|
|
43
|
+
children: intl$1.formatMessage({
|
|
44
|
+
id: 'runbox.timer.almost_end.dialog.quota_per_session.title'
|
|
45
|
+
}, {
|
|
46
|
+
time: [remainingHours > 0 ? intl$1.formatNumber(remainingHours, {
|
|
47
|
+
style: 'unit',
|
|
48
|
+
unit: 'hour',
|
|
49
|
+
unitDisplay: 'short'
|
|
50
|
+
}) : null, remainingMinutes > 0 || remainingHours === 0 ? intl$1.formatNumber(remainingMinutes, {
|
|
51
|
+
style: 'unit',
|
|
52
|
+
unit: 'minute',
|
|
53
|
+
unitDisplay: 'short'
|
|
54
|
+
}) : null].filter(Boolean).join(' ')
|
|
55
|
+
})
|
|
56
|
+
}), jsxRuntime.jsx(material.DialogContent, {
|
|
57
|
+
children: jsxRuntime.jsxs(material.Stack, {
|
|
58
|
+
direction: "column",
|
|
59
|
+
gap: "1.5rem",
|
|
60
|
+
children: [jsxRuntime.jsxs(material.Card, {
|
|
61
|
+
elevation: 0,
|
|
62
|
+
sx: {
|
|
63
|
+
bgcolor: 'background.neutral'
|
|
64
|
+
},
|
|
65
|
+
children: [jsxRuntime.jsxs(material.Stack, {
|
|
66
|
+
direction: "column",
|
|
67
|
+
gap: "0.5rem",
|
|
68
|
+
padding: "1rem",
|
|
69
|
+
bgcolor: isQuotaAlmostEnd ? 'warning.opacity03' : undefined,
|
|
70
|
+
children: [jsxRuntime.jsx(material.Typography, {
|
|
71
|
+
variant: "body2",
|
|
72
|
+
fontWeight: "bold",
|
|
73
|
+
children: intl$1.formatMessage({
|
|
74
|
+
id: 'runbox.timer.popover.quota.title'
|
|
75
|
+
})
|
|
76
|
+
}), quotaInfo.isUnlimited ? jsxRuntime.jsx(material.Typography, {
|
|
77
|
+
component: "span",
|
|
78
|
+
variant: "h5",
|
|
79
|
+
fontWeight: "extraBold",
|
|
80
|
+
children: intl$1.formatMessage({
|
|
81
|
+
id: 'runbox.timer.unlimited'
|
|
82
|
+
})
|
|
83
|
+
}) : jsxRuntime.jsx(MaterialRunboxQuotaAmount.default, {
|
|
84
|
+
remainingQuota: quotaInfo.remainingQuota,
|
|
85
|
+
quota: quotaInfo.quota,
|
|
86
|
+
color: isQuotaAlmostEnd ? 'warning.main' : 'success.main'
|
|
87
|
+
})]
|
|
88
|
+
}), jsxRuntime.jsx(material.Divider, {}), jsxRuntime.jsxs(material.Stack, {
|
|
89
|
+
direction: "column",
|
|
90
|
+
gap: "0.5rem",
|
|
91
|
+
padding: "1rem",
|
|
92
|
+
bgcolor: isQuotaPerSessionAlmostEnd ? 'warning.opacity03' : undefined,
|
|
93
|
+
children: [jsxRuntime.jsx(material.Typography, {
|
|
94
|
+
variant: "body2",
|
|
95
|
+
fontWeight: "bold",
|
|
96
|
+
children: intl$1.formatMessage({
|
|
97
|
+
id: 'runbox.timer.popover.quota_per_session.title'
|
|
98
|
+
})
|
|
99
|
+
}), jsxRuntime.jsx(MaterialRunboxQuotaAmount.default, {
|
|
100
|
+
remainingQuota: quotaPerSessionInfo.remainingQuota,
|
|
101
|
+
quota: quotaPerSessionInfo.quota,
|
|
102
|
+
color: isQuotaPerSessionAlmostEnd ? 'warning.main' : 'success.main'
|
|
103
|
+
})]
|
|
104
|
+
})]
|
|
105
|
+
}), jsxRuntime.jsx(material.Typography, {
|
|
106
|
+
variant: "body2",
|
|
107
|
+
whiteSpace: "pre-line",
|
|
108
|
+
children: intl$1.formatMessage({
|
|
109
|
+
id: 'runbox.timer.almost_end.dialog.quota_per_session.description'
|
|
110
|
+
})
|
|
111
|
+
})]
|
|
112
|
+
})
|
|
113
|
+
}), jsxRuntime.jsx(material.DialogActions, {
|
|
114
|
+
children: jsxRuntime.jsx(material.Button, {
|
|
115
|
+
variant: "contained",
|
|
116
|
+
color: "inherit",
|
|
117
|
+
onClick: onClose,
|
|
118
|
+
children: intl$1.formatMessage({
|
|
119
|
+
id: 'runbox.timer.almost_end.dialog.confirm'
|
|
120
|
+
})
|
|
121
|
+
})
|
|
122
|
+
})]
|
|
123
|
+
});
|
|
124
|
+
};
|
|
125
|
+
|
|
126
|
+
exports.default = MaterialRunboxQuotaPerSessionAlmostEndDialog;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export interface MaterialRunboxQuotaTimePartProps {
|
|
2
|
+
value: number;
|
|
3
|
+
unit: 'hour' | 'minute';
|
|
4
|
+
color?: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* A single `4시간` / `11분` part, with the unit rendered smaller than the number.
|
|
8
|
+
*
|
|
9
|
+
* The number and its unit are split with `formatNumberToParts` rather than by hand,
|
|
10
|
+
* because where the unit sits and how it is written differs per locale.
|
|
11
|
+
*
|
|
12
|
+
* Renders nothing when `value` is 0, so `29분` does not come out as `0시간 29분`.
|
|
13
|
+
*/
|
|
14
|
+
declare const MaterialRunboxQuotaTimePart: React.FC<MaterialRunboxQuotaTimePartProps>;
|
|
15
|
+
export default MaterialRunboxQuotaTimePart;
|
|
@@ -0,0 +1,50 @@
|
|
|
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 material = require('@mui/material');
|
|
8
|
+
|
|
9
|
+
//
|
|
10
|
+
//
|
|
11
|
+
//
|
|
12
|
+
/**
|
|
13
|
+
* A single `4시간` / `11분` part, with the unit rendered smaller than the number.
|
|
14
|
+
*
|
|
15
|
+
* The number and its unit are split with `formatNumberToParts` rather than by hand,
|
|
16
|
+
* because where the unit sits and how it is written differs per locale.
|
|
17
|
+
*
|
|
18
|
+
* Renders nothing when `value` is 0, so `29분` does not come out as `0시간 29분`.
|
|
19
|
+
*/
|
|
20
|
+
var MaterialRunboxQuotaTimePart = function MaterialRunboxQuotaTimePart(_ref) {
|
|
21
|
+
var value = _ref.value,
|
|
22
|
+
unit = _ref.unit,
|
|
23
|
+
color = _ref.color;
|
|
24
|
+
var intl$1 = intl.useRawEliceIntl();
|
|
25
|
+
if (value === 0) {
|
|
26
|
+
return null;
|
|
27
|
+
}
|
|
28
|
+
return jsxRuntime.jsx(material.Typography, {
|
|
29
|
+
component: "span",
|
|
30
|
+
variant: "h5",
|
|
31
|
+
fontWeight: "extraBold",
|
|
32
|
+
color: color,
|
|
33
|
+
children: intl$1.formatNumberToParts(value, {
|
|
34
|
+
style: 'unit',
|
|
35
|
+
unit: unit,
|
|
36
|
+
unitDisplay: 'short'
|
|
37
|
+
}).map(function (part, index) {
|
|
38
|
+
return part.type === 'unit' ? jsxRuntime.jsx(material.Typography, {
|
|
39
|
+
component: "span",
|
|
40
|
+
variant: "body2",
|
|
41
|
+
fontWeight: "regular",
|
|
42
|
+
children: part.value
|
|
43
|
+
}, index) : jsxRuntime.jsx("span", {
|
|
44
|
+
children: part.value
|
|
45
|
+
}, index);
|
|
46
|
+
})
|
|
47
|
+
});
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
exports.default = MaterialRunboxQuotaTimePart;
|