Merge remote-tracking branch 'origin/main' into trig-190
This commit is contained in:
commit
5a5a7bce27
@ -233,6 +233,9 @@ func (h *TemplatesHandler) ReplaceFiles(c *gin.Context) {
|
||||
"files": len(body.Files),
|
||||
"source": "ec2-ssh",
|
||||
})
|
||||
if h.wh != nil {
|
||||
go h.wh.RestartByID(workspaceID)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@ -264,6 +267,9 @@ func (h *TemplatesHandler) ReplaceFiles(c *gin.Context) {
|
||||
"files": len(body.Files),
|
||||
"source": "container",
|
||||
})
|
||||
if h.wh != nil {
|
||||
go h.wh.RestartByID(workspaceID)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@ -281,4 +287,7 @@ func (h *TemplatesHandler) ReplaceFiles(c *gin.Context) {
|
||||
}
|
||||
|
||||
c.JSON(http.StatusOK, gin.H{"status": "replaced", "workspace": workspaceID, "files": len(body.Files), "source": "volume"})
|
||||
if h.wh != nil {
|
||||
go h.wh.RestartByID(workspaceID)
|
||||
}
|
||||
}
|
||||
|
||||
@ -524,6 +524,9 @@ func (h *TemplatesHandler) WriteFile(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"status": "saved", "path": filePath})
|
||||
if h.wh != nil {
|
||||
go h.wh.RestartByID(workspaceID)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@ -535,6 +538,9 @@ func (h *TemplatesHandler) WriteFile(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"status": "saved", "path": filePath})
|
||||
if h.wh != nil {
|
||||
go h.wh.RestartByID(workspaceID)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@ -546,6 +552,9 @@ func (h *TemplatesHandler) WriteFile(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"status": "saved", "path": filePath})
|
||||
if h.wh != nil {
|
||||
go h.wh.RestartByID(workspaceID)
|
||||
}
|
||||
}
|
||||
|
||||
// DeleteFile handles DELETE /workspaces/:id/files/*path
|
||||
@ -592,6 +601,9 @@ func (h *TemplatesHandler) DeleteFile(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"status": "deleted", "path": filePath})
|
||||
if h.wh != nil {
|
||||
go h.wh.RestartByID(workspaceID)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@ -607,6 +619,9 @@ func (h *TemplatesHandler) DeleteFile(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"status": "deleted", "path": filePath})
|
||||
if h.wh != nil {
|
||||
go h.wh.RestartByID(workspaceID)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
@ -617,5 +632,8 @@ func (h *TemplatesHandler) DeleteFile(c *gin.Context) {
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, gin.H{"status": "deleted", "path": filePath})
|
||||
if h.wh != nil {
|
||||
go h.wh.RestartByID(workspaceID)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user