feat: update agent button on server page
Server Deploy / deploy (push) Successful in 1m39s
Agent Release / build (push) Successful in 2m10s

This commit is contained in:
domrichardson
2026-06-24 14:33:17 +01:00
parent e6ef9bc536
commit aff6736b18
13 changed files with 331 additions and 45 deletions
+4 -3
View File
@@ -73,13 +73,14 @@ func (c *Client) Register(serverID, preRegToken, hostname, ipAddress, osInfo str
return resp.AgentToken, nil
}
func (c *Client) SyncKeys(serverID, agentToken string) ([]string, error) {
func (c *Client) SyncKeys(serverID, agentToken, version string) ([]string, error) {
ctx, cancel := context.WithTimeout(context.Background(), 10*time.Second)
defer cancel()
resp, err := c.client.SyncKeys(ctx, &pb.SyncRequest{
ServerId: serverID,
AgentToken: agentToken,
ServerId: serverID,
AgentToken: agentToken,
AgentVersion: version,
})
if err != nil {
return nil, err
+9 -2
View File
@@ -23,8 +23,9 @@ type RegisterResponse struct {
}
type SyncRequest struct {
ServerId string `json:"server_id"`
AgentToken string `json:"agent_token"`
ServerId string `json:"server_id"`
AgentToken string `json:"agent_token"`
AgentVersion string `json:"agent_version,omitempty"`
}
type SyncResponse struct {
@@ -49,12 +50,18 @@ type ServerCommand struct {
CommandId string `json:"command_id"`
GenerateKey *GenerateKeyCmd `json:"generate_key,omitempty"`
DeleteKey *DeleteKeyCmd `json:"delete_key,omitempty"`
UpdateAgent *UpdateAgentCmd `json:"update_agent,omitempty"`
}
type DeleteKeyCmd struct {
Label string `json:"label"`
}
type UpdateAgentCmd struct {
Version string `json:"version"`
GiteaBaseURL string `json:"gitea_base_url"`
}
type GenerateKeyCmd struct {
Label string `json:"label"`
KeyType string `json:"key_type,omitempty"`