mirror of
https://github.com/siyuan-note/siyuan.git
synced 2025-05-12 15:11:10 +08:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
4cbb21e81a
@ -182,6 +182,7 @@
|
||||
"keepLazyLoad": "Keep loaded content",
|
||||
"localSnapshot": "Local snapshot",
|
||||
"localTagSnapshot": "Local tag snapshot",
|
||||
"cloudSnapshot": "Cloud snapshot",
|
||||
"cloudTagSnapshot": "Cloud tag snapshot",
|
||||
"cloudBackupTip": "Please go to [Data History - Data Snapshot] to operate",
|
||||
"snapshotMemo": "Snapshot Memo",
|
||||
|
@ -182,6 +182,7 @@
|
||||
"keepLazyLoad": "Mantener el contenido cargado",
|
||||
"localSnapshot": "Instantánea local",
|
||||
"localTagSnapshot": "Instantánea de etiqueta local",
|
||||
"cloudSnapshot": "Instantánea de la nube",
|
||||
"cloudTagSnapshot": "Instantánea de etiquetas en la nube",
|
||||
"cloudBackupTip": "Vaya a [Historial de datos - Instantánea de datos] para operar",
|
||||
"snapshotMemo": "Memo de Instantánea",
|
||||
|
@ -181,6 +181,7 @@
|
||||
"keepLazyLoad": "Conserver le contenu chargé",
|
||||
"localSnapshot": "Instantané local",
|
||||
"localTagSnapshot": "Instantané de balise locale",
|
||||
"cloudSnapshot": "Instantané cloud",
|
||||
"cloudTagSnapshot": "Instantané de balise cloud",
|
||||
"cloudBackupTip": "Veuillez accéder à [Historique des données - Instantané des données] pour opérer",
|
||||
"snapshotMemo": "Mémo d'instantané",
|
||||
|
@ -182,6 +182,7 @@
|
||||
"keepLazyLoad": "保持已載入的內容",
|
||||
"localSnapshot": "本地快照",
|
||||
"localTagSnapshot": "本地標記的快照",
|
||||
"cloudSnapshot": "雲端快照",
|
||||
"cloudTagSnapshot": "雲端標記的快照",
|
||||
"cloudBackupTip": "請到 [數據歷史 - 數據快照] 中進行操作",
|
||||
"snapshotMemo": "快照備註",
|
||||
|
@ -182,6 +182,7 @@
|
||||
"keepLazyLoad": "保持已加载的内容",
|
||||
"localSnapshot": "本地快照",
|
||||
"localTagSnapshot": "本地标记的快照",
|
||||
"cloudSnapshot": "云端快照",
|
||||
"cloudTagSnapshot": "云端标记的快照",
|
||||
"cloudBackupTip": "请到 [数据历史 - 数据快照] 中进行操作",
|
||||
"snapshotMemo": "快照备注",
|
||||
|
@ -177,6 +177,30 @@ func getRepoSnapshots(c *gin.Context) {
|
||||
}
|
||||
}
|
||||
|
||||
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) {
|
||||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
@ -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)
|
||||
|
@ -44,7 +44,7 @@ require (
|
||||
github.com/radovskyb/watcher v1.0.7
|
||||
github.com/sashabaranov/go-gpt3 v1.4.0
|
||||
github.com/shirou/gopsutil/v3 v3.23.2
|
||||
github.com/siyuan-note/dejavu v0.0.0-20230420114155-e49d9fac7e77
|
||||
github.com/siyuan-note/dejavu v0.0.0-20230421090246-20abbaa745d6
|
||||
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75
|
||||
github.com/siyuan-note/eventbus v0.0.0-20230216103454-41885eac6c2b
|
||||
github.com/siyuan-note/filelock v0.0.0-20230417044524-125ee78b5cc9
|
||||
|
@ -277,8 +277,8 @@ github.com/shopspring/decimal v1.3.1 h1:2Usl1nmF/WZucqkFZhnfFYxxxu8LG21F6nPQBE5g
|
||||
github.com/shopspring/decimal v1.3.1/go.mod h1:DKyhrW/HYNuLGql+MJL6WCR6knT2jwCFRcu2hWCYk4o=
|
||||
github.com/shurcooL/gofontwoff v0.0.0-20181114050219-180f79e6909d h1:lvCTyBbr36+tqMccdGMwuEU+hjux/zL6xSmf5S9ITaA=
|
||||
github.com/shurcooL/gofontwoff v0.0.0-20181114050219-180f79e6909d/go.mod h1:05UtEgK5zq39gLST6uB0cf3NEHjETfB4Fgr3Gx5R9Vw=
|
||||
github.com/siyuan-note/dejavu v0.0.0-20230420114155-e49d9fac7e77 h1:WTmknB4+c/mTn8h0c6GRtEZEi6APUaPTIA+veJbo/Lg=
|
||||
github.com/siyuan-note/dejavu v0.0.0-20230420114155-e49d9fac7e77/go.mod h1:R3PnH4Y9/0TollG4g0tX7jGW7lvhNIEL9hYi5zQ4+sI=
|
||||
github.com/siyuan-note/dejavu v0.0.0-20230421090246-20abbaa745d6 h1:s2BtWsabaCqDlS1D5A7zx63OCzpKjCW6Ke6rwpYhXCg=
|
||||
github.com/siyuan-note/dejavu v0.0.0-20230421090246-20abbaa745d6/go.mod h1:R3PnH4Y9/0TollG4g0tX7jGW7lvhNIEL9hYi5zQ4+sI=
|
||||
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75 h1:Bi7/7f29LW+Fm0cHc0J1NO1cZqyJwljSWVmfOqVZgaE=
|
||||
github.com/siyuan-note/encryption v0.0.0-20220713091850-5ecd92177b75/go.mod h1:H8fyqqAbp9XreANjeSbc72zEdFfKTXYN34tc1TjZwtw=
|
||||
github.com/siyuan-note/eventbus v0.0.0-20230216103454-41885eac6c2b h1:828lTUW2C0uNiolODqoACu7J8sDUzswD4Xo04mUombg=
|
||||
|
@ -672,6 +672,29 @@ func GetCloudRepoTagSnapshots() (ret []*dejavu.Log, err error) {
|
||||
return
|
||||
}
|
||||
|
||||
func GetCloudRepoSnapshots(marker string) (ret []*dejavu.Log, nextMarker string, err error) {
|
||||
ret = []*dejavu.Log{}
|
||||
if 1 > len(Conf.Repo.Key) {
|
||||
err = errors.New(Conf.Language(26))
|
||||
return
|
||||
}
|
||||
|
||||
repo, err := newRepository()
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
|
||||
logs, nextMarker, err := repo.GetCloudRepoLogs(marker)
|
||||
if nil != err {
|
||||
return
|
||||
}
|
||||
ret = logs
|
||||
if 1 > len(ret) {
|
||||
ret = []*dejavu.Log{}
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func GetTagSnapshots() (ret []*Snapshot, err error) {
|
||||
ret = []*Snapshot{}
|
||||
if 1 > len(Conf.Repo.Key) {
|
||||
|
Loading…
Reference in New Issue
Block a user