Merge branches 'dev_new_shixunsrepository' and 'develop' of https://bdgit.educoder.net/Hjqreturn/educoder into dev_new_shixunsrepository

 Conflicts:
	public/react/src/AppConfig.js
dev_new_shixunsrepository
杨树明 5 years ago
commit ceda427aa8

@ -297,7 +297,7 @@ class CommonWorkAppraiseReply extends Component{
<style>{`
.course-message .panel-comment_item .comment_orig_content {
width: 1074px;
width: 1040px;
}
.course-message .childrenCommentsView .comment_orig_content {
width: 1000px;

@ -55,7 +55,7 @@ class MemoDetail extends Component {
}
}
componentDidMount() {
window.$("html,body").animate({"scrollTop":0})
// window.$("html,body").animate({"scrollTop":0})
const { match } = this.props

@ -200,13 +200,13 @@ class ShixunsHome extends Component {
item.sub_repertoires.map((i,k)=>{
return(
<div className="clearfix mt20 mb5 pb10 navlistpanel-line" key={k}>
<p className="little-title clearfix welcome_shixun_index little-titles"
<div className="little-title clearfix welcome_shixun_index little-titles"
data-id="1" data-rep-id="1" data-type="sub"
>
<Link to={"/shixuns?id="+i.id+"&type=sub&palce="+item.id}>
{i.name}
</Link>
</p>
</div>
{
i.tags.map((t,e)=>{
return(

@ -69,6 +69,7 @@ function JupyterTPI (props) {
drawervisible,
reset_with_tpi,
jupytertime,
endjupytertime,
active_with_tpi,
spinning,
updataspinning,
@ -303,7 +304,7 @@ function JupyterTPI (props) {
>
<div className="sortinxdirection">
<Icon type="file-text" className="jupyter_icon fl lineheighttaj filestyles" />
<a className="jupyter_name ml10 maxnamewidth181 lineheighttaj colorlineheighttaj" title={item.title}>{item.title}</a>
<a className="jupyter_name ml10 maxnamewidth152 lineheighttaj colorlineheighttaj" title={item.title}>{item.title}</a>
<a className={"fr color-blue lineheighttaj"}
onClick={() => {
jsCopy("file_path"+i)
@ -337,11 +338,24 @@ function JupyterTPI (props) {
cancelText: '取消',
onOk () {
reset_with_tpi(myIdentifier, '重置成功');
// active_with_tpi(myIdentifier, '重置成功');
}
})
}
const endonFinish= () =>{
Modal.confirm({
title: '命令行连接时长提醒',
content: (
<p style={{ lineHeight: '24px' }}>
命令行即将中断需要延长使用时间吗
</p>
),
okText: '立即延长',
cancelText: '不需要',
onOk () {
active_with_tpi(myIdentifier, '延长成功');
}
})
}
return (
<Spin tip="加载中..." spinning={spinning}>
<div className="jupyter_area">
@ -351,6 +365,9 @@ function JupyterTPI (props) {
<span className="title_desc" style={{ marginTop: '10px' }}>{jupyterInfo.name}</span>
<span className="title_time jupytertitle_time">
<Countdown value={jupytertime} format="HH:mm:ss" onFinish={onFinish}/>
<span className={"Countdowntypes"}>
{endjupytertime===false?"":<Countdown value={endjupytertime} format="HH:mm:ss" onFinish={endonFinish}/>}
</span>
</span>
</p>
<p className="jupyter_btn">
@ -457,7 +474,7 @@ const mapStateToProps = (state) => {
jupyter_pagination,
jupyter_identifier
} = state.jupyterReducer;
const { loading ,drawervisible,jupytertime,spinning} = state.commonReducer;
const { loading ,drawervisible,jupytertime,spinning,endjupytertime} = state.commonReducer;
return {
loading,
jupyter_info,
@ -470,6 +487,7 @@ const mapStateToProps = (state) => {
jupyter_identifier,
drawervisible,
jupytertime,
endjupytertime,
spinning
};
}

@ -26,7 +26,7 @@
.filestyles{
color: #28b887 !important;
font-size: 25px !important;
margin-left:20px;
margin-left:48px;
}
.Resizer.horizontal:hover {
border-top: 5px solid rgba(0, 0, 0, 0.5);
@ -230,16 +230,23 @@ line-height: 50px !important;
width: 186px;
}
.maxnamewidth181{
max-width:181px;
.maxnamewidth152{
max-width:152px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: default;
width: 181px;
width: 152px;
}
.height45lineheight45{
height: 45px;
line-height: 45px !important;
}
.Countdowntypes{
width:1px;
height:1px;
overflow: hidden;
display: block;
}

@ -30,7 +30,8 @@ class Challengesjupyter extends Component {
fileList:[],
shuaxin:false,
showtime:false,
jupytertime:Date.now() +3600 * 1000
jupytertime:Date.now() +3600 * 1000,
endtimes:false
}
}
@ -119,10 +120,12 @@ class Challengesjupyter extends Component {
let remainingSeconds=response.data.remainingSeconds;
// let summain=3600 * 1000;
let sums= remainingSeconds * 1000;
let endsms=(remainingSeconds-300<0?0:remainingSeconds-300)*1000
// let sum=summain-sums;
setTimeout(()=>{
this.setState({
jupytertime:Date.now() +sums
jupytertime:Date.now() +sums,
endtimes:endsms===0?Date.now() +1000:Date.now() +endsms
})
},500);
}
@ -436,8 +439,45 @@ class Challengesjupyter extends Component {
}
})
}
onendFinish=()=>{
let id=this.props.match.params.shixunId;
let that=this;
Modal.confirm({
title: '命令行连接时长提醒',
content: (
<p style={{ lineHeight: '24px' }}>
命令行即将中断需要延长使用时间吗
</p>
),
okText: '立即延长',
cancelText: '不需要',
onOk () {
that.onendhandleClickResetTpi(id)
}
})
}
onendhandleClickResetTpi=(id)=>{
const url = `/jupyters/active_with_tpm.json`;
axios.get(url,{params:{
identifier:id
}}).then((response) => {
if(response.data.status===0){
this.props.showNotification('延长成功!');
setTimeout(()=>{
this.setState({
jupytertime:Date.now() + 900 * 1000,
endtimes:Date.now() + 300 * 1000
})
},500);
}
});
}
render() {
let{ChallengesDataList,booljupyterurls,enlarge,fileList}=this.state;
let{ChallengesDataList,booljupyterurls,enlarge,fileList,endtimes}=this.state;
let id = this.props.match.params.shixunId;
//老师
const is_teacher = this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;
@ -509,6 +549,7 @@ class Challengesjupyter extends Component {
<span className={"Countdowntypes"}>
{/*this.state.jupytertime*/}
<Countdown value={this.state.jupytertime} format="HH:mm:ss" onFinish={this.onFinish}/>
{endtimes===false?"":<Countdown value={endtimes} format="HH:mm:ss" onFinish={this.onendFinish}/>}
</span>
<p className="clearfix mb20 edu-back-white">

@ -74,7 +74,7 @@ export const getJupyterTpiUrl = (obj) => {
const id = obj.identifier || jupyter_info.myshixun_identifier;
fetchJupyterTpiUrl({identifier: id}).then(res => {
if (res.data.status === 401) return; // 用户未登录
console.log('获取url', res);
//console.log('获取url', res);
if (res.status === 200) {
const { status, url = '', port } = res.data;
dispatch(updataspinning(false))
@ -159,7 +159,8 @@ export const active_with_tpi = (identifier, msg) => {
const {status} = res.data
if (status === 0) {
message.success(msg);
dispatch(addjypertime(Date.now() + 900 * 1000))
// dispatch(addjypertime(Date.now() + 900 * 1000,false))
setTimeout(()=>{dispatch(addjypertime(Date.now() + 900 * 1000, Date.now() + 300 * 1000))},800);
}
}
})
@ -224,11 +225,21 @@ export const changeshowDrawer = (type) => {
}
}
//增加倒计时
export const addjypertime=(time)=>{
return {
type: types.CHANGE_JYPYTER_TIME,
payload: time
export const addjypertime=(time,endtime)=>{
if(endtime===false){
return {
type: types.CHANGE_JYPYTER_TIME,
payload: time,
endtime:false
}
}else{
return {
type: types.CHANGE_JYPYTER_TIME,
payload: time,
endtime:endtime
}
}
}
export const updataspinning=(type)=>{
@ -262,8 +273,9 @@ export const timeinfo_with_tpi = (identifier, dispatch) => {
let remainingSeconds=res.data.remainingSeconds;
// let summain=3600 * 1000;
let sums= remainingSeconds * 1000;
let endsms=(remainingSeconds-300<0?0:remainingSeconds-300)*1000
// let sum=summain-sums;
setTimeout(()=>{ dispatch(addjypertime(Date.now() +sums))},500);
setTimeout(()=>{ dispatch(addjypertime(Date.now() +sums,endsms===0?Date.now() +1000:Date.now() +endsms))},500);
}
}
}

@ -17,11 +17,12 @@ const initialState = {
isMySource: false,
drawervisible:false,
jupytertime:0,
endjupytertime:false,
spinning:false
}
const commonReducer = (state = initialState, action) => {
console.log(action)
switch (action.type) {
case types.SHOW_OR_HIDE_CONTROL:
return {
@ -61,7 +62,8 @@ const commonReducer = (state = initialState, action) => {
case types.CHANGE_JYPYTER_TIME:
return {
...state,
jupytertime: action.payload
jupytertime: action.payload,
endjupytertime:action.endtime,
}
case types.CHANGE_UPDETA_SPIN:
return {

@ -45,7 +45,7 @@ const JupyterReducer = (state = initState, action) => {
jupyter_tpi_code: port
}
case types.SAVE_JUPYTER_IDENTIFIER:
console.log('保存的jupyter_identifier', action.payload);
//console.log('保存的jupyter_identifier', action.payload);
return {
...state,
jupyter_identifier: action.payload

Loading…
Cancel
Save