Merge branches 'dev_aliyun' and 'dev_newysm' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_newysm

chromesetting
杨树明 5 years ago
commit f95114cb02

@ -103,7 +103,7 @@ class GamesController < ApplicationController
begin
@tpm_modified = @myshixun.repository_is_modified(@shixun.repo_path) # 判断TPM和TPI的版本库是否被改了
rescue
uid_logger("实训平台繁忙繁忙等级81")
uid_logger("服务器出现问题,请重置刷新页面")
end
end

@ -781,7 +781,7 @@ class ShixunsController < ApplicationController
end
rescue => e
uid_logger_error(e.message)
tip_exception("#{e.message}")
tip_exception("服务器出现问题,请重置环境")
end
end

@ -214,7 +214,15 @@ class SubjectsController < ApplicationController
GitService.add_repository(repo_path: repo_path)
# todo: 为什么保存的时候要去除后面的.git呢??
@shixun.update_column(:repo_name, repo_path.split(".")[0])
mirror_id = MirrorRepository.find_by(type_name: 'Python3.6')&.id
mirror_id =
if @shixun.is_jupyter?
MirrorRepository.where("type_name like '%Jupyter%'").first&.id
folder = EduSetting.get('shixun_folder')
path = "#{folder}/#{identifier}"
FileUtils.mkdir_p(path, :mode => 0777) unless File.directory?(path)
else
MirrorRepository.find_by(type_name: 'Python3.6')&.id
end
if mirror_id
ShixunMirrorRepository.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id)
@shixun.shixun_service_configs.create!(:shixun_id => @shixun.id, :mirror_repository_id => mirror_id)

@ -10,7 +10,7 @@ class Discuss < ApplicationRecord
has_one :praise_tread_cache, as: :object, dependent: :destroy
belongs_to :dis, polymorphic: true
belongs_to :challenge
belongs_to :challenge, optional: true
after_create :send_tiding
scope :children, -> (discuss_id){ where(parent_id: discuss_id).includes(:user).reorder(created_at: :asc) }

@ -300,6 +300,11 @@ class TPMDataset extends Component {
this.setState({
Buttonloading:true
})
if(!info.file.status){
this.setState({
Buttonloading:false
})
}
if(info.file.status == "done" || info.file.status == "uploading" || info.file.status === 'removed'){
let fileList = info.fileList;
@ -323,9 +328,9 @@ class TPMDataset extends Component {
}
}
}else{
this.setState({
Buttonloading:false
})
// this.setState({
// Buttonloading:false
// })
}
if(info.file.response){
@ -465,9 +470,9 @@ class TPMDataset extends Component {
}
ButtonloadinghandleChange=()=>{
// this.props.showNotification(`zhzzzzz`);
this.setState({
Buttonloading:false
})
// this.setState({
// Buttonloading:false
// })
}
render() {
const {tpmLoading, shixun, user, match} = this.props;
@ -495,12 +500,11 @@ class TPMDataset extends Component {
onRemove: this.onAttachmentRemove,
beforeUpload: (file) => {
//上传前的操作
// console.log('beforeUpload', file.name);
console.log('beforeUpload', file);
// this.props.showNotification(`文件上传中`);
const isLt400M = file.size / 1024 / 1024 <= 400;
const isLt400M = file.size / 1024 / 1024 <= 1;
if (!isLt400M) {
this.ButtonloadinghandleChange
this.props.showNotification('文件大小必须小于等于400MB!');
}
return isLt400M;

Loading…
Cancel
Save