mirror of
https://github.com/1Panel-dev/1Panel.git
synced 2025-09-09 16:14:45 +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)
|
total, data, _ := mcpServerRepo.Page(req.PageInfo.Page, req.PageInfo.PageSize)
|
||||||
for _, item := range data {
|
for _, item := range data {
|
||||||
|
_ = syncMcpServerContainerStatus(&item)
|
||||||
serverDTO := response.McpServerDTO{
|
serverDTO := response.McpServerDTO{
|
||||||
McpServer: item,
|
McpServer: item,
|
||||||
Environments: make([]request.Environment, 0),
|
Environments: make([]request.Environment, 0),
|
||||||
|
@ -158,6 +159,7 @@ func (m McpServerService) Create(create request.McpServerCreate) error {
|
||||||
BaseURL: create.BaseURL,
|
BaseURL: create.BaseURL,
|
||||||
SsePath: create.SsePath,
|
SsePath: create.SsePath,
|
||||||
Dir: mcpDir,
|
Dir: mcpDir,
|
||||||
|
HostIP: create.HostIP,
|
||||||
}
|
}
|
||||||
if err := handleCreateParams(mcpServer, create.Environments, create.Volumes); err != nil {
|
if err := handleCreateParams(mcpServer, create.Environments, create.Volumes); err != nil {
|
||||||
return err
|
return err
|
||||||
|
@ -616,6 +618,8 @@ func syncMcpServerContainerStatus(mcpServer *model.McpServer) error {
|
||||||
mcpServer.Status = constant.RuntimeRunning
|
mcpServer.Status = constant.RuntimeRunning
|
||||||
case "paused":
|
case "paused":
|
||||||
mcpServer.Status = constant.RuntimeStopped
|
mcpServer.Status = constant.RuntimeStopped
|
||||||
|
case "restarting":
|
||||||
|
mcpServer.Status = constant.RuntimeReStarting
|
||||||
default:
|
default:
|
||||||
if mcpServer.Status != constant.RuntimeBuildIng {
|
if mcpServer.Status != constant.RuntimeBuildIng {
|
||||||
mcpServer.Status = constant.RuntimeStopped
|
mcpServer.Status = constant.RuntimeStopped
|
||||||
|
|
|
@ -13,6 +13,7 @@ const (
|
||||||
RuntimeStopped = "stopped"
|
RuntimeStopped = "stopped"
|
||||||
RuntimeUnhealthy = "unhealthy"
|
RuntimeUnhealthy = "unhealthy"
|
||||||
RuntimeCreating = "creating"
|
RuntimeCreating = "creating"
|
||||||
|
RuntimeReStarting = "restarting"
|
||||||
|
|
||||||
RuntimePHP = "php"
|
RuntimePHP = "php"
|
||||||
RuntimeNode = "node"
|
RuntimeNode = "node"
|
||||||
|
|
|
@ -58,7 +58,9 @@
|
||||||
@click="openLog(row)"
|
@click="openLog(row)"
|
||||||
link
|
link
|
||||||
type="primary"
|
type="primary"
|
||||||
:disabled="row.status !== 'running' && row.status !== 'error'"
|
:disabled="
|
||||||
|
row.status !== 'running' && row.status !== 'error' && row.status !== 'restarting'
|
||||||
|
"
|
||||||
>
|
>
|
||||||
{{ $t('website.check') }}
|
{{ $t('website.check') }}
|
||||||
</el-button>
|
</el-button>
|
||||||
|
|
Loading…
Add table
Reference in a new issue