Merge branch 'dev_aliyun' into dev_tj

merge aliyun
dev_tpm_ui
tangjiang 5 years ago
commit 7817389d69

@ -92,7 +92,6 @@ class Course < ApplicationRecord
where("name LIKE ?", "%#{keywords.split(" ").join('|')}%") unless keywords.blank? where("name LIKE ?", "%#{keywords.split(" ").join('|')}%") unless keywords.blank?
} }
scope :started, -> { where("start_date is null or start_date <= '#{Date.today}'") } scope :started, -> { where("start_date is null or start_date <= '#{Date.today}'") }
scope :no_jupyter, -> { where(is_jupyter: false) }
# acts_as_taggable # acts_as_taggable

@ -83,6 +83,7 @@ class Shixun < ApplicationRecord
scope :publiced, lambda{ where(public: 2) } scope :publiced, lambda{ where(public: 2) }
scope :field_for_recommend, lambda{ select([:id, :name, :identifier, :myshixuns_count]) } scope :field_for_recommend, lambda{ select([:id, :name, :identifier, :myshixuns_count]) }
scope :find_by_ids,lambda{|k| where(id:k)} scope :find_by_ids,lambda{|k| where(id:k)}
scope :no_jupyter, -> { where(is_jupyter: false) }
after_create :send_tiding after_create :send_tiding
#同步到trustie #同步到trustie

@ -344,14 +344,20 @@ class Challengesjupyter extends Component {
identifier:id identifier:id
}}).then((response) => { }}).then((response) => {
if(response.data.status===0){ if(response.data.status===0){
setTimeout(()=>{ setTimeout(()=>{
this.setState({ this.setState({
jupyter_url :response.data.url, jupyter_url :response.data.url,
booljupyterurls:true, booljupyterurls:true,
}) })
},1000); },500);
this.props.showNotification('重置实训成功!'); this.props.showNotification('重置实训成功!');
setTimeout(()=>{
this.setState({
booljupyterurls:true,
})
},1000);
} }
}); });
} }
@ -557,7 +563,49 @@ class Challengesjupyter extends Component {
</style> </style>
{ {
this.state.jupyter_url === null || this.state.jupyter_url === undefined ? this.state.jupyter_url === null || this.state.jupyter_url === undefined ?
"" enlarge===true?
<div style={{
height: '63px',
}} className={enlarge?"shixunjianjiecballenges edu-back-white intermediatecenter fangdaone":"shixunjianjiecballenges edu-back-white mt20"}>
<div className={enlarge?"sortinxdirection jupyterswidth":"sortinxdirection"} >
<div className="renwuxiangssi sortinxdirection">
<div><p className="renwuxiangqdiv">任务详情</p></div>
<div><p className="renwuxiangqdivtest ml1 shixunbingbaocun">请将实训题目写在下方并保存</p></div>
</div>
<div className="renwuxiangssit xaxisreverseorder">
{
enlarge===true?
<i className="iconfont icon-suoxiao2 font-18 ml2 ysliconfont" style={{
marginLeft: '30px',
}} onClick={()=>this.onclki(false)}></i>
:
<i className="iconfont icon-fangda font-18 ml2 ysliconfont" style={{
marginLeft: '30px',
}} onClick={()=>this.onclki(true)}></i>
}
<style>
{
`
.ant-upload-list{
display:none
}
`
}
</style>
<Upload {...uploadProps}>
<div className="challenbaocun" type="upload">
<p className="challenbaocuntest" type="upload" >导入</p>
</div>
</Upload>
<button type="button" className="ant-btn deletebuttom chongzhistyles" onClick={this.handleClickResetTpi}><span>重置环境</span></button>
</div>
</div>
</div>
:""
: :
( (
admin===true||business===true||mysidentity===true? admin===true||business===true||mysidentity===true?
@ -640,15 +688,20 @@ class Challengesjupyter extends Component {
this.state.jupyter_url===null || this.state.jupyter_url===undefined? this.state.jupyter_url===null || this.state.jupyter_url===undefined?
( (
booljupyterurls===false? booljupyterurls===false?
<LoadingSpin></LoadingSpin> <div className={enlarge?"fangdatwo edu-back-white":""}>
:"" <LoadingSpin ></LoadingSpin>
</div>
:<div className={enlarge?"fangdatwo edu-back-white":""}>
</div>
) )
: :
<div className={enlarge?"fangdatwo edu-back-white":""}>
<iframe src={this.state.jupyter_url} className={enlarge?"fangdatwo":""} <iframe src={this.state.jupyter_url} className={enlarge?"fangdatwo":""}
scrolling="no" id="frame" scrolling="no" id="frame"
name="framename" width="100%" height="700" frameBorder="0" name="framename" width="100%" height="700" frameBorder="0"
></iframe> ></iframe>
</div>
} }
</div> </div>
</div> </div>
@ -664,3 +717,4 @@ class Challengesjupyter extends Component {
} }
export default Challengesjupyter; export default Challengesjupyter;

Loading…
Cancel
Save