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

dev_cs
杨树林 5 years ago
commit d5b0d180f5

@ -144,11 +144,7 @@ class MainContent extends Component {
{/* readRepoTimeout 如果读取代码超时,显示重新加载按钮,重新拉取代码 */}
{
st === 0
?
readRepoTimeout === true ? <div className="readRepoFailed">
代码加载失败<a className="retry"
onClick={() => this.props.fetchRepositoryCode(this.props, null, null, true, true)}>重试</a>
</div> :
?
<React.Fragment>
<div style={{display: (codeLoading ? 'block' : 'none'), textAlign: 'center'}}>
<CircularProgress size={40} thickness={3}

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

@ -474,7 +474,9 @@ class CodeRepositoryView extends Component {
<span id="return_last_code">
</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}>
<i className="iconfont icon-fanhuishangcidaima font-20 "></i>
</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}>
<Tooltip title={ "恢复初始代码"} disableFocusListener={true}>
<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)}>
<Tooltip title={ "设置"} disableFocusListener={true}>
<i className="iconfont icon-shezhi " style={{fontSize: '19px'}}></i>
@ -510,6 +512,7 @@ class CodeRepositoryView extends Component {
<div className="cl"></div>
</ul>
<div className="cl"></div>
<div id="codetab_con_1" style={{display: 'block', flex: 'auto'}} style={ tabIndex === 0 ? {display: 'block'} : {display: 'none'} }>
{/* 没必要显示这个,注释掉了 */}
{/* { !isEditablePath &&
@ -519,13 +522,20 @@ class CodeRepositoryView extends Component {
</div>
</Tooltip>
} */}
<div className="codemirrorBackground"
style={{ backgroundImage: `url('${notEditablePathImg}')`
, display: (isEditablePath || this.props.shixun && this.props.shixun.code_edit_permission ? 'none' : 'block') }}></div>
{/*<textarea className = "" id="extend-challenge-file-edit" name="content">{repositoryCode}</textarea>*/}
{/* cm monaco 切换 */}
{/* <TPICodeMirror {...this.props} ></TPICodeMirror> */}
<TPIMonaco {...this.props}></TPIMonaco>
{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"
style={{ backgroundImage: `url('${notEditablePathImg}')`
, display: (isEditablePath || this.props.shixun && this.props.shixun.code_edit_permission ? 'none' : 'block') }}></div>
{/*<textarea className = "" id="extend-challenge-file-edit" name="content">{repositoryCode}</textarea>*/}
{/* cm monaco 切换 */}
{/* <TPICodeMirror {...this.props} ></TPICodeMirror> */}
<TPIMonaco {...this.props}></TPIMonaco>
</React.Fragment>
}
</div>
<div id="codetab_con_81" className="undis -relative"
style={ { color: '#fff', display: tabIndex === STABLE_SSH_TAB_ID ? 'block' : 'none', 'marginLeft': '2px'} }>

Loading…
Cancel
Save