114 lines
4.6 KiB
HTML
114 lines
4.6 KiB
HTML
<!doctype html>
|
|
<html lang="zh">
|
|
|
|
<head>
|
|
<meta charset="utf-8" />
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
<title>远程桌面</title>
|
|
<link rel="stylesheet" href="./bootstrap.min.css">
|
|
<link rel="stylesheet" href="./rdp.css">
|
|
<link rel="stylesheet" href="./login.css">
|
|
<link rel="prefetch" href="./webrdp_bg.wasm">
|
|
<style type="text/css">
|
|
.horizontal-centre {
|
|
position: relative;
|
|
text-align: center;
|
|
}
|
|
.vertical-centre {
|
|
position: relative;
|
|
vertical-align: middle;
|
|
}
|
|
html,
|
|
body {
|
|
height: 100%;
|
|
margin: 0;
|
|
overscroll-behavior: none;
|
|
}
|
|
</style>
|
|
<script type="module" defer>
|
|
import initWASM from "/webrdp.js";
|
|
async function wasm() {
|
|
await initWASM();
|
|
}
|
|
window.wasm = wasm;
|
|
</script>
|
|
<script type="text/javascript">
|
|
function jsExportedCredentials(key) {
|
|
console.log("requested key", key)
|
|
if (jsExportedCredentials[key]) {
|
|
const ret = jsExportedCredentials[key];
|
|
delete jsExportedCredentials[key];
|
|
return ret;
|
|
}
|
|
return "";
|
|
}
|
|
|
|
function wrongCredential() {
|
|
disconnectedAndRefresh("用户名或密码错误!")
|
|
}
|
|
|
|
function disconnectedAndRefresh(msg) {
|
|
alert(msg ?? "抱歉,与服务器连接断开。");
|
|
window.location.reload();
|
|
}
|
|
</script>
|
|
</head>
|
|
|
|
<body onload="$('#rdp_container').hide();">
|
|
<div id="login_container">
|
|
<form class="form-signin"
|
|
onsubmit="connect(this.elements['inputUser'].value, this.elements['inputPassword'].value, event);">
|
|
<img class="logo" src="./logo.svg">
|
|
<input type="text" id="inputUser" autocomplete="username" class="form-control" placeholder="用户名">
|
|
<input type="password" id="inputPassword" autocomplete="current-password" class="form-control" placeholder="密码">
|
|
<button class="btn btn-lg btn-primary btn-block" type="submit"
|
|
style="background-color: #34A6FF; border-color: #34A6FF">连接</button>
|
|
<p></p>
|
|
<!-- Begin Customization -->
|
|
<!--CUSTOMANCHOR-->
|
|
|
|
<!-- End Customization -->
|
|
<p></p>
|
|
</form>
|
|
</div>
|
|
<div id="rdp_container" style="height: 100%; margin: 0;">
|
|
<div id="canvas" class="horizontal-centre vertical-centre">
|
|
<canvas id="rdp-canvas" tabIndex=1></canvas>
|
|
</div>
|
|
<div class="clipboardback">
|
|
<div class="clipboard">
|
|
<button id="clipboardbtn">«</button>
|
|
<div id="clipboardbox" class="horizontal-centre vertical-centre">
|
|
<div style="position: relative; top: 50%; transform: translateY(-50%);">
|
|
<div><textarea id="clipboardtxt" placeholder="发送文本内容" rows="12"></textarea></div>
|
|
<div><button id="clipboardsend">发送文本内容</button></div>
|
|
<div><button type="button" id="ctrlaltdel">发送 Ctrl+Alt+Del</button></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div class="fileshareback">
|
|
<div class="fileshare">
|
|
<button id="filesharebtn">»</button>
|
|
<div id="filesharebox" class="vertical-centre">
|
|
<div style="position: relative; top: 50%; transform: translateY(-50%);">
|
|
<div>当前路径: <span id="currentPath">/drive_c$/</span></div>
|
|
<div>分享:<select name="" id="">
|
|
<option value="drive_c$">drive_c$</option>
|
|
</select></div>
|
|
<table id="filesharelist">
|
|
</table>
|
|
<div><button onclick="mkdir()">新建文件夹</button><button onclick="listFile()">刷新</button></div>
|
|
<div><input type="file" name="文件上传" id="fileupload"><input type="submit" name="上传" id="filesubmit" onclick="uploadFile()"></div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<script src="./jquery-3.6.1.min.js" type="text/javascript"></script>
|
|
<script type="text/javascript" src="./ui.js"></script>
|
|
<script type="text/javascript" src="./rdp.js"></script>
|
|
<script type="text/javascript" src="./file.js"></script>
|
|
|
|
</body> |