Files
UNITRONIX 6537c994f5 Enhance support agent functionality and improve API integration
- 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.
2026-06-04 15:39:21 +02:00

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,
})
}