diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index c9b027a1b..d603b557e 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -217,7 +217,8 @@ class MyshixunsController < ApplicationController shixun_tomcat = edu_setting('tomcat_webssh') uri = "#{shixun_tomcat}/bridge/webssh/getConnectInfo" # 由于中间层采用混合云的方式,因为local参数表示在有文件生成的实训是在本地生成,还是在其他云端生成评测文件 - params = {tpiID:@myshixun.id, podType:@myshixun.shixun.try(:webssh), local: @myshixun.shixun.show_type != -1, + local = @myshixun.shixun.challenges.where.not(show_type: -1).count == 0 + params = {tpiID:@myshixun.id, podType:@myshixun.shixun.try(:webssh), local: local, containers:(Base64.urlsafe_encode64(shixun_container_limit @myshixun.shixun))} res = uri_post uri, params if res && res['code'].to_i != 0 @@ -365,31 +366,6 @@ class MyshixunsController < ApplicationController end end - def sync_code - shixun_tomcat = edu_setting('cloud_bridge') - begin - git_myshixun_url = repo_ip_url @myshixun.repo_path - git_shixun_url = repo_ip_url @myshixun.shixun.try(:repo_path) - git_myshixun_url = Base64.urlsafe_encode64(git_myshixun_url) - git_shixun_url = Base64.urlsafe_encode64(git_shixun_url) - # todo: identifier 是以前的密码,用来验证的,新版如果不需要,和中间层协调更改. - params = {tpiID: "#{@myshixun.try(:id)}", tpiGitURL: "#{git_myshixun_url}", tpmGitURL: "#{git_shixun_url}", - identifier: "xinhu1ji2qu3"} - uri = "#{shixun_tomcat}/bridge/game/resetTpmRepository" - res = uri_post uri, params - if (res && res['code'] != 0) - tip_exception("实训云平台繁忙(繁忙等级:95)") - end - shixun_new_commit = GitService.commits(repo_path: @myshixun.shixun.repo_path).first["id"] - @myshixun.update_attributes!(commit_id: shixun_new_commit, reset_time: @myshixun.shixun.try(:reset_time)) - # 更新完成后,弹框则隐藏不再提示 - @myshixun.update_column(:system_tip, false) - render_ok - rescue Exception => e - tip_exception("立即更新代码失败!#{e.message}") - end - end - # -----End diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index 3b3cc2b37..9670e5e0b 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -19,7 +19,8 @@ class NewShixunModel extends Component{ order:'desc', diff:0, limit:15, - sort:"myshixuns_count" + sort:"myshixuns_count", + belongtoindex:0, } } componentDidMount() { @@ -161,7 +162,17 @@ class NewShixunModel extends Component{ }) let{status,order,diff,limit,sort}=this.state; if(this.props.type==='shixuns'){ - this.getdatalist(1,value,status,undefined,order,diff,limit) + this.getdatalist(1,value,status,undefined,order,diff,limit); + if(value==="all"){ + this.setState({ + belongtoindex:0 + }) + }else{ + this.setState({ + belongtoindex:1 + }) + } + }else{ this.getdatalist(1,value,undefined,undefined,order,undefined,limit,undefined,sort) } @@ -322,6 +333,7 @@ class NewShixunModel extends Component{ this.getdatalist(page,type,status,keyword,order,diff,limit) } + updatepathlist=(sorts,orders)=>{ let{page,type,keyword,order,diff,limit,status,sort}=this.state; let seartorders; @@ -352,7 +364,7 @@ class NewShixunModel extends Component{ } render() { - let {diff,Grouplist,status,shixun_list,shixuns_count,page,type,order,sort}=this.state; + let {diff,Grouplist,status,shixun_list,shixuns_count,page,type,order,sort,belongtoindex}=this.state; // let {visible,patheditarry}=this.props; // console.log(Grouplist) // console.log(allGrouplist) @@ -446,7 +458,7 @@ class NewShixunModel extends Component{
-
+
@@ -472,7 +484,36 @@ class NewShixunModel extends Component{ onSearch={ (value)=>this.setdatafuns(value)} />
-
+ + + + + + + {this.props.type==='shixuns'? +
+

筛选:

+

this.belongto("all")}>全部实训

+

this.belongto("mine")}>普通实训

+
:"" + } + {/*{this.props.type==='shixuns'? */} + {/* */} + {/* {diff===0?"难度":diff===1?"初级":diff===2?"中级":diff===3?"高级":diff===4?"顶级":""}*/} + {/* */} + {/*:""}*/} + {this.props.type==='shixuns'? +
+

难度:

+

this.DropdownClick(0)}>全部

+

this.DropdownClick(1)}>初级

+

this.DropdownClick(2)}>中级

+

this.DropdownClick(3)}>高级

+

this.DropdownClick(4)}>顶级

+
:"" + } + +
@@ -509,17 +550,18 @@ class NewShixunModel extends Component{ :"":""} - {this.props.type==='shixuns'? - - {diff===0?"难度":diff===1?"初级":diff===2?"中级":diff===3?"高级":diff===4?"顶级":""} - - :""} +
-
- {/*this.props.hideNewShixunModelType()}>返回*/} - this.belongto("mine")}>我的{this.props.type==='shixuns'?'实训':"课程"} - this.belongto("all")}>全部{this.props.type==='shixuns'?'实训':"课程"} +
+ + {this.props.type==='shixuns'?"": + this.belongto("mine")}>我的课程 + } + + {this.props.type==='shixuns'?"": + this.belongto("all")}>全部课程 + }
diff --git a/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css index 782979de0..b69c41e25 100644 --- a/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css +++ b/public/react/src/modules/courses/coursesPublic/Newshixunmodel.css @@ -407,3 +407,110 @@ align-items: center; justify-content: center; } + + +/* 中间居中 */ +.intermediatecenter{ + display: flex; + flex-direction: column; + align-items: center; + justify-content: center; +} +/* 简单居中 */ +.intermediatecenterysls{ + display: flex; + align-items: center; +} +.spacearound{ + display: flex; + justify-content: space-around; + +} +.spacebetween{ + display: flex; + justify-content: space-between; +} +/* 头顶部居中 */ +.topcenter{ + display: -webkit-flex; + flex-direction: column; + align-items: center; + +} + + +/* x轴正方向排序 */ +/* 一 二 三 四 五 六 七 八 */ +.sortinxdirection{ + display: flex; + flex-direction:row; +} +/* x轴反方向排序 */ +/* 八 七 六 五 四 三 二 一 */ +.xaxisreverseorder{ + display: flex; + flex-direction:row-reverse; +} +/* 垂直布局 正方向*/ +/* 一 + 二 + 三 + 四 + 五 + 六 + 七 + 八 */ +.verticallayout{ + display: flex; + flex-direction:column; +} +/* 垂直布局 反方向*/ +.reversedirection{ + display: flex; + flex-direction:column-reverse; +} + +.nandu{ + width: 42px; + height: 19px; + font-size: 14px; + color: #000000; + line-height: 19px; + margin-left: 6px; +} + +.clickbuts{ + text-align: center; + width: 60px; + height: 32px; + background: #4CACFF; + border-radius: 16px; + line-height: 30px; + color: #FFFFFF; + cursor:pointer; +} +.clickbutst{ + height:19px; + font-size:14px; + color:#505050; + line-height:19px; + cursor:pointer; +} + +.clickbutstwo{ + text-align: center; + width: 85px; + height: 32px; + background: #4CACFF; + border-radius: 16px; + line-height: 30px; + color: #FFFFFF; + cursor:pointer; +} +.clickbutstwos{ + height:19px; + font-size:14px; + color:#505050; + line-height:19px; + cursor:pointer; +}