MCPcopy Create free account
hub / github.com/1Panel-dev/1Panel / batchOperateSkipMessage

Function batchOperateSkipMessage

agent/app/service/agents.go:583–603  ·  view source on GitHub ↗
(operate constant.AppOperate, status string)

Source from the content-addressed store, hash-verified

581}
582
583func batchOperateSkipMessage(operate constant.AppOperate, status string) string {
584 switch status {
585 case constant.StatusInstalling, constant.StatusUpgrading, constant.StatusUninstalling, constant.StatusRebuilding:
586 return fmt.Sprintf("agent status is %s", status)
587 }
588 switch operate {
589 case constant.Start:
590 if status == constant.StatusRunning || status == constant.StatusStarting || status == constant.StatusRestarting {
591 return fmt.Sprintf("agent status is %s", status)
592 }
593 case constant.Stop:
594 if status != constant.StatusRunning {
595 return fmt.Sprintf("agent status is %s", status)
596 }
597 case constant.Restart:
598 if status == constant.StatusStarting {
599 return fmt.Sprintf("agent status is %s", status)
600 }
601 }
602 return ""
603}
604
605func buildCreateReqFromBatchInstallReq(req dto.AgentBatchInstallReq) dto.AgentCreateReq {
606 return dto.AgentCreateReq{

Callers 1

BatchOperateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected