mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-06 14:44:42 +08:00
fix: fix bug with mcp-server status error (#8349)
This commit is contained in:
parent
c0ccc0318d
commit
515d6ca500
3 changed files with 8 additions and 1 deletions
|
@ -52,6 +52,7 @@ func (m McpServerService) Page(req request.McpServerSearch) response.McpServersR
|
|||
|
||||
total, data, _ := mcpServerRepo.Page(req.PageInfo.Page, req.PageInfo.PageSize)
|
||||
for _, item := range data {
|
||||
_ = syncMcpServerContainerStatus(&item)
|
||||
serverDTO := response.McpServerDTO{
|
||||
McpServer: item,
|
||||
Environments: make([]request.Environment, 0),
|
||||
|
@ -158,6 +159,7 @@ func (m McpServerService) Create(create request.McpServerCreate) error {
|
|||
BaseURL: create.BaseURL,
|
||||
SsePath: create.SsePath,
|
||||
Dir: mcpDir,
|
||||
HostIP: create.HostIP,
|
||||
}
|
||||
if err := handleCreateParams(mcpServer, create.Environments, create.Volumes); err != nil {
|
||||
return err
|
||||
|
@ -616,6 +618,8 @@ func syncMcpServerContainerStatus(mcpServer *model.McpServer) error {
|
|||
mcpServer.Status = constant.RuntimeRunning
|
||||
case "paused":
|
||||
mcpServer.Status = constant.RuntimeStopped
|
||||
case "restarting":
|
||||
mcpServer.Status = constant.RuntimeReStarting
|
||||
default:
|
||||
if mcpServer.Status != constant.RuntimeBuildIng {
|
||||
mcpServer.Status = constant.RuntimeStopped
|
||||
|
|
|
@ -13,6 +13,7 @@ const (
|
|||
RuntimeStopped = "stopped"
|
||||
RuntimeUnhealthy = "unhealthy"
|
||||
RuntimeCreating = "creating"
|
||||
RuntimeReStarting = "restarting"
|
||||
|
||||
RuntimePHP = "php"
|
||||
RuntimeNode = "node"
|
||||
|
|
|
@ -58,7 +58,9 @@
|
|||
@click="openLog(row)"
|
||||
link
|
||||
type="primary"
|
||||
:disabled="row.status !== 'running' && row.status !== 'error'"
|
||||
:disabled="
|
||||
row.status !== 'running' && row.status !== 'error' && row.status !== 'restarting'
|
||||
"
|
||||
>
|
||||
{{ $t('website.check') }}
|
||||
</el-button>
|
||||
|
|
Loading…
Add table
Reference in a new issue