Skip to content

Commit

Permalink
perf: rdp i18n errors (#371)
Browse files Browse the repository at this point in the history
* perf: rdp i18n errors

* perf: send required error

---------

Co-authored-by: Eric <[email protected]>
  • Loading branch information
fit2bot and LeeEirc authored Dec 10, 2024
1 parent 640b8d8 commit 0cd9757
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
5 changes: 5 additions & 0 deletions pkg/tunnel/conn.go
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,11 @@ func (t *Connection) Run(ctx *gin.Context) (err error) {
msg := fmt.Sprintf("required: %s", strings.Join(instruction.Args, ","))
logger.Infof("Session[%s] receive guacamole server required: %s", t, msg)
requiredErr = guacd.NewInstruction(guacd.InstructionServerError, msg)
logger.Errorf("Session[%s] send guacamole server required err: %s", t,
requiredErr.String())
_ = t.writeWsMessage([]byte(requiredErr.String()))
requiredErr = guacd.Instruction{}
continue
default:
noNopTime = time.Now()
}
Expand Down
3 changes: 2 additions & 1 deletion ui/src/i18n/lang/en.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ const message = {
GuacamoleErrInsufficientPrivileges: 'Insufficient privileges.',
GuacamoleErrManuallyDisconnected: 'Manually disconnected.',
GuacamoleErrManuallyLoggedOff: 'Manually logged off.',
GuacamoleErrUnsupportedCredentialTypeRequested: 'Unsupported credential type requested.'
GuacamoleErrUnsupportedCredentialTypeRequested: 'Unsupported credential type requested.',
GuacamoleErrUnableToConnectToVNCServer: 'Unable to connect to VNC server'
}

export default {
Expand Down
3 changes: 2 additions & 1 deletion ui/src/i18n/lang/zh-CN.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ const message = {
GuacamoleErrInsufficientPrivileges: '远程连接的用户权限不足',
GuacamoleErrManuallyDisconnected: '远程连接被手动断开',
GuacamoleErrManuallyLoggedOff: '远程连接的用户被手动注销',
GuacamoleErrUnsupportedCredentialTypeRequested: '远程连接的凭证类型不支持'
GuacamoleErrUnsupportedCredentialTypeRequested: '远程连接的凭证类型不支持',
GuacamoleErrUnableToConnectToVNCServer: '无法连接到 VNC 服务器'
}

export default {
Expand Down
3 changes: 2 additions & 1 deletion ui/src/i18n/lang/zh-Hant.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ const message = {
GuacamoleErrInsufficientPrivileges: '遠程連接的用戶權限不足',
GuacamoleErrManuallyDisconnected: '遠程連接被手動斷開',
GuacamoleErrManuallyLoggedOff: '遠程連接的用戶被手動註銷',
GuacamoleErrUnsupportedCredentialTypeRequested: '遠程連接的憑證類型不支持'
GuacamoleErrUnsupportedCredentialTypeRequested: '遠程連接的憑證類型不支持',
GuacamoleErrUnableToConnectToVNCServer: '無法連接到 VNC 伺服器'
}

export default {
Expand Down
4 changes: 2 additions & 2 deletions ui/src/utils/status.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
export const ErrorStatusCodes = {
256: 'GuaErrUnSupport',
519: 'GuaErrUpstreamNotFound',
514: 'GuaErrUpStreamTimeout',
521: 'GuaErrSessionConflict',
769: 'GuaErrClientUnauthorized',
Expand Down Expand Up @@ -64,5 +63,6 @@ export const GuacamoleErrMsg = {
'Manually disconnected.': 'GuacamoleErrManuallyDisconnected',
'Manually logged off.': 'GuacamoleErrManuallyLoggedOff',

'Unsupported credential type requested.': 'GuacamoleErrUnsupportedCredentialTypeRequested'
'Unsupported credential type requested.': 'GuacamoleErrUnsupportedCredentialTypeRequested',
'Unable to connect to VNC server.': 'GuacamoleErrUnableToConnectToVNCServer'
}

0 comments on commit 0cd9757

Please sign in to comment.