Merge branch 'dev_aliyun' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_cs
杨树林 5 years ago
commit d5b0d180f5

@ -145,10 +145,6 @@ class MainContent extends Component {
{ {
st === 0 st === 0
? ?
readRepoTimeout === true ? <div className="readRepoFailed">
代码加载失败<a className="retry"
onClick={() => this.props.fetchRepositoryCode(this.props, null, null, true, true)}>重试</a>
</div> :
<React.Fragment> <React.Fragment>
<div style={{display: (codeLoading ? 'block' : 'none'), textAlign: 'center'}}> <div style={{display: (codeLoading ? 'block' : 'none'), textAlign: 'center'}}>
<CircularProgress size={40} thickness={3} <CircularProgress size={40} thickness={3}

@ -319,7 +319,8 @@ class MainContentContainer extends Component {
readingRepoTimes = readingRepoTimes + 1; readingRepoTimes = readingRepoTimes + 1;
if(readingRepoTimes > 9) { if(readingRepoTimes > 9) {
this.setState({ this.setState({
readRepoTimeout: true readRepoTimeout: true,
codeLoading: false
}) })
readingRepoTimes = 0; readingRepoTimes = 0;
showSnackbar(`网络异常,请稍后重试。`); showSnackbar(`网络异常,请稍后重试。`);

@ -474,7 +474,9 @@ class CodeRepositoryView extends Component {
<span id="return_last_code"> <span id="return_last_code">
</span> </span>
{ challenge.pathIndex !== -1 && game.status === 2 && tabIndex === 0 && <a href="javascript:void(0);" className="iconButton" id="reset_success_game_code" onClick={showResetPassedCodeDialog}> { challenge.pathIndex !== -1 && game.status === 2 && tabIndex === 0 &&
this.props.readRepoTimeout !== true &&
<a href="javascript:void(0);" className="iconButton" id="reset_success_game_code" onClick={showResetPassedCodeDialog}>
<Tooltip title={ "加载上次通过的代码"} disableFocusListener={true}> <Tooltip title={ "加载上次通过的代码"} disableFocusListener={true}>
<i className="iconfont icon-fanhuishangcidaima font-20 "></i> <i className="iconfont icon-fanhuishangcidaima font-20 "></i>
</Tooltip> </Tooltip>
@ -482,7 +484,7 @@ class CodeRepositoryView extends Component {
} }
{ {
challenge.pathIndex !== -1 && tabIndex === 0 && challenge.pathIndex !== -1 && tabIndex === 0 && this.props.readRepoTimeout !== true &&
<a href="javascript:void(0);" className="iconButton" id="reset_game_code" onClick={showResetCodeDialog}> <a href="javascript:void(0);" className="iconButton" id="reset_game_code" onClick={showResetCodeDialog}>
<Tooltip title={ "恢复初始代码"} disableFocusListener={true}> <Tooltip title={ "恢复初始代码"} disableFocusListener={true}>
<i className="iconfont icon-zhongzhi font-20 "></i> <i className="iconfont icon-zhongzhi font-20 "></i>
@ -491,7 +493,7 @@ class CodeRepositoryView extends Component {
} }
{ {
tabIndex === 0 && tabIndex === 0 && this.props.readRepoTimeout !== true &&
<a href="javascript:void(0);" className="iconButton" id="setting" onClick={() => showSettingDrawer(true)}> <a href="javascript:void(0);" className="iconButton" id="setting" onClick={() => showSettingDrawer(true)}>
<Tooltip title={ "设置"} disableFocusListener={true}> <Tooltip title={ "设置"} disableFocusListener={true}>
<i className="iconfont icon-shezhi " style={{fontSize: '19px'}}></i> <i className="iconfont icon-shezhi " style={{fontSize: '19px'}}></i>
@ -510,6 +512,7 @@ class CodeRepositoryView extends Component {
<div className="cl"></div> <div className="cl"></div>
</ul> </ul>
<div className="cl"></div> <div className="cl"></div>
<div id="codetab_con_1" style={{display: 'block', flex: 'auto'}} style={ tabIndex === 0 ? {display: 'block'} : {display: 'none'} }> <div id="codetab_con_1" style={{display: 'block', flex: 'auto'}} style={ tabIndex === 0 ? {display: 'block'} : {display: 'none'} }>
{/* 没必要显示这个,注释掉了 */} {/* 没必要显示这个,注释掉了 */}
{/* { !isEditablePath && {/* { !isEditablePath &&
@ -519,6 +522,11 @@ class CodeRepositoryView extends Component {
</div> </div>
</Tooltip> </Tooltip>
} */} } */}
{this.props.readRepoTimeout === true ? <div className="readRepoFailed">
代码加载失败<a className="retry"
onClick={() => this.props.fetchRepositoryCode(this.props, null, null, true, true)}>重试</a>
</div> :
<React.Fragment>
<div className="codemirrorBackground" <div className="codemirrorBackground"
style={{ backgroundImage: `url('${notEditablePathImg}')` style={{ backgroundImage: `url('${notEditablePathImg}')`
, display: (isEditablePath || this.props.shixun && this.props.shixun.code_edit_permission ? 'none' : 'block') }}></div> , display: (isEditablePath || this.props.shixun && this.props.shixun.code_edit_permission ? 'none' : 'block') }}></div>
@ -526,6 +534,8 @@ class CodeRepositoryView extends Component {
{/* cm monaco 切换 */} {/* cm monaco 切换 */}
{/* <TPICodeMirror {...this.props} ></TPICodeMirror> */} {/* <TPICodeMirror {...this.props} ></TPICodeMirror> */}
<TPIMonaco {...this.props}></TPIMonaco> <TPIMonaco {...this.props}></TPIMonaco>
</React.Fragment>
}
</div> </div>
<div id="codetab_con_81" className="undis -relative" <div id="codetab_con_81" className="undis -relative"
style={ { color: '#fff', display: tabIndex === STABLE_SSH_TAB_ID ? 'block' : 'none', 'marginLeft': '2px'} }> style={ { color: '#fff', display: tabIndex === STABLE_SSH_TAB_ID ? 'block' : 'none', 'marginLeft': '2px'} }>

Loading…
Cancel
Save