mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-11 03:08:50 +01:00
🎨 Support downloading cloud data snapshots to local on demand https://github.com/siyuan-note/siyuan/issues/8057
This commit is contained in:
parent
83318d6246
commit
c2dafe4899
10 changed files with 59 additions and 3 deletions
|
|
@ -175,6 +175,33 @@ func getRepoSnapshots(c *gin.Context) {
|
|||
"pageCount": pageCount,
|
||||
"totalCount": totalCount,
|
||||
}
|
||||
|
||||
model.GetCloudRepoSnapshots("")
|
||||
|
||||
}
|
||||
|
||||
func getCloudRepoSnapshots(c *gin.Context) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
arg, ok := util.JsonArg(c, ret)
|
||||
if !ok {
|
||||
return
|
||||
}
|
||||
|
||||
marker := arg["marker"].(string)
|
||||
|
||||
snapshots, nextMarker, err := model.GetCloudRepoSnapshots(marker)
|
||||
if nil != err {
|
||||
ret.Code = -1
|
||||
ret.Msg = err.Error()
|
||||
return
|
||||
}
|
||||
|
||||
ret.Data = map[string]interface{}{
|
||||
"snapshots": snapshots,
|
||||
"nextMarker": nextMarker,
|
||||
}
|
||||
}
|
||||
|
||||
func getCloudRepoTagSnapshots(c *gin.Context) {
|
||||
|
|
|
|||
|
|
@ -305,6 +305,7 @@ func ServeAPI(ginServer *gin.Engine) {
|
|||
ginServer.Handle("POST", "/api/repo/getRepoTagSnapshots", model.CheckAuth, getRepoTagSnapshots)
|
||||
ginServer.Handle("POST", "/api/repo/removeRepoTagSnapshot", model.CheckAuth, model.CheckReadonly, removeRepoTagSnapshot)
|
||||
ginServer.Handle("POST", "/api/repo/getCloudRepoTagSnapshots", model.CheckAuth, getCloudRepoTagSnapshots)
|
||||
ginServer.Handle("POST", "/api/repo/getCloudRepoSnapshots", model.CheckAuth, getCloudRepoSnapshots)
|
||||
ginServer.Handle("POST", "/api/repo/removeCloudRepoTagSnapshot", model.CheckAuth, model.CheckReadonly, removeCloudRepoTagSnapshot)
|
||||
ginServer.Handle("POST", "/api/repo/uploadCloudSnapshot", model.CheckAuth, model.CheckReadonly, uploadCloudSnapshot)
|
||||
ginServer.Handle("POST", "/api/repo/downloadCloudSnapshot", model.CheckAuth, model.CheckReadonly, downloadCloudSnapshot)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue