mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2026-01-21 14:30:36 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b6bd9150d9 | ||
|
|
96e3e3bc86 | ||
|
|
41377f41bb | ||
|
|
fb744f81e2 | ||
|
|
750c3bcbcd | ||
|
|
d4015d7284 | ||
|
|
a9bf3fda73 | ||
|
|
7f467a4814 | ||
|
|
9f10b5e983 | ||
|
|
5291270e6a | ||
|
|
56bba381d8 |
@@ -39,6 +39,7 @@
|
||||
- 自动获取ID服务器和KEY
|
||||
- 自动获取地址簿
|
||||
- 游客通过临时分享链接直接远程到设备
|
||||
- v2 Preview
|
||||
- CLI
|
||||
- 重置管理员密码
|
||||
|
||||
@@ -142,6 +143,11 @@
|
||||

|
||||
3. 登录后,会自动同步ID服务器和KEY
|
||||
4. 登录后,会将地址簿自动保存到web client中,方便使用
|
||||
5. 现已支持`v2 Preview`,访问路径是`/webclient2`
|
||||

|
||||
6. `v2 preview` 部署
|
||||
- 如果是通过`443`端口的`https`部署,必须配置反向代理,可以参考[官方文档](https://rustdesk.com/docs/en/self-host/rustdesk-server-pro/faq/#8-add-websocket-secure-wss-support-for-the-id-server-and-relay-server-to-enable-secure-communication-for-the-web-client)
|
||||
- 如果是`http`或者其他的`https`端口部署,则和`v1`一样,配置好`21118`,`21119`即可
|
||||
|
||||
### 自动化文档: 使用 Swag 生成 API 文档,方便开发者理解和使用 API。
|
||||
|
||||
|
||||
@@ -147,6 +147,12 @@ installation are `admin` `admin`, please change the password immediately.
|
||||

|
||||
3. After logging in, the ID server and key will be automatically synced.
|
||||
4. The address book will also be automatically saved to the web client for convenient use.
|
||||
5. Now supports `v2 Preview`, accessible at `/webclient2`
|
||||

|
||||
6. `v2 preview` deployment
|
||||
- If deploying via `https` on port `443`, you must configure a reverse proxy. Refer to the [official documentation](https://rustdesk.com/docs/en/self-host/rustdesk-server-pro/faq/#8-add-websocket-secure-wss-support-for-the-id-server-and-relay-server-to-enable-secure-communication-for-the-web-client)
|
||||
- If deploying via `http` or other `https` ports, configure `21118` and `21119` as with `v1`
|
||||
|
||||
|
||||
### Automated Documentation : API documentation is generated using Swag, making it easier for developers to understand and use the API.
|
||||
|
||||
|
||||
@@ -1056,7 +1056,7 @@ const docTemplateapi = `{
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"WEBCLIENT"
|
||||
"WEBCLIENT_V2"
|
||||
],
|
||||
"summary": "服务配置",
|
||||
"responses": {
|
||||
|
||||
@@ -1049,7 +1049,7 @@
|
||||
"application/json"
|
||||
],
|
||||
"tags": [
|
||||
"WEBCLIENT"
|
||||
"WEBCLIENT_V2"
|
||||
],
|
||||
"summary": "服务配置",
|
||||
"responses": {
|
||||
|
||||
@@ -869,7 +869,7 @@ paths:
|
||||
- token: []
|
||||
summary: 服务配置
|
||||
tags:
|
||||
- WEBCLIENT
|
||||
- WEBCLIENT_V2
|
||||
/shared-peer:
|
||||
post:
|
||||
consumes:
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 21 KiB After Width: | Height: | Size: 19 KiB |
BIN
docs/webclientv2.png
Normal file
BIN
docs/webclientv2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 31 KiB |
4
resources/web2/index.html
vendored
4
resources/web2/index.html
vendored
@@ -32,7 +32,7 @@
|
||||
<title>RustDesk</title>
|
||||
<script src="/webclient-config/index.js"></script>
|
||||
<link rel="manifest" href="manifest.json" />
|
||||
<script type="module" crossorigin src="js/dist/index.js?v=3"></script>
|
||||
<script type="module" crossorigin src="js/dist/index.js?v=6"></script>
|
||||
<link rel="modulepreload" href="js/dist/vendor.js?v=0b990c6e" />
|
||||
<style>
|
||||
html,
|
||||
@@ -259,7 +259,7 @@
|
||||
}
|
||||
scriptLoaded = true;
|
||||
var scriptTag = document.createElement("script");
|
||||
scriptTag.src = "main.dart.js?v=6d46937e";
|
||||
scriptTag.src = "main.dart.js?v=6";
|
||||
scriptTag.type = "application/javascript";
|
||||
document.body.append(scriptTag);
|
||||
}
|
||||
|
||||
28111
resources/web2/js/dist/index.js
vendored
28111
resources/web2/js/dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
28121
resources/web2/js/dist/lang.js
vendored
Normal file
28121
resources/web2/js/dist/lang.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
36
resources/web2/js/dist/ljw.js
vendored
36
resources/web2/js/dist/ljw.js
vendored
@@ -1,6 +1,7 @@
|
||||
window._gwen = {}
|
||||
window._gwen.kv = {}
|
||||
const apiserver = localStorage.getItem('api-server')
|
||||
const storage_prefix = 'wc-'
|
||||
const apiserver = localStorage.getItem('wc-api-server')
|
||||
|
||||
function stringToUint8Array(str) {
|
||||
var arr = [];
|
||||
@@ -23,10 +24,10 @@ function getQueryVariable() {
|
||||
|
||||
getQueryVariable()
|
||||
|
||||
const id = window._gwen.kv.id || ''
|
||||
/*const id = window._gwen.kv.id || ''
|
||||
if (id) {
|
||||
localStorage.setItem('remote-id', id)
|
||||
}
|
||||
localStorage.setItem(storage_prefix+'option:local:last_remote_id', id)
|
||||
}*/
|
||||
const share_token = window._gwen.kv.share_token || ''
|
||||
if (share_token) {
|
||||
fetch(apiserver + "/api/shared-peer", {
|
||||
@@ -37,14 +38,15 @@ if (share_token) {
|
||||
body: JSON.stringify({share_token})
|
||||
}).then(res => res.json()).then(res => {
|
||||
if (res.code === 0) {
|
||||
localStorage.setItem('custom-rendezvous-server', res.data.id_server)
|
||||
localStorage.setItem('key', res.data.key)
|
||||
const peer = res.data.peer
|
||||
localStorage.setItem('remote-id', peer.info.id)
|
||||
peer.tmppwd = stringToUint8Array(window.atob(peer.tmppwd)).toString()
|
||||
const oldPeers = JSON.parse(localStorage.getItem('peers')) || {}
|
||||
oldPeers[peer.info.id] = peer
|
||||
localStorage.setItem('peers', JSON.stringify(oldPeers))
|
||||
localStorage.setItem(storage_prefix + 'custom-rendezvous-server', res.data.id_server)
|
||||
localStorage.setItem(storage_prefix + 'key', res.data.key)
|
||||
const peer = res.data.peer || {}
|
||||
/*const s = {
|
||||
id: peer.info.id,
|
||||
password: peer.tmppwd,
|
||||
}*/
|
||||
//修改location
|
||||
window.location.href = `/webclient2/#/${peer.info.id}?password=${peer.tmppwd}`
|
||||
}
|
||||
})
|
||||
}
|
||||
@@ -55,8 +57,8 @@ export function getServerConf(token) {
|
||||
if (!token) {
|
||||
return
|
||||
}
|
||||
const prefix = 'wc-'
|
||||
console.log('getServerConf', token)
|
||||
|
||||
// console.log('getServerConf', token)
|
||||
if (fetching) {
|
||||
return
|
||||
}
|
||||
@@ -71,9 +73,9 @@ export function getServerConf(token) {
|
||||
).then(res => res.json()).then(res => {
|
||||
fetching = false
|
||||
if (res.code === 0) {
|
||||
if (!localStorage.getItem(prefix + 'custom-rendezvous-server') || !localStorage.getItem('key')) {
|
||||
localStorage.setItem(prefix + 'custom-rendezvous-server', res.data.id_server)
|
||||
localStorage.setItem(prefix + 'key', res.data.key)
|
||||
if (!localStorage.getItem(storage_prefix + 'custom-rendezvous-server') || !localStorage.getItem('key')) {
|
||||
localStorage.setItem(storage_prefix + 'custom-rendezvous-server', res.data.id_server)
|
||||
localStorage.setItem(storage_prefix + 'key', res.data.key)
|
||||
}
|
||||
}
|
||||
}).catch(_ => {
|
||||
|
||||
224452
resources/web2/main.dart.js
vendored
224452
resources/web2/main.dart.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user