Merge remote-tracking branch 'origin/dev_jupyter' into dev_jupyter

chromesetting
杨树明 5 years ago
commit c28cecc3c9

@ -28,6 +28,7 @@ class AttachmentsController < ApplicationController
def create def create
# 1. 本地存储 # 1. 本地存储
# 2. 上传到云 # 2. 上传到云
begin
upload_file = params["file"] || params["#{params[:file_param_name]}"] # 这里的file_param_name是为了方便其他插件名称 upload_file = params["file"] || params["#{params[:file_param_name]}"] # 这里的file_param_name是为了方便其他插件名称
uid_logger("#########################file_params####{params["#{params[:file_param_name]}"]}") uid_logger("#########################file_params####{params["#{params[:file_param_name]}"]}")
raise "未上传文件" unless upload_file raise "未上传文件" unless upload_file
@ -74,6 +75,10 @@ class AttachmentsController < ApplicationController
end end
render_json render_json
rescue => e
uid_logger_error(e.message)
tip_exception(e.message)
end
end end
def destroy def destroy

@ -469,6 +469,8 @@ class ShixunsController < ApplicationController
# 实训测试集附件 # 实训测试集附件
def upload_data_sets def upload_data_sets
begin
upload_file = params["file"] upload_file = params["file"]
raise "未上传文件" unless upload_file raise "未上传文件" unless upload_file
folder = edu_setting('shixun_folder') folder = edu_setting('shixun_folder')
@ -500,6 +502,10 @@ class ShixunsController < ApplicationController
logger.info "文件已存在id = #{@attachment.id}, filename = #{@attachment.filename}" logger.info "文件已存在id = #{@attachment.id}, filename = #{@attachment.filename}"
end end
render_ok render_ok
rescue => e
uid_logger_error(e.message)
tip_exception(e.message)
end
end end
# 多文件删除 # 多文件删除

@ -84,6 +84,7 @@ class TPMDataset extends Component {
loadingstate:false, loadingstate:false,
checked: false, checked: false,
showmodel:false, showmodel:false,
itemtypebool:false,
} }
} }
@ -304,10 +305,18 @@ class TPMDataset extends Component {
if(info.file.response){ if(info.file.response){
if(info.file.response.status===-1||info.file.response.status==="-1"){ if(info.file.response.status===-1||info.file.response.status==="-1"){
// console.log("准备显示弹框了"); // console.log("准备显示弹框了");
// console.log(info); // console.log(info);false
let itemtype=-1;
try {
itemtype=info.file.response.message.indexOf('文件名已经存在'.toLowerCase());
}catch (e) {
}
this.setState({ this.setState({
showmodel:true, showmodel:true,
tittest:info.file.response.message, tittest:info.file.response.message,
itemtypebool:itemtype>-1?true:itemtype<=-1?false:false,
}) })
} }
} }
@ -466,7 +475,7 @@ class TPMDataset extends Component {
<div className="with65 fl edu-back-white commentsDelegateParent"> <div className="with65 fl edu-back-white commentsDelegateParent">
{ {
this.state.showmodel===true? this.state.showmodel===true?
<Tpmdatasetmodel modalCancel={()=>this.ModalSave()} tittest={this.state.tittest} modalsType={this.state.showmodel}></Tpmdatasetmodel> <Tpmdatasetmodel itemtypebool={this.state.itemtypebool} modalCancel={()=>this.ModalSave()} tittest={this.state.tittest} modalsType={this.state.showmodel}></Tpmdatasetmodel>
:"" :""
} }
<TPMNav <TPMNav

@ -214,7 +214,7 @@ class Challengesjupyter extends Component {
this.state.jupyter_url === null? this.state.jupyter_url === null?
<div className="mt50 intermediatecenter juplbool"> <div className="mt50 intermediatecenter juplbool">
<span className="icon iconfontysl icon-jiazaishibai1"></span> <span className="icon iconfontysl icon-jiazaishibai1"></span>
<p className="intermediatecenter sortinxdirection mt5 juplboolp"><p className="colorbluetest">加载实训出错是否</p><p className="colorbluetwo" onClick={()=>this.updatamakedowns()}></p></p> <p className="intermediatecenter sortinxdirection mt5 juplboolp"><p className="colorbluetest">加载实训失败</p><p className="colorbluetwo" onClick={()=>this.updatamakedowns()}></p></p>
</div> </div>

@ -34,7 +34,13 @@ class Tpmdatasetmodel extends Component {
width="530px" width="530px"
> >
<div className="educouddiv intermediatecenter"> <div className="educouddiv intermediatecenter">
{
this.props.itemtypebool===true?
<div className={"tabeltext-alignleftysl mt10"}><p>文件名重复</p></div> <div className={"tabeltext-alignleftysl mt10"}><p>文件名重复</p></div>
:""
}
<div className={"tabeltext-alignleftysltwo mt10"}><p>{this.props.tittest}</p></div> <div className={"tabeltext-alignleftysltwo mt10"}><p>{this.props.tittest}</p></div>
<div className="clearfix mt30 edu-txt-center task-btn-blues"> <div className="clearfix mt30 edu-txt-center task-btn-blues">
{/*<a className="task-btn mr30" onClick={()=>this.modalCancel()}>先试试看</a>*/} {/*<a className="task-btn mr30" onClick={()=>this.modalCancel()}>先试试看</a>*/}

Loading…
Cancel
Save