|
|
|
@ -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
|
|
|
|
|