mirror of
https://github.com/UNITRONIX/BetterDesk.git
synced 2026-09-10 17:45:42 +00:00
6537c994f5
- Added a new method to check if the agent has an active CDAP session, improving connection status reporting. - Updated the SendHelpRequest function to utilize the engine for sending help requests, enhancing the request handling process. - Refactored health check methods to include the Go management API, replacing the console health checks for better integration. - Improved branding logo handling by introducing a PNG validation function, ensuring only valid images are used. - Updated UI elements and localization strings to reflect changes in API endpoints and improve user experience.
24 lines
492 B
Go
24 lines
492 B
Go
package agent
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
// RequestHelp raises a support request on the active CDAP connection.
|
|
func (a *Agent) RequestHelp(message string) error {
|
|
if !a.connected.Load() {
|
|
return fmt.Errorf("not connected to gateway")
|
|
}
|
|
message = strings.TrimSpace(message)
|
|
if message == "" {
|
|
return fmt.Errorf("message required")
|
|
}
|
|
hostname, _ := os.Hostname()
|
|
return a.sendMessage("help_request", map[string]string{
|
|
"message": message,
|
|
"hostname": hostname,
|
|
})
|
|
}
|