mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-22 17:31:03 +01:00
不展示无项目
This commit is contained in:
@@ -47,20 +47,20 @@ func GetProjectList(c *gin.Context) {
|
||||
}
|
||||
|
||||
// 获取未被分配的爬虫数量
|
||||
if tag == "" {
|
||||
noProject := model.Project{
|
||||
Id: bson.ObjectIdHex(constants.ObjectIdNull),
|
||||
Name: "No Project",
|
||||
Description: "Not assigned to any project",
|
||||
}
|
||||
spiders, err := noProject.GetSpiders()
|
||||
if err != nil {
|
||||
HandleError(http.StatusInternalServerError, c, err)
|
||||
return
|
||||
}
|
||||
noProject.Spiders = spiders
|
||||
projects = append(projects, noProject)
|
||||
}
|
||||
//if tag == "" {
|
||||
// noProject := model.Project{
|
||||
// Id: bson.ObjectIdHex(constants.ObjectIdNull),
|
||||
// Name: "No Project",
|
||||
// Description: "Not assigned to any project",
|
||||
// }
|
||||
// spiders, err := noProject.GetSpiders()
|
||||
// if err != nil {
|
||||
// HandleError(http.StatusInternalServerError, c, err)
|
||||
// return
|
||||
// }
|
||||
// noProject.Spiders = spiders
|
||||
// projects = append(projects, noProject)
|
||||
//}
|
||||
|
||||
c.JSON(http.StatusOK, ListResponse{
|
||||
Status: "ok",
|
||||
|
||||
Reference in New Issue
Block a user