Merge branch 'dev_jupyter' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_jupyter

chromesetting
daiao 5 years ago
commit 235e00557c

@ -207,7 +207,7 @@ class ShixunsController < ApplicationController
@new_shixun = Shixun.new @new_shixun = Shixun.new
@new_shixun.attributes = @shixun.attributes.dup.except("id","user_id","visits","gpid","status", "identifier", "averge_star", @new_shixun.attributes = @shixun.attributes.dup.except("id","user_id","visits","gpid","status", "identifier", "averge_star",
"homepage_show","repo_name", "myshixuns_count", "challenges_count", "homepage_show","repo_name", "myshixuns_count", "challenges_count",
"can_copy", "created_at", "updated_at") "can_copy", "created_at", "updated_at", "public")
@new_shixun.user_id = User.current.id @new_shixun.user_id = User.current.id
@new_shixun.averge_star = 5 @new_shixun.averge_star = 5
@new_shixun.identifier = generate_identifier Shixun, 8 @new_shixun.identifier = generate_identifier Shixun, 8

@ -60,7 +60,7 @@ class Subjects::CopySubjectService < ApplicationService
shixun = stage_shixun.shixun shixun = stage_shixun.shixun
to_shixun = Shixun.new to_shixun = Shixun.new
to_shixun.attributes = shixun.attributes.dup.except('id', 'user_id', 'identifier', 'homepage_show', to_shixun.attributes = shixun.attributes.dup.except('id', 'user_id', 'identifier', 'homepage_show',
'use_scope', 'averge_star', 'myshixuns_count', 'challenges_count') 'use_scope', 'averge_star', 'myshixuns_count', 'challenges_count', "public")
to_shixun.identifier = Util::UUID.generate_identifier(Shixun, 8) to_shixun.identifier = Util::UUID.generate_identifier(Shixun, 8)
to_shixun.user_id = user.id to_shixun.user_id = user.id
if laboratory if laboratory

@ -44,7 +44,7 @@ class Users::ShixunService
def user_policy_filter(relations) def user_policy_filter(relations)
# 只有自己或者管理员才有过滤筛选及查看全部状态下实训功能 # 只有自己或者管理员才有过滤筛选及查看全部状态下实训功能
if self_or_admin? if self_or_admin?
relations = relations.where.not(status: -1) relations = relations.where.not(status: -1).where(hidden: false)
status_filter(relations) status_filter(relations)
else else
relations.where(status: [2, 3], hidden: false) relations.where(status: [2, 3], hidden: false)

@ -35,7 +35,7 @@ class Users::SubjectService
def user_policy_filter(relations) def user_policy_filter(relations)
# 只有自己或者管理员才有过滤筛选及查看全部状态下实训功能 # 只有自己或者管理员才有过滤筛选及查看全部状态下实训功能
if self_or_admin? if self_or_admin?
status_filter(relations) status_filter(relations.unhidden)
else else
relations.where(status: 2, hidden: false) relations.where(status: 2, hidden: false)
end end

@ -591,7 +591,7 @@ class NewShixunModel extends Component{
this.props.type==='shixuns'? this.props.type==='shixuns'?
( (
item.is_jupyter===true? item.is_jupyter===true?
<div className="myysljupyter fl ml20 mt3 intermediatecenter"> <div className="myysljupyter fl ml20 intermediatecenter">
<p className="myysljupytertest"> <p className="myysljupytertest">
Jupyter Jupyter
</p> </p>

@ -391,7 +391,6 @@
text-align: center; text-align: center;
border-radius:5px; border-radius:5px;
border:1px solid #FF6802; border:1px solid #FF6802;
margin-top: 4px;
} }
.myysljupytertest{ .myysljupytertest{
width:54px; width:54px;

@ -529,6 +529,7 @@ class YslDetailCards extends Component{
{ {
this.props.isAdmin()===true? this.props.isAdmin()===true?
<DetailCardsEditAndEdit <DetailCardsEditAndEdit
{...this.props}
idsum={idsum} idsum={idsum}
keys={key} keys={key}
pathCardsedittype={pathCardsedittype} pathCardsedittype={pathCardsedittype}

@ -355,11 +355,15 @@ class ShixunhomeWorkItem extends Component{
.homepagePostSettingbox{ .homepagePostSettingbox{
width:139px !important; width:139px !important;
} }
.colorfff{
color:#fff !important;
}
` `
} }
</style> </style>
{this.props.isAdmin?<span onClick={(event)=>this.stopPro(event)} className={this.props.isAdminOrCreator()?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"6px","display":"block"}}> {this.props.isAdmin?<span onClick={(event)=>this.stopPro(event)} className={this.props.isAdminOrCreator()?"homepagePostSetting homepagePostSettingname":"homepagePostSetting homepagePostSettingbox"} style={{"right":"-2px","top":"6px","display":"block"}}>
{discussMessage&&discussMessage.shixun_status>1?<Link className="btn colorblue font-16 fontweight400" to={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</Link>:""} {discussMessage&&discussMessage.shixun_status>1?<Link className="btn colorblue font-16 fontweight400" to={"/shixuns/"+discussMessage.shixun_identifier+"/challenges"} target={"_blank"}>实训详情</Link>:
<a className={"btn colorfff font-16 fontweight400"}>实训详情</a>}
{this.props.isAdminOrCreator()?<a onClick={(event)=>this.editname(discussMessage.name,discussMessage.homework_id,event)} className={"btn colorblue ml20 font-16 fontweight400"}>重命名</a>:""} {this.props.isAdminOrCreator()?<a onClick={(event)=>this.editname(discussMessage.name,discussMessage.homework_id,event)} className={"btn colorblue ml20 font-16 fontweight400"}>重命名</a>:""}
{/*<WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>*/} {/*<WordsBtn className="btn colorblue ml20 font-16" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>*/}
<WordsBtn className="btn colorblue font-16 ml15 fontweight400" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn> <WordsBtn className="btn colorblue font-16 ml15 fontweight400" to={`/courses/${this.props.match.params.coursesId}/${this.state.shixuntypes}/${discussMessage.homework_id}/settings?tab=3`} > 设置</WordsBtn>

@ -69,6 +69,7 @@ class Addshixuns extends Component {
labelCol: { span: 4 }, labelCol: { span: 4 },
wrapperCol: { span: 14 }, wrapperCol: { span: 14 },
}; };
console.log(this.props)
return( return(
<Modal <Modal
className={this.props.className} className={this.props.className}
@ -92,14 +93,14 @@ class Addshixuns extends Component {
</style>:""} </style>:""}
<div className="task-popup-content"> <div className="task-popup-content">
<Form {...formItemLayout}> {/*<Form {...formItemLayout}>*/}
<Form.Item label="实训类型"> {/* <Form.Item label="实训类型">*/}
<Radio.Group value={this.state.is_jupyter} onChange={this.GrouponChange}> {/* <Radio.Group value={this.state.is_jupyter} onChange={this.GrouponChange}>*/}
<Radio value="1">普通实训</Radio> {/* <Radio value="1">普通实训</Radio>*/}
<Radio value="2">jupyter实训</Radio> {/* <Radio value="2">jupyter实训</Radio>*/}
</Radio.Group> {/* </Radio.Group>*/}
</Form.Item> {/* </Form.Item>*/}
</Form> {/*</Form>*/}
<p className="task-popup-text-center font-16"> <p className="task-popup-text-center font-16">
<span style={{ "line-height":"30px"}}>实训名称</span> <span style={{ "line-height":"30px"}}>实训名称</span>
<span><Input style={{ width:"80%"}} className="yslzxueshisy " placeholder="请输入60字以内的实训名称" onChange={this.handleChange} addonAfter={String(this.state.shixunname===undefined?0:this.state.shixunname.length)+"/60"} maxLength={60} /> <span><Input style={{ width:"80%"}} className="yslzxueshisy " placeholder="请输入60字以内的实训名称" onChange={this.handleChange} addonAfter={String(this.state.shixunname===undefined?0:this.state.shixunname.length)+"/60"} maxLength={60} />

@ -1223,7 +1223,7 @@ class TPMBanner extends Component {
} }
{this.props.identity < 8 && shixunsDetails.shixun_status != -1 && shixunsDetails.shixun_status != 0? {this.props.identity < 5 && shixunsDetails.shixun_status != -1 && shixunsDetails.shixun_status != 0?
<div className="fr kaike kkbth mr20" <div className="fr kaike kkbth mr20"
style={{display: shixunsDetails.can_copy === false || shixunsDetails.can_copy === null ? "none" : "flex"}}> style={{display: shixunsDetails.can_copy === false || shixunsDetails.can_copy === null ? "none" : "flex"}}>
<Tooltip placement="bottom" title={"基于这个实训修改形成新的实训"}> <Tooltip placement="bottom" title={"基于这个实训修改形成新的实训"}>

@ -121,8 +121,9 @@ export default class Shixuninformation extends Component {
} }
onSubmits = () => { onSubmits = () => {
let {can_copy, use_scope, scope_partment, opening_time,oldscope_partment} = this.state; let {can_copy, use_scope, scope_partment, opening_time,oldscope_partment} = this.state;
if(this.state.opentime===true){ if(this.state.opentime===true){
if(opening_time===null){ if(opening_time===null){
this.setState({ this.setState({
@ -143,9 +144,7 @@ export default class Shixuninformation extends Component {
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_permission_setting.json`;
this.setState({
loading: true
})
axios.post(url, axios.post(url,
{ {
scope_partment: list, scope_partment: list,
@ -168,14 +167,10 @@ export default class Shixuninformation extends Component {
this.props.getdatas("3") this.props.getdatas("3")
} }
}).catch((error) => { }).catch((error) => {
this.setState({
loading: false
})
}) })
this.setState({
loading: false
})
} }
CheckboxonChange = (e) => { CheckboxonChange = (e) => {
this.setState({ this.setState({

@ -96,8 +96,8 @@ export default class TPMsettings extends Component {
operateshixunstype: false, operateshixunstype: false,
}); });
// window.location.href = "/shixuns"; window.location.href = "/shixuns";
this.props.history.replace( "/shixuns/"); // this.props.history.replace( "/shixuns/");
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)
@ -114,8 +114,8 @@ export default class TPMsettings extends Component {
operateshixunstype: false, operateshixunstype: false,
}); });
// window.location.href = "/shixuns/" + id + "/challenges"; window.location.href = "/shixuns/" + id + "/challenges";
this.props.history.replace( "/shixuns/" + id + "/challenges"); // this.props.history.replace( "/shixuns/" + id + "/challenges");
} }
}).catch((error) => { }).catch((error) => {
console.log(error) console.log(error)

@ -431,6 +431,7 @@ class Newshixuns extends Component {
return isLt150M; return isLt150M;
}, },
} }
return ( return (
<div className="newMain clearfix"> <div className="newMain clearfix">
<style> <style>
@ -455,14 +456,14 @@ class Newshixuns extends Component {
</div> </div>
<div className="padding10-20 color-grey-3 clearfix"> <div className="padding10-20 color-grey-3 clearfix">
<Form> <Form>
<Form.Item label="实训类型"> {this.props.user&&this.props.user.admin===true||this.props.user&&this.props.user.business===true?<Form.Item label="实训类型">
{getFieldDecorator('is_jupyter')( {getFieldDecorator('is_jupyter')(
<Radio.Group onChange={this.RadiovalueonChange}> <Radio.Group onChange={this.RadiovalueonChange}>
<Radio value="1">普通实训</Radio> <Radio value="1">普通实训</Radio>
<Radio value="2">Jupyter实训</Radio> <Radio value="2">Jupyter实训</Radio>
</Radio.Group>, </Radio.Group>,
)} )}
</Form.Item> </Form.Item>:""}
<Form.Item <Form.Item
label="名称" label="名称"
className="mt15" className="mt15"

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-12-12 09:01:30 * @Date: 2019-12-12 09:01:30
* @LastEditors: tangjiang * @LastEditors: tangjiang
* @LastEditTime: 2019-12-13 15:27:13 * @LastEditTime: 2019-12-13 21:02:48
*/ */
import types from "./actionTypes"; import types from "./actionTypes";
import { message } from 'antd'; import { message } from 'antd';
@ -25,18 +25,18 @@ export const getJupyterInfo = (id) => {
if (res.data.status === 401) return; if (res.data.status === 401) return;
if (res.status === 200) { if (res.status === 200) {
const { data } = res; const { data } = res;
if (data.status === 0) { // if (data.status === 0) {
dispatch({ dispatch({
type: types.SAVE_JUPYTER_INFO, type: types.SAVE_JUPYTER_INFO,
payload: data payload: data
}); });
const { identifier, myshixun_identifier } = data; const { identifier, myshixun_identifier } = data;
dispatch(saveJupyterIdentifier(identifier)); dispatch(saveJupyterIdentifier(identifier));
// 调用获取数据集接口 // 调用获取数据集接口
dispatch(getJupyterTpiDataSet(identifier, jupyter_pagination)); dispatch(getJupyterTpiDataSet(identifier, jupyter_pagination));
// 调用获取url接口 // 调用获取url接口
dispatch(getJupyterTpiUrl({identifier: myshixun_identifier})); dispatch(getJupyterTpiUrl({identifier: myshixun_identifier}));
} // }
} }
}) })
} }

@ -138,7 +138,7 @@
text-align: center; text-align: center;
border-radius:5px; border-radius:5px;
border:1px solid #FF6802; border:1px solid #FF6802;
margin-top: 4px; margin-top: 3px;
} }
.jupytertextp{ .jupytertextp{

Loading…
Cancel
Save