fix: add sshPort of listIP result (#2656)

Signed-off-by: joyceliu <joyceliu@yunify.com>
This commit is contained in:
liujian 2025-07-14 11:03:29 +08:00 committed by GitHub
parent 39657b3dd9
commit 2e6bad6355
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 3 additions and 0 deletions

View File

@ -97,6 +97,7 @@ type SchemaTablePlaybook struct {
// It indicates whether the IP is a localhost, if SSH is reachable, and if SSH authorization is present.
type IPTable struct {
IP string `json:"ip"` // IP address
SSHPort string `json:"sshPort"` // SSH port
Localhost bool `json:"localhost"` // Whether the IP is a localhost IP
SSHReachable bool `json:"sshReachable"` // Whether SSH port is reachable on this IP
SSHAuthorized bool `json:"sshAuthorized"` // Whether SSH is authorized for this IP

View File

@ -108,6 +108,7 @@ func (h schemaHandler) listIP(request *restful.Request, response *restful.Respon
mu.Lock()
ipTable = append(ipTable, api.IPTable{
IP: ip,
SSHPort: string(sshPort),
Localhost: true,
SSHReachable: true,
SSHAuthorized: true,
@ -126,6 +127,7 @@ func (h schemaHandler) listIP(request *restful.Request, response *restful.Respon
mu.Lock()
ipTable = append(ipTable, api.IPTable{
IP: ip,
SSHPort: string(sshPort),
SSHReachable: reachable,
SSHAuthorized: authorized,
})