@elice/material-runbox 1.260825.0-runboxusability.1 → 1.260826.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/assets/runbox_logo.png.js +7 -0
- package/cjs/components/material-runbox/MaterialRunboxContent.js +2 -1
- package/cjs/components/material-runbox/MaterialRunboxFooter.d.ts +4 -0
- package/cjs/components/material-runbox/MaterialRunboxFooter.js +64 -0
- package/cjs/components/material-runbox/MaterialRunboxHeader.js +29 -12
- package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.d.ts +1 -3
- package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.js +1 -17
- package/cjs/components/material-runbox/hooks/index.d.ts +0 -2
- package/cjs/components/material-runbox/hooks/index.js +0 -6
- 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/timer/MaterialRunboxAlmostEndSnackbars.d.ts +6 -0
- package/cjs/components/material-runbox/timer/MaterialRunboxAlmostEndSnackbars.js +90 -0
- package/cjs/components/material-runbox/timer/MaterialRunboxTimer.d.ts +0 -6
- package/cjs/components/material-runbox/timer/MaterialRunboxTimer.js +16 -20
- package/cjs/components/material-runbox/timer/MaterialRunboxTimerDetailPopover.js +81 -19
- package/es/assets/runbox_logo.png.js +3 -0
- package/es/components/material-runbox/MaterialRunboxContent.js +2 -1
- package/es/components/material-runbox/MaterialRunboxFooter.d.ts +4 -0
- package/es/components/material-runbox/MaterialRunboxFooter.js +56 -0
- package/es/components/material-runbox/MaterialRunboxHeader.js +30 -13
- package/es/components/material-runbox/actions/MaterialRunboxActionMenu.d.ts +1 -3
- package/es/components/material-runbox/actions/MaterialRunboxActionMenu.js +3 -19
- package/es/components/material-runbox/hooks/index.d.ts +0 -2
- package/es/components/material-runbox/hooks/index.js +0 -2
- 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/timer/MaterialRunboxAlmostEndSnackbars.d.ts +6 -0
- package/es/components/material-runbox/timer/MaterialRunboxAlmostEndSnackbars.js +86 -0
- package/es/components/material-runbox/timer/MaterialRunboxTimer.d.ts +0 -6
- package/es/components/material-runbox/timer/MaterialRunboxTimer.js +15 -19
- package/es/components/material-runbox/timer/MaterialRunboxTimerDetailPopover.js +77 -15
- package/package.json +6 -6
- package/cjs/components/material-runbox/hooks/useOnlineState.d.ts +0 -12
- package/cjs/components/material-runbox/hooks/useOnlineState.js +0 -50
- package/cjs/components/material-runbox/hooks/useRunboxSessionEndWarning.d.ts +0 -18
- package/cjs/components/material-runbox/hooks/useRunboxSessionEndWarning.js +0 -67
- package/cjs/components/material-runbox/status/MaterialRunboxStatusButton.d.ts +0 -18
- package/cjs/components/material-runbox/status/MaterialRunboxStatusButton.js +0 -88
- package/cjs/components/material-runbox/status/MaterialRunboxStatusConnectionItem.d.ts +0 -11
- package/cjs/components/material-runbox/status/MaterialRunboxStatusConnectionItem.js +0 -32
- package/cjs/components/material-runbox/status/MaterialRunboxStatusPopover.d.ts +0 -17
- package/cjs/components/material-runbox/status/MaterialRunboxStatusPopover.js +0 -133
- package/cjs/components/material-runbox/status/MaterialRunboxStatusResourceItem.d.ts +0 -11
- package/cjs/components/material-runbox/status/MaterialRunboxStatusResourceItem.js +0 -42
- package/cjs/components/material-runbox/status/index.d.ts +0 -4
- package/cjs/components/material-runbox/status/index.js +0 -9
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaAlmostEndDialog.d.ts +0 -11
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaAlmostEndDialog.js +0 -116
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaAmount.d.ts +0 -13
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaAmount.js +0 -56
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.d.ts +0 -12
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.js +0 -117
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaTimePart.d.ts +0 -15
- package/cjs/components/material-runbox/timer/MaterialRunboxQuotaTimePart.js +0 -50
- package/es/components/material-runbox/hooks/useOnlineState.d.ts +0 -12
- package/es/components/material-runbox/hooks/useOnlineState.js +0 -44
- package/es/components/material-runbox/hooks/useRunboxSessionEndWarning.d.ts +0 -18
- package/es/components/material-runbox/hooks/useRunboxSessionEndWarning.js +0 -63
- package/es/components/material-runbox/status/MaterialRunboxStatusButton.d.ts +0 -18
- package/es/components/material-runbox/status/MaterialRunboxStatusButton.js +0 -80
- package/es/components/material-runbox/status/MaterialRunboxStatusConnectionItem.d.ts +0 -11
- package/es/components/material-runbox/status/MaterialRunboxStatusConnectionItem.js +0 -28
- package/es/components/material-runbox/status/MaterialRunboxStatusPopover.d.ts +0 -17
- package/es/components/material-runbox/status/MaterialRunboxStatusPopover.js +0 -129
- package/es/components/material-runbox/status/MaterialRunboxStatusResourceItem.d.ts +0 -11
- package/es/components/material-runbox/status/MaterialRunboxStatusResourceItem.js +0 -38
- package/es/components/material-runbox/status/index.d.ts +0 -4
- package/es/components/material-runbox/status/index.js +0 -2
- package/es/components/material-runbox/timer/MaterialRunboxQuotaAlmostEndDialog.d.ts +0 -11
- package/es/components/material-runbox/timer/MaterialRunboxQuotaAlmostEndDialog.js +0 -112
- package/es/components/material-runbox/timer/MaterialRunboxQuotaAmount.d.ts +0 -13
- package/es/components/material-runbox/timer/MaterialRunboxQuotaAmount.js +0 -52
- package/es/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.d.ts +0 -12
- package/es/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.js +0 -113
- package/es/components/material-runbox/timer/MaterialRunboxQuotaTimePart.d.ts +0 -15
- package/es/components/material-runbox/timer/MaterialRunboxQuotaTimePart.js +0 -46
|
@@ -1,80 +0,0 @@
|
|
|
1
|
-
import { slicedToArray as _slicedToArray, defineProperty as _defineProperty } from '../../../_virtual/_rollupPluginBabelHelpers.js';
|
|
2
|
-
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { useRawEliceIntl } from '@elice/intl';
|
|
5
|
-
import { EliceIcon } from '@elice/mui-elements';
|
|
6
|
-
import { useEliceRunboxRunning } from '@elice/runbox-client';
|
|
7
|
-
import { faAngleDown, faWifi } from '@fortawesome/pro-solid-svg-icons';
|
|
8
|
-
import { Button, buttonClasses } from '@mui/material';
|
|
9
|
-
import MaterialRunboxStatusPopover from './MaterialRunboxStatusPopover.js';
|
|
10
|
-
|
|
11
|
-
//
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
/**
|
|
15
|
-
* Opens the runbox connection/resource status popover.
|
|
16
|
-
*
|
|
17
|
-
* Replaces the always-visible resource stats of the removed footer,
|
|
18
|
-
* so the numbers are only shown on explicit request. (`[R-5]` `[R-6]`)
|
|
19
|
-
*/
|
|
20
|
-
var MaterialRunboxStatusButton = function MaterialRunboxStatusButton(_ref) {
|
|
21
|
-
var bottomAction = _ref.bottomAction;
|
|
22
|
-
var intl = useRawEliceIntl();
|
|
23
|
-
var _useEliceRunboxRunnin = useEliceRunboxRunning(),
|
|
24
|
-
status = _useEliceRunboxRunnin.status;
|
|
25
|
-
var _React$useState = React.useState(null),
|
|
26
|
-
_React$useState2 = _slicedToArray(_React$useState, 2),
|
|
27
|
-
anchorEl = _React$useState2[0],
|
|
28
|
-
setAnchorEl = _React$useState2[1];
|
|
29
|
-
var isRunboxRunning = status === 'running';
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
*/
|
|
33
|
-
var handleClose = function handleClose() {
|
|
34
|
-
setAnchorEl(null);
|
|
35
|
-
};
|
|
36
|
-
//
|
|
37
|
-
//
|
|
38
|
-
//
|
|
39
|
-
return jsxs(Fragment, {
|
|
40
|
-
children: [jsx(Button, {
|
|
41
|
-
variant: "text",
|
|
42
|
-
size: "small",
|
|
43
|
-
startIcon: jsx(EliceIcon, {
|
|
44
|
-
icon: faWifi
|
|
45
|
-
}),
|
|
46
|
-
endIcon: jsx(EliceIcon, {
|
|
47
|
-
icon: faAngleDown
|
|
48
|
-
}),
|
|
49
|
-
sx: _defineProperty({}, "& .".concat(buttonClasses.startIcon), {
|
|
50
|
-
color: isRunboxRunning ? 'success.main' : 'text.disabled'
|
|
51
|
-
}),
|
|
52
|
-
onClick: function onClick(e) {
|
|
53
|
-
return setAnchorEl(function (prev) {
|
|
54
|
-
return prev ? null : e.currentTarget;
|
|
55
|
-
});
|
|
56
|
-
},
|
|
57
|
-
children: intl.formatMessage({
|
|
58
|
-
id: 'runbox.status.button.title'
|
|
59
|
-
})
|
|
60
|
-
}), jsx(MaterialRunboxStatusPopover, {
|
|
61
|
-
open: Boolean(anchorEl),
|
|
62
|
-
anchorEl: anchorEl,
|
|
63
|
-
anchorOrigin: {
|
|
64
|
-
vertical: 'bottom',
|
|
65
|
-
horizontal: 'left'
|
|
66
|
-
},
|
|
67
|
-
transformOrigin: {
|
|
68
|
-
vertical: 'top',
|
|
69
|
-
horizontal: 'left'
|
|
70
|
-
},
|
|
71
|
-
sx: {
|
|
72
|
-
marginTop: '0.5rem'
|
|
73
|
-
},
|
|
74
|
-
bottomAction: bottomAction,
|
|
75
|
-
onClose: handleClose
|
|
76
|
-
})]
|
|
77
|
-
});
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export { MaterialRunboxStatusButton as default };
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import type React from 'react';
|
|
2
|
-
export interface MaterialRunboxStatusConnectionItemProps {
|
|
3
|
-
/** Leading icon element. */
|
|
4
|
-
icon: React.ReactNode;
|
|
5
|
-
/** Row label. */
|
|
6
|
-
label: React.ReactNode;
|
|
7
|
-
/** Whether the subject is connected. Drives the icon color. */
|
|
8
|
-
connected: boolean;
|
|
9
|
-
}
|
|
10
|
-
declare const MaterialRunboxStatusConnectionItem: React.FC<MaterialRunboxStatusConnectionItemProps>;
|
|
11
|
-
export default MaterialRunboxStatusConnectionItem;
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Stack, Typography } from '@mui/material';
|
|
3
|
-
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
var MaterialRunboxStatusConnectionItem = function MaterialRunboxStatusConnectionItem(_ref) {
|
|
8
|
-
var icon = _ref.icon,
|
|
9
|
-
label = _ref.label,
|
|
10
|
-
connected = _ref.connected;
|
|
11
|
-
return jsxs(Stack, {
|
|
12
|
-
direction: "row",
|
|
13
|
-
alignItems: "center",
|
|
14
|
-
gap: "0.75rem",
|
|
15
|
-
padding: "0.625rem 0.75rem",
|
|
16
|
-
children: [jsx(Typography, {
|
|
17
|
-
component: "span",
|
|
18
|
-
display: "inline-flex",
|
|
19
|
-
color: connected ? 'success.main' : 'text.disabled',
|
|
20
|
-
children: icon
|
|
21
|
-
}), jsx(Typography, {
|
|
22
|
-
variant: "body2",
|
|
23
|
-
children: label
|
|
24
|
-
})]
|
|
25
|
-
});
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export { MaterialRunboxStatusConnectionItem as default };
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import type { PopoverProps } from '@mui/material';
|
|
2
|
-
import type React from 'react';
|
|
3
|
-
export interface MaterialRunboxStatusPopoverProps extends Omit<PopoverProps, 'open' | 'onClose' | 'children'> {
|
|
4
|
-
/** Whether the popover is open. */
|
|
5
|
-
open: boolean;
|
|
6
|
-
/** Called when the popover requests to be closed. */
|
|
7
|
-
onClose: () => void;
|
|
8
|
-
/**
|
|
9
|
-
* Bottom action slot.
|
|
10
|
-
*
|
|
11
|
-
* NOTICE: the "실습 환경 초기화" button is out of scope for PLAT-4181.
|
|
12
|
-
* PLAT-4184 injects it here.
|
|
13
|
-
*/
|
|
14
|
-
bottomAction?: React.ReactNode;
|
|
15
|
-
}
|
|
16
|
-
declare const MaterialRunboxStatusPopover: React.FC<MaterialRunboxStatusPopoverProps>;
|
|
17
|
-
export default MaterialRunboxStatusPopover;
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import { __rest } from 'tslib';
|
|
2
|
-
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
3
|
-
import { useRawEliceIntl } from '@elice/intl';
|
|
4
|
-
import { EliceIcon } from '@elice/mui-elements';
|
|
5
|
-
import { useEliceRunboxRunning, useEliceRunboxContainerStats } from '@elice/runbox-client';
|
|
6
|
-
import { faWifiSlash, faWifi, faLinkSimple, faLinkSimpleSlash, faMicrochip, faMemory, faArrowUpRight, faArrowDownLeft, faDiscDrive } from '@fortawesome/pro-solid-svg-icons';
|
|
7
|
-
import { Popover, Stack, Divider } from '@mui/material';
|
|
8
|
-
import MaterialRunboxStatusConnectionItem from './MaterialRunboxStatusConnectionItem.js';
|
|
9
|
-
import MaterialRunboxStatusResourceItem from './MaterialRunboxStatusResourceItem.js';
|
|
10
|
-
import { useOnlineState } from '../hooks/useOnlineState.js';
|
|
11
|
-
|
|
12
|
-
//
|
|
13
|
-
//
|
|
14
|
-
//
|
|
15
|
-
var POPOVER_WIDTH = '15.25rem'; // 244px
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
19
|
-
var MaterialRunboxStatusPopover = function MaterialRunboxStatusPopover(_a) {
|
|
20
|
-
var open = _a.open,
|
|
21
|
-
onClose = _a.onClose,
|
|
22
|
-
bottomAction = _a.bottomAction,
|
|
23
|
-
props = __rest(_a, ["open", "onClose", "bottomAction"]);
|
|
24
|
-
var intl = useRawEliceIntl();
|
|
25
|
-
var _useEliceRunboxRunnin = useEliceRunboxRunning(),
|
|
26
|
-
status = _useEliceRunboxRunnin.status;
|
|
27
|
-
var online = useOnlineState();
|
|
28
|
-
var contStats = useEliceRunboxContainerStats();
|
|
29
|
-
var stats = contStats ? contStats[contStats.length - 1] : null;
|
|
30
|
-
var isRunboxRunning = status === 'running';
|
|
31
|
-
//
|
|
32
|
-
//
|
|
33
|
-
//
|
|
34
|
-
return jsx(Popover, Object.assign({
|
|
35
|
-
open: open,
|
|
36
|
-
onClose: onClose
|
|
37
|
-
}, props, {
|
|
38
|
-
children: jsxs(Stack, {
|
|
39
|
-
direction: "column",
|
|
40
|
-
padding: "0.75rem 0",
|
|
41
|
-
width: POPOVER_WIDTH,
|
|
42
|
-
bgcolor: "background.paper",
|
|
43
|
-
children: [jsxs(Stack, {
|
|
44
|
-
direction: "column",
|
|
45
|
-
children: [jsx(MaterialRunboxStatusConnectionItem, {
|
|
46
|
-
icon: jsx(EliceIcon, {
|
|
47
|
-
icon: online === false ? faWifiSlash : faWifi
|
|
48
|
-
}),
|
|
49
|
-
label: intl.formatMessage({
|
|
50
|
-
id: 'runbox.status.network'
|
|
51
|
-
}),
|
|
52
|
-
// `online` is undefined while unknown — only mark it down when known offline.
|
|
53
|
-
connected: online !== false
|
|
54
|
-
}), jsx(MaterialRunboxStatusConnectionItem, {
|
|
55
|
-
icon: jsx(EliceIcon, {
|
|
56
|
-
icon: isRunboxRunning ? faLinkSimple : faLinkSimpleSlash
|
|
57
|
-
}),
|
|
58
|
-
label: intl.formatMessage({
|
|
59
|
-
id: isRunboxRunning ? 'runbox.status.runtime.connected' : 'runbox.status.runtime.disconnected'
|
|
60
|
-
}),
|
|
61
|
-
connected: isRunboxRunning
|
|
62
|
-
})]
|
|
63
|
-
}), stats ? jsxs(Fragment, {
|
|
64
|
-
children: [jsx(Divider, {
|
|
65
|
-
sx: {
|
|
66
|
-
margin: '0.75rem'
|
|
67
|
-
}
|
|
68
|
-
}), jsxs(Stack, {
|
|
69
|
-
direction: "column",
|
|
70
|
-
children: [jsx(MaterialRunboxStatusResourceItem, {
|
|
71
|
-
icon: jsx(EliceIcon, {
|
|
72
|
-
icon: faMicrochip
|
|
73
|
-
}),
|
|
74
|
-
label: "CPU",
|
|
75
|
-
value: intl.formatNumber(stats.avgCpu, {
|
|
76
|
-
style: 'percent',
|
|
77
|
-
maximumFractionDigits: 2
|
|
78
|
-
})
|
|
79
|
-
}), jsx(MaterialRunboxStatusResourceItem, {
|
|
80
|
-
icon: jsx(EliceIcon, {
|
|
81
|
-
icon: faMemory
|
|
82
|
-
}),
|
|
83
|
-
label: "Memory",
|
|
84
|
-
value: "".concat(intl.formatDataSize(stats.memCurrent, {
|
|
85
|
-
unitSystem: 'iec',
|
|
86
|
-
maximumFractionDigits: 2
|
|
87
|
-
}), " / ").concat(intl.formatDataSize(stats.memTotal, {
|
|
88
|
-
unitSystem: 'iec',
|
|
89
|
-
maximumFractionDigits: 2
|
|
90
|
-
}))
|
|
91
|
-
}), jsx(MaterialRunboxStatusResourceItem, {
|
|
92
|
-
icon: jsx(EliceIcon, {
|
|
93
|
-
icon: faArrowUpRight
|
|
94
|
-
}),
|
|
95
|
-
label: "UP",
|
|
96
|
-
value: "".concat(intl.formatDataSize(stats.netOutPsec, {
|
|
97
|
-
unitSystem: 'iec'
|
|
98
|
-
}), "/s")
|
|
99
|
-
}), jsx(MaterialRunboxStatusResourceItem, {
|
|
100
|
-
icon: jsx(EliceIcon, {
|
|
101
|
-
icon: faArrowDownLeft
|
|
102
|
-
}),
|
|
103
|
-
label: "DOWN",
|
|
104
|
-
value: "".concat(intl.formatDataSize(stats.netInPsec, {
|
|
105
|
-
unitSystem: 'iec'
|
|
106
|
-
}), "/s")
|
|
107
|
-
}), jsx(MaterialRunboxStatusResourceItem, {
|
|
108
|
-
icon: jsx(EliceIcon, {
|
|
109
|
-
icon: faDiscDrive
|
|
110
|
-
}),
|
|
111
|
-
label: "DISK",
|
|
112
|
-
value: "".concat(intl.formatDataSize(stats.diskCurrent, {
|
|
113
|
-
unitSystem: 'iec',
|
|
114
|
-
maximumFractionDigits: 2
|
|
115
|
-
}), " / ").concat(intl.formatDataSize(stats.diskTotal, {
|
|
116
|
-
unitSystem: 'iec',
|
|
117
|
-
maximumFractionDigits: 2
|
|
118
|
-
}))
|
|
119
|
-
})]
|
|
120
|
-
})]
|
|
121
|
-
}) : null, bottomAction ? jsx(Stack, {
|
|
122
|
-
padding: "0.75rem 0.75rem 0",
|
|
123
|
-
children: bottomAction
|
|
124
|
-
}) : null]
|
|
125
|
-
})
|
|
126
|
-
}));
|
|
127
|
-
};
|
|
128
|
-
|
|
129
|
-
export { MaterialRunboxStatusPopover as default };
|
|
@@ -1,11 +0,0 @@
|
|
|
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;
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { Stack, Typography } from '@mui/material';
|
|
3
|
-
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
var MaterialRunboxStatusResourceItem = function MaterialRunboxStatusResourceItem(_ref) {
|
|
8
|
-
var icon = _ref.icon,
|
|
9
|
-
label = _ref.label,
|
|
10
|
-
value = _ref.value;
|
|
11
|
-
return jsxs(Stack, {
|
|
12
|
-
direction: "row",
|
|
13
|
-
alignItems: "flex-start",
|
|
14
|
-
gap: "0.75rem",
|
|
15
|
-
padding: "0.375rem 0.75rem",
|
|
16
|
-
children: [jsx(Typography, {
|
|
17
|
-
component: "span",
|
|
18
|
-
display: "inline-flex",
|
|
19
|
-
color: "text.secondary",
|
|
20
|
-
paddingTop: "0.5rem",
|
|
21
|
-
children: icon
|
|
22
|
-
}), jsxs(Stack, {
|
|
23
|
-
direction: "column",
|
|
24
|
-
children: [jsx(Typography, {
|
|
25
|
-
variant: "body2",
|
|
26
|
-
fontWeight: "bold",
|
|
27
|
-
children: label
|
|
28
|
-
}), jsx(Typography, {
|
|
29
|
-
variant: "caption",
|
|
30
|
-
color: "text.secondary",
|
|
31
|
-
fontFamily: "'JetBrains Mono', monospace",
|
|
32
|
-
children: value
|
|
33
|
-
})]
|
|
34
|
-
})]
|
|
35
|
-
});
|
|
36
|
-
};
|
|
37
|
-
|
|
38
|
-
export { MaterialRunboxStatusResourceItem as default };
|
|
@@ -1,4 +0,0 @@
|
|
|
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';
|
|
@@ -1,11 +0,0 @@
|
|
|
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;
|
|
@@ -1,112 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useRawEliceIntl } from '@elice/intl';
|
|
3
|
-
import { useEliceRunboxQuota } from '@elice/runbox-client';
|
|
4
|
-
import { Dialog, DialogTitle, DialogContent, Stack, Card, Typography, Divider, DialogActions, Button } from '@mui/material';
|
|
5
|
-
import { QUOTA_ALMOST_END_MINUTES, QUOTA_PER_SESSION_ALMOST_END_MINUTES } from '../hooks/useRunboxSessionEndWarning.js';
|
|
6
|
-
import MaterialRunboxQuotaAmount from './MaterialRunboxQuotaAmount.js';
|
|
7
|
-
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
/**
|
|
12
|
-
* Warns the learner that the *total* available time is about to run out.
|
|
13
|
-
*
|
|
14
|
-
* Once it does, the practice ends for good — there is no reconnecting.
|
|
15
|
-
*/
|
|
16
|
-
var MaterialRunboxQuotaAlmostEndDialog = function MaterialRunboxQuotaAlmostEndDialog(_ref) {
|
|
17
|
-
var open = _ref.open,
|
|
18
|
-
onClose = _ref.onClose;
|
|
19
|
-
var intl = useRawEliceIntl();
|
|
20
|
-
var _useEliceRunboxQuota = useEliceRunboxQuota(),
|
|
21
|
-
quotaInfo = _useEliceRunboxQuota.quotaInfo,
|
|
22
|
-
quotaPerSessionInfo = _useEliceRunboxQuota.quotaPerSessionInfo;
|
|
23
|
-
if (quotaInfo.isUnlimited) {
|
|
24
|
-
return null;
|
|
25
|
-
}
|
|
26
|
-
var isQuotaAlmostEnd = quotaInfo.remainingQuota <= QUOTA_ALMOST_END_MINUTES;
|
|
27
|
-
var isQuotaPerSessionAlmostEnd = !quotaPerSessionInfo.isUnlimited && quotaPerSessionInfo.remainingQuota <= QUOTA_PER_SESSION_ALMOST_END_MINUTES;
|
|
28
|
-
return jsxs(Dialog, {
|
|
29
|
-
fullWidth: true,
|
|
30
|
-
maxWidth: "xs",
|
|
31
|
-
open: open,
|
|
32
|
-
onClose: onClose,
|
|
33
|
-
children: [jsx(DialogTitle, {
|
|
34
|
-
children: intl.formatMessage({
|
|
35
|
-
id: 'runbox.timer.almost_end.dialog.quota.title'
|
|
36
|
-
}, {
|
|
37
|
-
time: intl.formatNumber(QUOTA_ALMOST_END_MINUTES, {
|
|
38
|
-
style: 'unit',
|
|
39
|
-
unit: 'minute',
|
|
40
|
-
unitDisplay: 'short'
|
|
41
|
-
})
|
|
42
|
-
})
|
|
43
|
-
}), jsx(DialogContent, {
|
|
44
|
-
children: jsxs(Stack, {
|
|
45
|
-
direction: "column",
|
|
46
|
-
gap: "1.5rem",
|
|
47
|
-
children: [jsxs(Card, {
|
|
48
|
-
sx: {
|
|
49
|
-
bgcolor: 'background.neutral'
|
|
50
|
-
},
|
|
51
|
-
children: [jsxs(Stack, {
|
|
52
|
-
direction: "column",
|
|
53
|
-
gap: "0.5rem",
|
|
54
|
-
padding: "1rem",
|
|
55
|
-
bgcolor: isQuotaAlmostEnd ? 'warning.opacity03' : undefined,
|
|
56
|
-
children: [jsx(Typography, {
|
|
57
|
-
variant: "body2",
|
|
58
|
-
fontWeight: "bold",
|
|
59
|
-
children: intl.formatMessage({
|
|
60
|
-
id: 'runbox.timer.popover.quota.title'
|
|
61
|
-
})
|
|
62
|
-
}), jsx(MaterialRunboxQuotaAmount, {
|
|
63
|
-
remainingQuota: quotaInfo.remainingQuota,
|
|
64
|
-
quota: quotaInfo.quota,
|
|
65
|
-
color: isQuotaAlmostEnd ? 'warning.main' : 'success.main'
|
|
66
|
-
})]
|
|
67
|
-
}), jsx(Divider, {}), jsxs(Stack, {
|
|
68
|
-
direction: "column",
|
|
69
|
-
gap: "0.5rem",
|
|
70
|
-
padding: "1rem",
|
|
71
|
-
bgcolor: isQuotaPerSessionAlmostEnd ? 'warning.opacity03' : undefined,
|
|
72
|
-
children: [jsx(Typography, {
|
|
73
|
-
variant: "body2",
|
|
74
|
-
fontWeight: "bold",
|
|
75
|
-
children: intl.formatMessage({
|
|
76
|
-
id: 'runbox.timer.popover.quota_per_session.title'
|
|
77
|
-
})
|
|
78
|
-
}), quotaPerSessionInfo.isUnlimited ? jsx(Typography, {
|
|
79
|
-
component: "span",
|
|
80
|
-
variant: "h5",
|
|
81
|
-
fontWeight: "extraBold",
|
|
82
|
-
children: intl.formatMessage({
|
|
83
|
-
id: 'runbox.timer.unlimited'
|
|
84
|
-
})
|
|
85
|
-
}) : jsx(MaterialRunboxQuotaAmount, {
|
|
86
|
-
remainingQuota: quotaPerSessionInfo.remainingQuota,
|
|
87
|
-
quota: quotaPerSessionInfo.quota,
|
|
88
|
-
color: isQuotaPerSessionAlmostEnd ? 'warning.main' : 'success.main'
|
|
89
|
-
})]
|
|
90
|
-
})]
|
|
91
|
-
}), jsx(Typography, {
|
|
92
|
-
variant: "body2",
|
|
93
|
-
whiteSpace: "pre-line",
|
|
94
|
-
children: intl.formatMessage({
|
|
95
|
-
id: 'runbox.timer.almost_end.dialog.quota.description'
|
|
96
|
-
})
|
|
97
|
-
})]
|
|
98
|
-
})
|
|
99
|
-
}), jsx(DialogActions, {
|
|
100
|
-
children: jsx(Button, {
|
|
101
|
-
variant: "contained",
|
|
102
|
-
color: "inherit",
|
|
103
|
-
onClick: onClose,
|
|
104
|
-
children: intl.formatMessage({
|
|
105
|
-
id: 'runbox.timer.almost_end.dialog.confirm'
|
|
106
|
-
})
|
|
107
|
-
})
|
|
108
|
-
})]
|
|
109
|
-
});
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
export { MaterialRunboxQuotaAlmostEndDialog as default };
|
|
@@ -1,13 +0,0 @@
|
|
|
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;
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useRawEliceIntl } from '@elice/intl';
|
|
3
|
-
import { Typography, Stack } from '@mui/material';
|
|
4
|
-
import MaterialRunboxQuotaTimePart from './MaterialRunboxQuotaTimePart.js';
|
|
5
|
-
import { getTimeParts } from '../../../utils/time.js';
|
|
6
|
-
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
/**
|
|
11
|
-
* Renders `<remaining> / <total>`, e.g. `4시간 11분 / 5시간`.
|
|
12
|
-
*/
|
|
13
|
-
var MaterialRunboxQuotaAmount = function MaterialRunboxQuotaAmount(_ref) {
|
|
14
|
-
var remainingQuota = _ref.remainingQuota,
|
|
15
|
-
quota = _ref.quota,
|
|
16
|
-
color = _ref.color;
|
|
17
|
-
var intl = useRawEliceIntl();
|
|
18
|
-
var _getTimeParts = getTimeParts(remainingQuota * 60),
|
|
19
|
-
remainingHours = _getTimeParts.hours,
|
|
20
|
-
remainingMinutes = _getTimeParts.minutes;
|
|
21
|
-
var _getTimeParts2 = getTimeParts(quota * 60),
|
|
22
|
-
totalHours = _getTimeParts2.hours,
|
|
23
|
-
totalMinutes = _getTimeParts2.minutes;
|
|
24
|
-
return jsxs(Typography, {
|
|
25
|
-
variant: "body2",
|
|
26
|
-
children: [jsxs(Stack, {
|
|
27
|
-
component: "span",
|
|
28
|
-
display: "inline-flex",
|
|
29
|
-
direction: "row",
|
|
30
|
-
gap: "0.25rem",
|
|
31
|
-
children: [jsx(MaterialRunboxQuotaTimePart, {
|
|
32
|
-
value: remainingHours,
|
|
33
|
-
unit: "hour",
|
|
34
|
-
color: color
|
|
35
|
-
}), jsx(MaterialRunboxQuotaTimePart, {
|
|
36
|
-
value: remainingMinutes,
|
|
37
|
-
unit: "minute",
|
|
38
|
-
color: color
|
|
39
|
-
})]
|
|
40
|
-
}), " / ", [totalHours > 0 ? intl.formatNumber(totalHours, {
|
|
41
|
-
style: 'unit',
|
|
42
|
-
unit: 'hour',
|
|
43
|
-
unitDisplay: 'short'
|
|
44
|
-
}) : null, totalMinutes > 0 ? intl.formatNumber(totalMinutes, {
|
|
45
|
-
style: 'unit',
|
|
46
|
-
unit: 'minute',
|
|
47
|
-
unitDisplay: 'short'
|
|
48
|
-
}) : null].filter(Boolean).join(' ')]
|
|
49
|
-
});
|
|
50
|
-
};
|
|
51
|
-
|
|
52
|
-
export { MaterialRunboxQuotaAmount as default };
|
package/es/components/material-runbox/timer/MaterialRunboxQuotaPerSessionAlmostEndDialog.d.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
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;
|
|
@@ -1,113 +0,0 @@
|
|
|
1
|
-
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
|
-
import { useRawEliceIntl } from '@elice/intl';
|
|
3
|
-
import { useEliceRunboxQuota } from '@elice/runbox-client';
|
|
4
|
-
import { Dialog, DialogTitle, DialogContent, Stack, Card, Typography, Divider, DialogActions, Button } from '@mui/material';
|
|
5
|
-
import { QUOTA_ALMOST_END_MINUTES, QUOTA_PER_SESSION_ALMOST_END_MINUTES } from '../hooks/useRunboxSessionEndWarning.js';
|
|
6
|
-
import MaterialRunboxQuotaAmount from './MaterialRunboxQuotaAmount.js';
|
|
7
|
-
|
|
8
|
-
//
|
|
9
|
-
//
|
|
10
|
-
//
|
|
11
|
-
/**
|
|
12
|
-
* Warns the learner that the time granted to *this connection* is about to run out.
|
|
13
|
-
*
|
|
14
|
-
* Unlike the total quota, the learner can reconnect and keep going as long as total
|
|
15
|
-
* time is left — so this dialog is about saving work, not about the practice ending.
|
|
16
|
-
*/
|
|
17
|
-
var MaterialRunboxQuotaPerSessionAlmostEndDialog = function MaterialRunboxQuotaPerSessionAlmostEndDialog(_ref) {
|
|
18
|
-
var open = _ref.open,
|
|
19
|
-
onClose = _ref.onClose;
|
|
20
|
-
var intl = useRawEliceIntl();
|
|
21
|
-
var _useEliceRunboxQuota = useEliceRunboxQuota(),
|
|
22
|
-
quotaInfo = _useEliceRunboxQuota.quotaInfo,
|
|
23
|
-
quotaPerSessionInfo = _useEliceRunboxQuota.quotaPerSessionInfo;
|
|
24
|
-
if (quotaPerSessionInfo.isUnlimited) {
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
var isQuotaAlmostEnd = !quotaInfo.isUnlimited && quotaInfo.remainingQuota <= QUOTA_ALMOST_END_MINUTES;
|
|
28
|
-
var isQuotaPerSessionAlmostEnd = quotaPerSessionInfo.remainingQuota <= QUOTA_PER_SESSION_ALMOST_END_MINUTES;
|
|
29
|
-
return jsxs(Dialog, {
|
|
30
|
-
fullWidth: true,
|
|
31
|
-
maxWidth: "xs",
|
|
32
|
-
open: open,
|
|
33
|
-
onClose: onClose,
|
|
34
|
-
children: [jsx(DialogTitle, {
|
|
35
|
-
children: intl.formatMessage({
|
|
36
|
-
id: 'runbox.timer.almost_end.dialog.quota_per_session.title'
|
|
37
|
-
}, {
|
|
38
|
-
time: intl.formatNumber(QUOTA_PER_SESSION_ALMOST_END_MINUTES, {
|
|
39
|
-
style: 'unit',
|
|
40
|
-
unit: 'minute',
|
|
41
|
-
unitDisplay: 'short'
|
|
42
|
-
})
|
|
43
|
-
})
|
|
44
|
-
}), jsx(DialogContent, {
|
|
45
|
-
children: jsxs(Stack, {
|
|
46
|
-
direction: "column",
|
|
47
|
-
gap: "1.5rem",
|
|
48
|
-
children: [jsxs(Card, {
|
|
49
|
-
sx: {
|
|
50
|
-
bgcolor: 'background.neutral'
|
|
51
|
-
},
|
|
52
|
-
children: [jsxs(Stack, {
|
|
53
|
-
direction: "column",
|
|
54
|
-
gap: "0.5rem",
|
|
55
|
-
padding: "1rem",
|
|
56
|
-
bgcolor: isQuotaAlmostEnd ? 'warning.opacity03' : undefined,
|
|
57
|
-
children: [jsx(Typography, {
|
|
58
|
-
variant: "body2",
|
|
59
|
-
fontWeight: "bold",
|
|
60
|
-
children: intl.formatMessage({
|
|
61
|
-
id: 'runbox.timer.popover.quota.title'
|
|
62
|
-
})
|
|
63
|
-
}), quotaInfo.isUnlimited ? jsx(Typography, {
|
|
64
|
-
component: "span",
|
|
65
|
-
variant: "h5",
|
|
66
|
-
fontWeight: "extraBold",
|
|
67
|
-
children: intl.formatMessage({
|
|
68
|
-
id: 'runbox.timer.unlimited'
|
|
69
|
-
})
|
|
70
|
-
}) : jsx(MaterialRunboxQuotaAmount, {
|
|
71
|
-
remainingQuota: quotaInfo.remainingQuota,
|
|
72
|
-
quota: quotaInfo.quota,
|
|
73
|
-
color: isQuotaAlmostEnd ? 'warning.main' : 'success.main'
|
|
74
|
-
})]
|
|
75
|
-
}), jsx(Divider, {}), jsxs(Stack, {
|
|
76
|
-
direction: "column",
|
|
77
|
-
gap: "0.5rem",
|
|
78
|
-
padding: "1rem",
|
|
79
|
-
bgcolor: isQuotaPerSessionAlmostEnd ? 'warning.opacity03' : undefined,
|
|
80
|
-
children: [jsx(Typography, {
|
|
81
|
-
variant: "body2",
|
|
82
|
-
fontWeight: "bold",
|
|
83
|
-
children: intl.formatMessage({
|
|
84
|
-
id: 'runbox.timer.popover.quota_per_session.title'
|
|
85
|
-
})
|
|
86
|
-
}), jsx(MaterialRunboxQuotaAmount, {
|
|
87
|
-
remainingQuota: quotaPerSessionInfo.remainingQuota,
|
|
88
|
-
quota: quotaPerSessionInfo.quota,
|
|
89
|
-
color: isQuotaPerSessionAlmostEnd ? 'warning.main' : 'success.main'
|
|
90
|
-
})]
|
|
91
|
-
})]
|
|
92
|
-
}), jsx(Typography, {
|
|
93
|
-
variant: "body2",
|
|
94
|
-
whiteSpace: "pre-line",
|
|
95
|
-
children: intl.formatMessage({
|
|
96
|
-
id: 'runbox.timer.almost_end.dialog.quota_per_session.description'
|
|
97
|
-
})
|
|
98
|
-
})]
|
|
99
|
-
})
|
|
100
|
-
}), jsx(DialogActions, {
|
|
101
|
-
children: jsx(Button, {
|
|
102
|
-
variant: "contained",
|
|
103
|
-
color: "inherit",
|
|
104
|
-
onClick: onClose,
|
|
105
|
-
children: intl.formatMessage({
|
|
106
|
-
id: 'runbox.timer.almost_end.dialog.confirm'
|
|
107
|
-
})
|
|
108
|
-
})
|
|
109
|
-
})]
|
|
110
|
-
});
|
|
111
|
-
};
|
|
112
|
-
|
|
113
|
-
export { MaterialRunboxQuotaPerSessionAlmostEndDialog as default };
|
|
@@ -1,15 +0,0 @@
|
|
|
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;
|