mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-29 18:00:51 +01:00
feat: added multi-spider in git
https://github.com/crawlab-team/crawlab/issues/1485
This commit is contained in:
@@ -560,7 +560,8 @@ func PostSpiderSaveFiles(c *gin.Context) {
|
||||
HandleErrorForbidden(c, err)
|
||||
return
|
||||
}
|
||||
PostBaseFileSaveFiles(rootPath, c)
|
||||
targetDirectory := c.PostForm("targetDirectory")
|
||||
PostBaseFileSaveFiles(filepath.Join(rootPath, targetDirectory), c)
|
||||
}
|
||||
|
||||
func PostSpiderSaveDir(c *gin.Context) {
|
||||
@@ -723,10 +724,6 @@ func getSpiderFsSvc(s *models.SpiderV2) (svc interfaces.FsServiceV2, err error)
|
||||
return fsSvc, nil
|
||||
}
|
||||
|
||||
func GetSpiderFsSvcById(id primitive.ObjectID) (svc interfaces.FsServiceV2, err error) {
|
||||
return getSpiderFsSvcById(id)
|
||||
}
|
||||
|
||||
func getSpiderFsSvcById(id primitive.ObjectID) (svc interfaces.FsServiceV2, err error) {
|
||||
s, err := service.NewModelServiceV2[models.SpiderV2]().GetById(id)
|
||||
if err != nil {
|
||||
@@ -803,5 +800,5 @@ func getSpiderRootPath(c *gin.Context) (rootPath string, err error) {
|
||||
return id.Hex(), nil
|
||||
}
|
||||
|
||||
return filepath.Join(s.GitId.Hex(), rootPath), nil
|
||||
return filepath.Join(s.GitId.Hex(), s.GitRootPath), nil
|
||||
}
|
||||
|
||||
@@ -25,7 +25,7 @@ require (
|
||||
github.com/emirpasic/gods v1.18.1
|
||||
github.com/fsnotify/fsnotify v1.7.0
|
||||
github.com/gavv/httpexpect/v2 v2.16.0
|
||||
github.com/gin-gonic/gin v1.9.1
|
||||
github.com/gin-gonic/gin v1.10.0
|
||||
github.com/go-git/go-git/v5 v5.12.0
|
||||
github.com/golang-jwt/jwt/v5 v5.2.1
|
||||
github.com/google/uuid v1.6.0
|
||||
|
||||
Reference in New Issue
Block a user