Files
rustdesk-api/http/response/api/webClient.go
T
thomasandClaude Opus 4.8 16e97c8efa i18n: Translate all Chinese to English across the codebase
Translate Chinese comments, log/error messages, validator labels and
Swagger annotations to English throughout the source code, generated
Swagger docs, config files and CI workflows.

Make the English README primary: README.md now holds the English docs
and README_EN.md holds the Chinese version, with cross-language links
updated accordingly.

Note: the generated docs/ swagger files were translated in place; run
`go generate ./...` (swag init) to regenerate them from the now-English
annotations when a Go toolchain is available.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-27 12:17:04 +02:00

47 lines
1.1 KiB
Go

package api
import (
"github.com/lejianwen/rustdesk-api/v2/model"
"time"
)
type WebClientPeerPayload struct {
ViewStyle string `json:"view-style"`
Tm int64 `json:"tm"`
Info WebClientPeerInfoPayload `json:"info"`
Tmppwd string `json:"tmppwd"`
}
type WebClientPeerInfoPayload struct {
Username string `json:"username"`
Hostname string `json:"hostname"`
Platform string `json:"platform"`
Hash string `json:"hash"`
Id string `json:"id"`
}
func (wcpp *WebClientPeerPayload) FromAddressBook(a *model.AddressBook) {
wcpp.ViewStyle = "shrink"
//24 hours ago
wcpp.Tm = time.Now().Add(-time.Hour * 24).UnixNano()
wcpp.Info = WebClientPeerInfoPayload{
Username: a.Username,
Hostname: a.Hostname,
Platform: a.Platform,
Hash: a.Hash,
}
}
func (wcpp *WebClientPeerPayload) FromShareRecord(sr *model.ShareRecord) {
wcpp.ViewStyle = "shrink"
//24 hours ago
wcpp.Tm = time.Now().UnixNano()
wcpp.Tmppwd = sr.Password
wcpp.Info = WebClientPeerInfoPayload{
Username: "",
Hostname: "",
Platform: "",
Id: sr.PeerId,
}
}