mirror of
https://github.com/siyuan-note/siyuan.git
synced 2026-01-30 20:25:17 +01:00
Merge remote-tracking branch 'origin/dev' into dev
This commit is contained in:
commit
deadace25b
7 changed files with 23 additions and 13 deletions
|
|
@ -163,7 +163,7 @@
|
|||
"downloaded": "Downloaded",
|
||||
"allOp": "All operations",
|
||||
"htmlBlockError": "The execution of the following script will affect the interface display, and the script has stopped running",
|
||||
"fileHistory": "File History",
|
||||
"fileHistory": "File history",
|
||||
"htmlBlockTip": "Multiple HTML blocks are formed. To prevent data loss, please use <code class='fn__code'><div></code> tags to wrap and remove blank lines",
|
||||
"katexMacros": "KaTex macro definition",
|
||||
"katexMacrosTip": "Please use JSON object format (<code class='fn__code'>{}</code>) to wrap macro definitions, eg <code class='fn__code'>{ \"\\\\foo\": \"{x^2}\" }</code>",
|
||||
|
|
@ -225,7 +225,7 @@
|
|||
"includeChildDoc": "Include child documents",
|
||||
"text": "Text",
|
||||
"lastUsed": "Recently used fonts",
|
||||
"removedNotebook": "Removed Notebook",
|
||||
"removedNotebook": "Removed notebook",
|
||||
"querySyntax": "Query Syntax",
|
||||
"rollback": "Rollback",
|
||||
"custom": "Custom",
|
||||
|
|
|
|||
|
|
@ -176,6 +176,8 @@ const bindProviderEvent = () => {
|
|||
<ul class="b3-list">
|
||||
<li class="b3-list-item" style="cursor: auto;">${window.siyuan.languages.upload}<span class="fn__space"></span><span class="ft__on-surface">${response.data.hTrafficUploadSize}</span></li>
|
||||
<li class="b3-list-item" style="cursor: auto;">${window.siyuan.languages.download}<span class="fn__space"></span><span class="ft__on-surface">${response.data.hTrafficDownloadSize}</span></li>
|
||||
<li class="b3-list-item" style="cursor: auto;">API GET<span class="fn__space"></span><span class="ft__on-surface">${response.data.hTrafficAPIGet}</span></li>
|
||||
<li class="b3-list-item" style="cursor: auto;">API PUT<span class="fn__space"></span><span class="ft__on-surface">${response.data.hTrafficAPIPut}</span></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
|
|
|
|||
|
|
@ -83,7 +83,7 @@ func getCloudSpace(c *gin.Context) {
|
|||
ret := gulu.Ret.NewResult()
|
||||
defer c.JSON(http.StatusOK, ret)
|
||||
|
||||
sync, backup, hSize, hAssetSize, hTotalSize, exchangeSize, hTrafficUploadSize, hTrafficDownloadSize, err := model.GetCloudSpace()
|
||||
sync, backup, hSize, hAssetSize, hTotalSize, exchangeSize, hTrafficUploadSize, hTrafficDownloadSize, htrafficAPIGet, hTrafficAPIPut, err := model.GetCloudSpace()
|
||||
if nil != err {
|
||||
ret.Code = 1
|
||||
ret.Msg = err.Error()
|
||||
|
|
@ -100,6 +100,8 @@ func getCloudSpace(c *gin.Context) {
|
|||
"hExchangeSize": exchangeSize,
|
||||
"hTrafficUploadSize": hTrafficUploadSize,
|
||||
"hTrafficDownloadSize": hTrafficDownloadSize,
|
||||
"hTrafficAPIGet": htrafficAPIGet,
|
||||
"hTrafficAPIPut": hTrafficAPIPut,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ type User struct {
|
|||
UserSiYuanAssetSize float64 `json:"userSiYuanAssetSize"`
|
||||
UserTrafficUpload float64 `json:"userTrafficUpload"`
|
||||
UserTrafficDownload float64 `json:"userTrafficDownload"`
|
||||
UserTrafficAPIGet float64 `json:"userTrafficAPIGet"`
|
||||
UserTrafficAPIPut float64 `json:"userTrafficAPIPut"`
|
||||
UserTrafficTime float64 `json:"userTrafficTime"`
|
||||
UserSiYuanSubscriptionPlan float64 `json:"userSiYuanSubscriptionPlan"` // -1:未订阅,0:标准订阅,1:教育订阅,2:试用
|
||||
UserSiYuanSubscriptionStatus float64 `json:"userSiYuanSubscriptionStatus"` // -1:未订阅,0:订阅可用,1:订阅封禁,2:订阅过期
|
||||
|
|
|
|||
|
|
@ -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-20230419110639-dc62c252b60b
|
||||
github.com/siyuan-note/dejavu v0.0.0-20230420022535-782a2dbfb757
|
||||
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
|
||||
|
|
@ -68,7 +68,7 @@ require (
|
|||
github.com/alecthomas/chroma v0.10.0 // indirect
|
||||
github.com/andybalholm/cascadia v1.3.1 // indirect
|
||||
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef // indirect
|
||||
github.com/aws/aws-sdk-go v1.44.245 // indirect
|
||||
github.com/aws/aws-sdk-go v1.44.246 // indirect
|
||||
github.com/bytedance/sonic v1.8.5 // indirect
|
||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311 // indirect
|
||||
|
|
@ -128,7 +128,7 @@ require (
|
|||
github.com/yusufpapurcu/wmi v1.2.2 // indirect
|
||||
golang.org/x/arch v0.3.0 // indirect
|
||||
golang.org/x/crypto v0.8.0 // indirect
|
||||
golang.org/x/exp v0.0.0-20230418202329-0354be287a23 // indirect
|
||||
golang.org/x/exp v0.0.0-20230419192730-864b3d6c5c2c // indirect
|
||||
golang.org/x/net v0.9.0 // indirect
|
||||
golang.org/x/sync v0.1.0 // indirect
|
||||
golang.org/x/sys v0.7.0 // indirect
|
||||
|
|
|
|||
|
|
@ -37,8 +37,8 @@ github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de h1:FxWPpzIjnTlhP
|
|||
github.com/araddon/dateparse v0.0.0-20210429162001-6b43995a97de/go.mod h1:DCaWoUhZrYW9p1lxo/cm8EmUOOzAPSEZNGF2DK1dJgw=
|
||||
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef h1:2JGTg6JapxP9/R33ZaagQtAM4EkkSYnIAlOG5EI8gkM=
|
||||
github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef/go.mod h1:JS7hed4L1fj0hXcyEejnW57/7LCetXggd+vwrRnYeII=
|
||||
github.com/aws/aws-sdk-go v1.44.245 h1:KtY2s4q31/kn33AdV63R5t77mdxsI7rq3YT7Mgo805M=
|
||||
github.com/aws/aws-sdk-go v1.44.245/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
|
||||
github.com/aws/aws-sdk-go v1.44.246 h1:iLxPX6JU0bxAci9R6/bp8rX0kL871ByCTx0MZlQWv1U=
|
||||
github.com/aws/aws-sdk-go v1.44.246/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
|
||||
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
|
||||
github.com/bytedance/sonic v1.8.5 h1:kjX0/vo5acEQ/sinD/18SkA/lDDUk23F0RcaHvI7omc=
|
||||
github.com/bytedance/sonic v1.8.5/go.mod h1:i736AoUSYt75HyZLoJW9ERYxcy6eaN6h4BZXU064P/U=
|
||||
|
|
@ -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-20230419110639-dc62c252b60b h1:F/gO3DIvFHKbl9oJyV5UZ0SAuOpCDafwc/VIwrSlNp4=
|
||||
github.com/siyuan-note/dejavu v0.0.0-20230419110639-dc62c252b60b/go.mod h1:uX8glu/TOY5a10e1VOqAV3/92MslpxEN+W4zUtUSFVo=
|
||||
github.com/siyuan-note/dejavu v0.0.0-20230420022535-782a2dbfb757 h1:WZ0ahzQ2rLJlry4GgMbVXYyG1tJpmbU2VXsdRZAq/D4=
|
||||
github.com/siyuan-note/dejavu v0.0.0-20230420022535-782a2dbfb757/go.mod h1:ltB1VyRo4A178+ykH74f3AEUliU0UwC6Dn7Ed6tF/8Y=
|
||||
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=
|
||||
|
|
@ -351,8 +351,8 @@ golang.org/x/crypto v0.3.0/go.mod h1:hebNnKkNXi2UzZN1eVRvBB7co0a+JxK6XbPiWVs/3J4
|
|||
golang.org/x/crypto v0.8.0 h1:pd9TJtTueMTVQXzk8E2XESSMQDj/U7OUu0PqJqPXQjQ=
|
||||
golang.org/x/crypto v0.8.0/go.mod h1:mRqEX+O9/h5TFCrQhkgjo2yKi0yYA+9ecGkdQoHrywE=
|
||||
golang.org/x/exp v0.0.0-20190731235908-ec7cb31e5a56/go.mod h1:JhuoJpWY28nO4Vef9tZUw9qufEGTyX1+7lmHxV5q5G4=
|
||||
golang.org/x/exp v0.0.0-20230418202329-0354be287a23 h1:4NKENAGIctmZYLK9W+X1kDK8ObBFqOSCJM6WE7CvkJY=
|
||||
golang.org/x/exp v0.0.0-20230418202329-0354be287a23/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
|
||||
golang.org/x/exp v0.0.0-20230419192730-864b3d6c5c2c h1:HDdYQYKOkvJT/Plb5HwJJywTVyUnIctjQm6XSnZ/0CY=
|
||||
golang.org/x/exp v0.0.0-20230419192730-864b3d6c5c2c/go.mod h1:CxIveKay+FTh1D0yPZemJVgC/95VzuuOLq5Qi4xnoYc=
|
||||
golang.org/x/image v0.0.0-20190227222117-0694c2d4d067/go.mod h1:kZ7UVZpmo3dzQBMxlp+ypCbDeSB+sBbTgSJuh5dn5js=
|
||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b/go.mod h1:FeLwcggjj3mMvU+oOTbSwawSJRM1uh48EjtB4UJZlP0=
|
||||
golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM=
|
||||
|
|
|
|||
|
|
@ -1599,7 +1599,7 @@ type Sync struct {
|
|||
SaveDir string `json:"saveDir"` // 本地同步数据存放目录路径
|
||||
}
|
||||
|
||||
func GetCloudSpace() (s *Sync, b *Backup, hSize, hAssetSize, hTotalSize, hExchangeSize, hTrafficUploadSize, hTrafficDownloadSize string, err error) {
|
||||
func GetCloudSpace() (s *Sync, b *Backup, hSize, hAssetSize, hTotalSize, hExchangeSize, hTrafficUploadSize, hTrafficDownloadSize, hTrafficAPIGet, hTrafficAPIPut string, err error) {
|
||||
stat, err := getCloudSpaceOSS()
|
||||
if nil != err {
|
||||
err = errors.New(Conf.Language(30) + " " + err.Error())
|
||||
|
|
@ -1630,6 +1630,8 @@ func GetCloudSpace() (s *Sync, b *Backup, hSize, hAssetSize, hTotalSize, hExchan
|
|||
hExchangeSize = "-"
|
||||
hTrafficUploadSize = "-"
|
||||
hTrafficDownloadSize = "-"
|
||||
hTrafficAPIGet = "-"
|
||||
hTrafficAPIPut = "-"
|
||||
if conf.ProviderSiYuan == Conf.Sync.Provider {
|
||||
s.HSize = humanize.Bytes(uint64(syncSize))
|
||||
b.HSize = humanize.Bytes(uint64(backupSize))
|
||||
|
|
@ -1639,6 +1641,8 @@ func GetCloudSpace() (s *Sync, b *Backup, hSize, hAssetSize, hTotalSize, hExchan
|
|||
hExchangeSize = humanize.Bytes(uint64(Conf.User.UserSiYuanPointExchangeRepoSize))
|
||||
hTrafficUploadSize = humanize.Bytes(uint64(Conf.User.UserTrafficUpload))
|
||||
hTrafficDownloadSize = humanize.Bytes(uint64(Conf.User.UserTrafficDownload))
|
||||
hTrafficAPIGet = fmt.Sprintf("%d", int(Conf.User.UserTrafficAPIGet))
|
||||
hTrafficAPIPut = fmt.Sprintf("%d", int(Conf.User.UserTrafficAPIPut))
|
||||
}
|
||||
return
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue