@elice/material-runbox-legacy 1.240718.0-trasncript.2 → 1.240718.2
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/components/material-runbox-legacy/MaterialRunboxLegacy.js +20 -22
- package/cjs/components/material-runbox-legacy/MaterialRunboxLegacy.styled.js +1 -5
- package/cjs/components/material-runbox-legacy/MaterialRunboxLegacyContent.js +171 -250
- package/cjs/components/material-runbox-legacy/MaterialRunboxLegacyContent.styled.js +6 -10
- package/cjs/components/material-runbox-legacy/MaterialRunboxLegacyRunnerRoomWrapper.js +43 -80
- package/cjs/components/material-runbox-legacy/MaterialRunboxLegacyStdioWrapper.js +30 -63
- package/cjs/components/material-runbox-legacy/websocket.js +2 -2
- package/es/components/material-runbox-legacy/MaterialRunboxLegacy.js +20 -22
- package/es/components/material-runbox-legacy/MaterialRunboxLegacy.styled.js +1 -1
- package/es/components/material-runbox-legacy/MaterialRunboxLegacyContent.js +171 -246
- package/es/components/material-runbox-legacy/MaterialRunboxLegacyContent.styled.js +6 -6
- package/es/components/material-runbox-legacy/MaterialRunboxLegacyRunnerRoomWrapper.js +43 -76
- package/es/components/material-runbox-legacy/MaterialRunboxLegacyStdioWrapper.js +30 -59
- package/es/components/material-runbox-legacy/websocket.js +2 -2
- package/package.json +12 -9
- package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -383
- package/cjs/components/material-runbox-legacy/index.js +0 -7
- package/cjs/components/material-runbox-legacy/locales/index.js +0 -13
- package/es/_virtual/_rollupPluginBabelHelpers.js +0 -374
- package/es/components/material-runbox-legacy/index.js +0 -1
- package/es/components/material-runbox-legacy/locales/index.js +0 -4
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var
|
|
5
|
+
var React = require('react');
|
|
6
6
|
var apiClient = require('@elice/api-client');
|
|
7
7
|
var blocks = require('@elice/blocks');
|
|
8
8
|
var intl = require('@elice/intl');
|
|
@@ -12,32 +12,30 @@ var ko = require('./locales/ko.json.js');
|
|
|
12
12
|
var MaterialRunboxLegacyRunnerRoomWrapper = require('./MaterialRunboxLegacyRunnerRoomWrapper.js');
|
|
13
13
|
var MaterialRunboxLegacy_styled = require('./MaterialRunboxLegacy.styled.js');
|
|
14
14
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
15
|
+
const MaterialRunboxLegacy = ({
|
|
16
|
+
materialRunboxId,
|
|
17
|
+
__intl
|
|
18
|
+
}) => {
|
|
19
|
+
const isReady = materialSharedUtils.useMaterialConfigApiClientUpdate(apiClient.config.init);
|
|
19
20
|
if (!isReady) {
|
|
20
|
-
return
|
|
21
|
+
return React.createElement(blocks.Flex, {
|
|
21
22
|
justify: "center",
|
|
22
23
|
align: "center",
|
|
23
24
|
width: "100%",
|
|
24
|
-
height: "100%"
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
});
|
|
25
|
+
height: "100%"
|
|
26
|
+
}, React.createElement(blocks.Spinner, {
|
|
27
|
+
size: "small"
|
|
28
|
+
}));
|
|
29
29
|
}
|
|
30
|
-
return
|
|
31
|
-
value: __intl
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
}, materialRunboxId)
|
|
40
|
-
});
|
|
30
|
+
return React.createElement(intl.RawEliceIntlProvider, {
|
|
31
|
+
value: __intl
|
|
32
|
+
}, React.createElement(MaterialRunboxLegacy_styled.StyledMaterialRunboxLegacy, {
|
|
33
|
+
key: materialRunboxId
|
|
34
|
+
}, React.createElement(intl.RawEliceIntlProvider, {
|
|
35
|
+
value: __intl
|
|
36
|
+
}, React.createElement(MaterialRunboxLegacyRunnerRoomWrapper.default, {
|
|
37
|
+
materialRunboxId: materialRunboxId
|
|
38
|
+
}))));
|
|
41
39
|
};
|
|
42
40
|
var MaterialRunboxLegacy$1 = new intl.IntlComponentBuilder(MaterialRunboxLegacy).add('en', en.default).add('ko', ko.default).addAsync('th', Promise.resolve().then(function () { return require('./locales/th.json.js'); })).addAsync('ja', Promise.resolve().then(function () { return require('./locales/ja.json.js'); })).build();
|
|
43
41
|
|
|
@@ -2,11 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var styled = require('styled-components');
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
8
|
-
|
|
9
|
-
var StyledMaterialRunboxLegacy = styled__default.default.div.withConfig({
|
|
5
|
+
const StyledMaterialRunboxLegacy = styled.div.withConfig({
|
|
10
6
|
componentId: "sc-w139i8-0"
|
|
11
7
|
})(["display:flex;flex-direction:column;padding-top:0.5rem;width:100%;height:100%;background-color:#fff;"]);
|
|
12
8
|
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
7
5
|
var React = require('react');
|
|
8
6
|
var reactUse = require('react-use');
|
|
9
7
|
var blocks = require('@elice/blocks');
|
|
@@ -12,10 +10,7 @@ var intl = require('@elice/intl');
|
|
|
12
10
|
var websocket = require('./websocket.js');
|
|
13
11
|
var MaterialRunboxLegacyContent_styled = require('./MaterialRunboxLegacyContent.styled.js');
|
|
14
12
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
18
|
-
|
|
13
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
19
14
|
exports.MaterialRunboxLegacyStatus = void 0;
|
|
20
15
|
(function (MaterialRunboxLegacyStatus) {
|
|
21
16
|
MaterialRunboxLegacyStatus[MaterialRunboxLegacyStatus["Idle"] = 0] = "Idle";
|
|
@@ -26,74 +21,47 @@ exports.MaterialRunboxLegacyStatus = void 0;
|
|
|
26
21
|
MaterialRunboxLegacyStatus[MaterialRunboxLegacyStatus["Terminated"] = 5] = "Terminated";
|
|
27
22
|
MaterialRunboxLegacyStatus[MaterialRunboxLegacyStatus["Error"] = 6] = "Error";
|
|
28
23
|
})(exports.MaterialRunboxLegacyStatus || (exports.MaterialRunboxLegacyStatus = {}));
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
setRunboxUrlLoaded = _React$useState4[1];
|
|
43
|
-
var isRunboxUrlLoadedPrev = reactUse.usePrevious(isRunboxUrlLoaded);
|
|
44
|
-
var _React$useState5 = React__default.default.useState(exports.MaterialRunboxLegacyStatus.Idle),
|
|
45
|
-
_React$useState6 = _rollupPluginBabelHelpers.slicedToArray(_React$useState5, 2),
|
|
46
|
-
runboxStatus = _React$useState6[0],
|
|
47
|
-
setRunboxStatus = _React$useState6[1];
|
|
48
|
-
var isRunboxPreparing = runboxStatus !== exports.MaterialRunboxLegacyStatus.Done && runboxStatus !== exports.MaterialRunboxLegacyStatus.Terminated;
|
|
49
|
-
websocket.WSMaterialRunboxLegacyStdio.useMessage(function (message) {
|
|
24
|
+
const MaterialRunboxLegacyContent = ({
|
|
25
|
+
runboxUrl,
|
|
26
|
+
isRunboxTerminated,
|
|
27
|
+
isRunboxJoinError,
|
|
28
|
+
reconnect
|
|
29
|
+
}) => {
|
|
30
|
+
const intl$1 = intl.useRawEliceIntl();
|
|
31
|
+
const [runboxStats, setRunboxStats] = React.useState(null);
|
|
32
|
+
const [isRunboxUrlLoaded, setRunboxUrlLoaded] = React.useState(false);
|
|
33
|
+
const isRunboxUrlLoadedPrev = reactUse.usePrevious(isRunboxUrlLoaded);
|
|
34
|
+
const [runboxStatus, setRunboxStatus] = React.useState(exports.MaterialRunboxLegacyStatus.Idle);
|
|
35
|
+
const isRunboxPreparing = runboxStatus !== exports.MaterialRunboxLegacyStatus.Done && runboxStatus !== exports.MaterialRunboxLegacyStatus.Terminated;
|
|
36
|
+
websocket.WSMaterialRunboxLegacyStdio.useMessage(message => {
|
|
50
37
|
if (message.type === 'stats') {
|
|
51
38
|
setRunboxStats(message.data);
|
|
52
39
|
}
|
|
40
|
+
}, {
|
|
41
|
+
camelize: true
|
|
53
42
|
});
|
|
54
|
-
|
|
43
|
+
const handleReconnect = () => {
|
|
55
44
|
setRunboxStats(null);
|
|
56
45
|
setRunboxUrlLoaded(false);
|
|
57
46
|
reconnect();
|
|
58
47
|
};
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
return
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
return navigator.clipboard.writeText(runboxUrl);
|
|
73
|
-
case 5:
|
|
74
|
-
blocks.Notification.success(intl$1.formatMessage({
|
|
75
|
-
id: 'runboxLegacy.share.success'
|
|
76
|
-
}));
|
|
77
|
-
_context.next = 11;
|
|
78
|
-
break;
|
|
79
|
-
case 8:
|
|
80
|
-
_context.prev = 8;
|
|
81
|
-
_context.t0 = _context["catch"](2);
|
|
82
|
-
alert(runboxUrl);
|
|
83
|
-
case 11:
|
|
84
|
-
case "end":
|
|
85
|
-
return _context.stop();
|
|
86
|
-
}
|
|
87
|
-
}, _callee, null, [[2, 8]]);
|
|
88
|
-
}));
|
|
89
|
-
return function handleShare() {
|
|
90
|
-
return _ref2.apply(this, arguments);
|
|
91
|
-
};
|
|
92
|
-
}();
|
|
48
|
+
const handleShare = async () => {
|
|
49
|
+
if (!runboxUrl) {
|
|
50
|
+
return;
|
|
51
|
+
}
|
|
52
|
+
try {
|
|
53
|
+
await navigator.clipboard.writeText(runboxUrl);
|
|
54
|
+
blocks.Notification.success(intl$1.formatMessage({
|
|
55
|
+
id: 'runboxLegacy.share.success'
|
|
56
|
+
}));
|
|
57
|
+
} catch (e) {
|
|
58
|
+
alert(runboxUrl);
|
|
59
|
+
}
|
|
60
|
+
};
|
|
93
61
|
//
|
|
94
62
|
// Change `isRunboxUrlLoaded` flag to false, when runbox url removed.
|
|
95
63
|
//
|
|
96
|
-
|
|
64
|
+
React.useEffect(() => {
|
|
97
65
|
if (!runboxUrl) {
|
|
98
66
|
setRunboxUrlLoaded(false);
|
|
99
67
|
}
|
|
@@ -101,8 +69,8 @@ var MaterialRunboxLegacyContent = function MaterialRunboxLegacyContent(_ref) {
|
|
|
101
69
|
//
|
|
102
70
|
// Determine runbox status.
|
|
103
71
|
//
|
|
104
|
-
|
|
105
|
-
setRunboxStatus(
|
|
72
|
+
React.useEffect(() => {
|
|
73
|
+
setRunboxStatus((() => {
|
|
106
74
|
switch (true) {
|
|
107
75
|
case isRunboxJoinError:
|
|
108
76
|
return exports.MaterialRunboxLegacyStatus.Error;
|
|
@@ -119,12 +87,12 @@ var MaterialRunboxLegacyContent = function MaterialRunboxLegacyContent(_ref) {
|
|
|
119
87
|
default:
|
|
120
88
|
return exports.MaterialRunboxLegacyStatus.Idle;
|
|
121
89
|
}
|
|
122
|
-
}());
|
|
90
|
+
})());
|
|
123
91
|
}, [isRunboxJoinError, isRunboxTerminated, isRunboxUrlLoaded, isRunboxUrlLoadedPrev, runboxUrl]);
|
|
124
92
|
/**
|
|
125
93
|
* Runbox status message shown at header.
|
|
126
94
|
*/
|
|
127
|
-
|
|
95
|
+
const renderRunboxStatusMessage = () => {
|
|
128
96
|
switch (runboxStatus) {
|
|
129
97
|
case exports.MaterialRunboxLegacyStatus.Idle:
|
|
130
98
|
return intl$1.formatMessage({
|
|
@@ -155,201 +123,154 @@ var MaterialRunboxLegacyContent = function MaterialRunboxLegacyContent(_ref) {
|
|
|
155
123
|
/**
|
|
156
124
|
* Header of runbox.
|
|
157
125
|
*/
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
size: "small",
|
|
256
|
-
border: true,
|
|
257
|
-
disabled: isRunboxPreparing,
|
|
258
|
-
onClick: handleShare
|
|
259
|
-
}), jsxRuntime.jsx(blocks.Hspace, {
|
|
260
|
-
width: 0.5
|
|
261
|
-
}), jsxRuntime.jsx(blocks.Tooltip, {
|
|
262
|
-
title: isRunboxPreparing ? intl$1.formatMessage({
|
|
263
|
-
id: 'runboxLegacy.reloadButton.tooltip'
|
|
264
|
-
}) : undefined,
|
|
265
|
-
children: jsxRuntime.jsx("span", {
|
|
266
|
-
children: jsxRuntime.jsx(blocks.IconButton, {
|
|
267
|
-
icon: icons.eilReset,
|
|
268
|
-
iconSpin: isRunboxPreparing,
|
|
269
|
-
role: "greyfb",
|
|
270
|
-
size: "small",
|
|
271
|
-
border: true,
|
|
272
|
-
disabled: isRunboxPreparing,
|
|
273
|
-
onClick: handleReconnect
|
|
274
|
-
})
|
|
275
|
-
})
|
|
276
|
-
})]
|
|
277
|
-
});
|
|
126
|
+
const renderRunboxHeader = () => {
|
|
127
|
+
const runboxStatsInfo = runboxStats ? React.createElement(blocks.LaptopOrLarger, null, React.createElement(blocks.Flex, null, React.createElement(blocks.Flex, {
|
|
128
|
+
align: "center"
|
|
129
|
+
}, React.createElement(blocks.Text, {
|
|
130
|
+
size: "tiny",
|
|
131
|
+
lineHeight: 1.5,
|
|
132
|
+
role: "gray7",
|
|
133
|
+
bold: true
|
|
134
|
+
}, "CPU:\u00A0"), React.createElement(blocks.Flex, {
|
|
135
|
+
align: "center",
|
|
136
|
+
width: "30px"
|
|
137
|
+
}, React.createElement(blocks.AntProgress, {
|
|
138
|
+
type: "line",
|
|
139
|
+
percent: runboxStats.cpu.percent,
|
|
140
|
+
status: 'active',
|
|
141
|
+
showInfo: false
|
|
142
|
+
})), React.createElement(blocks.Text, {
|
|
143
|
+
size: "tiny",
|
|
144
|
+
lineHeight: 1.5,
|
|
145
|
+
role: "gray5"
|
|
146
|
+
}, "\u00A0", `${runboxStats.cpu.percent.toFixed(0)}%`)), React.createElement(blocks.Hspace, {
|
|
147
|
+
width: 1
|
|
148
|
+
}), React.createElement(blocks.Flex, {
|
|
149
|
+
align: "center"
|
|
150
|
+
}, React.createElement(blocks.Text, {
|
|
151
|
+
size: "tiny",
|
|
152
|
+
lineHeight: 1.5,
|
|
153
|
+
role: "gray7",
|
|
154
|
+
bold: true
|
|
155
|
+
}, "MEM:\u00A0"), React.createElement(blocks.Flex, {
|
|
156
|
+
align: "center",
|
|
157
|
+
width: "30px"
|
|
158
|
+
}, React.createElement(blocks.AntProgress, {
|
|
159
|
+
percent: runboxStats.memory.currentBytes / runboxStats.memory.limitBytes * 100,
|
|
160
|
+
status: 'active',
|
|
161
|
+
showInfo: false
|
|
162
|
+
})), React.createElement(blocks.Text, {
|
|
163
|
+
size: "tiny",
|
|
164
|
+
lineHeight: 1.5,
|
|
165
|
+
role: "gray5"
|
|
166
|
+
}, "\u00A0", `${(runboxStats.memory.currentBytes / 1024 / 1024).toFixed(0)}M / ${(runboxStats.memory.limitBytes / 1024 / 1024).toFixed(0)}M`)), React.createElement(blocks.Hspace, {
|
|
167
|
+
width: 1
|
|
168
|
+
}), React.createElement(blocks.Text, {
|
|
169
|
+
size: "tiny",
|
|
170
|
+
lineHeight: 1.5,
|
|
171
|
+
role: "gray7",
|
|
172
|
+
bold: true
|
|
173
|
+
}, "DISK:\u00A0"), React.createElement(blocks.Text, {
|
|
174
|
+
size: "tiny",
|
|
175
|
+
lineHeight: 1.5,
|
|
176
|
+
role: "gray5"
|
|
177
|
+
}, `Read ${(runboxStats.block.rxBytes / 1024 / 1024).toFixed(0)}M Write ${(runboxStats.block.txBytes / 1024 / 1024).toFixed(0)}M`), React.createElement(blocks.Hspace, {
|
|
178
|
+
width: 1
|
|
179
|
+
}), React.createElement(blocks.Text, {
|
|
180
|
+
size: "tiny",
|
|
181
|
+
lineHeight: 1.5,
|
|
182
|
+
role: "gray7",
|
|
183
|
+
bold: true
|
|
184
|
+
}, "NET:\u00A0"), React.createElement(blocks.Text, {
|
|
185
|
+
size: "tiny",
|
|
186
|
+
lineHeight: 1.5,
|
|
187
|
+
role: "gray5"
|
|
188
|
+
}, `↓${(runboxStats.network.rxBytes / 1024 / 1024).toFixed(0)}M ↑${(runboxStats.network.txBytes / 1024 / 1024).toFixed(0)}M`), React.createElement(blocks.Hspace, {
|
|
189
|
+
width: 1
|
|
190
|
+
}))) : null;
|
|
191
|
+
return React.createElement(MaterialRunboxLegacyContent_styled.RunboxHeader, null, runboxStatsInfo, React.createElement(blocks.Flex, {
|
|
192
|
+
align: "center"
|
|
193
|
+
}, React.createElement(MaterialRunboxLegacyContent_styled.RunboxStatusLight, {
|
|
194
|
+
status: runboxStatus
|
|
195
|
+
}), React.createElement(blocks.Hspace, {
|
|
196
|
+
width: 0.5
|
|
197
|
+
}), React.createElement(blocks.Text, {
|
|
198
|
+
size: "small"
|
|
199
|
+
}, renderRunboxStatusMessage())), React.createElement(blocks.Hspace, {
|
|
200
|
+
width: 1
|
|
201
|
+
}), React.createElement(blocks.IconButton, {
|
|
202
|
+
icon: icons.eilShare,
|
|
203
|
+
role: "greyfb",
|
|
204
|
+
size: "small",
|
|
205
|
+
border: true,
|
|
206
|
+
disabled: isRunboxPreparing,
|
|
207
|
+
onClick: handleShare
|
|
208
|
+
}), React.createElement(blocks.Hspace, {
|
|
209
|
+
width: 0.5
|
|
210
|
+
}), React.createElement(blocks.Tooltip, {
|
|
211
|
+
title: isRunboxPreparing ? intl$1.formatMessage({
|
|
212
|
+
id: 'runboxLegacy.reloadButton.tooltip'
|
|
213
|
+
}) : undefined
|
|
214
|
+
}, React.createElement("span", null, React.createElement(blocks.IconButton, {
|
|
215
|
+
icon: icons.eilReset,
|
|
216
|
+
iconSpin: isRunboxPreparing,
|
|
217
|
+
role: "greyfb",
|
|
218
|
+
size: "small",
|
|
219
|
+
border: true,
|
|
220
|
+
disabled: isRunboxPreparing,
|
|
221
|
+
onClick: handleReconnect
|
|
222
|
+
}))));
|
|
278
223
|
};
|
|
279
224
|
/**
|
|
280
225
|
* Body of runbox.
|
|
281
226
|
*/
|
|
282
|
-
|
|
227
|
+
const renderRunboxBody = () => {
|
|
283
228
|
if (runboxStatus === exports.MaterialRunboxLegacyStatus.Terminated) {
|
|
284
|
-
return
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
children: intl$1.formatMessage({
|
|
293
|
-
id: 'runboxLegacy.overlay.message.terminated'
|
|
294
|
-
})
|
|
295
|
-
})
|
|
296
|
-
})
|
|
297
|
-
})
|
|
298
|
-
});
|
|
229
|
+
return React.createElement(MaterialRunboxLegacyContent_styled.RunboxBody, null, React.createElement(MaterialRunboxLegacyContent_styled.RunboxBodyOverlay, null, React.createElement(blocks.Box, null, React.createElement(blocks.Text, {
|
|
230
|
+
size: "small",
|
|
231
|
+
preWrap: true,
|
|
232
|
+
lineHeight: 1.5,
|
|
233
|
+
textAlign: "center"
|
|
234
|
+
}, intl$1.formatMessage({
|
|
235
|
+
id: 'runboxLegacy.overlay.message.terminated'
|
|
236
|
+
})))));
|
|
299
237
|
}
|
|
300
238
|
if (runboxStatus === exports.MaterialRunboxLegacyStatus.Error) {
|
|
301
|
-
return
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
children: intl$1.formatMessage({
|
|
310
|
-
id: 'runboxLegacy.overlay.message.error'
|
|
311
|
-
})
|
|
312
|
-
})
|
|
313
|
-
})
|
|
314
|
-
})
|
|
315
|
-
});
|
|
239
|
+
return React.createElement(MaterialRunboxLegacyContent_styled.RunboxBody, null, React.createElement(MaterialRunboxLegacyContent_styled.RunboxBodyOverlay, null, React.createElement(blocks.Box, null, React.createElement(blocks.Text, {
|
|
240
|
+
size: "small",
|
|
241
|
+
preWrap: true,
|
|
242
|
+
lineHeight: 1.5,
|
|
243
|
+
textAlign: "center"
|
|
244
|
+
}, intl$1.formatMessage({
|
|
245
|
+
id: 'runboxLegacy.overlay.message.error'
|
|
246
|
+
})))));
|
|
316
247
|
}
|
|
317
|
-
return
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
src: runboxUrl + '/?folder=/mnt/elice/workspace',
|
|
337
|
-
title: "material-runbox-legacy",
|
|
338
|
-
onLoad: function onLoad() {
|
|
339
|
-
return setRunboxUrlLoaded(true);
|
|
340
|
-
},
|
|
341
|
-
allow: "clipboard-read; clipboard-write; camera *; microphone *"
|
|
342
|
-
}) : null]
|
|
343
|
-
});
|
|
248
|
+
return React.createElement(MaterialRunboxLegacyContent_styled.RunboxBody, null, React.createElement(MaterialRunboxLegacyContent_styled.RunboxBodyOverlay, {
|
|
249
|
+
"aria-hidden": !isRunboxPreparing
|
|
250
|
+
}, React.createElement(blocks.Box, null, React.createElement(blocks.Spinner, null), React.createElement(blocks.Vspace, {
|
|
251
|
+
height: 1
|
|
252
|
+
}), React.createElement(blocks.Text, {
|
|
253
|
+
size: "small",
|
|
254
|
+
preWrap: true,
|
|
255
|
+
lineHeight: 1.5,
|
|
256
|
+
textAlign: "center"
|
|
257
|
+
}, runboxStatus === exports.MaterialRunboxLegacyStatus.Disconnected ? intl$1.formatMessage({
|
|
258
|
+
id: 'runboxLegacy.overlay.message.disconnected'
|
|
259
|
+
}) : intl$1.formatMessage({
|
|
260
|
+
id: 'runboxLegacy.overlay.message.connecting'
|
|
261
|
+
})))), runboxUrl ? React.createElement(MaterialRunboxLegacyContent_styled.RunboxBodyIframe, {
|
|
262
|
+
src: runboxUrl + '/?folder=/mnt/elice/workspace',
|
|
263
|
+
title: "material-runbox-legacy",
|
|
264
|
+
onLoad: () => setRunboxUrlLoaded(true),
|
|
265
|
+
allow: "clipboard-read; clipboard-write; camera *; microphone *"
|
|
266
|
+
}) : null);
|
|
344
267
|
};
|
|
345
268
|
//
|
|
346
269
|
//
|
|
347
270
|
//
|
|
348
|
-
return
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
}), renderRunboxBody()]
|
|
352
|
-
});
|
|
271
|
+
return React.createElement(React.Fragment, null, renderRunboxHeader(), React.createElement(blocks.Vspace, {
|
|
272
|
+
height: 0.5
|
|
273
|
+
}), renderRunboxBody());
|
|
353
274
|
};
|
|
354
275
|
|
|
355
276
|
exports.default = MaterialRunboxLegacyContent;
|
|
@@ -4,25 +4,21 @@ var designTokens = require('@elice/design-tokens');
|
|
|
4
4
|
var styled = require('styled-components');
|
|
5
5
|
var MaterialRunboxLegacyContent = require('./MaterialRunboxLegacyContent.js');
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
var styled__default = /*#__PURE__*/_interopDefaultCompat(styled);
|
|
10
|
-
|
|
11
|
-
var RunboxHeader = styled__default.default.div.withConfig({
|
|
7
|
+
const RunboxHeader = styled.div.withConfig({
|
|
12
8
|
componentId: "sc-18a3wux-0"
|
|
13
9
|
})(["flex:0 0 2.5rem;display:flex;justify-content:flex-end;align-items:center;padding:0 0.5rem;"]);
|
|
14
|
-
|
|
10
|
+
const RunboxBody = styled.div.withConfig({
|
|
15
11
|
componentId: "sc-18a3wux-1"
|
|
16
12
|
})(["position:relative;flex:1;"]);
|
|
17
|
-
|
|
13
|
+
const RunboxBodyOverlay = styled.div.withConfig({
|
|
18
14
|
componentId: "sc-18a3wux-2"
|
|
19
15
|
})(["position:absolute;top:0;left:0;display:flex;justify-content:center;align-items:center;flex:1;width:100%;height:100%;background:rgba(255,255,255,0.8);&[aria-hidden='true']{display:none;}"]);
|
|
20
|
-
|
|
16
|
+
const RunboxBodyIframe = styled.iframe.withConfig({
|
|
21
17
|
componentId: "sc-18a3wux-3"
|
|
22
18
|
})(["width:100%;height:100%;border:none;"]);
|
|
23
|
-
|
|
19
|
+
const RunboxStatusLight = styled.span.withConfig({
|
|
24
20
|
componentId: "sc-18a3wux-4"
|
|
25
|
-
})(["display:block;width:0.5rem;height:0.5rem;border-radius:50%;background-color:", ";"],
|
|
21
|
+
})(["display:block;width:0.5rem;height:0.5rem;border-radius:50%;background-color:", ";"], props => {
|
|
26
22
|
switch (props.status) {
|
|
27
23
|
case MaterialRunboxLegacyContent.MaterialRunboxLegacyStatus.Loading:
|
|
28
24
|
case MaterialRunboxLegacyContent.MaterialRunboxLegacyStatus.Connecting:
|