chromesetting
杨树明 5 years ago
parent 94a6fb8556
commit 74f89610ad

@ -30,7 +30,7 @@ const env = getClientEnvironment(publicUrl);
module.exports = {
// You may want 'eval' instead if you prefer to see the compiled output in DevTools.
// See the discussion in https://github.com/facebookincubator/create-react-app/issues/343.s
// devtool: "cheap-module-eval-source-map",
devtool: "cheap-module-eval-source-map",
// 开启调试
//devtool: "source-map", // 开启调试
// These are the "entry points" to our application.

@ -19,13 +19,18 @@ import actions from '../../../redux/actions';
import RightPane from './rightPane';
import MyIcon from "../../../common/components/MyIcon";
function clearSlct() {
if("getSelection" in window){
window.getSelection().removeAllRanges();
}else{
document.selection.empty();
};
}
function jsCopy(s) {
var copyEle = document.getElementById(s);
const range = document.createRange(); // 创造range
window.getSelection().removeAllRanges(); //清除页面中已有的selection
range.selectNode(copyEle); // 选中需要复制的节点
window.getSelection().addRange(range); // 执行选中元素
const copyStatus = document.execCommand("Copy"); // 执行copy操作
clearSlct();
const copyEle = document.getElementById(s);
copyEle.select();
const copyStatus=document.execCommand("Copy");
// 对成功与否定进行提示
copyStatuss(copyStatus)
}
@ -66,7 +71,8 @@ function JupyterTPI (props) {
jupytertime,
active_with_tpi,
spinning,
updataspinning
updataspinning,
jupyter_folder_name
} = props;
const emptyCtx = (
@ -274,8 +280,8 @@ function JupyterTPI (props) {
mouseLeaveDelay={0.3}
>
<div className="sortinxdirection">
<Icon type="file-text" className="jupyter_icon fl lineheighttaj" />
<a className="jupyter_name ml10 maxnamewidth150 lineheighttaj colorlineheighttaj" title={item.title}>{item.title}</a>
<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={"fr color-blue lineheighttaj"}
onClick={() => {
jsCopy("file_path"+i)
@ -382,11 +388,22 @@ function JupyterTPI (props) {
>
{/*<p className={"RightPaneDrawertop"}></p>*/}
<div className="jupyter_data_sets_area newjupyter_data_sets_area">
<h2 className="jupyter_h2_title">
<h2 className="jupyter_h2_title bortop17212F">
{/*<MyIcon type="iconwenti" className="jupyter_data_icon"/>*/}
<i className={"iconfont icon-base"}></i>
{/* <span className="iconfont icon-java jupyter_data_icon"></span>数据集 */}
</h2>
<h2 className="borbottom17212F jupyterfilepaths">
<span className={"ml50"}>文件路径</span>
<div className="sortinxdirection">
<a className="jupyter_name ml50 maxnamewidth200 lineheighttaj colorlineheighttaj">{jupyter_folder_name}</a>
<a className={"fr color-blue lineheighttaj font-14"}
onClick={() => {
jsCopy("jupyter_folder_name")
}}>复制地址</a>
</div>
<input id="jupyter_folder_name" className={"file_path_input"} value={jupyter_folder_name}/>
</h2>
{ renderCtx }
<div className='jupyter_pagination'>
{total<20?"":<Pagination
@ -413,6 +430,7 @@ const mapStateToProps = (state) => {
jupyter_data_set,
jupyter_tpi_url_state,
jupyter_data_set_count,
jupyter_folder_name,
jupyter_pagination,
jupyter_identifier
} = state.jupyterReducer;
@ -425,6 +443,7 @@ const mapStateToProps = (state) => {
jupyter_tpi_url_state,
total: jupyter_data_set_count,
pagination: jupyter_pagination,
jupyter_folder_name:jupyter_folder_name,
jupyter_identifier,
drawervisible,
jupytertime,

@ -23,7 +23,11 @@
cursor: row-resize;
width: 100%;
}
.filestyles{
color: #28b887 !important;
font-size: 25px !important;
margin-left:20px;
}
.Resizer.horizontal:hover {
border-top: 5px solid rgba(0, 0, 0, 0.5);
border-bottom: 5px solid rgba(0, 0, 0, 0.5);
@ -138,9 +142,9 @@
height:49px;
line-height: 49px;
background: #070F1A !important;
border-bottom: 1px solid #17212F !important;
//border-bottom: 1px solid #17212F !important;
color:#FFFFFF !important;
border-top: 1px solid #17212F !important;
//border-top: 1px solid #17212F !important;
}
.iconfont{
color:#28b887!important;
@ -193,4 +197,38 @@ line-height: 50px !important;
.jupyter_data_list{
padding-left: 20px;
}
.bortop17212F{
border-top: 1px solid #17212F !important;
}
.borbottom17212F{
border-bottom: 1px solid #17212F !important;
}
.jupyterfilepaths{
color: #888 !important;
font-size: 16px !important;
padding-left: 20px;
background: #070F1A !important;
}
.maxnamewidth200{
max-width: 200px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: default;
width: 200px;
}
.maxnamewidth181{
max-width:181px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
cursor: default;
width: 181px;
}

@ -1,14 +1,23 @@
import React, { Component } from 'react';
import { Link } from "react-router-dom";
import { markdownToHTML, configShareForCustom,getImageUrl,getUploadActionUrlthree,appendFileSizeToUploadFileAll} from 'educoder'
import { Divider, Tooltip,Upload,Spin} from 'antd';
import { Divider, Tooltip,Upload,Modal} from 'antd';
import LoadingSpin from '../../../../common/LoadingSpin';
import 'antd/lib/pagination/style/index.css';
import '../shixunchildCss/Challenges.css';
import axios from 'axios';
const $ = window.$;
function handleClickResetTpisync_code(id){
const url = `/jupyters/reset_with_tpm.json`;
axios.post(url,{
identifier:id
}).then((response) => {
if(response.data.status===0){
return response
}
})
}
class Challengesjupyter extends Component {
constructor(props) {
super(props)
@ -316,6 +325,28 @@ class Challengesjupyter extends Component {
}
}
// 重置实训
handleClickResetTpi = () => {
let id=this.props.match.params.shixunId;
Modal.confirm({
title: '重置实训',
content: (
<p style={{ lineHeight: '24px' }}>
你在本文件中修改的内容将丢失,<br />
是否确定重新加载初始代码
</p>
),
okText: '确定',
cancelText: '取消',
onOk () {
console.log(handleClickResetTpisync_code(id))
},
onCancel() {
},
})
}
render() {
let{ChallengesDataList,booljupyterurls,enlarge,fileList}=this.state;
let id = this.props.match.params.shixunId;
@ -514,11 +545,12 @@ class Challengesjupyter extends Component {
}
</style>
<Upload {...uploadProps}>
<div className="challenbaocun" type="upload">
<p
className="challenbaocuntest" type="upload" >导入</p>
</div>
<div className="challenbaocun" type="upload">
<p className="challenbaocuntest" type="upload" >导入</p>
</div>
</Upload>
<button type="button" className="ant-btn deletebuttom chongzhistyles" onClick={this.handleClickResetTpi}><span>重置实训</span></button>
</div>
</div>

@ -217,3 +217,21 @@
.jupyterswidth{
width: 1140px;
}
.chongzhistyles{
color: #fff;
width: 85px !important;
height: 32px !important;
margin-right: 20px;
}
.chongzhistyles:hover, .chongzhistyles:focus{
color: #fff !important;
background-color: #29BD8B !important;
border-color: transparent;
}
.chongzhistyles:active, .chongzhistyles:active{
color: #fff !important;
background-color: #29BD8B !important;
border-color: transparent ;
}

@ -52,12 +52,13 @@ export const getJupyterTpiDataSet = (identifier, params) => {
fetchJupyterTpiDataSet(identifier, params).then(res => {
if (res.data.status === 401) return; // 用户未登录
if (res.status === 200) {
const {data_sets, data_sets_count} = res.data;
const {data_sets, data_sets_count,folder_name} = res.data;
dispatch({
type: types.GET_JUPYTER_DATA_SETS,
payload: {
data_sets,
data_sets_count
data_sets_count,
folder_name,
}
});
}

@ -25,11 +25,12 @@ const initState = {
const JupyterReducer = (state = initState, action) => {
switch (action.type) {
case types.GET_JUPYTER_DATA_SETS:
const { data_sets, data_sets_count } = action.payload;
const { data_sets, data_sets_count,folder_name} = action.payload;
return {
...state,
jupyter_data_set: data_sets,
jupyter_data_set_count: data_sets_count
jupyter_data_set_count: data_sets_count,
jupyter_folder_name:folder_name,
}
case types.GET_JUPYTER_TPI_URL:
const {url, status, port} = action.payload;

Loading…
Cancel
Save