dev_cs
hjm 5 years ago
parent 51e4d7bb36
commit 665358570e

@ -32,7 +32,7 @@ import _ from 'lodash'
import TPIContext from './TPIContext'
import { EDU_ADMIN, EDU_SHIXUN_MANAGER, EDU_SHIXUN_MEMBER, EDU_CERTIFICATION_TEACHER
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL, EDU_BUSINESS} from 'educoder'
, EDU_GAME_MANAGER, EDU_TEACHER, EDU_NORMAL, EDU_BUSINESS, CNotificationHOC } from 'educoder'
import { MuiThemeProvider, createMuiTheme, withStyles } from 'material-ui/styles';
import MUIDialogStyleUtil from '../modules/page/component/MUIDialogStyleUtil'
@ -877,6 +877,7 @@ pop_box_new(htmlvalue, 480, 182);
return (
<TPIContext.Provider
value={{
...this.props,
...this.state,
resetTestSetsExpandedArray: this.resetTestSetsExpandedArray,
onRunCodeTestFinish: this.onRunCodeTestFinish,
@ -961,7 +962,7 @@ pop_box_new(htmlvalue, 480, 182);
}
}
export default withStyles(styles) (TPIContextProvider);
export default CNotificationHOC() (withStyles(styles) (TPIContextProvider));

@ -109,7 +109,7 @@ export function CNotificationHOC(options = {}) {
const { title, content,subContent, onOk, onCancel, okText } = object;
this.onCancel = onCancel
this.onOk = onOk
this.okText = okText || ''
this.okText = okText || '确定'
this.setState({ title, content , subContent , dialogOpen: true })
}
onDialogOkBtnClick = () => {
@ -146,7 +146,15 @@ export function CNotificationHOC(options = {}) {
return (
<React.Fragment>
<style>
{`
.confirmModal .task-popup-content {
padding: 0px;
}
`}
</style>
<Modals
className="confirmModal"
modalsType={dialogOpen}
modalsTopval={
content

@ -13,6 +13,7 @@ render() {
const antIcons = <Icon type="loading" style={{ fontSize: 24 }} spin />
return(
<Modal
className={this.props.className}
keyboard={false}
title="提示"
visible={this.props.modalsType===undefined?false:this.props.modalsType}

@ -210,6 +210,8 @@ class Index extends Component {
{/* 区分下repo和evaluate模块的以及子模块的 */}
<MainContentContainer
confirm={context.confirm}
onDrawerButtonClick={this.onDrawerButtonClick}
grade={context.grade}
allowed_unlock={context.allowed_unlock}

@ -21,7 +21,8 @@ class VNCContainer extends Component {
this.state = {
fileTreeSelectedKeys: [],
repositoryCode: ''
repositoryCode: '',
displayKey: 1
}
}
componentDidMount() {
@ -114,6 +115,43 @@ class VNCContainer extends Component {
showCodeEvaluate = () => {
this.setState({ bottomDrawer: true })
}
onResetVNC = () => {
// 桌面系统将恢复到初始状态,您在系统中创建的数据可能会丢失
// 请确保您的数据已保存(如:版本库代码已推送到服务器)
// 是否确认重置?
this.props.confirm({
content: <div style={{textAlign: 'center'}}>
<div>桌面系统将恢复到初始状态您在系统中创建的数据可能会丢失</div>
<div>请确保您的数据已保存版本库代码已推送到服务器</div>
<div>是否确认重置</div>
</div>,
onOk: () => {
const url = `/tasks/${this.props.game.identifier}/reset_vnc_link.json`
axios.get(url, {
}).then((response) => {
if (response.data.data && response.data.data.vnc_url) {
// reset
this.setState({
displayKey: this.state.displayKey + 1,
vnc_url: response.data.data.vnc_url
})
} else {
}
// this.setState({ isEditablePath, currentPath: path });
}).catch(error =>{
console.log(error)
this.setState({ readingCodeLoading: false });
this.props.showSnackbar(`服务端异常,请联系管理员!`);
})
console.log('doooo')
},
onCancel() {
console.log('Cancel');
},
})
}
/*
selectedKeys={fileTreeSelectedKeys}
@ -191,6 +229,30 @@ class VNCContainer extends Component {
.codeInDrawer .ant-spin-nested-loading > div > .ant-spin .ant-spin-text {
text-shadow: none;
}
.resetVNC {
top: 30px;
writing-mode: initial;
left: calc(100% - 120px);
background-image: none;
width: auto;
background: #081516;
height: 30px;
padding: 0 6px;
border-radius: 4px;
}
.resetVNC .text {
top: 0px;
writing-mode: initial;
left: unset;
}
.resetVNC .text span {
vertical-align: middle;
margin-left: 2px;
}
.float_button:hover .text {
color: #4CACFF;
}
`}</style>
<div style={{ 'padding': '16px', 'border-bottom': '1px solid #3A383A' }}>
<div style={{ color: '#888888' }}>网址克隆</div>
@ -207,9 +269,14 @@ class VNCContainer extends Component {
></RepoTree>
</SecondDrawer>
{/* <FloatButton></FloatButton> */}
<FloatButton className="resetVNC" onClick={this.onResetVNC}>
<i className="iconfont icon-zhongzhi2 font-16 "></i>
<span>重置桌面系统</span>
</FloatButton>
<VNCDisplay
{...this.props}
key={this.state.displayKey}
vnc_url={this.state.vnc_url || this.props.vnc_url}
>
<Drawer

@ -6,6 +6,7 @@ const $ = window.$;
// const showIframeContent = window.location.search.indexOf('vnc=1') != -1;
class VNCDisplay extends Component {
componentDidMount() {
console.log('vnc init')
console.log(RFB)
let rfb;

Loading…
Cancel
Save