fix: batch-uninstall 也检查 SSHKey(对齐 batch-upgrade 逻辑)
This commit is contained in:
1 parent
bc813e611c
commit
fcc15c0d73
1 file changed
+1
-1
@@ -357,7 +357,7 @@ func (h *AgentInstallHandler) BatchUninstallAgent(c *gin.Context) {
|
|||||||
log.Printf("[BatchUninstall] 服务器 %d 不存在,跳过", id)
|
log.Printf("[BatchUninstall] 服务器 %d 不存在,跳过", id)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
if server.Username == "" || server.Password == "" {
|
if server.Username == "" || (server.Password == "" && server.SSHKey == "") {
|
||||||
h.db.Model(&server).Updates(map[string]interface{}{"agent_status": "offline", "agent_version": ""})
|
h.db.Model(&server).Updates(map[string]interface{}{"agent_status": "offline", "agent_version": ""})
|
||||||
log.Printf("[BatchUninstall] %s 无SSH凭据,已标记离线", server.Hostname)
|
log.Printf("[BatchUninstall] %s 无SSH凭据,已标记离线", server.Hostname)
|
||||||
successCount++
|
successCount++
|
||||||
|
|||||||
Reference in new issue
Block a user