Merge branch 'dev_aliyun' of http://bdgit.educoder.net/Hjqreturn/educoder into dev_aliyun

dev_tpm_ui
jingquan huang 5 years ago
commit 49266e12e1

@ -329,13 +329,14 @@ function JupyterTPI (props) {
title: '倒计时截止',
content: (
<p style={{ lineHeight: '24px' }}>
Jupyter将中断服务是否需要延长使用时间
服务已中断是否确认重置实验环境
</p>
),
okText: '确定',
cancelText: '取消',
onOk () {
active_with_tpi(myIdentifier, '重置成功');
reset_with_tpi(myIdentifier, '重置成功');
// active_with_tpi(myIdentifier, '重置成功');
}
})
}

@ -1,13 +1,14 @@
import React, { Component } from 'react';
import { Link } from "react-router-dom";
import { markdownToHTML, configShareForCustom,getImageUrl,getUploadActionUrlthree,appendFileSizeToUploadFileAll} from 'educoder'
import { Divider, Tooltip,Upload,Modal,Spin} from 'antd';
import { Divider, Tooltip,Upload,Modal,Statistic} from 'antd';
import LoadingSpin from '../../../../common/LoadingSpin';
import 'antd/lib/pagination/style/index.css';
import '../shixunchildCss/Challenges.css';
import axios from 'axios';
import {addjypertime} from "../../../../redux/actions/jupyter";
const $ = window.$;
const { Countdown } = Statistic;
class Challengesjupyter extends Component {
constructor(props) {
super(props)
@ -28,7 +29,8 @@ class Challengesjupyter extends Component {
enlarge:false,
fileList:[],
shuaxin:false,
showtime:false
showtime:false,
jupytertime:Date.now() +3600 * 1000
}
}
@ -104,13 +106,44 @@ class Challengesjupyter extends Component {
}
componentDidMount() {
var that=this;
let that=this;
setTimeout(this.ChallengesList(), 1000);
let id = this.props.match.params.shixunId;
let ChallengesURL = `/jupyters/get_info_with_tpm.json`;
let datas={
identifier:id,
}
let timeinfo_with_tpm=`/jupyters/timeinfo_with_tpm.json`
axios.get(timeinfo_with_tpm, {params: datas}).then((response) => {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
}else{
if(response.data.status===0){
if(res.data.useSeconds===null){
Modal.warning({
title: '提示',
content: '因为这个实训pod不在了请联系系统管理人员',
});
}else{
let useSeconds=res.data.useSeconds;
let summain=3600 * 1000;
let sums= useSeconds * 1000;
let sum=summain-sums;
setTimeout(()=>{
this.setState({
jupytertime:Date.now() +sum
})
},500);
}
}else{
}
}
}).catch((error) => {
});
let ChallengesURL = `/jupyters/get_info_with_tpm.json`;
axios.get(ChallengesURL, {params: datas}).then((response) => {
if (response.data.status === 403||response.data.status === 401||response.data.status === 500) {
setTimeout(() => {
@ -383,6 +416,23 @@ class Challengesjupyter extends Component {
},
})
}
onFinish=()=>{
let id=this.props.match.params.shixunId;
Modal.confirm({
title: '倒计时截止',
content: (
<p style={{ lineHeight: '24px' }}>
服务已中断是否确认重置实验环境
</p>
),
okText: '确定',
cancelText: '取消',
onOk () {
this.handleClickResetTpisync_code(id)
}
})
}
render() {
let{ChallengesDataList,booljupyterurls,enlarge,fileList}=this.state;
let id = this.props.match.params.shixunId;
@ -433,7 +483,7 @@ class Challengesjupyter extends Component {
<div >
<style>
{
`
`
.ant-notification{
position: fixed !important;
@ -443,10 +493,19 @@ class Challengesjupyter extends Component {
position: fixed !important;
z-index: 3000 !important;
margin-top: 100px !important;
}
.Countdowntypes{
width:1px;
height:1px;
overflow: hidden;
}
`
}
</style>
<span className={"Countdowntypes"}>
<Countdown value={this.state.jupytertime} format="HH:mm:ss" onFinish={this.onFinish}/>
</span>
<p className="clearfix mb20 edu-back-white">
<div className={"shixunjianjie"}>
<span className="font-16 fl">简介</span>

Loading…
Cancel
Save