合并aliyun

yslnewtiku
杨树林 5 years ago
commit 60fdfcffbb

File diff suppressed because one or more lines are too long

@ -27,7 +27,7 @@ function onMessageByLocalStorage(eventName, callback) {
}
window.addEventListener("storage", function(ev) {
const cb = localStorageMap[ev.key];
console.log('storage event:', ev)
// console.log('storage event:', ev)
if (cb) {
cb(JSON.parse(ev.newValue))
}

@ -728,9 +728,12 @@ class CoursesBanner extends Component {
<Breadcrumb.Item className={"pointer"}>
<Tooltip visible={coursedata.teacher_applies_count===undefined?false:coursedata.teacher_applies_count>0?true:false}
placement="topLeft"
title={<pre>{coursedata.teacher_applies_count===undefined?"":coursedata.teacher_applies_count>0?<span>您有{coursedata.teacher_applies_count}条新的加入申请<a className={"daishenp"} onClick={()=>this.setHistoryFun("/courses/"+this.props.match.params.coursesId+"/teachers?tab=2")}><span style={{
color:"#FFA804"
}}>待审批</span></a></span>:""}</pre>}>
title={<pre>{coursedata.teacher_applies_count===undefined?"":coursedata.teacher_applies_count>0?<span>您有{coursedata.teacher_applies_count}条新的加入申请<a className={"daishenp"} onClick={()=>this.setHistoryFun("/courses/"+this.props.match.params.coursesId+"/teachers?tab=2")}>
<span style={{
color:"#FFA804"
}}>
待审批
</span></a></span>:""}</pre>}>
<span className="color-grey-c font-16" onClick={()=>this.setHistoryFun("/courses/"+this.props.match.params.coursesId+"/teachers")}>
<span className={"mr10"}>教师</span>
<span className={"mr10"}>{coursedata.teacher_count}</span>

@ -34,6 +34,7 @@ class NewShixunModel extends Component{
getdatalist=(page,type,newstatus,keyword,order,diff,limit,pagetype,sorts)=>{
let newsort=sorts;
let no_jupyter=undefined;
if(this.props.type==="shixuns"&&type==="mine"){
if(this.props&&this.props.user.course_name===undefined){
newsort="created_at";
@ -41,6 +42,12 @@ class NewShixunModel extends Component{
newsort="publish_time";
}
}
if(this.props.type==="shixuns"){
if(this.props&&this.props.user.course_name===undefined){
}else{
no_jupyter=1;
}
}
this.setState({
isspinning:true
})
@ -51,6 +58,7 @@ class NewShixunModel extends Component{
}else{
url="/subject_lists.json";
}
axios.get(url,{params:{
page:page,
type:type,
@ -59,7 +67,8 @@ class NewShixunModel extends Component{
order:order,
diff:diff,
limit:limit,
sort:newsort
sort:newsort,
no_jupyter:no_jupyter
}}).then((response) => {
if(response.data){
if(pagetype===undefined){

@ -388,7 +388,6 @@ class TPMIndex extends Component {
let url = window.location.href;
let flag = url.indexOf("add_file")>-1;
return (
<div className="newMain clearfix">
{/*头部*/}

@ -88,6 +88,15 @@ function JupyterTPI (props) {
const [myIdentifier, setMyIdentifier] = useState('');
const [renderCtx, setRenderCtx] = useState(() => (emptyCtx));
let newHandletype=false
const newHandle = function (event) {
if(newHandletype===false){
newHandletype=true
saveJupyterTpi(event);
setTimeout(()=>{newHandletype=false},500)
}
}
// 保存代码
const addEventListeners = () => {
window.addEventListener('message', (e) => {
@ -95,12 +104,10 @@ function JupyterTPI (props) {
if(e){
if(e.data){
if(e.data==="jupytermessage"){
saveJupyterTpi();
newHandle()
}
}
}
})
}

@ -15,7 +15,8 @@ import {
fetchSyncJupyterCode,
fetchreset_with_tpi,
fetchSaveJupyterTpi,
fetactive_with_tpi
fetactive_with_tpi,
timeinfo_with_tpis
} from "../../services/jupyterServer";
// 获取 jupyter 相关信息
@ -76,7 +77,9 @@ export const getJupyterTpiUrl = (obj) => {
console.log('获取url', res);
if (res.status === 200) {
const { status, url = '', port } = res.data;
addjypertime(Date.now() +3600 * 1000)
dispatch(updataspinning(false))
setTimeout(()=>{ dispatch(addjypertime(Date.now() +3600 * 1000))},500)
// timeinfo_with_tpi(id,dispatch)
dispatch({
type: types.GET_JUPYTER_TPI_URL,
payload: {
@ -106,7 +109,7 @@ export const syncJupyterCode = (identifier, msg) => {
const {status} = res.data
if (status === 0) {
message.success(msg);
updataspinning(false)
dispatch(updataspinning(false))
setTimeout(() => {
window.location.reload();
}, 300);
@ -131,7 +134,7 @@ export const reset_with_tpi = (identifier, msg) => {
const {status} = res.data
if (status === 0) {
message.success(msg);
updataspinning(false)
dispatch(updataspinning(false))
setTimeout(() => {
window.location.reload();
}, 300);
@ -156,7 +159,7 @@ export const active_with_tpi = (identifier, msg) => {
const {status} = res.data
if (status === 0) {
message.success(msg);
addjypertime(Date.now() + 900 * 1000);
dispatch(addjypertime(Date.now() + 900 * 1000))
}
}
})
@ -171,6 +174,7 @@ export const changeGetJupyterUrlState = (status) => {
payload: status
}
}
// 保存 jupyter tpi
export const saveJupyterTpi = () => {
return (dispatch, getState) => {
@ -234,3 +238,29 @@ export const updataspinning=(type)=>{
}
}
// 获取重置实训后的时间
export const timeinfo_with_tpi = (identifier, dispatch) => {
debugger
const params = {
identifier: identifier
};
debugger
timeinfo_with_tpis(params).then(res => {
debugger
console.log('同步时间成功: ', res);
if (res.data.status === 401) return;
if (res.status === 200) {
const {status} = res.data
console.log(status)
// dispatch(addjypertime(Date.now() +3600 * 1000))
// setTimeout(()=>{ dispatch(addjypertime(Date.now() +3600 * 1000))},500)
// if (status === 0) {
// message.success(msg);
// dispatch(updataspinning(false))
// setTimeout(() => {
// window.location.reload();
// }, 300);
// }
}
})
}

@ -16,7 +16,7 @@ const initialState = {
publishLoading: false, // 发布
isMySource: false,
drawervisible:false,
jupytertime:Date.now() + 3600 * 1000,
jupytertime:0,
spinning:false
}

@ -44,4 +44,11 @@ export async function fetchreset_with_tpi (params) {
export async function fetactive_with_tpi(params) {
const url = `/jupyters/active_with_tpi.json`;
return axios.get(url, { params });
}
//获取tpi重置实训的time
export async function timeinfo_with_tpis(params){
const url = `/jupyters/timeinfo_with_tpi.json`;
return axios.get(url, { params });
}

@ -528,7 +528,7 @@ li.li-width15{width: 15%;text-align: left}
li.li-width7{width: 7%;text-align: left}
/*-----------------------------在线课堂动态----------------------------------*/
.courseHead{width: 100%;margin-bottom:40px;background-size: 100% 100%;background-image: url("/images/educoder/course-detail.jpg");height: 240px;
.courseHead{width: 100%;margin-bottom:40px;background-size: 100% 100%;background-image: url("/images/educoder/courtailsbdpicture.jpg");height: 240px;
justify-content: center;align-items: center;display: -webkit-flex;
background-size: cover;
background-position: center;
@ -3803,4 +3803,4 @@ a.singlepublishtwo{
.markdown-body {
text-align: justify;
word-break: break-all;
}
}

File diff suppressed because one or more lines are too long
Loading…
Cancel
Save