Merge branch 'dev_aliyun' into dev_tj

merge aliyun
yslnewtiku
tangjiang 5 years ago
commit 5332fc66a7

@ -112,9 +112,9 @@ class Admins::ShixunSettingsController < Admins::BaseController
sheet1[count_row, 2] = shixun.mirror_repositories.select{|mr| mr.main_type == "1"}.first&.type_name sheet1[count_row, 2] = shixun.mirror_repositories.select{|mr| mr.main_type == "1"}.first&.type_name
sheet1[count_row, 3] = shixun.fork_from sheet1[count_row, 3] = shixun.fork_from
sheet1[count_row, 4] = shixun.shixun_status sheet1[count_row, 4] = shixun.shixun_status
sheet1[count_row, 5] = shixun.user.show_real_name sheet1[count_row, 5] = shixun.user&.show_real_name
sheet1[count_row, 6] = shixun.user.school_name sheet1[count_row, 6] = shixun.user&.school_name
sheet1[count_row, 7] = shixun.user.identity sheet1[count_row, 7] = shixun.user&.identity
challenge_count = shixun.challenges.count challenge_count = shixun.challenges.count
shixun.challenges.each_with_index do |challenge, index| shixun.challenges.each_with_index do |challenge, index|
sheet1[count_row, 8] = "#{challenge.position}" sheet1[count_row, 8] = "#{challenge.position}"

@ -10,9 +10,6 @@ class GamesController < ApplicationController
include GamesHelper include GamesHelper
include ApplicationHelper include ApplicationHelper
def show def show
uid_logger("--games show start") uid_logger("--games show start")
# 防止评测中途ajaxE被取消;3改成0是为了处理首次进入下一关的问题 # 防止评测中途ajaxE被取消;3改成0是为了处理首次进入下一关的问题
@ -91,7 +88,6 @@ class GamesController < ApplicationController
end end
end end
def jupyter def jupyter
# Jupyter没有challenge # Jupyter没有challenge
@myshixun = Myshixun.find_by_identifier params[:identifier] @myshixun = Myshixun.find_by_identifier params[:identifier]

@ -3,8 +3,8 @@ class HackUserLastestCodesController < ApplicationController
before_action :find_my_hack, only: [:show, :code_debug, :code_submit, :update_code, :sync_code, before_action :find_my_hack, only: [:show, :code_debug, :code_submit, :update_code, :sync_code,
:listen_result, :result, :submit_records, :restore_initial_code] :listen_result, :result, :submit_records, :restore_initial_code]
before_action :update_user_hack_status, only: [:code_debug, :code_submit] before_action :update_user_hack_status, only: [:code_debug, :code_submit]
before_action :require_auth_identity, only: [:update_code, :restore_initial_code, :sync_code] #before_action :require_auth_identity, only: [:restore_initial_code, :sync_code]
before_action :require_manager_identity, only: [:update_code] before_action :require_manager_identity, only: [:show, :update_code, :restore_initial_code, :sync_code]
def show def show
@my_hack.update_attribute(:submit_status, 0) if @my_hack.submit_status == 1 @my_hack.update_attribute(:submit_status, 0) if @my_hack.submit_status == 1

@ -188,10 +188,13 @@ class HacksController < ApplicationController
def param_update_sets sets, all_sets_id def param_update_sets sets, all_sets_id
delete_set_ids = all_sets_id - sets.map{|set|set[:id]} delete_set_ids = all_sets_id - sets.map{|set|set[:id]}
@hack.hack_sets.where(id: delete_set_ids).destroy_all @hack.hack_sets.where(id: delete_set_ids).destroy_all
logger.info("#######sets:#{sets}")
sets.each do |set| sets.each do |set|
logger.info("###set[:id] #{set[:id]}")
logger.info("###all_sets #{all_sets_id.include?(set[:id])}")
if all_sets_id.include?(set[:id]) if all_sets_id.include?(set[:id])
update_attrs = {input: set[:input], output: set[:output], position: set[:position]} update_attrs = {input: set[:input], output: set[:output], position: set[:position]}
@hack.hack_sets.find_by!(id: set[:id]).update_attributes(update_attrs) @hack.hack_sets.find_by!(id: set[:id]).update_attributes!(update_attrs)
end end
end end
end end

@ -467,7 +467,13 @@ class ShixunsController < ApplicationController
def update_learn_setting def update_learn_setting
begin begin
ActiveRecord::Base.transaction do ActiveRecord::Base.transaction do
@shixun.update_attributes!(shixun_params) update_params =
if params[:shixun][:vnc]
shixun_params.merge(vnc_evaluate: 1)
else
shixun_params
end
@shixun.update_attributes!(update_params)
end end
rescue => e rescue => e
uid_logger_error("实训学习页面设置失败--------#{e.message}") uid_logger_error("实训学习页面设置失败--------#{e.message}")

@ -33,7 +33,7 @@ module GradeDecorator
game.present? ? "查看实训“#{game.challenge.shixun.name}”第#{game.challenge.position}关的TA人解答消耗的金币" : '' game.present? ? "查看实训“#{game.challenge.shixun.name}”第#{game.challenge.position}关的TA人解答消耗的金币" : ''
when 'hack' then when 'hack' then
hack = Hack.find_by(id: container_id) hack = Hack.find_by(id: container_id)
game.present? ? "完成了题目解答“#{hack.name}”,获得金币奖励:#{hack.score}" : '' hack.present? ? "完成了题目解答“#{hack.name}”,获得金币奖励:#{hack.score}" : ''
end end
end end
end end

@ -226,7 +226,7 @@ module TidingDecorator
end end
def discuss_content def discuss_content
I18n.t(locale_format(container_type, container.parent_id.present?)) % message_content_helper(container.content) I18n.t(locale_format(parent_container_type, container.parent_id.present?)) % message_content_helper(container.content)
end end
def grade_content def grade_content

@ -5,9 +5,11 @@ json.chooses do
json.type choose.category json.type choose.category
end end
end end
json.st @challenge.st
if @tab == 0 if @tab == 0
# 本关任务tab的编辑模式 # 本关任务tab的编辑模式
json.(@challenge, :id, :subject, :task_pass, :difficulty, :score, :exec_time) json.(@challenge, :id, :subject, :task_pass, :difficulty, :score, :exec_time, :st)
json.tags @challenge.challenge_tags.map(&:name) json.tags @challenge.challenge_tags.map(&:name)
elsif @tab == 1 elsif @tab == 1
# 评测设置的编辑模式 # 评测设置的编辑模式

@ -1,7 +1,7 @@
json.(@challenge_choose, :challenge_id, :subject, :answer, json.(@challenge_choose, :challenge_id, :subject, :answer,
:standard_answer, :score, :difficult, :standard_answer, :score, :difficult,
:position, :category) :position, :category)
json.st @challenge.st
# 选项的参数 # 选项的参数
json.choose_contents @challenge_choose.challenge_questions do |question| json.choose_contents @challenge_choose.challenge_questions do |question|
json.(question, :option_name, :position, :right_key) json.(question, :option_name, :position, :right_key)

@ -1,6 +1,6 @@
# 导航栏公共数据 # 导航栏公共数据
json.partial! "challenges/top_common_data", shixun_identifier: @shixun.identifier json.partial! "challenges/top_common_data", shixun_identifier: @shixun.identifier
json.(@challenge, :id, :subject, :task_pass, :difficulty, :score, :exec_time) json.(@challenge, :id, :subject, :task_pass, :difficulty, :score, :exec_time, :st)
json.tags @challenge.challenge_tags.map(&:name) json.tags @challenge.challenge_tags.map(&:name)

@ -1,8 +1,12 @@
json.(@hack_user, :id, :status, :error_line, :error_msg, :expected_output, json.status 0
:input, :output, :execute_time, :execute_memory, :created_at, :code) json.message "返回成功"
json.language @hack_user.hack.language json.data do
json.name @hack_user.hack.name json.(@hack_user, :id, :status, :error_line, :error_msg, :expected_output,
json.myproblem_identifier @my_hack.identifier :input, :output, :execute_time, :execute_memory, :created_at, :code)
json.user do json.language @hack_user.hack.language
json.partial! 'users/user', user: current_user json.name @hack_user.hack.name
end json.myproblem_identifier @my_hack.identifier
json.user do
json.partial! 'users/user', user: current_user
end
end

@ -108,7 +108,7 @@
Issue_end: "赞了你发布的项目Issue%s" Issue_end: "赞了你发布的项目Issue%s"
Journal_end: "赞了你的回复%s" Journal_end: "赞了你的回复%s"
Discuss: Discuss:
Shixun: Challenge:
true_end: "评论了你的回复:%s" true_end: "评论了你的回复:%s"
false_end: "评论了你发布的实训:%s" false_end: "评论了你发布的实训:%s"
Hack: Hack:

@ -163,11 +163,10 @@ class TPMIndex extends Component {
componentDidUpdate(prevProps, prevState) { componentDidUpdate(prevProps, prevState) {
if (prevProps != this.props) { if (prevProps!=this.props) {
if (prevProps.user != this.props.user) { if(this.props.user&&this.props.user.user_id){
let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings'; let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings';
let newTPMsettings=window.localStorage.getItem(getnewTPMsettings) let newTPMsettings=window.localStorage.getItem(getnewTPMsettings)
if(this.state.identity <4){
if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){ if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){
this.setState({ this.setState({
openknows:true openknows:true
@ -180,125 +179,123 @@ class TPMIndex extends Component {
} }
} }
} }
}
componentDidMount = () => {
let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings'; getcomponentdidmount=()=>{
let newTPMsettings=window.localStorage.getItem(getnewTPMsettings) let userid=this.props.user&&this.props.user.user_id;
let id = this.props.match.params.shixunId; let getnewTPMsettings=this.props.user&&this.props.user.user_id+'newTPMsettings';
// console.log('props', this.props); let newTPMsettings=window.localStorage.getItem(getnewTPMsettings)
// let collaborators = `/shixuns/` + id + `/propaedeutics.json`; let id = this.props.match.params.shixunId;
// // console.log('props', this.props);
// axios.get(collaborators).then((response) => { // let collaborators = `/shixuns/` + id + `/propaedeutics.json`;
// if (response.status === 200) { //
// if (response.data.status === 403||response.data.status === 401||response.data.status === 500) { // axios.get(collaborators).then((response) => {
// // if (response.status === 200) {
// }else{ // if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
// this.setState({ //
// PropaedeuticsList: response.data, // }else{
// shixunId: id // this.setState({
// }); // PropaedeuticsList: response.data,
// } // shixunId: id
// // });
// } // }
// }).catch((error) => { //
// console.log(error) // }
// }); // }).catch((error) => {
// console.log(error)
let Url = `/shixuns/` + id + `.json`; // });
axios.get(Url).then((response) => { let Url = `/shixuns/` + id + `.json`;
if (response.status === 200) { axios.get(Url).then((response) => {
document.title=response.data.name; if (response.status === 200) {
let newstar_info = []; document.title=response.data.name;
// let start1= let newstar_info = [];
for (var i = 0; i < response.data.score_info.length; i++) { // let start1=
for (var i = 0; i < response.data.score_info.length; i++) {
if (i === 0) {
newstar_info.push(response.data.score_info[i]) if (i === 0) {
} else { newstar_info.push(response.data.score_info[i])
newstar_info.push((response.data.score_info[i] / 100) * 5) } else {
} newstar_info.push((response.data.score_info[i] / 100) * 5)
} }
let newstar_infos = response.data.score_info; }
let newstar_infos = response.data.score_info;
this.setState({
shixunsDetails: response.data,
shixunId: id,
star_info: newstar_info,
star_infos: newstar_infos,
power: response.data.power,
identity: response.data.identity,
propaedeutics:response.data.propaedeutics,
status: response.data.shixun_status,
secret_repository: response.data.secret_repository,
public:response.data.public,
is_jupyter:response.data.is_jupyter=== undefined||response.data.is_jupyter===null?false:response.data.is_jupyter,
});
if(userid){
if(response.data.identity <4){
if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){
console.log()
this.setState({ this.setState({
shixunsDetails: response.data, openknows:true
shixunId: id, })
star_info: newstar_info, }else{
star_infos: newstar_infos, this.setState({
power: response.data.power, openknows:false
identity: response.data.identity, })
propaedeutics:response.data.propaedeutics,
status: response.data.shixun_status,
secret_repository: response.data.secret_repository,
public:response.data.public,
is_jupyter:response.data.is_jupyter=== undefined||response.data.is_jupyter===null?false:response.data.is_jupyter,
});
if(response.data.identity <4){
if(newTPMsettings===undefined||newTPMsettings===false||newTPMsettings===null){
this.setState({
openknows:true
})
}else{
this.setState({
openknows:false
})
}
} }
} }
}).catch((error) => { }
this.setState({
shixunsDetails: undefined,
shixunId: undefined,
star_info: undefined,
star_infos: undefined,
power: undefined,
identity: undefined,
status: undefined,
propaedeutics:undefined,
is_jupyter:false,
});
});
this.tpmContentRequestInterceptor = axios.interceptors.request.use((config) => {
let url = config.url;
// console.log('tpmContentRequestInterceptor:', url)
for ( let i = 0; i < interceptorUrlArray.length; i++ ) {
if (url.indexOf(interceptorUrlArray[i]) != -1) {
url = url.split('?')[0]
console.log('loadingContent, url:', url)
this.setState({ loadingContent: true })
cacheInterceptorUrlMap[url] = true }
} }).catch((error) => {
} this.setState({
return config; shixunsDetails: undefined,
}, function (error) { shixunId: undefined,
return Promise.reject(error); star_info: undefined,
star_infos: undefined,
power: undefined,
identity: undefined,
status: undefined,
propaedeutics:undefined,
is_jupyter:false,
}); });
});
// Add a response interceptor this.tpmContentRequestInterceptor = axios.interceptors.request.use((config) => {
this.tpmContentResponseInterceptor = axios.interceptors.response.use((response) => { let url = config.url;
// console.log('loadingContent finished, url:', response.config.url) // console.log('tpmContentRequestInterceptor:', url)
// TODO 依赖了api这个前缀 for ( let i = 0; i < interceptorUrlArray.length; i++ ) {
let url = response.config.url.split('api')[1]; if (url.indexOf(interceptorUrlArray[i]) != -1) {
url = url.split('?')[0] url = url.split('?')[0]
if (cacheInterceptorUrlMap[url]) { console.log('loadingContent, url:', url)
this.setState({ loadingContent: false }) this.setState({ loadingContent: true })
delete cacheInterceptorUrlMap[response.url]
} cacheInterceptorUrlMap[url] = true
return response; }
}, function (error) { }
// Do something with response error return config;
return Promise.reject(error); }, function (error) {
}); return Promise.reject(error);
});
// Add a response interceptor
this.tpmContentResponseInterceptor = axios.interceptors.response.use((response) => {
// console.log('loadingContent finished, url:', response.config.url)
// TODO 依赖了api这个前缀
let url = response.config.url.split('api')[1];
url = url.split('?')[0]
if (cacheInterceptorUrlMap[url]) {
this.setState({ loadingContent: false })
delete cacheInterceptorUrlMap[response.url]
}
return response;
}, function (error) {
// Do something with response error
return Promise.reject(error);
});
//右侧数据 //右侧数据
let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`; let shixunsDetailsURL=`/shixuns/`+id+`/show_right.json`;
axios.get(shixunsDetailsURL).then((response)=> { axios.get(shixunsDetailsURL).then((response)=> {
@ -311,6 +308,10 @@ class TPMIndex extends Component {
}) })
this.getnavdatas() this.getnavdatas()
} }
componentDidMount = () => {
this.getcomponentdidmount()
}
componentWillUnmount = () => { componentWillUnmount = () => {
axios.interceptors.request.eject(this.tpmContentRequestInterceptor); axios.interceptors.request.eject(this.tpmContentRequestInterceptor);
@ -383,6 +384,7 @@ class TPMIndex extends Component {
let url = window.location.href; let url = window.location.href;
let flag = url.indexOf("add_file")>-1; let flag = url.indexOf("add_file")>-1;
console.log(this.state.openknows)
return ( return (
<div className="newMain clearfix"> <div className="newMain clearfix">
{/*头部*/} {/*头部*/}
@ -447,7 +449,7 @@ class TPMIndex extends Component {
{ this.state.is_jupyter===false? <Menu.Item key="8" className={"competitionmr50"}> { this.state.is_jupyter===false? <Menu.Item key="8" className={"competitionmr50"}>
<span className={"tpmbannernavstyler"}>排行榜</span> <span className={"tpmbannernavstyler"}>排行榜</span>
</Menu.Item>:""} </Menu.Item>:""}
<span> {this.state.identity >4||this.state.identity===undefined ? "":this.state.openknows===true?<span>
<Popover <Popover
content={ content={
<pre className={"bannerpd201"}> <pre className={"bannerpd201"}>
@ -460,7 +462,7 @@ class TPMIndex extends Component {
visible={this.state.openknows} visible={this.state.openknows}
> >
</Popover> </Popover>
</span> </span>:""}
{this.state.identity >4||this.state.identity===undefined ? "": {this.state.identity >4||this.state.identity===undefined ? "":
<Menu.Item key="9" className={"competitionmr50"}> <Menu.Item key="9" className={"competitionmr50"}>

@ -94,7 +94,7 @@ export default class Shixuninformation extends Component {
loading: true loading: true
}) })
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
let url = `/shixuns/${id}/update_permission_setting.json`; let url = `/shixuns/${id}/update_learn_setting.json`;
axios.post(url, axios.post(url,
{ {
shixun: { shixun: {

@ -172,40 +172,44 @@ class TPMRightSection extends Component {
<div className="recommend-list"> <div className="recommend-list">
{ {
TPMRightSectionData === undefined ? "" : TPMRightSectionData.paths === undefined ? "" : TPMRightSectionData.paths.map((i, k) => { TPMRightSectionData === undefined ? "" : TPMRightSectionData.paths === undefined ? "" : TPMRightSectionData.paths.map((i, k) => {
if(k>2){
return ( }else{
return (
<div className="recomments clearfix df" key={k}> <div className="recomments clearfix df" key={k}>
<a href={"/paths/" + i.id} height="96" width="128" target="_blank"> <a href={"/paths/" + i.id} height="96" width="128" target="_blank">
<img alt="实训" height="96" src={"/" + i.image_url} width="128"/> <img alt="实训" height="96" src={"/" + i.image_url} width="128"/>
</a> </a>
<div className="ml10 flex1"> <div className="ml10 flex1">
<a href={"/paths/" + i.id} target="_blank" data-tip-down={i.name} <a href={"/paths/" + i.id} target="_blank" data-tip-down={i.name}
className="color-grey-6 task-hide mb12 recomment-name">{i.name}</a> className="color-grey-6 task-hide mb12 recomment-name">{i.name}</a>
<p className="clearfix mt8 font-12 color-grey-B4"> <p className="clearfix mt8 font-12 color-grey-B4">
<Tooltip placement="bottom" title={"章节"}> <Tooltip placement="bottom" title={"章节"}>
<span className="mr10 fl squareIconSpan"><i <span className="mr10 fl squareIconSpan"><i
className="iconfont icon-shixun fl mr3"></i>{i.stages_count}</span> className="iconfont icon-shixun fl mr3"></i>{i.stages_count}</span>
</Tooltip> </Tooltip>
{/*<Tooltip placement="bottom" title={"经验值"}>*/} {/*<Tooltip placement="bottom" title={"经验值"}>*/}
{/*<span className="mr10 fl squareIconSpan"><i className="iconfont icon-jingyan fl mr3"></i>{i.score_count}</span>*/} {/*<span className="mr10 fl squareIconSpan"><i className="iconfont icon-jingyan fl mr3"></i>{i.score_count}</span>*/}
{/*</Tooltip>*/} {/*</Tooltip>*/}
<Tooltip placement="bottom" title={"学习人数"}> <Tooltip placement="bottom" title={"学习人数"}>
<span className="mr10 fl squareIconSpan"><i <span className="mr10 fl squareIconSpan"><i
className="iconfont icon-chengyuan fl mr3"></i>{i.members_count}</span> className="iconfont icon-chengyuan fl mr3"></i>{i.members_count}</span>
</Tooltip> </Tooltip>
</p>
</div>
</p>
</div> </div>
</div> )
}
)
}) })
} }
</div> </div>
@ -222,23 +226,28 @@ class TPMRightSection extends Component {
<div className="recommend-list"> <div className="recommend-list">
{ {
TPMRightSectionData === undefined ? "" : TPMRightSectionData.recommands === undefined ? "" : TPMRightSectionData.recommands.map((item, key) => { TPMRightSectionData === undefined ? "" : TPMRightSectionData.recommands === undefined ? "" : TPMRightSectionData.recommands.map((item, key) => {
return ( if(key>2){
<div className="recomments clearfix df" key={key}>
<a href={"/shixuns/" + item.identifier + "/challenges"} target="_blank"> }else{
<img alt="69?1526971094" height="96" src={"/" + item.pic} width="128"/> return (
</a> <div className="recomments clearfix df" key={key}>
<div className="ml10 flex1"> <a href={"/shixuns/" + item.identifier + "/challenges"} target="_blank">
<Tooltip placement="bottom" title={item.name}> <img alt="69?1526971094" height="96" src={"/" + item.pic} width="128"/>
<a href={"/shixuns/" + item.identifier + "/challenges"} target="_blank" </a>
className="color-grey-6 task-hide mb12 recomment-name">{item.name}</a> <div className="ml10 flex1">
</Tooltip> <Tooltip placement="bottom" title={item.name}>
<p className="clearfix mt8 font-12 color-grey-B4"> <a href={"/shixuns/" + item.identifier + "/challenges"} target="_blank"
{item.stu_num} 人学习 className="color-grey-6 task-hide mb12 recomment-name">{item.name}</a>
</p> </Tooltip>
<p className="edu-txt-right color-orange pr10">{item.level}</p> <p className="clearfix mt8 font-12 color-grey-B4">
{item.stu_num} 人学习
</p>
<p className="edu-txt-right color-orange pr10">{item.level}</p>
</div>
</div> </div>
</div> )
) }
}) })
} }
</div> </div>

@ -219,7 +219,7 @@ class Challengesjupyter extends Component {
modifyjupyter=()=>{ modifyjupyter=()=>{
// this.props.showNotification('实训正在保存中...!'); // this.props.showNotification('实训正在保存中...!');
setTimeout(() => {
let id=this.props.match.params.shixunId; let id=this.props.match.params.shixunId;
var jupyter_port=""; var jupyter_port="";
try{ try{
@ -257,8 +257,10 @@ class Challengesjupyter extends Component {
}) })
this.props.showNotification('实训保存失败!'); this.props.showNotification('实训保存失败!');
}) })
}, 500)
} }
opentitle=()=>{ opentitle=()=>{
this.setState({ this.setState({
opentitletype:!this.state.opentitletype opentitletype:!this.state.opentitletype
@ -577,7 +579,7 @@ class Challengesjupyter extends Component {
<p className="challenbaocuntest" type="upload" >导入</p> <p className="challenbaocuntest" type="upload" >导入</p>
</div> </div>
</Upload> </Upload>
{/*<button type="button" className="ant-btn deletebuttom chongzhistyles" onClick={this.handleClickResetTpi}><span>重置实训</span></button>*/} {/*<button type="button" className="ant-btn deletebuttom chongzhistyles" onClick={this.handleClickResetTpi}><span>重置环境</span></button>*/}
</div> </div>

@ -88,17 +88,20 @@ class Collaborators extends Component {
this.setState({ this.setState({
Collaboratorsvisibleadmin: false, Collaboratorsvisibleadmin: false,
Collaboratorslist: [], Collaboratorslist: [],
Searchadmin: [] Searchadmin: [],
addadminrediovalue:undefined
}); });
} else if (type === "admin") { } else if (type === "admin") {
this.setState({ this.setState({
Collaboratorsvisible: false, Collaboratorsvisible: false,
Collaboratorslist: [], Collaboratorslist: [],
Searchadmin: [] Searchadmin: [],
addadminrediovalue:undefined
}); });
} else if (type === "collaborators_deletetype") { } else if (type === "collaborators_deletetype") {
this.setState({ this.setState({
collaborators_deletetype: false, collaborators_deletetype: false,
addadminrediovalue:undefined
}); });
} }
} }
@ -312,12 +315,13 @@ class Collaborators extends Component {
let url = "/shixuns/" + id + "/change_manager.json"; let url = "/shixuns/" + id + "/change_manager.json";
if (addadminrediovalue === undefined) { if (addadminrediovalue === undefined) {
this.setState({ this.setState({
Collaboratorsvisible: false, // Collaboratorsvisible: false,
Collaboratorslist: [], // Collaboratorslist: [],
Searchadmin: [] // Searchadmin: [],
addadminrediovalue:undefined
}); });
this.props.showNotification("所选人员为空,没有更换成功"); this.props.showNotification("所选人员为空,没有更换成功");
this.CollaboratorsshowModal("admin") // this.CollaboratorsshowModal("admin")
return return
} }
@ -328,7 +332,8 @@ class Collaborators extends Component {
this.setState({ this.setState({
Collaboratorsvisible: false, Collaboratorsvisible: false,
Collaboratorslist: [], Collaboratorslist: [],
Searchadmin: [] Searchadmin: [],
addadminrediovalue:undefined
}); });
this.updatacomponentDiddata(); this.updatacomponentDiddata();
this.props.showNotification(response.data.message); this.props.showNotification(response.data.message);

@ -214,12 +214,15 @@ class InfosShixun extends Component{
</style> </style>
<div className="white-panel edu-back-white pt20 pb20 clearfix "> <div className="white-panel edu-back-white pt20 pb20 clearfix ">
<li className={category ? " font-16 whitepanelyslli" : "active font-16 whitepanelyslli"}><a <li className={category ? " font-16 whitepanelyslli" : "active font-16 whitepanelyslli"}><a
href="javascript:void(0)"
onClick={() => this.changeCategory()} className="font-16 w32">全部</a></li> onClick={() => this.changeCategory()} className="font-16 w32">全部</a></li>
<li className={category == "manage" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a <li className={category == "manage" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
onClick={() => this.changeCategory("manage")} onClick={() => this.changeCategory("manage")}
href="javascript:void(0)"
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}管理的</a></li> className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}管理的</a></li>
<li className={category == "study" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a <li className={category == "study" ? "active font-16 whitepanelysllis" : "font-16 whitepanelysllis"}><a
onClick={() => this.changeCategory("study")} onClick={() => this.changeCategory("study")}
href="javascript:void(0)"
className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}学习的</a></li> className={is_current ? "font-16 w66" : "font-16 w80"}>{is_current ? "我" : "TA"}学习的</a></li>
</div> </div>
<style> <style>
@ -243,29 +246,29 @@ class InfosShixun extends Component{
category && category == "manage" && is_current && category && category == "manage" && is_current &&
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE"> <div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}> <li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}>
<a onClick={() => this.changeStatus()} className="w32">全部</a></li> <a onClick={() => this.changeStatus()} className="w32" href="javascript:void(0)">全部</a></li>
<li className={status == "editing" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "editing" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("editing")} className="w60">编辑中</a></li> onClick={() => this.changeStatus("editing")} className="w60" href="javascript:void(0)">编辑中</a></li>
<li className={status == "published" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "published" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("published")} className="w60">已发布</a></li> onClick={() => this.changeStatus("published")} className="w60" href="javascript:void(0)">已发布</a></li>
<li className={status == "applying" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "applying" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("applying")} className="w60">待审核</a></li> onClick={() => this.changeStatus("applying")} className="w60" href="javascript:void(0)">待审核</a></li>
<li className={status == "publiced" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "publiced" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("publiced")} className="w60">已公开</a></li> onClick={() => this.changeStatus("publiced")} className="w60" href="javascript:void(0)">已公开</a></li>
<li className={status == "closed" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "closed" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("closed")} className="w60">已关闭</a></li> onClick={() => this.changeStatus("closed")} className="w60" href="javascript:void(0)">已关闭</a></li>
</div> </div>
} }
{ {
category && category == "study" && is_current && category && category == "study" && is_current &&
<div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE"> <div className="edu-back-white padding10-30 clearfix secondNavs bor-top-greyE">
<li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a <li className={status ? "whitepanelyslliss" : "active whitepanelyslliss"}><a href="javascript:void(0)"
onClick={() => this.changeStatus()} onClick={() => this.changeStatus()}
className="w32">全部</a></li> className="w32">全部</a></li>
<li className={status == "processing" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "processing" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("processing")} className="w60">未通关</a></li> onClick={() => this.changeStatus("processing")} className="w60" href="javascript:void(0)">未通关</a></li>
<li className={status == "passed" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a <li className={status == "passed" ? "active whitepanelysllisyt" : "whitepanelysllisyt"}><a
onClick={() => this.changeStatus("passed")} className="w60">已通关</a></li> onClick={() => this.changeStatus("passed")} className="w60" href="javascript:void(0)">已通关</a></li>
</div> </div>
} }
<div className=" clearfix font-12 " style={{ <div className=" clearfix font-12 " style={{

@ -174,7 +174,7 @@ export const changeGetJupyterUrlState = (status) => {
// 保存 jupyter tpi // 保存 jupyter tpi
export const saveJupyterTpi = () => { export const saveJupyterTpi = () => {
return (dispatch, getState) => { return (dispatch, getState) => {
setTimeout(() => {
const { jupyter_tpi_code, jupyter_info }= getState().jupyterReducer; const { jupyter_tpi_code, jupyter_info }= getState().jupyterReducer;
// console.log(jupyter_info.myshixun_identifier, jupyter_tpi_code); // console.log(jupyter_info.myshixun_identifier, jupyter_tpi_code);
if (!jupyter_info.myshixun_identifier) return; if (!jupyter_info.myshixun_identifier) return;
@ -182,7 +182,7 @@ export const saveJupyterTpi = () => {
identifier: jupyter_info.myshixun_identifier, identifier: jupyter_info.myshixun_identifier,
jupyter_port: jupyter_tpi_code jupyter_port: jupyter_tpi_code
}; };
console.log(params);
fetchSaveJupyterTpi(params).then(res => { fetchSaveJupyterTpi(params).then(res => {
dispatch({ dispatch({
type: types.LOADING_STATUS, type: types.LOADING_STATUS,
@ -200,6 +200,8 @@ export const saveJupyterTpi = () => {
payload: false payload: false
}); });
}); });
}, 500)
} }
} }
// 改变当前页数 // 改变当前页数

Loading…
Cancel
Save