dev_haigong
cxt 6 years ago
commit e3a7e90805

@ -587,7 +587,7 @@ class MainContentContainer extends Component {
// var timeOut = parseInt(<%= @myshixun.main_mirror.try(:time_limit) %>); // 超时参数
this.setEvaluateMiddleStatusText('')
this.setState({
gameBuilding: true
})
@ -611,6 +611,9 @@ class MainContentContainer extends Component {
this.setGameBuildFalse()
});
}
setEvaluateMiddleStatusText = (msg) => {
window.$('#evaluateMiddleStatusText').html(msg)
}
// 之前的task_commit方法
gameBuild(fileUpdateResponse, first) {
const { st, challenge, output_sets, onRunCodeTestFinish, resetTestSetsExpandedArray, showSnackbar, time_limit } = this.props
@ -641,14 +644,18 @@ class MainContentContainer extends Component {
axios.get(game_status_url, {
withCredentials: true,
}).then((gameStatusResponse) => {
requestTimes++;
if(!gameStatusResponse.data) {
if(requestTimes >= timeOut - 1){ // 最后一次参数改为true
timeOutFlag = true;
}
requestTimes++;
const { status, running_code_message } = gameStatusResponse.data;
if(!gameStatusResponse.data || !status && status !== 0 ) {
if(requestTimes >= timeOut - 1) { // 最后一次参数改为true
timeOutFlag = true;
}
if (running_code_message) {
this.setEvaluateMiddleStatusText(running_code_message)
}
return;
}
const { status } = gameStatusResponse.data;
if (timeOutFlag === false && (status === 2 || status === 0)) {
// 网络太慢或服务处理较慢的情况下,可能这里会执行第二次

@ -127,7 +127,7 @@ class UpdateDrawer extends Component {
const { path, status } = response.data;
if (status === -1) {
showSnackbar('更新失败,服务端错误')
showSnackbar(response.data.message || '更新失败,服务端错误')
} else if (status === 1) {
if (path) {
updateChallengePath(path);

@ -307,6 +307,14 @@ class CodeEvaluateView extends Component {
<CircularProgress size={40} thickness={3}
style={{ marginLeft: 'auto', marginRight: 'auto', marginTop: '10%', display: gameBuilding ? 'block': 'none' }}/>
<div id="evaluateMiddleStatusText" style={{
marginTop: "4px",
textAlign: "center",
color: "#4CACFF",
display: gameBuilding ? 'block': 'none'
}}
></div>
{/* 正在编译代码。。。 */}
<div id="game_test_set_results" className="-flex -relative blacktab-inner"
style={{ display: gameBuilding ? 'none': 'block' }}>

Loading…
Cancel
Save