Merge remote-tracking branch 'origin/dev_jupyter' into dev_jupyter

chromesetting
杨树明 5 years ago
commit 3b4f587278

@ -45,4 +45,4 @@ class GitService
end end
end end
end end

@ -89,7 +89,7 @@ module JupyterService
raise("获取文件内容失败:#{response.status}") raise("获取文件内容失败:#{response.status}")
end end
content = response.body content = response.body.force_encoding('utf-8')
c = GitService.update_file(repo_path: shixun.repo_path, c = GitService.update_file(repo_path: shixun.repo_path,
file_path: "01.ipynb", file_path: "01.ipynb",
@ -117,7 +117,7 @@ module JupyterService
raise("获取文件内容失败:#{response.status}") raise("获取文件内容失败:#{response.status}")
end end
content = response.body content = response.body.force_encoding('utf-8')
c = GitService.update_file(repo_path: myshixun.repo_path, c = GitService.update_file(repo_path: myshixun.repo_path,
file_path: "01.ipynb", file_path: "01.ipynb",

@ -539,26 +539,26 @@ class NewShixunModel extends Component{
className="fl task-hide edu-txt-left mt3" className="fl task-hide edu-txt-left mt3"
name="shixun_homework[]" name="shixun_homework[]"
></Checkbox> ></Checkbox>
<a target="_blank" href={this.props.type==='shixuns'?`/shixuns/${item.identifier}/challenges`:`/paths/${item.id}`} className="ml15 fl font-16 color-dark maxwidth1100"
dangerouslySetInnerHTML={{__html: item.title}}
>
</a>
{ {
this.props.type==='shixuns'? this.props.type==='shixuns'?
( (
item.is_jupyter===true? item.is_jupyter===true?
<div className="myysljupyter fl ml15 mt3 intermediatecenter"> <div className="myysljupyter fl ml20 mt3 intermediatecenter">
<p className="myysljupytertest"> <p className="myysljupytertest">
Jupyter Jupyter
</p> </p>
</div> </div>
:"" :""
) )
:"" :""
} }
<a target="_blank" href={this.props.type==='shixuns'?`/shixuns/${item.identifier}/challenges`:`/paths/${item.id}`} className="ml15 fl font-16 color-dark maxwidth1100"
dangerouslySetInnerHTML={{__html: item.title}}
>
</a>
<div className="cl"></div> <div className="cl"></div>
<style> <style>
{ {

@ -386,16 +386,19 @@
margin: 0 auto; margin: 0 auto;
} }
.myysljupyter{ .myysljupyter{
width:48px; width:54px;
height:22px; height:24px;
background:#FF6802; text-align: center;
border-radius:2px 10px 10px 2px; border-radius:5px;
border:1px solid #FF6802;
margin-top: 4px;
} }
.myysljupytertest{ .myysljupytertest{
width:39px; width:54px;
height:16px; height:16px;
line-height:16px;
font-size:12px; font-size:12px;
color:#FFFFFF; color:#FF6802;
line-height:16px; line-height:16px;
} }
.intermediatecenter{ .intermediatecenter{

@ -748,82 +748,86 @@ class TPMBanner extends Component {
</li> </li>
</ul> </ul>
{
<div className="pr fl" id="commentsStar" onMouseOver={() => this.showonMouseOver()} this.props.is_jupyter===false?
onMouseOut={() => this.hideonMouseOut()}> <div className="pr fl" id="commentsStar" onMouseOver={() => this.showonMouseOver()}
<div className={"color-grey-c ml15"} style={{color: "#Fff", textAlign: "center"}}>学员评分</div> onMouseOut={() => this.hideonMouseOut()}>
<div className="rateYo"> <div className={"color-grey-c ml15"} style={{color: "#Fff", textAlign: "center"}}>学员评分</div>
<MyRate allowHalf defaultValue={star_info[0]} disabled/> <div className="rateYo">
</div> <MyRate allowHalf defaultValue={star_info[0]} disabled/>
<div id="ratePanel" className="showratePanel" style={{"width": "530px"}} </div>
onMouseOut={() => this.hideonMouseOut()}> <div id="ratePanel" className="showratePanel" style={{"width": "530px"}}
<div className="pr"> onMouseOut={() => this.hideonMouseOut()}>
<span className="rateTrangle"></span> <div className="pr">
<div className="pr clearfix ratePanelContent" style={{height: '177px'}}> <span className="rateTrangle"></span>
<div className="fl totalScore"> <div className="pr clearfix ratePanelContent" style={{height: '177px'}}>
<div> <div className="fl totalScore">
<div>
<span <span
className="font-24 color-yellow-ff lineh-20 mb10 ml20">{star_infos[0]}</span> className="font-24 color-yellow-ff lineh-20 mb10 ml20">{star_infos[0]}</span>
<span className="displayblock">总评分</span> <span className="displayblock">总评分</span>
<div className="rateYo"> <div className="rateYo">
{showradios === true ? {showradios === true ?
<MyRate allowHalf defaultValue={star_info[0]} disabled/> <MyRate allowHalf defaultValue={star_info[0]} disabled/>
: ""} : ""}
</div> </div>
</div> </div>
</div> </div>
<div className="fr" style={{width: '375px'}}> <div className="fr" style={{width: '375px'}}>
<div className="clearfix"> <div className="clearfix">
<div className="rateYo fl mt3"> <div className="rateYo fl mt3">
{showradios === true ? {showradios === true ?
<MyRate allowHalf defaultValue={5} disabled/> <MyRate allowHalf defaultValue={5} disabled/>
: ""} : ""}
</div> </div>
<Progress percent={star_infos[1]} showInfo={false}></Progress> <Progress percent={star_infos[1]} showInfo={false}></Progress>
<span className="fr ml10 color-grey-6 font-12 mt4">{star_infos[1]}%</span> <span className="fr ml10 color-grey-6 font-12 mt4">{star_infos[1]}%</span>
</div> </div>
<div className="clearfix"> <div className="clearfix">
<div className="rateYo fl mt3"> <div className="rateYo fl mt3">
{showradios === true ? {showradios === true ?
<MyRate allowHalf defaultValue={4} disabled/> <MyRate allowHalf defaultValue={4} disabled/>
: ""} : ""}
</div> </div>
<Progress percent={star_infos[2]} showInfo={false}></Progress> <Progress percent={star_infos[2]} showInfo={false}></Progress>
<span className="fr ml10 color-grey-6 font-12 mt4">{star_infos[2]}%</span> <span className="fr ml10 color-grey-6 font-12 mt4">{star_infos[2]}%</span>
</div> </div>
<div className="clearfix"> <div className="clearfix">
<div className="rateYo fl mt3"> <div className="rateYo fl mt3">
{showradios === true ? {showradios === true ?
<MyRate allowHalf defaultValue={3} disabled/> <MyRate allowHalf defaultValue={3} disabled/>
: ""} : ""}
</div> </div>
<Progress percent={star_infos[3]} showInfo={false}></Progress> <Progress percent={star_infos[3]} showInfo={false}></Progress>
<span className="fr ml10 color-grey-6 font-12 mt4">{star_infos[3]}%</span> <span className="fr ml10 color-grey-6 font-12 mt4">{star_infos[3]}%</span>
</div> </div>
<div className="clearfix"> <div className="clearfix">
<div className="rateYo fl mt3"> <div className="rateYo fl mt3">
{showradios === true ? {showradios === true ?
<MyRate allowHalf defaultValue={2} disabled/> <MyRate allowHalf defaultValue={2} disabled/>
: ""} : ""}
</div> </div>
<Progress percent={star_infos[4]} showInfo={false}></Progress> <Progress percent={star_infos[4]} showInfo={false}></Progress>
<span className="fr ml10 color-grey-6 font-12 mt4">{star_infos[4]}%</span> <span className="fr ml10 color-grey-6 font-12 mt4">{star_infos[4]}%</span>
</div> </div>
<div className="clearfix"> <div className="clearfix">
<div className="rateYo fl mt3"> <div className="rateYo fl mt3">
{showradios === true ? {showradios === true ?
<MyRate allowHalf defaultValue={1} disabled/> <MyRate allowHalf defaultValue={1} disabled/>
: ""} : ""}
</div> </div>
<Progress percent={star_infos[5]} showInfo={false}></Progress> <Progress percent={star_infos[5]} showInfo={false}></Progress>
<span className="fr ml10 color-grey-6 font-12 mt4">{star_infos[5]}%</span> <span className="fr ml10 color-grey-6 font-12 mt4">{star_infos[5]}%</span>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
</div>
:""
}
</div>
{ {
startbtn === false && shixunsDetails.shixun_status != -1 ? startbtn === false && shixunsDetails.shixun_status != -1 ?

@ -460,9 +460,14 @@ class TPMDataset extends Component {
<div className="padding20 edu-back-white mt20 " style={{minHeight: '463px'}}> <div className="padding20 edu-back-white mt20 " style={{minHeight: '463px'}}>
<div className="sortinxdirection"> <div className="sortinxdirection">
<div className="tpmwidth"> {
<Checkbox checked={this.state.checked} onChange={this.mysonChange}>全选</Checkbox> data_sets_count>0?
</div> <div className="tpmwidth">
<Checkbox checked={this.state.checked} onChange={this.mysonChange}>全选</Checkbox>
</div>
:""
}
<div className="tpmwidth xaxisreverseorder"> <div className="tpmwidth xaxisreverseorder">
<style> <style>
{ {

@ -288,6 +288,7 @@ class TPMIndex extends Component {
<TPMBanner <TPMBanner
{...this.props} {...this.props}
{...this.state} {...this.state}
is_jupyter={this.state. is_jupyter}
></TPMBanner> ></TPMBanner>
} }
{/*筛选*/} {/*筛选*/}

@ -4,7 +4,7 @@
* @Github: * @Github:
* @Date: 2019-12-11 08:35:23 * @Date: 2019-12-11 08:35:23
* @LastEditors: tangjiang * @LastEditors: tangjiang
* @LastEditTime: 2019-12-12 18:00:03 * @LastEditTime: 2019-12-12 20:19:48
*/ */
import './index.scss'; import './index.scss';
import React, { useEffect, useState } from 'react'; import React, { useEffect, useState } from 'react';
@ -26,6 +26,7 @@ function JupyterTPI (props) {
}, },
url, url,
loading, // 保存按钮状态 loading, // 保存按钮状态
dataSets, // 数据集
jupyter_info, jupyter_info,
getJupyterInfo, getJupyterInfo,
syncJupyterCode, syncJupyterCode,
@ -151,7 +152,7 @@ function JupyterTPI (props) {
<div className="jupyter_ctx"> <div className="jupyter_ctx">
<SplitPane split="vertical" minSize={350} maxSize={-350} defaultSize="30%"> <SplitPane split="vertical" minSize={350} maxSize={-350} defaultSize="30%">
<div className={'split-pane-left'}> <div className={'split-pane-left'}>
<LeftPane dataSets={[]} /> <LeftPane dataSets={dataSets} />
</div> </div>
<SplitPane split="vertical" defaultSize="100%" allowResize={false}> <SplitPane split="vertical" defaultSize="100%" allowResize={false}>
<RightPane <RightPane

@ -4,10 +4,10 @@
* @Github: * @Github:
* @Date: 2019-12-12 10:34:03 * @Date: 2019-12-12 10:34:03
* @LastEditors: tangjiang * @LastEditors: tangjiang
* @LastEditTime: 2019-12-12 11:22:11 * @LastEditTime: 2019-12-12 20:18:46
*/ */
import './index.scss'; import './index.scss';
import React from 'react'; import React, { useState, useEffect } from 'react';
import {Icon, Empty} from 'antd'; import {Icon, Empty} from 'antd';
import MyIcon from '../../../../common/components/MyIcon'; import MyIcon from '../../../../common/components/MyIcon';
@ -16,15 +16,18 @@ function LeftPane (props) {
// 获取数据集 // 获取数据集
const { dataSets = [] } = props; const { dataSets = [] } = props;
// 渲染数据集 const emptyCtx = (
const renderList = () => { <div className="jupyter_empty">
// 空数据 <Empty />
if (dataSets.length === 0) { </div>
return <div className="jupyter_empty"> );
<Empty />
</div> // const listCtx = ;
} else { const [renderCtx, setRenderCtx] = useState(() => (emptyCtx));
// 渲染列表
useEffect(() => {
if (dataSets.length > 0) {
console.log('数据集的个数: ', dataSets.length);
const oList = dataSets.map((item, i) => { const oList = dataSets.map((item, i) => {
return ( return (
<li className="jupyter_item" key={`key_${i}`}> <li className="jupyter_item" key={`key_${i}`}>
@ -33,21 +36,47 @@ function LeftPane (props) {
</li> </li>
); );
}); });
return (
const oUl = (
<ul className="jupyter_data_list"> <ul className="jupyter_data_list">
{ oList } { oList }
</ul> </ul>
); );
setRenderCtx(oUl);
} }
} }, [props]);
// 渲染数据集
// const renderList = () => {
// // 空数据
// if (dataSets.length === 0) {
// return <div className="jupyter_empty">
// <Empty />
// </div>
// } else {
// // 渲染列表
// const oList = dataSets.map((item, i) => {
// return (
// <li className="jupyter_item" key={`key_${i}`}>
// <Icon type="file-text" className="jupyter_icon"/>
// <span className="jupyter_name">{item.title}</span>
// </li>
// );
// });
// return (
// <ul className="jupyter_data_list">
// { oList }
// </ul>
// );
// }
// }
return ( return (
<div className="jupyter_data_sets_area"> <div className="jupyter_data_sets_area">
<h2 className="jupyter_h2_title"> <h2 className="jupyter_h2_title">
<MyIcon type="iconwenti" className="jupyter_data_icon"/> 数据集 <MyIcon type="iconwenti" className="jupyter_data_icon"/> 数据集
</h2> </h2>
{renderList()} { renderCtx }
</div> </div>
) )
} }

@ -17,6 +17,7 @@
.jupyter_data_list, .jupyter_data_list,
.jupyter_empty{ .jupyter_empty{
height: calc(100vh - 110px); height: calc(100vh - 110px);
overflow-y: auto;
} }
.jupyter_data_list{ .jupyter_data_list{
@ -28,6 +29,10 @@
text-overflow:ellipsis; text-overflow:ellipsis;
white-space: nowrap; white-space: nowrap;
cursor: pointer; cursor: pointer;
transition: .3s;
&:hover{
background-color: rgba(235, 235, 235, .3);
}
.jupyter_icon{ .jupyter_icon{
color: rgb(74, 188, 125); color: rgb(74, 188, 125);
font-size: 16px; font-size: 16px;

@ -86,10 +86,6 @@ class Challengesjupyter extends Component {
booljupyterurls:true, booljupyterurls:true,
}) })
}); });
} }
updatamakedowns = () => { updatamakedowns = () => {
@ -125,56 +121,17 @@ class Challengesjupyter extends Component {
} }
// 关卡的上移下移操作
operations = (sumid, type) => {
}
delOperations = (sumid) => {
}
clonedelOperationss = () => {
}
delOperationss = () => {
}
startgameid=(id)=>{
}
hidestartshixunsreplace=(url)=>{
}
//编辑实训题目选择题
EditTraining=(type, ids, path)=>{
}
//开始实战按钮
startshixunCombat = (type, ids, id) => {
}
hidestartshixunCombattype=()=>{
}
hideAccountProfile=()=>{
};
modifyjupyter=()=>{ modifyjupyter=()=>{
// //console.log("propsysl");
// //console.log(propsysl);
let id=this.props.match.params.shixunId; let id=this.props.match.params.shixunId;
var jupyter_port=""; var jupyter_port="";
try{ try{
@ -197,40 +154,10 @@ class Challengesjupyter extends Component {
}) })
} }
sendToken=()=>{
// //console.log("sendToken");
// const iframe = document.getElementById('iframe');
// //console.log("modifyjupyter");
// const frameWindow = iframe.contentWindow;
// //console.log("frameWindow");
// //console.log(frameWindow);
}
render() { render() {
let{ChallengesDataList,booljupyterurls}=this.state; let{ChallengesDataList,booljupyterurls}=this.state;
let id = this.props.match.params.shixunId; let id = this.props.match.params.shixunId;
// var deptObjs=document.getElementById("IFRAMEID").contentWindow.document.getElementById("TAGID");
// //判断此元素是否存在
// if(deptObjs!=null){
// //设置该元素的样式或其他属性
// deptObjs.setAttribute('style',' height: 20px !important;'); //!important用来提升指定样式条目的应用优先权
// }
// var submitObj = document.getElementById('submit');
// if(submitObj){
// submitObj.style.color = 'green';
// }
// const dom = document.getElementById('shutdown');
// ReactDOM.unmountComponentAtNode(dom)
// // window.$('#picture_display').hide();
// window.$('.data-tip-right').hide()
// window.onload=()=>{
// debugger
// var _iframe = document.getElementById('header');
// //console.log(_iframe);
// // .contentWindow.document.getElementById('shutdown_widget') //get iframe下的id
// // _iframe.style.display= "none"; //修改样式
// }
const is_teacher = this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false; const is_teacher = this.props&&this.props.current_user&&this.props.current_user.is_teacher?this.props.current_user.is_teacher:false;

@ -31,6 +31,7 @@
height:30px; height:30px;
background:#29BD8B; background:#29BD8B;
border-radius:3px; border-radius:3px;
cursor:pointer
} }
.challenbaocuntest{ .challenbaocuntest{
width:103px; width:103px;
@ -39,7 +40,7 @@
color:#FFFFFF; color:#FFFFFF;
text-align: center; text-align: center;
line-height:30px; line-height:30px;
cursor:default cursor:pointer
} }
.renwuxiangqdiv{ .renwuxiangqdiv{
width:72px; width:72px;

@ -66,6 +66,8 @@
height:30px; height:30px;
background:#C4C4C4; background:#C4C4C4;
border-radius:3px; border-radius:3px;
cursor:pointer
} }
.deletebutomtext{ .deletebutomtext{
width:28px; width:28px;
@ -73,12 +75,14 @@
font-size:14px; font-size:14px;
color:#FFFFFF; color:#FFFFFF;
line-height:19px; line-height:19px;
cursor:pointer
} }
.deletebuttom{ .deletebuttom{
width:85px; width:85px;
height:30px; height:30px;
background:#29BD8B; background:#29BD8B;
border-radius:3px; border-radius:3px;
cursor:pointer
} }
.deletebuttomtest{ .deletebuttomtest{
width:56px; width:56px;
@ -86,6 +90,8 @@
font-size:14px; font-size:14px;
color:#FFFFFF; color:#FFFFFF;
line-height:19px; line-height:19px;
cursor:pointer
} }
.tpmwidth{ .tpmwidth{
width: 50%; width: 50%;
@ -111,6 +117,8 @@
height:30px; height:30px;
background:#FF5555; background:#FF5555;
border-radius:3px; border-radius:3px;
cursor:pointer
} }
.light-row{ .light-row{
background: #F7F7F8; background: #F7F7F8;

@ -215,7 +215,7 @@ class SearchPage extends Component{
type==="shixun"? type==="shixun"?
( (
item.is_jupyter===true? item.is_jupyter===true?
<div className="jupytertext intermediatecenter ml15"><p className="jupytertextp">Jupyter</p></div> <div className="jupytertext intermediatecenter ml20"><p className="jupytertextp">Jupyter</p></div>
:"" :""
) )
:"" :""

@ -135,17 +135,18 @@
.jupytertext{ .jupytertext{
width:54px; width:54px;
height:24px; height:24px;
background:#FF6802;
border-radius:2px 10px 10px 2px;
margin-top: 2px;
text-align: center; text-align: center;
border-radius:5px;
border:1px solid #FF6802;
margin-top: 4px;
} }
.jupytertextp{ .jupytertextp{
width:39px; width:54px;
height:16px; height:16px;
line-height:16px;
font-size:12px; font-size:12px;
color:#FFFFFF; color:#FF6802;
line-height:16px; line-height:16px;
} }
/* x轴正方向排序 */ /* x轴正方向排序 */

Loading…
Cancel
Save