mirror of
https://github.com/lejianwen/rustdesk-api.git
synced 2026-01-22 15:00:36 +00:00
Compare commits
9 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d368bdc84c | ||
|
|
cdc1150505 | ||
|
|
32d525c53c | ||
|
|
a89b40c607 | ||
|
|
b6bd9150d9 | ||
|
|
96e3e3bc86 | ||
|
|
41377f41bb | ||
|
|
fb744f81e2 | ||
|
|
750c3bcbcd |
21
LICENSE
Normal file
21
LICENSE
Normal file
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2024-present Lejianwen and contributors
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -148,6 +148,7 @@
|
||||
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`即可
|
||||
- 更多参考[Web-Client-V2-Preview-Document](https://github.com/lejianwen/rustdesk-api/wiki/Web-Client-V2-Preview-Document)
|
||||
|
||||
### 自动化文档: 使用 Swag 生成 API 文档,方便开发者理解和使用 API。
|
||||
|
||||
|
||||
@@ -152,6 +152,7 @@ installation are `admin` `admin`, please change the password immediately.
|
||||
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`
|
||||
- More [Web-Client-V2-Preview-Document](https://github.com/lejianwen/rustdesk-api/wiki/Web-Client-V2-Preview-Document)
|
||||
|
||||
|
||||
### 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 |
@@ -3,6 +3,7 @@ package global
|
||||
import (
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/go-playground/locales/en"
|
||||
"github.com/go-playground/locales/es"
|
||||
"github.com/go-playground/locales/ko"
|
||||
"github.com/go-playground/locales/ru"
|
||||
"github.com/go-playground/locales/zh_Hans_CN"
|
||||
@@ -10,6 +11,7 @@ import (
|
||||
ut "github.com/go-playground/universal-translator"
|
||||
"github.com/go-playground/validator/v10"
|
||||
en_translations "github.com/go-playground/validator/v10/translations/en"
|
||||
es_translations "github.com/go-playground/validator/v10/translations/es"
|
||||
ru_translations "github.com/go-playground/validator/v10/translations/ru"
|
||||
zh_translations "github.com/go-playground/validator/v10/translations/zh"
|
||||
"reflect"
|
||||
@@ -23,13 +25,15 @@ func ApiInitValidator() {
|
||||
cn := zh_Hans_CN.New()
|
||||
koT := ko.New()
|
||||
ruT := ru.New()
|
||||
esT := es.New()
|
||||
|
||||
uni := ut.New(enT, cn, koT, ruT)
|
||||
uni := ut.New(enT, cn, koT, ruT, esT)
|
||||
|
||||
enTrans, _ := uni.GetTranslator("en")
|
||||
zhTrans, _ := uni.GetTranslator("zh_Hans_CN")
|
||||
koTrans, _ := uni.GetTranslator("ko")
|
||||
ruTrans, _ := uni.GetTranslator("ru")
|
||||
esTrans, _ := uni.GetTranslator("es")
|
||||
|
||||
err := zh_translations.RegisterDefaultTranslations(validate, zhTrans)
|
||||
if err != nil {
|
||||
@@ -49,6 +53,10 @@ func ApiInitValidator() {
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
err = es_translations.RegisterDefaultTranslations(validate, esTrans)
|
||||
if err != nil {
|
||||
panic(err)
|
||||
}
|
||||
|
||||
validate.RegisterTagNameFunc(func(field reflect.StructField) string {
|
||||
label := field.Tag.Get("label")
|
||||
@@ -115,6 +123,9 @@ func getTranslatorForLang(lang string) ut.Translator {
|
||||
case "ru":
|
||||
trans, _ := Validator.UT.GetTranslator("ru")
|
||||
return trans
|
||||
case "es":
|
||||
trans, _ := Validator.UT.GetTranslator("es")
|
||||
return trans
|
||||
case "en":
|
||||
fallthrough
|
||||
default:
|
||||
|
||||
134
resources/i18n/es.toml
Normal file
134
resources/i18n/es.toml
Normal file
@@ -0,0 +1,134 @@
|
||||
[Test]
|
||||
description = "test"
|
||||
one = "prueba1"
|
||||
other = "Prueba2 {{.P0}}"
|
||||
|
||||
[ParamsError]
|
||||
description = "Params validation failed."
|
||||
one = "La validación de los parámetros falló."
|
||||
other = "La validación de los parámetros falló."
|
||||
|
||||
[OperationFailed]
|
||||
description = "OperationFailed."
|
||||
one = "La operación falló."
|
||||
other = "La operación falló."
|
||||
|
||||
[OperationSuccess]
|
||||
description = "OperationSuccess."
|
||||
one = "La operación fue exitosa."
|
||||
other = "La operación fue exitosa."
|
||||
|
||||
[ItemExists]
|
||||
description = "Item already exists."
|
||||
one = "El elemento ya existe."
|
||||
other = "El elemento ya existe."
|
||||
|
||||
[ItemNotFound]
|
||||
description = "Item not found."
|
||||
one = "El elemento no fue encontrado."
|
||||
other = "El elemento no fue encontrado."
|
||||
|
||||
[NoAccess]
|
||||
description = "No access."
|
||||
one = "Sin acceso."
|
||||
other = "Sin acceso."
|
||||
|
||||
[UsernameOrPasswordError]
|
||||
description = "Username or password error."
|
||||
one = "Error de usuario o contraseña."
|
||||
other = "Error de usuario o contraseña."
|
||||
|
||||
[SystemError]
|
||||
description = "System error."
|
||||
one = "Error del sistema."
|
||||
other = "Error del sistema."
|
||||
|
||||
[ConfigNotFound]
|
||||
description = "Config not found."
|
||||
one = "Configuración no encontrada."
|
||||
other = "Configuración no encontrada."
|
||||
|
||||
[OauthExpired]
|
||||
description = "Oauth expired."
|
||||
one = "Oauth expirado, por favor intente nuevamente."
|
||||
other = "Oauth expirado, por favor intente nuevamente."
|
||||
|
||||
[OauthFailed]
|
||||
description = "Oauth failed."
|
||||
one = "Oauth falló."
|
||||
other = "Oauth falló."
|
||||
|
||||
[OauthHasBindOtherUser]
|
||||
description = "Oauth has bind other user."
|
||||
one = "Oauth está vinculado a otro usuario."
|
||||
other = "Oauth está vinculado a otro usuario."
|
||||
|
||||
[ParamIsEmpty]
|
||||
description = "Param is empty."
|
||||
one = "{{.P0}} está vacío."
|
||||
other = "{{.P0}} está vacío."
|
||||
|
||||
[BindFail]
|
||||
description = "Bind fail."
|
||||
one = "Fallo al vincular."
|
||||
other = "Fallo al vincular."
|
||||
|
||||
[BindSuccess]
|
||||
description = "Bind success."
|
||||
one = "Vinculación exitosa."
|
||||
other = "Vinculación exitosa."
|
||||
|
||||
[OauthHasBeenSuccess]
|
||||
description = "Oauth has been success."
|
||||
one = "Oauth fue exitoso."
|
||||
other = "Oauth fue exitoso."
|
||||
|
||||
[OauthSuccess]
|
||||
description = "Oauth success."
|
||||
one = "Oauth exitoso."
|
||||
other = "Oauth exitoso."
|
||||
|
||||
[OauthRegisterSuccess]
|
||||
description = "Oauth register success."
|
||||
one = "Registro de Oauth exitoso."
|
||||
other = "Registro de Oauth exitoso."
|
||||
|
||||
[OauthRegisterFailed]
|
||||
description = "Oauth register failed."
|
||||
one = "Registro de Oauth falló."
|
||||
other = "Registro de Oauth falló."
|
||||
|
||||
[GetOauthTokenError]
|
||||
description = "Get oauth token error."
|
||||
one = "Error al obtener el token de Oauth."
|
||||
other = "Error al obtener el token de Oauth."
|
||||
|
||||
[GetOauthUserInfoError]
|
||||
description = "Get oauth user info error."
|
||||
one = "Error al obtener la información del usuario de Oauth."
|
||||
other = "Error al obtener la información del usuario de Oauth."
|
||||
|
||||
[DecodeOauthUserInfoError]
|
||||
description = "Decode oauth user info error."
|
||||
one = "Error al decodificar la información del usuario de Oauth."
|
||||
other = "Error al decodificar la información del usuario de Oauth."
|
||||
|
||||
[OldPasswordError]
|
||||
description = "Old password error."
|
||||
one = "Error con la contraseña anterior."
|
||||
other = "Error con la contraseña anterior."
|
||||
|
||||
[DefaultGroup]
|
||||
description = "Default group"
|
||||
one = "Grupo predeterminado"
|
||||
other = "Grupo predeterminado"
|
||||
|
||||
[ShareGroup]
|
||||
description = "Share group"
|
||||
one = "Grupo compartido"
|
||||
other = "Grupo compartido"
|
||||
|
||||
[RegisterClosed]
|
||||
description = "Register closed."
|
||||
one = "Registro cerrado."
|
||||
other = "Registro cerrado."
|
||||
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=5"></script>
|
||||
<script type="module" crossorigin src="js/dist/index.js?v=893935a2"></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=5";
|
||||
scriptTag.src = "main.dart.js?v=df360f45";
|
||||
scriptTag.type = "application/javascript";
|
||||
document.body.append(scriptTag);
|
||||
}
|
||||
|
||||
31700
resources/web2/js/dist/index.js
vendored
31700
resources/web2/js/dist/index.js
vendored
File diff suppressed because it is too large
Load Diff
28163
resources/web2/js/dist/lang.js
vendored
Normal file
28163
resources/web2/js/dist/lang.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
2
resources/web2/js/dist/ljw.js
vendored
2
resources/web2/js/dist/ljw.js
vendored
@@ -58,7 +58,7 @@ export function getServerConf(token) {
|
||||
return
|
||||
}
|
||||
|
||||
console.log('getServerConf', token)
|
||||
// console.log('getServerConf', token)
|
||||
if (fetching) {
|
||||
return
|
||||
}
|
||||
|
||||
224522
resources/web2/main.dart.js
vendored
224522
resources/web2/main.dart.js
vendored
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user