@elice/material-runbox 1.240718.0-trasncript.2 → 1.240718.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cjs/assets/queue.gif.js +2 -1
- package/cjs/assets/runbox_logo.png.js +2 -1
- package/cjs/assets/terminated.png.js +2 -1
- package/cjs/components/material-runbox/MaterialRunbox.js +20 -24
- package/cjs/components/material-runbox/MaterialRunboxBody.js +4 -10
- package/cjs/components/material-runbox/MaterialRunboxContent.js +103 -132
- package/cjs/components/material-runbox/MaterialRunboxFooter.js +18 -27
- package/cjs/components/material-runbox/MaterialRunboxHeader.js +87 -103
- package/cjs/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +27 -31
- package/cjs/components/material-runbox/actions/MaterialRunboxActionGrade.js +159 -242
- package/cjs/components/material-runbox/actions/MaterialRunboxActionMenu.js +28 -32
- package/cjs/components/material-runbox/actions/MaterialRunboxActionReset.js +76 -125
- package/cjs/components/material-runbox/actions/MaterialRunboxActionRestart.js +53 -84
- package/cjs/components/material-runbox/actions/MaterialRunboxActionShare.js +28 -40
- package/cjs/components/material-runbox/contexts/MaterialRunboxApiContext.js +15 -27
- package/cjs/components/material-runbox/contexts/MaterialRunboxCommandContext.js +36 -52
- package/cjs/components/material-runbox/contexts/MaterialRunboxContext.js +8 -11
- package/cjs/components/material-runbox/hooks/useRunboxControl.js +38 -62
- package/cjs/components/material-runbox/runtime/Runtime.js +17 -25
- package/cjs/components/material-runbox/runtime/RuntimeOverlayAssigned.js +29 -33
- package/cjs/components/material-runbox/runtime/RuntimeOverlayQueued.js +39 -40
- package/cjs/components/material-runbox/runtime/RuntimeOverlayTerminated.js +57 -72
- package/es/assets/queue.gif.js +2 -1
- package/es/assets/runbox_logo.png.js +2 -1
- package/es/assets/terminated.png.js +2 -1
- package/es/components/material-runbox/MaterialRunbox.js +20 -24
- package/es/components/material-runbox/MaterialRunboxBody.js +4 -6
- package/es/components/material-runbox/MaterialRunboxContent.js +103 -128
- package/es/components/material-runbox/MaterialRunboxFooter.js +18 -23
- package/es/components/material-runbox/MaterialRunboxHeader.js +88 -99
- package/es/components/material-runbox/actions/MaterialRunboxActionAutoShutdown.js +27 -27
- package/es/components/material-runbox/actions/MaterialRunboxActionGrade.js +159 -237
- package/es/components/material-runbox/actions/MaterialRunboxActionMenu.js +28 -28
- package/es/components/material-runbox/actions/MaterialRunboxActionReset.js +76 -121
- package/es/components/material-runbox/actions/MaterialRunboxActionRestart.js +53 -80
- package/es/components/material-runbox/actions/MaterialRunboxActionShare.js +28 -36
- package/es/components/material-runbox/contexts/MaterialRunboxApiContext.js +14 -22
- package/es/components/material-runbox/contexts/MaterialRunboxCommandContext.js +35 -47
- package/es/components/material-runbox/contexts/MaterialRunboxContext.js +7 -6
- package/es/components/material-runbox/hooks/useRunboxControl.js +38 -62
- package/es/components/material-runbox/runtime/Runtime.js +17 -21
- package/es/components/material-runbox/runtime/RuntimeOverlayAssigned.js +30 -34
- package/es/components/material-runbox/runtime/RuntimeOverlayQueued.js +40 -41
- package/es/components/material-runbox/runtime/RuntimeOverlayTerminated.js +58 -69
- package/package.json +11 -8
- package/cjs/_virtual/_rollupPluginBabelHelpers.js +0 -386
- package/cjs/components/material-runbox/contexts/index.js +0 -17
- package/cjs/components/material-runbox/hooks/index.js +0 -7
- package/cjs/components/material-runbox/index.js +0 -7
- package/cjs/components/material-runbox/locales/index.js +0 -13
- package/es/_virtual/_rollupPluginBabelHelpers.js +0 -377
- package/es/components/material-runbox/contexts/index.js +0 -3
- package/es/components/material-runbox/hooks/index.js +0 -1
- package/es/components/material-runbox/index.js +0 -1
- package/es/components/material-runbox/locales/index.js +0 -4
|
@@ -3,18 +3,14 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _styled = require('@emotion/styled/base');
|
|
6
|
-
var
|
|
6
|
+
var React = require('react');
|
|
7
7
|
var Runtime = require('./runtime/Runtime.js');
|
|
8
8
|
|
|
9
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
10
|
-
|
|
11
|
-
var _styled__default = /*#__PURE__*/_interopDefaultCompat(_styled);
|
|
12
|
-
|
|
13
9
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
14
10
|
//
|
|
15
11
|
//
|
|
16
12
|
//
|
|
17
|
-
|
|
13
|
+
const StyledRunboxBody = /*#__PURE__*/_styled("div", {
|
|
18
14
|
target: "e9bwldp0"
|
|
19
15
|
})("production" === "production" ? {
|
|
20
16
|
name: "277wu0",
|
|
@@ -27,10 +23,8 @@ var StyledRunboxBody = /*#__PURE__*/_styled__default.default("div", {
|
|
|
27
23
|
//
|
|
28
24
|
//
|
|
29
25
|
//
|
|
30
|
-
|
|
31
|
-
return
|
|
32
|
-
children: jsxRuntime.jsx(Runtime.default, Object.assign({}, props))
|
|
33
|
-
});
|
|
26
|
+
const MaterialRunboxBody = props => {
|
|
27
|
+
return React.createElement(StyledRunboxBody, null, React.createElement(Runtime.default, Object.assign({}, props)));
|
|
34
28
|
};
|
|
35
29
|
|
|
36
30
|
exports.default = MaterialRunboxBody;
|
|
@@ -2,9 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
5
|
var _styled = require('@emotion/styled/base');
|
|
7
|
-
var
|
|
6
|
+
var React = require('react');
|
|
8
7
|
var blocks = require('@elice/blocks');
|
|
9
8
|
var intl = require('@elice/intl');
|
|
10
9
|
var runboxClient = require('@elice/runbox-client');
|
|
@@ -18,19 +17,15 @@ var MaterialRunboxBody = require('./MaterialRunboxBody.js');
|
|
|
18
17
|
var MaterialRunboxFooter = require('./MaterialRunboxFooter.js');
|
|
19
18
|
var MaterialRunboxHeader = require('./MaterialRunboxHeader.js');
|
|
20
19
|
|
|
21
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
22
|
-
|
|
23
|
-
var _styled__default = /*#__PURE__*/_interopDefaultCompat(_styled);
|
|
24
|
-
|
|
25
20
|
function _EMOTION_STRINGIFIED_CSS_ERROR__() { return "You have tried to stringify object returned from `css` function. It isn't supposed to be used directly (e.g. as value of the `className` prop), but rather handed to emotion so it can handle it (e.g. as value of `css` prop)."; }
|
|
26
21
|
//
|
|
27
22
|
//
|
|
28
23
|
//
|
|
29
|
-
|
|
24
|
+
const DEFAULT_DATA = [null, null, null];
|
|
30
25
|
//
|
|
31
26
|
//
|
|
32
27
|
//
|
|
33
|
-
|
|
28
|
+
const StyledRunboxContainer = /*#__PURE__*/_styled("div", {
|
|
34
29
|
target: "eeh98mq0"
|
|
35
30
|
})("production" === "production" ? {
|
|
36
31
|
name: "t5t5sq",
|
|
@@ -43,146 +38,122 @@ var StyledRunboxContainer = /*#__PURE__*/_styled__default.default("div", {
|
|
|
43
38
|
//
|
|
44
39
|
//
|
|
45
40
|
//
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
41
|
+
const MaterialRunboxContent = ({
|
|
42
|
+
runboxId,
|
|
43
|
+
courseId
|
|
44
|
+
}) => {
|
|
45
|
+
const intl$1 = intl.useRawEliceIntl();
|
|
46
|
+
const {
|
|
47
|
+
showMessenger
|
|
48
|
+
} = MaterialRunboxContext.useMaterialRunboxContext();
|
|
49
|
+
const materialRunboxApi = MaterialRunboxApiContext.useMaterialRunboxApiContext();
|
|
53
50
|
//
|
|
54
51
|
//
|
|
55
52
|
//
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
eliceCourseId: courseId
|
|
87
|
-
}, {
|
|
88
|
-
signal: signal
|
|
89
|
-
})]);
|
|
90
|
-
});
|
|
91
|
-
},
|
|
92
|
-
cacheTime: 0,
|
|
93
|
-
keepPreviousData: true,
|
|
94
|
-
refetchOnWindowFocus: false
|
|
53
|
+
const {
|
|
54
|
+
data: [runbox, runtime, runtimeTemplate] = DEFAULT_DATA,
|
|
55
|
+
isInitialLoading,
|
|
56
|
+
isError,
|
|
57
|
+
refetch
|
|
58
|
+
} = reactQuery.useQuery({
|
|
59
|
+
enabled: Boolean(runboxId),
|
|
60
|
+
queryKey: ['eliceMaterialRunboxRunboxApi.runboxRunboxIdGet', 'eliceMaterialRunboxRuntimeTemplateApi.runtimeTemplateRuntimeTemplateIdGet', runboxId, courseId],
|
|
61
|
+
queryFn: ({
|
|
62
|
+
signal
|
|
63
|
+
}) => materialRunboxApi.runbox.runboxRunboxIdGet({
|
|
64
|
+
runboxId: runboxId,
|
|
65
|
+
eliceCourseId: courseId
|
|
66
|
+
}, {
|
|
67
|
+
signal
|
|
68
|
+
}).then(runbox => Promise.all([
|
|
69
|
+
// runbox
|
|
70
|
+
runbox,
|
|
71
|
+
// runtime
|
|
72
|
+
materialRunboxApi.runtime.runtimeGet({
|
|
73
|
+
filterImageId: runbox.imageId,
|
|
74
|
+
filterRuntimeTemplateId: runbox.runtimeTemplateId,
|
|
75
|
+
skip: 0,
|
|
76
|
+
count: 1,
|
|
77
|
+
eliceCourseId: courseId
|
|
78
|
+
}, {
|
|
79
|
+
signal
|
|
80
|
+
}).then(runtimes => {
|
|
81
|
+
var _a;
|
|
82
|
+
return (_a = runtimes[0]) !== null && _a !== void 0 ? _a : null;
|
|
95
83
|
}),
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
84
|
+
// runtimeTemplate
|
|
85
|
+
materialRunboxApi.runtimeTemplate.runtimeTemplateRuntimeTemplateIdGet({
|
|
86
|
+
runtimeTemplateId: runbox.runtimeTemplateId,
|
|
87
|
+
eliceCourseId: courseId
|
|
88
|
+
}, {
|
|
89
|
+
signal
|
|
90
|
+
})])),
|
|
91
|
+
cacheTime: 0,
|
|
92
|
+
keepPreviousData: true,
|
|
93
|
+
refetchOnWindowFocus: false
|
|
94
|
+
});
|
|
105
95
|
//
|
|
106
96
|
//
|
|
107
97
|
//
|
|
108
98
|
if (isInitialLoading) {
|
|
109
|
-
return
|
|
110
|
-
children: jsxRuntime.jsx(blocks.Spinner, {})
|
|
111
|
-
});
|
|
99
|
+
return React.createElement(StyledRunboxContainer, null, React.createElement(blocks.Spinner, null));
|
|
112
100
|
}
|
|
113
101
|
if (isError) {
|
|
114
|
-
return
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
variant: "outlined",
|
|
134
|
-
onClick: function onClick() {
|
|
135
|
-
return showMessenger();
|
|
136
|
-
},
|
|
137
|
-
children: intl$1.formatMessage({
|
|
138
|
-
id: 'runbox.common.support'
|
|
139
|
-
})
|
|
140
|
-
}) : null]
|
|
141
|
-
})]
|
|
142
|
-
})
|
|
143
|
-
});
|
|
102
|
+
return React.createElement(StyledRunboxContainer, null, React.createElement(material.Stack, {
|
|
103
|
+
gap: "1.5rem"
|
|
104
|
+
}, React.createElement(material.Typography, {
|
|
105
|
+
variant: "h6"
|
|
106
|
+
}, intl$1.formatMessage({
|
|
107
|
+
id: 'runbox.runtime.message.startError'
|
|
108
|
+
})), React.createElement(material.Stack, {
|
|
109
|
+
gap: "0.5rem"
|
|
110
|
+
}, React.createElement(material.Button, {
|
|
111
|
+
startIcon: React.createElement(iconsMaterial.Refresh, null),
|
|
112
|
+
onClick: () => refetch()
|
|
113
|
+
}, intl$1.formatMessage({
|
|
114
|
+
id: 'runbox.common.retry'
|
|
115
|
+
})), typeof showMessenger === 'function' ? React.createElement(material.Button, {
|
|
116
|
+
variant: "outlined",
|
|
117
|
+
onClick: () => showMessenger()
|
|
118
|
+
}, intl$1.formatMessage({
|
|
119
|
+
id: 'runbox.common.support'
|
|
120
|
+
})) : null)));
|
|
144
121
|
}
|
|
145
122
|
if (!runbox || !runtimeTemplate) {
|
|
146
123
|
return null;
|
|
147
124
|
}
|
|
148
|
-
|
|
149
|
-
runbox
|
|
150
|
-
runtime
|
|
151
|
-
runtimeTemplate
|
|
152
|
-
courseId
|
|
153
|
-
refetch
|
|
125
|
+
const props = {
|
|
126
|
+
runbox,
|
|
127
|
+
runtime,
|
|
128
|
+
runtimeTemplate,
|
|
129
|
+
courseId,
|
|
130
|
+
refetch
|
|
154
131
|
};
|
|
155
|
-
return
|
|
132
|
+
return React.createElement(MaterialRunboxCommandContext.default, {
|
|
156
133
|
runtime: runtime,
|
|
157
|
-
courseId: courseId
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
onRunboxRefetchRequest: refetch,
|
|
181
|
-
children: jsxRuntime.jsxs(StyledRunboxContainer, {
|
|
182
|
-
children: [jsxRuntime.jsx(MaterialRunboxHeader.default, Object.assign({}, props)), jsxRuntime.jsx(MaterialRunboxBody.default, Object.assign({}, props)), jsxRuntime.jsx(MaterialRunboxFooter.default, Object.assign({}, props))]
|
|
183
|
-
})
|
|
184
|
-
})
|
|
185
|
-
});
|
|
134
|
+
courseId: courseId
|
|
135
|
+
}, React.createElement(runboxClient.EliceRunboxProvider, {
|
|
136
|
+
runboxId: runbox.id,
|
|
137
|
+
runboxApiHeartbeat: ({
|
|
138
|
+
id,
|
|
139
|
+
signal
|
|
140
|
+
}) => materialRunboxApi.runbox.runboxRunboxIdHeartbeatPost({
|
|
141
|
+
runboxId: id,
|
|
142
|
+
eliceCourseId: courseId
|
|
143
|
+
}, {
|
|
144
|
+
signal
|
|
145
|
+
}),
|
|
146
|
+
runboxApiQuota: ({
|
|
147
|
+
id,
|
|
148
|
+
signal
|
|
149
|
+
}) => materialRunboxApi.runbox.runboxRunboxIdQuotaGet({
|
|
150
|
+
runboxId: id,
|
|
151
|
+
eliceCourseId: courseId
|
|
152
|
+
}, {
|
|
153
|
+
signal
|
|
154
|
+
}),
|
|
155
|
+
onRunboxRefetchRequest: refetch
|
|
156
|
+
}, React.createElement(StyledRunboxContainer, null, React.createElement(MaterialRunboxHeader.default, Object.assign({}, props)), React.createElement(MaterialRunboxBody.default, Object.assign({}, props)), React.createElement(MaterialRunboxFooter.default, Object.assign({}, props)))));
|
|
186
157
|
};
|
|
187
158
|
|
|
188
159
|
exports.default = MaterialRunboxContent;
|
|
@@ -3,59 +3,50 @@
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
5
|
var _styled = require('@emotion/styled/base');
|
|
6
|
-
var
|
|
6
|
+
var React = require('react');
|
|
7
7
|
var runboxClient = require('@elice/runbox-client');
|
|
8
8
|
var material = require('@mui/material');
|
|
9
9
|
|
|
10
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
11
|
-
|
|
12
|
-
var _styled__default = /*#__PURE__*/_interopDefaultCompat(_styled);
|
|
13
|
-
|
|
14
10
|
//
|
|
15
11
|
//
|
|
16
12
|
//
|
|
17
|
-
|
|
13
|
+
const StyledFooter = /*#__PURE__*/_styled("div", {
|
|
18
14
|
target: "e9lbhtr0"
|
|
19
|
-
})("position:relative;flex:0 0 2rem;display:flex;justify-content:space-between;align-items:center;padding:0 1rem;width:100%;border-top:1px solid ",
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
}, ";");
|
|
15
|
+
})("position:relative;flex:0 0 2rem;display:flex;justify-content:space-between;align-items:center;padding:0 1rem;width:100%;border-top:1px solid ", ({
|
|
16
|
+
theme
|
|
17
|
+
}) => theme.palette.divider, ";");
|
|
23
18
|
//
|
|
24
19
|
//
|
|
25
20
|
//
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
const MaterialRunboxFooter = ({
|
|
22
|
+
runtimeTemplate
|
|
23
|
+
}) => {
|
|
28
24
|
/**
|
|
29
25
|
* Resource stats
|
|
30
26
|
*/
|
|
31
|
-
|
|
27
|
+
const renderFooterResourceStats = () => {
|
|
32
28
|
var _a, _b;
|
|
33
|
-
return
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
})
|
|
37
|
-
});
|
|
29
|
+
return React.createElement(material.Box, null, React.createElement(runboxClient.EliceRunboxResourceStat, {
|
|
30
|
+
gpu: ((_b = (_a = runtimeTemplate.gpus) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0) > 0
|
|
31
|
+
}));
|
|
38
32
|
};
|
|
39
33
|
/**
|
|
40
34
|
* Status
|
|
41
35
|
*/
|
|
42
|
-
|
|
43
|
-
return
|
|
36
|
+
const renderFooterStatus = () => {
|
|
37
|
+
return React.createElement(material.Stack, {
|
|
44
38
|
direction: "row",
|
|
45
39
|
gap: "0.5rem",
|
|
46
|
-
divider:
|
|
40
|
+
divider: React.createElement(material.Divider, {
|
|
47
41
|
orientation: "vertical",
|
|
48
42
|
flexItem: true
|
|
49
|
-
})
|
|
50
|
-
|
|
51
|
-
});
|
|
43
|
+
})
|
|
44
|
+
}, React.createElement(runboxClient.EliceRunboxRemainingTimer, null), React.createElement(runboxClient.EliceRunboxNetworkStat, null), React.createElement(runboxClient.EliceRunboxRunningStatus, null));
|
|
52
45
|
};
|
|
53
46
|
//
|
|
54
47
|
//
|
|
55
48
|
//
|
|
56
|
-
return
|
|
57
|
-
children: [renderFooterResourceStats(), renderFooterStatus()]
|
|
58
|
-
});
|
|
49
|
+
return React.createElement(StyledFooter, null, renderFooterResourceStats(), renderFooterStatus());
|
|
59
50
|
};
|
|
60
51
|
|
|
61
52
|
exports.default = MaterialRunboxFooter;
|
|
@@ -2,9 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
4
|
|
|
5
|
-
var _rollupPluginBabelHelpers = require('../../_virtual/_rollupPluginBabelHelpers.js');
|
|
6
5
|
var _styled = require('@emotion/styled/base');
|
|
7
|
-
var jsxRuntime = require('react/jsx-runtime');
|
|
8
6
|
var React = require('react');
|
|
9
7
|
var intl = require('@elice/intl');
|
|
10
8
|
var muiElements = require('@elice/mui-elements');
|
|
@@ -21,83 +19,75 @@ require('./contexts/MaterialRunboxCommandContext.js');
|
|
|
21
19
|
var MaterialRunboxContext = require('./contexts/MaterialRunboxContext.js');
|
|
22
20
|
var runbox_logo = require('../../assets/runbox_logo.png.js');
|
|
23
21
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
var _styled__default = /*#__PURE__*/_interopDefaultCompat(_styled);
|
|
27
|
-
var React__default = /*#__PURE__*/_interopDefaultCompat(React);
|
|
28
|
-
|
|
29
|
-
var StyledHeader = /*#__PURE__*/_styled__default.default("div", {
|
|
22
|
+
const StyledHeader = /*#__PURE__*/_styled("div", {
|
|
30
23
|
target: "e110d0bp0"
|
|
31
|
-
})("position:relative;flex:0 0 3rem;display:flex;justify-content:space-between;align-items:center;padding:0 1rem;width:100%;border-bottom:1px solid ",
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
}, ";overflow:hidden;");
|
|
24
|
+
})("position:relative;flex:0 0 3rem;display:flex;justify-content:space-between;align-items:center;padding:0 1rem;width:100%;border-bottom:1px solid ", ({
|
|
25
|
+
theme
|
|
26
|
+
}) => theme.palette.divider, ";overflow:hidden;");
|
|
35
27
|
//
|
|
36
28
|
//
|
|
37
29
|
//
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
30
|
+
const MaterialRunboxHeader = ({
|
|
31
|
+
runbox,
|
|
32
|
+
runtime,
|
|
33
|
+
runtimeTemplate,
|
|
34
|
+
courseId,
|
|
35
|
+
refetch
|
|
36
|
+
}) => {
|
|
37
|
+
const intl$1 = intl.useRawEliceIntl();
|
|
38
|
+
const {
|
|
39
|
+
enableAutoShutdownToggle
|
|
40
|
+
} = MaterialRunboxContext.useMaterialRunboxContext();
|
|
41
|
+
const [menuAnchorEl, setMenuAnchorEl] = React.useState(null);
|
|
42
|
+
const {
|
|
43
|
+
status
|
|
44
|
+
} = runboxClient.useEliceRunboxRunning();
|
|
45
|
+
const isRunboxRunning = status === 'running';
|
|
54
46
|
/**
|
|
55
47
|
*
|
|
56
48
|
*/
|
|
57
|
-
|
|
49
|
+
const handleMenuClose = () => {
|
|
58
50
|
setMenuAnchorEl(null);
|
|
59
51
|
};
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
return !(data === null || data === void 0 ? void 0 : data.remainSubmitCount) ? false : 5 * 1000;
|
|
77
|
-
},
|
|
78
|
-
enabled: Boolean(runtime === null || runtime === void 0 ? void 0 : runtime.runboxId),
|
|
79
|
-
retry: false
|
|
52
|
+
const materialRunboxApi = MaterialRunboxApiContext.useMaterialRunboxApiContext();
|
|
53
|
+
const {
|
|
54
|
+
data: leaderboardSubmitInfo,
|
|
55
|
+
isLoading: isLeaderboardSubmitInfoLoading
|
|
56
|
+
} = reactQuery.useQuery({
|
|
57
|
+
queryKey: ['eliceMaterialRunboxRunboxApi.runboxRunboxIdSubmitInfoGet', {
|
|
58
|
+
courseId,
|
|
59
|
+
runtime
|
|
60
|
+
}],
|
|
61
|
+
queryFn: ({
|
|
62
|
+
signal
|
|
63
|
+
}) => materialRunboxApi.runbox.runboxRunboxIdSubmitInfoGet({
|
|
64
|
+
eliceCourseId: courseId,
|
|
65
|
+
runboxId: runtime === null || runtime === void 0 ? void 0 : runtime.runboxId
|
|
66
|
+
}, {
|
|
67
|
+
signal
|
|
80
68
|
}),
|
|
81
|
-
|
|
82
|
-
|
|
69
|
+
refetchInterval: data => !(data === null || data === void 0 ? void 0 : data.remainSubmitCount) ? false : 5 * 1000,
|
|
70
|
+
enabled: Boolean(runtime === null || runtime === void 0 ? void 0 : runtime.runboxId),
|
|
71
|
+
retry: false
|
|
72
|
+
});
|
|
83
73
|
/**
|
|
84
74
|
*
|
|
85
75
|
*/
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
76
|
+
const renderHeaderSubmitInfo = () => {
|
|
77
|
+
const remainSubmitCount = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.remainSubmitCount;
|
|
78
|
+
const totalSubmitCount = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.submitCountLimit;
|
|
79
|
+
const isDailyLimitEnabled = leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.dailyLimitEnabled;
|
|
80
|
+
const isIndividualTypeLeaderboard = (leaderboardSubmitInfo === null || leaderboardSubmitInfo === void 0 ? void 0 : leaderboardSubmitInfo.entryType) === types.enums.LeaderboardEntryType.Individual;
|
|
91
81
|
if (isLeaderboardSubmitInfoLoading || remainSubmitCount === null) {
|
|
92
82
|
return null;
|
|
93
83
|
}
|
|
94
|
-
return
|
|
84
|
+
return React.createElement(muiElements.Tag, {
|
|
95
85
|
label: intl$1.formatMessage({
|
|
96
86
|
id: 'runbox.header.submitInfo'
|
|
97
87
|
}, {
|
|
98
88
|
remainCount: remainSubmitCount,
|
|
99
89
|
totalCount: totalSubmitCount,
|
|
100
|
-
isDailyLimitEnabled
|
|
90
|
+
isDailyLimitEnabled,
|
|
101
91
|
isIndividual: isIndividualTypeLeaderboard
|
|
102
92
|
}),
|
|
103
93
|
variant: "muted",
|
|
@@ -107,11 +97,11 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref2) {
|
|
|
107
97
|
/**
|
|
108
98
|
*
|
|
109
99
|
*/
|
|
110
|
-
|
|
100
|
+
const renderHeaderActionAutoShutdown = () => {
|
|
111
101
|
if (!enableAutoShutdownToggle) {
|
|
112
102
|
return null;
|
|
113
103
|
}
|
|
114
|
-
return
|
|
104
|
+
return React.createElement(MaterialRunboxActionAutoShutdown.default, {
|
|
115
105
|
runtime: runtime,
|
|
116
106
|
runtimeTemplate: runtimeTemplate,
|
|
117
107
|
courseId: courseId,
|
|
@@ -121,11 +111,11 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref2) {
|
|
|
121
111
|
/**
|
|
122
112
|
*
|
|
123
113
|
*/
|
|
124
|
-
|
|
114
|
+
const renderHeaderActionGrade = () => {
|
|
125
115
|
if (!runbox.submission.enabled) {
|
|
126
116
|
return null;
|
|
127
117
|
}
|
|
128
|
-
return
|
|
118
|
+
return React.createElement(MaterialRunboxActionGrade.default, {
|
|
129
119
|
runtime: runtime,
|
|
130
120
|
courseId: courseId
|
|
131
121
|
});
|
|
@@ -133,51 +123,45 @@ var MaterialRunboxHeader = function MaterialRunboxHeader(_ref2) {
|
|
|
133
123
|
/**
|
|
134
124
|
*
|
|
135
125
|
*/
|
|
136
|
-
|
|
137
|
-
return
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
handleMenuClose: handleMenuClose
|
|
157
|
-
})]
|
|
158
|
-
});
|
|
126
|
+
const renderOptionMenu = () => {
|
|
127
|
+
return React.createElement(React.Fragment, null, React.createElement(material.IconButton, {
|
|
128
|
+
disabled: !isRunboxRunning,
|
|
129
|
+
onClick: e => {
|
|
130
|
+
if (Boolean(menuAnchorEl)) {
|
|
131
|
+
setMenuAnchorEl(null);
|
|
132
|
+
} else {
|
|
133
|
+
setMenuAnchorEl(e.currentTarget);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}, React.createElement(muiElements.EliceIcon, {
|
|
137
|
+
icon: proSolidSvgIcons.faEllipsisVertical
|
|
138
|
+
})), React.createElement(MaterialRunboxActionMenu.default, {
|
|
139
|
+
runbox: runbox,
|
|
140
|
+
runtime: runtime,
|
|
141
|
+
courseId: courseId,
|
|
142
|
+
menuAnchorEl: menuAnchorEl,
|
|
143
|
+
refetch: refetch,
|
|
144
|
+
handleMenuClose: handleMenuClose
|
|
145
|
+
}));
|
|
159
146
|
};
|
|
160
147
|
//
|
|
161
148
|
//
|
|
162
149
|
//
|
|
163
|
-
return
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
children: [renderHeaderSubmitInfo(), renderHeaderActionAutoShutdown(), renderOptionMenu(), renderHeaderActionGrade()]
|
|
179
|
-
})]
|
|
180
|
-
});
|
|
150
|
+
return React.createElement(StyledHeader, null, React.createElement(material.Box, {
|
|
151
|
+
component: "img",
|
|
152
|
+
src: runbox_logo.default,
|
|
153
|
+
alt: "elice runbox",
|
|
154
|
+
sx: {
|
|
155
|
+
width: 'auto',
|
|
156
|
+
height: '100%',
|
|
157
|
+
imageRendering: 'auto',
|
|
158
|
+
padding: '0.465rem 0'
|
|
159
|
+
}
|
|
160
|
+
}), React.createElement(material.Stack, {
|
|
161
|
+
direction: "row",
|
|
162
|
+
alignItems: "center",
|
|
163
|
+
gap: "0.5rem"
|
|
164
|
+
}, renderHeaderSubmitInfo(), renderHeaderActionAutoShutdown(), renderOptionMenu(), renderHeaderActionGrade()));
|
|
181
165
|
};
|
|
182
166
|
|
|
183
167
|
exports.default = MaterialRunboxHeader;
|