diff --git a/app/controllers/hack_user_lastest_codes_controller.rb b/app/controllers/hack_user_lastest_codes_controller.rb
index 814d16d51..5f5eddddc 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
@@ -163,12 +166,12 @@ class HackUserLastestCodesController < ApplicationController
# 通关
if submit_params[:status] == "0"
# 编程题已经发布,且之前未通关奖励积分
+ @hack.increment!(:pass_num)
if @hack.status == 1 && !@my_hack.passed?
reward_attrs = { container_id: game.id, container_type: 'Hack', score: @hack.score }
RewardGradeService.call(@my_hack.user, reward_attrs)
RewardExperienceService.call(@my_hack.user, reward_attrs)
# 评测完成更新通过数
- @hack.increment!(:pass_num)
@my_hack.update_attributes(passed: true, passed_time: Time.now)
end
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 940955e93..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
# 同步私密版本库
@@ -363,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/grade_decorator.rb b/app/decorators/grade_decorator.rb
index ffffa11c9..b89cd99ce 100644
--- a/app/decorators/grade_decorator.rb
+++ b/app/decorators/grade_decorator.rb
@@ -31,6 +31,9 @@ module GradeDecorator
when 'check_ta_answer' then
game = Game.find_by(id: container_id)
game.present? ? "查看实训“#{game.challenge.shixun.name}”第#{game.challenge.position}关的TA人解答消耗的金币" : ''
+ when 'hack' then
+ hack = Hack.find_by(id: container_id)
+ game.present? ? "完成了题目解答“#{hack.name}”,获得金币奖励:#{hack.score}" : ''
end
end
end
\ No newline at end of file
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/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/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/javascripts/jupyter.js b/public/javascripts/jupyter.js
index 5ffd34dd4..192b15fe8 100644
--- a/public/javascripts/jupyter.js
+++ b/public/javascripts/jupyter.js
@@ -37,9 +37,9 @@ document.addEventListener('keydown', (e) => {
if(e.data==="stopParent"){
//重置停止
timebool=false;
- console.log("父窗口调用停止");
+ // console.log("父窗口调用停止");
}else if(e.data==="clonsParent"){
- console.log("父窗口调用启动");
+ // console.log("父窗口调用启动");
//取消启动
timebool=true;
// runEvery10Sec();
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/src/common/components/comment/CommentIcon.js b/public/react/src/common/components/comment/CommentIcon.js
index 97a57da5e..9e9650b47 100644
--- a/public/react/src/common/components/comment/CommentIcon.js
+++ b/public/react/src/common/components/comment/CommentIcon.js
@@ -4,11 +4,11 @@
* @Github:
* @Date: 2019-12-18 10:49:46
* @LastEditors : tangjiang
- * @LastEditTime : 2019-12-24 18:04:52
+ * @LastEditTime : 2019-12-25 10:03:21
*/
import './index.scss';
import React from 'react';
-import { Icon } from 'antd';
+// import { Icon } from 'antd';
// import MyIcon from '../MyIcon';
function CommentIcon ({
type, // 图标类型
@@ -25,13 +25,15 @@ function CommentIcon ({
}
const _className = [undefined, null, ''].includes(count) ? 'comment_count_none' : 'comment_count';
+ const _classIcon = `iconfont icon-${type} icon_font_size_14 comment_icon `;
return (
-
系统繁忙,请稍后重试
- {error_msg} + 系统繁忙,请稍后重试
) } else if (state === -1) { diff --git a/public/react/src/modules/developer/components/textNumber/index.js b/public/react/src/modules/developer/components/textNumber/index.js index 77a58c3e8..a8f743d16 100644 --- a/public/react/src/modules/developer/components/textNumber/index.js +++ b/public/react/src/modules/developer/components/textNumber/index.js @@ -4,11 +4,11 @@ * @Github: * @Date: 2019-11-27 10:58:37 * @LastEditors : tangjiang - * @LastEditTime : 2019-12-24 16:48:56 + * @LastEditTime : 2019-12-25 10:02:03 */ import './index.scss'; import React from 'react'; -import { Icon } from 'antd'; +// import { Icon } from 'antd'; const numberal = require('numeral'); const TextNumber = (props) => { @@ -47,14 +47,18 @@ const TextNumber = (props) => { const renderCtx = (className, theme) => { if (type === 'icon') { // 图标加文字时 const _className = `text_number_area text_icon_numb flex_${position} ${className}`; + const _classIcon = `iconfont icon-${text} numb_icon`; return (出题者: - {username} + {username}
评测脚本生成成功!
已根据您的选择,生成新的评测脚本!
*/} + {/*您之前使用的脚本已复制到剪贴板,可通过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..e5e709fac 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)
@@ -29,6 +28,7 @@ class Challengesjupyter extends Component {
enlarge:false,
fileList:[],
shuaxin:false,
+ showtime:false
}
}
@@ -150,12 +150,15 @@ class Challengesjupyter extends Component {
window.addEventListener('message', (e) => {
-
- console.log(e);
if(e){
if(e.data){
if(e.data==="jupytermessage"){
- that.modifyjupyter();
+ if(this.state.showtime===false){
+ that.modifyjupyter();
+ this.setState({
+ showtime:true
+ })
+ }
}
}
@@ -215,7 +218,7 @@ class Challengesjupyter extends Component {
modifyjupyter=()=>{
- this.props.showNotification('实训正在保存中...!');
+ // this.props.showNotification('实训正在保存中...!');
let id=this.props.match.params.shixunId;
var jupyter_port="";
@@ -235,11 +238,23 @@ class Challengesjupyter extends Component {
if (result.data.status === 0) {
// this.props.showNotification(`应用成功`);
console.log("应用成功了");
- this.props.showNotification('实训保存成功!');
+ this.props.showNotification('保存成功!');
+ setTimeout(() => {
+ this.setState({
+ showtime:false
+ })
+ }, 500)
+
}else{
+ this.setState({
+ showtime:false
+ })
this.props.showNotification(result.data.message);
}
}).catch((error) => {
+ this.setState({
+ showtime:false
+ })
this.props.showNotification('实训保存失败!');
})
@@ -316,6 +331,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 +573,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 {