diff --git a/public/react/src/context/TPIContextProvider.js b/public/react/src/context/TPIContextProvider.js index 3fbdb6ed1..df738ef98 100644 --- a/public/react/src/context/TPIContextProvider.js +++ b/public/react/src/context/TPIContextProvider.js @@ -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 ( { @@ -146,7 +146,15 @@ export function CNotificationHOC(options = {}) { return ( + return( { this.setState({ bottomDrawer: true }) } + onResetVNC = () => { + // 桌面系统将恢复到初始状态,您在系统中创建的数据可能会丢失 + // 请确保您的数据已保存(如:版本库代码已推送到服务器) + // 是否确认重置? + this.props.confirm({ + content:
+
桌面系统将恢复到初始状态,您在系统中创建的数据可能会丢失
+
请确保您的数据已保存(如:版本库代码已推送到服务器)
+
是否确认重置?
+
, + 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; + } `}
网址克隆
@@ -207,9 +269,14 @@ class VNCContainer extends Component { > - {/* */} + + + 重置桌面系统 +