cmc-web/public/static/vmks/vmConsole.html

37 lines
1.2 KiB
HTML
Raw Normal View History

2024-05-31 05:28:46 +00:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>vmware remote console</title>
</head>
<body>
<link rel="stylesheet" type="text/css" href ="wmks-all.css"/>
<script type ="text/javascript" src ="vmksJq.js"></script>
<script type ="text/javascript" src ="vmkaJqUi.js"></script>
<script type ="text/javascript" src ="wmks.min.js"></script>
<div>
<button id="button">发送Ctrl+Alt+Delete</button>
<button id="button1">查看全屏</button>
</div>
<div id="wmksContainer" style="position:absolute;width:100%;height:100%">
</div>
<script>
var item = JSON.parse(sessionStorage.getItem('console'));
var url = 'wss://' + item.host +':'+item.port + '/ticket/'+item.ticket;
var wmks=WMKS.createWMKS("wmksContainer",{}).register(WMKS.CONST.Events.CONNECTION_STATE_CHANGE,function(event,data){
if(data.state==WMKS.CONST.ConnectionState.CONNECTED){
console.log("连接状态改变:连接");
}
});
wmks.connect(url);
var btn = document.getElementById('button');
btn.onclick = function () {
wmks.sendKeyCodes([17, 18, 46])
}
document.getElementById('button1').onclick = function () {
wmks.enterFullScreen();
}
</script>
</body>
</html>