diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb index 814d16d51..08ca3ff77 100644 --- a/app/controllers/hack_user_lastest_codes_controller.rb +++ b/app/controllers/hack_user_lastest_codes_controller.rb @@ -61,7 +61,10 @@ class HackUserLastestCodesController < ApplicationController # 提交记录 def submit_records - @records = @my_hack.hack_user_codes.created_order + records = @my_hack.hack_user_codes + @records_count = records.count + @records = paginate records.created_order + end diff --git a/app/controllers/hacks_controller.rb b/app/controllers/hacks_controller.rb index 7a0fb7635..f93b2dab5 100644 --- a/app/controllers/hacks_controller.rb +++ b/app/controllers/hacks_controller.rb @@ -100,6 +100,7 @@ class HacksController < ApplicationController @hack.update_attribute(:status, 1) base_attrs = { trigger_user_id: current_user.id, viewed: 0, tiding_type: 'System', user_id: @hack.user_id, + parent_container_type: "HackPublish" } @hack.tidings.create!(base_attrs) render_ok @@ -109,7 +110,8 @@ class HacksController < ApplicationController def cancel_publish @hack.update_attribute(:status, 0) base_attrs = { - trigger_user_id: current_user.id, viewed: 0, tiding_type: 'System', user_id: @hack.user_id + trigger_user_id: current_user.id, viewed: 0, tiding_type: 'System', user_id: @hack.user_id, + parent_container_type: "HackUnPublish" } @hack.tidings.create!(base_attrs) render_ok @@ -129,8 +131,19 @@ class HacksController < ApplicationController def new;end def destroy - @hack.destroy - render_ok + begin + base_attrs = { + user_id: @hack.user_id, viewed: 0, tiding_type: 'System', trigger_user_id: current_user.id, + parent_container_type: "HackDelete", extra: "#{@hack.name}" + } + @hack.tidings.create!(base_attrs) + @hack.destroy + render_ok + rescue => e + logger.error("####hack_delete_error: #{e.message}") + render_error("删除失败") + end + end private diff --git a/app/controllers/jupyters_controller.rb b/app/controllers/jupyters_controller.rb index 988cef01a..6cc78536a 100644 --- a/app/controllers/jupyters_controller.rb +++ b/app/controllers/jupyters_controller.rb @@ -80,4 +80,17 @@ class JupytersController < ApplicationController render json: {status: 0} end + def timeinfo_with_tpm + shixun = Shixun.find_by(identifier: params[:identifier]) + info = jupyter_timeinfo_tpm(shixun) + render json: {status: 0}.merge(info) + end + + def timeinfo_with_tpi + myshixun = Myshixun.find_by(identifier: params[:identifier]) + info = jupyter_timeinfo_tpi(shixun) + render json: {status: 0}.merge(info) + end + + end diff --git a/app/controllers/myshixuns_controller.rb b/app/controllers/myshixuns_controller.rb index 0e9ba477a..255c0f42e 100644 --- a/app/controllers/myshixuns_controller.rb +++ b/app/controllers/myshixuns_controller.rb @@ -376,7 +376,7 @@ class MyshixunsController < ApplicationController # todo: identifier 是以前的密码,用来验证的,新版如果不需要,和中间层协调更改. params = {tpiID: "#{@myshixun.try(:id)}", tpiGitURL: "#{git_myshixun_url}", tpmGitURL: "#{git_shixun_url}", identifier: "xinhu1ji2qu3"} - uri = "#{shixun_tomcat}/bridge/game/resetTpmRepository" + uri = "#{shixun_tomcat}/bridge/game/resetJupyterTpm" res = uri_post uri, params if (res && res['code'] != 0) tip_exception("实训云平台繁忙(繁忙等级:95)") diff --git a/app/controllers/shixuns_controller.rb b/app/controllers/shixuns_controller.rb index 190892730..859dce6f6 100644 --- a/app/controllers/shixuns_controller.rb +++ b/app/controllers/shixuns_controller.rb @@ -216,7 +216,7 @@ class ShixunsController < ApplicationController ShixunInfo.create!(shixun_id: @new_shixun.id, description: @shixun.description, evaluate_script: @shixun.evaluate_script, - shixun_reason: params[:reason].to_s.strip) + fork_reason: params[:reason].to_s.strip) end # 同步私密版本库 @@ -266,8 +266,20 @@ class ShixunsController < ApplicationController # 如果是jupyter,先创建一个目录,为了挂载(因为后续数据集,开启Pod后环境在没销毁前,你上传数据集是挂载不上目录的,因此要先创建目录,方便中间层挂载) if @new_shixun.is_jupyter? folder = EduSetting.get('shixun_folder') + raise "存储目录未定义" unless folder.present? path = "#{folder}/#{@new_shixun.identifier}" FileUtils.mkdir_p(path, :mode => 0777) unless File.directory?(path) + # 复制数据集 + save_path = File.join(folder, @shixun.identifier) + @shixun.data_sets.each do |set| + new_date_set = Attachment.new + new_date_set.attributes = set.attributes.dup.except("id", "container_id", "disk_directory") + new_date_set.container_id = @new_shixun.id + new_date_set.disk_directory = @new_shixun.identifier + new_date_set.save! + FileUtils.cp("#{save_path}/#{set.relative_path_filename}", path) + end + end # 同步复制关卡 if @shixun.challenges.present? @@ -351,7 +363,7 @@ class ShixunsController < ApplicationController page = params[:page] || 1 limit = params[:limit] || 10 @member_count = @shixun.shixun_members.count - @members = @shixun.shixun_members.includes(:user).page(page).per(limit) + @members = @shixun.shixun_members.order("role = 1 desc, created_at asc").includes(:user).page(page).per(limit) end def fork_list diff --git a/app/decorators/tiding_decorator.rb b/app/decorators/tiding_decorator.rb index 130e7f4b8..8e0c402dd 100644 --- a/app/decorators/tiding_decorator.rb +++ b/app/decorators/tiding_decorator.rb @@ -220,11 +220,13 @@ module TidingDecorator when 'Journal' then message = parent_container&.notes.present? ? ':' + message_content_helper(parent_container.notes) : '' I18n.t(locale_format(parent_container_type)) % message + when 'Hack' then + I18n.t(locale_format(parent_container_type)) % parent_container.name end end def discuss_content - I18n.t(locale_format(container.parent_id.present?)) % message_content_helper(container.content) + I18n.t(locale_format(container_type, container.parent_id.present?)) % message_content_helper(container.content) end def grade_content @@ -250,6 +252,9 @@ module TidingDecorator when 'shixunPublish' then name = Shixun.find_by(id: parent_container_id)&.name || '---' I18n.t(locale_format(parent_container_type)) % [name, container.score] + when 'Hack' then + name = Hack.find_by(id: container_id)&.name || '---' + I18n.t(locale_format(parent_container_type)) % [name, container.score] else I18n.t(locale_format(parent_container_type)) % container.score end @@ -405,4 +410,8 @@ module TidingDecorator def subject_start_course_content I18n.t(locale_format) % belong_container&.name end + + def hack_content + I18n.t(locale_format(parent_container_type)) % (container&.name || extra) + end end diff --git a/app/models/discuss.rb b/app/models/discuss.rb index 148d6518b..4491a886c 100644 --- a/app/models/discuss.rb +++ b/app/models/discuss.rb @@ -59,7 +59,7 @@ class Discuss < ApplicationRecord elsif dis_type == 'Hack' user_id = has_parent? ? parent.user_id : Hack.find(dis_id).user_id parent_container_type = 'Hack' - challenge_id = nil + challenge_id = dis_id end base_attrs = { trigger_user_id: user_id, parent_container_id: challenge_id, parent_container_type: parent_container_type, diff --git a/app/models/hack.rb b/app/models/hack.rb index d1ec3932c..37e1f239d 100644 --- a/app/models/hack.rb +++ b/app/models/hack.rb @@ -14,7 +14,7 @@ class Hack < ApplicationRecord # 点赞 has_many :praise_treads, as: :praise_tread_object, dependent: :destroy # 消息 - has_many :tidings, as: :container, dependent: :destroy + has_many :tidings, as: :container belongs_to :user @@ -23,8 +23,6 @@ class Hack < ApplicationRecord scope :opening, -> {where(open_or_not: 1)} scope :mine, -> (author_id){ where(user_id: author_id) } - after_destroy :send_delete_tiding - def language if hack_codes.count == 1 hack_codes.first.language @@ -53,12 +51,4 @@ class Hack < ApplicationRecord user_id == user.id || user.admin_or_business? end - private - def send_delete_tiding - base_attrs = { - user_id: user_id, viewed: 0, tiding_type: 'Delete', trigger_user_id: current_user.id, content: "你删除了题目:#{name}" - } - tidings.create!(base_attrs) - end - end diff --git a/app/models/shixun_info.rb b/app/models/shixun_info.rb index 321b4c44a..7f7aa364e 100644 --- a/app/models/shixun_info.rb +++ b/app/models/shixun_info.rb @@ -1,6 +1,7 @@ class ShixunInfo < ApplicationRecord belongs_to :shixun validates_uniqueness_of :shixun_id + validates_length_of :fork_reason, maximum: 60 after_commit :create_diff_record private diff --git a/app/services/jupyter_service.rb b/app/services/jupyter_service.rb index bff9b5dc6..29f54cb02 100644 --- a/app/services/jupyter_service.rb +++ b/app/services/jupyter_service.rb @@ -213,4 +213,27 @@ module JupyterService _jupyter_active(tpiID) end + def _jupyter_timeinfo(tpiID) + shixun_tomcat = edu_setting('cloud_bridge') + uri = "#{shixun_tomcat}/bridge/jupyter/getTimeInfo" + params = {:tpiID => tpiID} + res = uri_post uri, params + if res && res['code'].to_i != 0 + raise("实训云平台繁忙(繁忙等级:130)") + end + + res['data'] + end + + # 获取时间参数 + def jupyter_timeinfo_tpm(shixun) + tpiID = "tpm#{shixun.id}" + _jupyter_timeinfo(tpiID) + end + + # 获取时间参数 + def jupyter_timeinfo_tpi(myshixun) + tpiID = myshixun.id + _jupyter_timeinfo(tpiID) + end end diff --git a/app/services/subjects/copy_subject_service.rb b/app/services/subjects/copy_subject_service.rb index f44191fda..4715a8bad 100644 --- a/app/services/subjects/copy_subject_service.rb +++ b/app/services/subjects/copy_subject_service.rb @@ -79,7 +79,7 @@ class Subjects::CopySubjectService < ApplicationService copy_shixun_service_configs_data!(shixun, to_shixun) copy_challenges_data!(shixun, to_shixun) copy_shixun_members_data!(to_shixun) - + copy_jupyter_data_sets(shixun, to_shixun) if shixun.is_jupyter? # 云上实验室 if laboratory laboratory.laboratory_shixuns.create(shixun: to_shixun) @@ -87,6 +87,25 @@ class Subjects::CopySubjectService < ApplicationService to_shixun end + # 复制jupyter的数据集 + def copy_jupyter_data_sets(shixun, to_shixun) + return unless shixun.is_jupyter? + folder = EduSetting.get('shixun_folder') + raise "存储目录未定义" unless folder.present? + path = "#{folder}/#{to_shixun.identifier}" + FileUtils.mkdir_p(path, :mode => 0777) unless File.directory?(path) + # 复制数据集 + save_path = File.join(folder, shixun.identifier) + shixun.data_sets.each do |set| + new_date_set = Attachment.new + new_date_set.attributes = set.attributes.dup.except("id", "container_id", "disk_directory") + new_date_set.container_id = to_shixun.id + new_date_set.disk_directory = to_shixun.identifier + new_date_set.save! + FileUtils.cp("#{save_path}/#{set.relative_path_filename}", path) + end + end + # 创建实训长字段内容 def copy_shixun_info_data!(shixun, to_shixun) to_shixun_info = ShixunInfo.new diff --git a/app/views/comments/_discuss.json.jbuilder b/app/views/comments/_discuss.json.jbuilder index fed402ffa..55b27acdf 100644 --- a/app/views/comments/_discuss.json.jbuilder +++ b/app/views/comments/_discuss.json.jbuilder @@ -12,4 +12,5 @@ if discuss.parent_id else json.praise_count discuss.praises_count json.user_praise discuss.praise_treads.select{|pt| pt.user_id == current_user.id}.length > 0 + json.can_delete discuss.can_deleted?(current_user) && child.count == 0 end \ No newline at end of file diff --git a/app/views/comments/index.json.jbuilder b/app/views/comments/index.json.jbuilder index b176d00b9..bfdbdacbb 100644 --- a/app/views/comments/index.json.jbuilder +++ b/app/views/comments/index.json.jbuilder @@ -1,6 +1,6 @@ json.disscuss_count @discusses_count json.comments @discusses do |discuss| - json.partial! 'comments/discuss', locals: { discuss: discuss} + json.partial! 'comments/discuss', locals: { discuss: discuss, child: discuss.child_discuss(current_user)} json.children discuss.child_discuss(current_user) do |c_d| json.partial! 'comments/discuss', locals: { discuss: c_d } end diff --git a/app/views/hack_user_lastest_codes/result.json.jbuilder b/app/views/hack_user_lastest_codes/result.json.jbuilder index 2561d4ecd..d8f010cc3 100644 --- a/app/views/hack_user_lastest_codes/result.json.jbuilder +++ b/app/views/hack_user_lastest_codes/result.json.jbuilder @@ -1,5 +1,5 @@ json.status 0 -json.message "评测成功" +json.message "评测完成" json.data do json.(@result, :id, :status, :error_line, :error_msg, :input, :output, :execute_time, :execute_memory) diff --git a/app/views/hack_user_lastest_codes/submit_records.json.jbuilder b/app/views/hack_user_lastest_codes/submit_records.json.jbuilder index 797bda742..a73d58c4e 100644 --- a/app/views/hack_user_lastest_codes/submit_records.json.jbuilder +++ b/app/views/hack_user_lastest_codes/submit_records.json.jbuilder @@ -1,4 +1,8 @@ -json.array! @records do |hack_user| - json.(hack_user, :id, :created_at, :status, :execute_time, :execute_memory) - json.language hack_user.hack.language -end \ No newline at end of file +json.records do + json.array! @records do |hack_user| + json.(hack_user, :id, :created_at, :status, :execute_time, :execute_memory) + json.language hack_user.hack.language + end +end + +json.records_count @records_count \ No newline at end of file diff --git a/app/views/shixuns/get_data_sets.json.jbuilder b/app/views/shixuns/get_data_sets.json.jbuilder index 82ef309f7..f800d1c32 100644 --- a/app/views/shixuns/get_data_sets.json.jbuilder +++ b/app/views/shixuns/get_data_sets.json.jbuilder @@ -10,4 +10,5 @@ json.data_sets do json.file_path "#{@absolute_folder}/#{set.relative_path_filename}".gsub("/#{@shixun.identifier}", "") end end -json.data_sets_count @data_count \ No newline at end of file +json.data_sets_count @data_count +json.folder_name @absolute_folder \ No newline at end of file diff --git a/bin/bundle b/bin/bundle old mode 100644 new mode 100755 diff --git a/bin/rails b/bin/rails old mode 100644 new mode 100755 diff --git a/bin/rake b/bin/rake old mode 100644 new mode 100755 diff --git a/bin/setup b/bin/setup old mode 100644 new mode 100755 diff --git a/bin/update b/bin/update old mode 100644 new mode 100755 diff --git a/bin/yarn b/bin/yarn old mode 100644 new mode 100755 diff --git a/config/locales/tidings/zh-CN.yml b/config/locales/tidings/zh-CN.yml index f484efdc1..cdde0f97f 100644 --- a/config/locales/tidings/zh-CN.yml +++ b/config/locales/tidings/zh-CN.yml @@ -93,6 +93,7 @@ Challenge: "1_end": "赞了你发布的实训任务:%s,第%s关" "2_end": "踩了你发布的实训任务:%s,第%s关" + Hack_end: "赞了你发布的题目:%s" Memo: true_end: "赞了你的评论:%s" false_end: "赞了发布的帖子:%s" @@ -107,8 +108,16 @@ Issue_end: "赞了你发布的项目Issue:%s" Journal_end: "赞了你的回复%s" Discuss: - true_end: "评论了你的回复:%s" - false_end: "评论了你发布的实训:%s" + Shixun: + true_end: "评论了你的回复:%s" + false_end: "评论了你发布的实训:%s" + Hack: + true_end: "评论了你的回复:%s" + false_end: "评论了你发布的题目:%s" + Hack: + HackPublish_end: "你发布了题目:%s" + HackUnPublish_end: "你撤销发布了题目:%s" + HackDelete_end: "你删除了题目:%s" Grade: Avatar_end: "首次上传头像获得金币奖励:%s金币" Phone_end: "首次绑定手机号码获得金币奖励:%s金币" @@ -118,6 +127,7 @@ Answer: true_end: "查看实训%s第%s关的参考答案消耗金币:%s金币" false_end: "查看实训的参考答案消耗金币:%s金币" + Hack_end: "完成题目解答:%s,获得金币奖励:%s金币" Game_end: "通过实训%s的第%s关获得金币奖励:%s金币" Memo_end: "发布的评论或者帖子获得平台奖励:%s金币" Discusses_end: "发布的评论获得金币奖励:%s金币" diff --git a/config/routes.rb b/config/routes.rb index 45bd13680..7a68ed5e2 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -35,6 +35,8 @@ Rails.application.routes.draw do get :reset_with_tpm get :active_with_tpm get :active_with_tpi + get :timeinfo_with_tpm + get :timeinfo_with_tpi post :import_with_tpm end diff --git a/db/migrate/20191225035117_modify_open_or_not_for_hacks.rb b/db/migrate/20191225035117_modify_open_or_not_for_hacks.rb new file mode 100644 index 000000000..6b67d2dfd --- /dev/null +++ b/db/migrate/20191225035117_modify_open_or_not_for_hacks.rb @@ -0,0 +1,5 @@ +class ModifyOpenOrNotForHacks < ActiveRecord::Migration[5.2] + def change + change_column :hacks, :open_or_not, :boolean, :default => false + end +end diff --git a/public/react/config/webpack.config.dev.js b/public/react/config/webpack.config.dev.js index 86938e51d..4e28af31f 100644 --- a/public/react/config/webpack.config.dev.js +++ b/public/react/config/webpack.config.dev.js @@ -30,7 +30,7 @@ const env = getClientEnvironment(publicUrl); module.exports = { // You may want 'eval' instead if you prefer to see the compiled output in DevTools. // See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s - // devtool: "cheap-module-eval-source-map", + devtool: "cheap-module-eval-source-map", // 开启调试 //devtool: "source-map", // 开启调试 // These are the "entry points" to our application. diff --git a/public/react/public/css/css_min_all.css b/public/react/public/css/css_min_all.css index cf453ac21..431a4da8e 100755 --- a/public/react/public/css/css_min_all.css +++ b/public/react/public/css/css_min_all.css @@ -1883,9 +1883,8 @@ a:hover.task_icons_close{background: url(../images/popup/sy_icons_close.png) -40 .newupload_nav li:last-child{ border-right: none;} .newupload_nav li a{font-size:12px; color:#444;} .newupload_nav_hover{ background: #3498db; } -.newupload_nav_nomal { } .newupload_nav_hover a{color: #fff !important; } - +.markdown-body { text-align: justify;word-break: break-all;} .bor-reds{ border:1px solid #FF0000!important; border-radius: 4px; @@ -1894,6 +1893,7 @@ a:hover.task_icons_close{background: url(../images/popup/sy_icons_close.png) -40 border-bottom-right-radius: 4px; border-bottom-left-radius: 4px; } + @charset "UTF-8"; /*! diff --git a/public/react/public/css/edu-all.css b/public/react/public/css/edu-all.css index f628b1e5c..48386e675 100644 --- a/public/react/public/css/edu-all.css +++ b/public/react/public/css/edu-all.css @@ -2934,7 +2934,7 @@ a.singlepublishtwo{ padding: 40px !important; } .editormd-html-preview{ - width: 94% !important; + width: 100% !important; color: #323232 !important; } #homework_editorMd_description hr{ @@ -3478,3 +3478,9 @@ a.singlepublishtwo{ /*width: auto !important;*/ /*max-width: 600px !important;*/ /*}*/ + + +.markdown-body { + text-align: justify; + word-break: break-all; +} \ No newline at end of file diff --git a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js index 1f7518a9d..f9318eb9d 100644 --- a/public/react/src/modules/courses/coursesPublic/NewShixunModel.js +++ b/public/react/src/modules/courses/coursesPublic/NewShixunModel.js @@ -25,23 +25,22 @@ class NewShixunModel extends Component{ } componentDidMount() { let{page,type,keyword,order,diff,limit,status,sort}=this.state; - let newsort=sort - if(this.props&&this.props.user.course_name===undefined){ - newsort="created_at"; - }else{ - newsort="publish_time"; - } - if(this.props.type==='shixuns'){ - this.getdatalist(page,type,status,keyword,order,diff,limit,undefined,newsort); + this.getdatalist(page,type,status,keyword,order,diff,limit,undefined,sort); }else{ this.getdatalist(page,type,undefined,keyword,order,undefined,limit,undefined,sort); } - } - getdatalist=(page,type,newstatus,keyword,order,diff,limit,pagetype,sort)=>{ - + getdatalist=(page,type,newstatus,keyword,order,diff,limit,pagetype,sorts)=>{ + let newsort=sorts; + if(this.props.type==="shixuns"&&type==="mine"){ + if(this.props&&this.props.user.course_name===undefined){ + newsort="created_at"; + }else{ + newsort="publish_time"; + } + } this.setState({ isspinning:true }) @@ -53,14 +52,14 @@ class NewShixunModel extends Component{ url="/subject_lists.json"; } axios.get(url,{params:{ - page, - type, - status, - keyword, - order, - diff, - limit, - sort + page:page, + type:type, + status:status, + keyword:keyword, + order:order, + diff:diff, + limit:limit, + sort:newsort }}).then((response) => { if(response.data){ if(pagetype===undefined){ diff --git a/public/react/src/modules/courses/shixunHomework/Challenges.css b/public/react/src/modules/courses/shixunHomework/Challenges.css index 2183fd708..8ae2c002c 100644 --- a/public/react/src/modules/courses/shixunHomework/Challenges.css +++ b/public/react/src/modules/courses/shixunHomework/Challenges.css @@ -1,5 +1,5 @@ .editormd-html-preview, .editormd-preview-container { - width: 95% !important; + width: 100% !important; } .Finish_button{ height: 30px; diff --git a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js index 2326a4fe6..438df7b05 100644 --- a/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js +++ b/public/react/src/modules/courses/shixunHomework/Listofworksstudentone.js @@ -1667,7 +1667,7 @@ class Listofworksstudentone extends Component { ], yslpros: false, datajs: [], - homework_status: [], + homework_status: undefined, } } @@ -3597,7 +3597,14 @@ class Listofworksstudentone extends Component { starttimesend={this.state.starttimesend} typs={this.state.typs} /> : ""} - { + {homework_status===undefined? +
评测脚本生成成功!
已根据您的选择,生成新的评测脚本!
*/} + {/*您之前使用的脚本已复制到剪贴板,可通过Ctrl+C贴贴
*/} +评测脚本生成成功!
+关卡任务的代码文件有更新啦
-更新操作将保留已完成的评测记录和成绩
-还未完成评测的任务代码,请自行保存
+该实训已更新,更新后您编写的实训代码将会丢失
+如有需要请先导出代码再进行更新
+ {/*还未完成评测的任务代码,请自行保存
*/}+
{total<20?"": {
jupyter_data_set,
jupyter_tpi_url_state,
jupyter_data_set_count,
+ jupyter_folder_name,
jupyter_pagination,
jupyter_identifier
} = state.jupyterReducer;
@@ -425,6 +443,7 @@ const mapStateToProps = (state) => {
jupyter_tpi_url_state,
total: jupyter_data_set_count,
pagination: jupyter_pagination,
+ jupyter_folder_name:jupyter_folder_name,
jupyter_identifier,
drawervisible,
jupytertime,
diff --git a/public/react/src/modules/tpm/jupyter/index.scss b/public/react/src/modules/tpm/jupyter/index.scss
index 932b0c89f..c056f019b 100644
--- a/public/react/src/modules/tpm/jupyter/index.scss
+++ b/public/react/src/modules/tpm/jupyter/index.scss
@@ -23,7 +23,11 @@
cursor: row-resize;
width: 100%;
}
-
+.filestyles{
+ color: #28b887 !important;
+ font-size: 25px !important;
+ margin-left:20px;
+}
.Resizer.horizontal:hover {
border-top: 5px solid rgba(0, 0, 0, 0.5);
border-bottom: 5px solid rgba(0, 0, 0, 0.5);
@@ -138,9 +142,9 @@
height:49px;
line-height: 49px;
background: #070F1A !important;
- border-bottom: 1px solid #17212F !important;
+ //border-bottom: 1px solid #17212F !important;
color:#FFFFFF !important;
- border-top: 1px solid #17212F !important;
+ //border-top: 1px solid #17212F !important;
}
.iconfont{
color:#28b887!important;
@@ -193,4 +197,38 @@ line-height: 50px !important;
.jupyter_data_list{
padding-left: 20px;
+
+}
+
+.bortop17212F{
+ border-top: 1px solid #17212F !important;
+}
+
+.borbottom17212F{
+ border-bottom: 1px solid #17212F !important;
+}
+
+.jupyterfilepaths{
+ color: #888 !important;
+ font-size: 16px !important;
+ padding-left: 20px;
+ background: #070F1A !important;
+}
+
+.maxnamewidth200{
+ max-width: 200px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ cursor: default;
+ width: 200px;
+}
+
+.maxnamewidth181{
+ max-width:181px;
+ overflow: hidden;
+ text-overflow: ellipsis;
+ white-space: nowrap;
+ cursor: default;
+ width: 181px;
}
\ No newline at end of file
diff --git a/public/react/src/modules/tpm/newshixuns/Newshixuns.js b/public/react/src/modules/tpm/newshixuns/Newshixuns.js
index 99f8a4377..071b19a5f 100644
--- a/public/react/src/modules/tpm/newshixuns/Newshixuns.js
+++ b/public/react/src/modules/tpm/newshixuns/Newshixuns.js
@@ -620,10 +620,10 @@ class Newshixuns extends Component {
{this.state.mainvalues === undefined && this.state.subvalues === undefined || this.state.mainvalues === "" && this.state.subvalues === "" ? "" :
- {`${this.state.mainvalues === undefined || this.state.mainvalues === "" ? "" : `已安装软件:` + this.state.mainvalues}`}
- {`${this.state.subvalues === undefined || this.state.subvalues === "" ? "" : this.state.mainvalues === undefined || this.state.mainvalues === "" ? `已安装软件:` + this.state.subvalues : this.state.subvalues}`}
- {`${this.state.mainvalues === undefined || this.state.mainvalues === "" ? "" : `说明:添加了` + this.state.mainvalues}${this.state.subvalues === undefined || this.state.subvalues === "" ? "" :
- this.state.mainvalues === undefined || this.state.mainvalues === "" ? `说明:添加了` + this.state.subvalues : this.state.subvalues}`}
+ {`${this.state.mainvalues === undefined || this.state.mainvalues === "" ? "" : this.state.mainvalues}`}
+ {`${this.state.subvalues === undefined || this.state.subvalues === "" ? "" : this.state.mainvalues === undefined || this.state.mainvalues === "" ? this.state.subvalues : this.state.subvalues}`}
+ {`${this.state.mainvalues === undefined || this.state.mainvalues === "" ? "" : this.state.mainvalues}${this.state.subvalues === undefined || this.state.subvalues === "" ? "" :
+ this.state.mainvalues === undefined || this.state.mainvalues === "" ? this.state.subvalues : this.state.subvalues}`}
}
diff --git a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js
index 684e24bc1..371468f09 100644
--- a/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js
+++ b/public/react/src/modules/tpm/shixunchild/Challenges/Challengesjupyter.js
@@ -1,14 +1,13 @@
import React, { Component } from 'react';
import { Link } from "react-router-dom";
import { markdownToHTML, configShareForCustom,getImageUrl,getUploadActionUrlthree,appendFileSizeToUploadFileAll} from 'educoder'
-import { Divider, Tooltip,Upload,Spin} from 'antd';
+import { Divider, Tooltip,Upload,Modal,Spin} from 'antd';
import LoadingSpin from '../../../../common/LoadingSpin';
import 'antd/lib/pagination/style/index.css';
import '../shixunchildCss/Challenges.css';
import axios from 'axios';
const $ = window.$;
-
class Challengesjupyter extends Component {
constructor(props) {
super(props)
@@ -316,6 +315,50 @@ class Challengesjupyter extends Component {
}
}
+
+ handleClickResetTpisync_code=(id)=>{
+ this.setState({
+ jupyter_url : null,
+ booljupyterurls:false,
+ })
+ const url = `/jupyters/reset_with_tpm.json`;
+ axios.get(url,{params:{
+ identifier:id
+ }}).then((response) => {
+ if(response.data.status===0){
+
+ setTimeout(()=>{
+ this.setState({
+ jupyter_url :response.data.url,
+ booljupyterurls:true,
+ })
+ },1000);
+ this.props.showNotification('重置实训成功!');
+ }
+ });
+ }
+ // 重置实训
+ handleClickResetTpi = () => {
+ let id=this.props.match.params.shixunId;
+ let that=this;
+ Modal.confirm({
+ title: '重置实训',
+ content: (
+
-
-
+
+
+ {/**/}
+
{/* */}
数据集
{/* 数据集 */}
++ 文件路径 +
+ {jupyter_folder_name}
+ {
+ jsCopy("jupyter_folder_name")
+ }}>复制地址
+
+
+
{ renderCtx }+ 你在本文件中修改的内容将丢失,
+ ), + okText: '确定', + cancelText: '取消', + onOk () { + that.handleClickResetTpisync_code(id) + }, + onCancel() { + + }, + }) + } render() { let{ChallengesDataList,booljupyterurls,enlarge,fileList}=this.state; let id = this.props.match.params.shixunId; @@ -514,11 +557,12 @@ class Challengesjupyter extends Component { }+ 是否确定重新加载初始代码? +
导入
-导入
+您将不再拥有管理员的权限,但您仍是合作团队的一员
--
+
-
+ {Collaboratorslist&&Collaboratorslist.length===0?
+ 请先将新的管理员通过 this.showCollaboratorsvisible("cooperation")}>"添加合作者" 加入合作者列表
+ :""}
-
{
Collaboratorslist.length === 0 ? "" : Collaboratorslist.map((item, key) => {
return (
@@ -536,7 +537,6 @@ class Collaborators extends Component {
)
})
}
-
@@ -642,7 +642,7 @@ class Collaborators extends Component {