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

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

@ -539,26 +539,26 @@ class NewShixunModel extends Component{
className="fl task-hide edu-txt-left mt3"
name="shixun_homework[]"
></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'?
(
item.is_jupyter===true?
<div className="myysljupyter fl ml15 mt3 intermediatecenter">
<div className="myysljupyter fl ml20 mt3 intermediatecenter">
<p className="myysljupytertest">
Jupyter
</p>
</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>
<style>
{

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

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

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

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

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

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

@ -86,10 +86,6 @@ class Challengesjupyter extends Component {
booljupyterurls:true,
})
});
}
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=()=>{
// //console.log("propsysl");
// //console.log(propsysl);
let id=this.props.match.params.shixunId;
var jupyter_port="";
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() {
let{ChallengesDataList,booljupyterurls}=this.state;
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;

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

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

@ -215,7 +215,7 @@ class SearchPage extends Component{
type==="shixun"?
(
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{
width:54px;
height:24px;
background:#FF6802;
border-radius:2px 10px 10px 2px;
margin-top: 2px;
text-align: center;
border-radius:5px;
border:1px solid #FF6802;
margin-top: 4px;
}
.jupytertextp{
width:39px;
width:54px;
height:16px;
line-height:16px;
font-size:12px;
color:#FFFFFF;
color:#FF6802;
line-height:16px;
}
/* x轴正方向排序 */

Loading…
Cancel
Save