mirror of
https://github.com/Buriburizaem0n/nezha_domains.git
synced 2026-11-04 08:40:20 +00:00
fix(mcp): harden dashboard dispatch lifecycle
Co-authored-by: naiba/CloudCode <hi+cloudcode@nai.ba>
This commit is contained in:
1 parent
2640b86d3a
commit
3f6de265a0
48 files changed
+1332
-265
No files matched your search
@@ -9,7 +9,6 @@ import (
|
||||
|
||||
"github.com/gin-gonic/gin"
|
||||
"github.com/goccy/go-json"
|
||||
"github.com/jinzhu/copier"
|
||||
"gorm.io/gorm"
|
||||
|
||||
"github.com/nezhahq/nezha/model"
|
||||
@@ -31,10 +30,13 @@ import (
|
||||
// @Router /server [get]
|
||||
func listServer(c *gin.Context) ([]*model.Server, error) {
|
||||
slist := singleton.ServerShared.GetSortedList()
|
||||
|
||||
var ssl []*model.Server
|
||||
if err := copier.Copy(&ssl, &slist); err != nil {
|
||||
return nil, err
|
||||
ssl := make([]*model.Server, 0, len(slist))
|
||||
for _, server := range slist {
|
||||
if server == nil {
|
||||
continue
|
||||
}
|
||||
runtime := server.RuntimeSnapshot()
|
||||
ssl = append(ssl, server.RuntimeCopy(runtime))
|
||||
}
|
||||
return ssl, nil
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user