Merge remote-tracking branch 'origin/dev' into dev

This commit is contained in:
Vanessa 2023-06-12 12:42:42 +08:00
commit 5560fd03c8
10 changed files with 34 additions and 19 deletions

View file

@ -1,4 +1,6 @@
{
"currentKernel": "Current kernel",
"otherOnlineKernels": "Other online kernels",
"syncPerception": "⚗\uFE0F Sync perception",
"syncPerceptionTip": "After enabling, it will automatically receive and send data sync signals, so that data sync can be performed for all online devices as much as possible in real time (this feature is currently in the experimental stage)",
"hide": "Hide",
@ -1112,7 +1114,7 @@
"147": "Created a new data snapshot, took %.2fs",
"148": "Checked the data snapshot and found no changes, took %.2fs",
"149": "Data snapshot has been synchronized, took %.2fs",
"150": "Uploaded/Downloaded files %d/%d\nUploaded/Downloaded chunks %d/%d\nSent/Received bytes %s/%s",
"150": "uploaded/downloaded files %d/%d\n uploaded/downloaded chunks %d/%d\n sent/received bytes %s/%s",
"151": "Do not include symbols \\ / : * ? " ' < > |",
"152": "Uploaded files %d, chunks %d, sent bytes %s",
"153": "Downloaded files %d, chunks %d, received bytes %s",

View file

@ -1,4 +1,6 @@
{
"currentKernel": "Núcleo actual",
"otherOnlineKernels": "Otros núcleos en línea",
"syncPerception": "⚗\uFE0F Percepción de sincronización",
"syncPerceptionTip": "Después de habilitarlo, automáticamente recibirá y enviará señales de sincronización de datos, de modo que la sincronización de datos se pueda realizar para todos los dispositivos en línea tanto como sea posible en tiempo real (esta función se encuentra actualmente en etapa experimental)",
"hide": "Ocultar",
@ -1112,7 +1114,7 @@
"147": "Creó una nueva instantánea de datos, tomó %.2fs",
"148": "Se ha comprobado la instantánea de los datos y no se encontro ningún cambio, tomó %.2fs",
"149": "La instantánea de datos ha sido sincronizada, ha tomado %.2fs",
"150": "Archivos cargados/descargados %d/%d\nFragmentos cargados/descargados %d/%d\nBytes enviados/recibidos %s/%s",
"150": "archivos cargados/descargados %d/%d\n fragmentos cargados/descargados %d/%d\n bytes enviados/recibidos %s/%s",
"151": "No incluir símbolos \\ / : * ? " ' < > |",
"152": "Archivos cargados %d, fragmentos %d, bytes enviados %s",
"153": "Archivos descargados %d, fragmentos %d, bytes recibidos %s",

View file

@ -1,4 +1,6 @@
{
"currentKernel": "Noyau actuel",
"otherOnlineKernels": "Autres noyaux en ligne",
"syncPerception": "⚗\uFE0F Perception de la synchronisation",
"syncPerceptionTip": "Après l'activation, il recevra et enverra automatiquement des signaux de synchronisation des données, afin que la synchronisation des données puisse être effectuée pour tous les appareils en ligne autant que possible en temps réel (cette fonctionnalité est actuellement en phase expérimentale)",
"hide": "Masquer",
@ -1112,7 +1114,7 @@
"147": "Créé un nouvel instantané de données, a pris %.2fs",
"148": "Vérifié l'instantané des données et n'a trouvé aucun changement, a pris %.2fs",
"149": "L'instantané des données a été synchronisé, a pris %.2fs",
"150": "Fichiers chargés/téléchargés %d/%d\nMorceaux chargés/téléchargés %d/%d\nOctets envoyés/reçus %s/%s",
"150": "fichiers chargés/téléchargés %d/%d\n morceaux chargés/téléchargés %d/%d\n octets envoyés/reçus %s/%s",
"151": "Ne pas inclure les symboles \\ / : * ? " ' < > |",
"152": "Fichiers téléchargés %d, morceaux %d, octets envoyés %s",
"153": "Fichiers chargés %d, morceaux %d, octets reçus %s",

View file

@ -1,4 +1,6 @@
{
"currentKernel": "當前內核",
"otherOnlineKernels": "其他聯機內核",
"syncPerception": "⚗\uFE0F 同步感知",
"syncPerceptionTip": "啟用後將自動接收和發送數據同步信號,這樣可以盡量實時地為所有在線設備進行數據同步(該特性目前處於實驗階段)",
"hide": "隱藏",
@ -1112,7 +1114,7 @@
"147": "創建了一個新的數據快照,耗時 %.2fs",
"148": "檢查數據快照,沒有發現任何變化,耗時 %.2fs",
"149": "已經同步數據快照,耗時 %.2fs",
"150": "上傳/下載文件數 %d/%d\n上傳/下載分塊數 %d/%d\n發送/接收字節數 %s/%s",
"150": "上傳/下載文件數 %d/%d\n 上傳/下載分塊數 %d/%d\n 發送/接收字節數 %s/%s",
"151": "請勿包含符號 \\ / : * ? " ' < > |",
"152": "上傳文件數 %d 上傳分塊數 %d 發送字節數 %s",
"153": "下載文件數 %d 下載分塊數 %d 接收字節數 %s",

View file

@ -1,4 +1,6 @@
{
"currentKernel": "当前内核",
"otherOnlineKernels": "其他联机内核",
"syncPerception": "⚗\uFE0F 同步感知",
"syncPerceptionTip": "启用后将自动接收和发送数据同步信号,这样可以尽量实时地为所有在线设备进行数据同步(该特性目前处于实验阶段)",
"hide": "隐藏",
@ -1114,7 +1116,7 @@
"147": "创建了一个新的数据快照,耗时 %.2fs",
"148": "检查数据快照,没有发现任何变化,耗时 %.2fs",
"149": "已经同步数据快照,耗时 %.2fs",
"150": "上传/下载文件数 %d/%d\n上传/下载分块数 %d/%d\n发送/接收字节数 %s/%s",
"150": "上传/下载文件数 %d/%d\n 上传/下载分块数 %d/%d\n 发送/接收字节数 %s/%s",
"151": "请勿包含符号 \\ / : * ? " ' < > |",
"152": "上传文件数 %d 上传分块数 %d 发送字节数 %s",
"153": "下载文件数 %d 下载分块数 %d 接收字节数 %s",

View file

@ -240,19 +240,22 @@ export const initBar = (app: App) => {
if (!window.siyuan.config.sync.enabled || (0 === window.siyuan.config.sync.provider && needSubscribe(""))) {
html = response.data.stat;
} else {
html = window.siyuan.languages._kernel[82].replace("%s", dayjs(response.data.synced).format("YYYY-MM-DD HH:mm")) + "\n\n"
response.data.kernels.forEach((item: {
os: string;
ver: string;
hostname: string;
id: string;
}) => {
html += `${item.os}-${item.ver} ${item.hostname} ${item.id}\n`
})
html = window.siyuan.languages._kernel[82].replace("%s", dayjs(response.data.synced).format("YYYY-MM-DD HH:mm")) + "\n"
html += " " + response.data.stat;
if (response.data.kernels.length > 0) {
html += "\n"
html += window.siyuan.languages.currentKernel + "\n"
html += " " + response.data.kernel + "/" + window.siyuan.config.system.kernelVersion + " (" + window.siyuan.config.system.os + "/" + window.siyuan.config.system.name + ")\n"
html += window.siyuan.languages.otherOnlineKernels + "\n"
response.data.kernels.forEach((item: {
os: string;
ver: string;
hostname: string;
id: string;
}) => {
html += ` ${item.id}/${item.ver} (${item.os}/${item.hostname}) \n`
})
}
html += response.data.stat;
}
barSyncElement.setAttribute("aria-label", escapeAttr(html));
})

View file

@ -555,6 +555,7 @@ interface IConfig {
port: string
scheme: string
}
name: string
kernelVersion: string
isInsider: boolean
appDir: string

View file

@ -39,6 +39,7 @@ func getSyncInfo(c *gin.Context) {
"synced": model.Conf.Sync.Synced,
"stat": stat,
"kernels": model.GetOnlineKernels(),
"kernel": model.KernelID,
}
}

View file

@ -1175,7 +1175,7 @@ func syncRepo(exit, byHand bool) (err error) {
Conf.Save()
autoSyncErrCount = 0
logging.LogInfof("synced data repo [kernel=%s, provider=%d, ufc=%d, dfc=%d, ucc=%d, dcc=%d, ub=%s, db=%s] in [%.2fs]",
kernelID, Conf.Sync.Provider, trafficStat.UploadFileCount, trafficStat.DownloadFileCount, trafficStat.UploadChunkCount, trafficStat.DownloadChunkCount, humanize.Bytes(uint64(trafficStat.UploadBytes)), humanize.Bytes(uint64(trafficStat.DownloadBytes)), elapsed.Seconds())
KernelID, Conf.Sync.Provider, trafficStat.UploadFileCount, trafficStat.DownloadFileCount, trafficStat.UploadChunkCount, trafficStat.DownloadChunkCount, humanize.Bytes(uint64(trafficStat.UploadBytes)), humanize.Bytes(uint64(trafficStat.DownloadBytes)), elapsed.Seconds())
processSyncMergeResult(exit, byHand, start, mergeResult)
return

View file

@ -623,7 +623,7 @@ func GetOnlineKernels() (ret []*OnlineKernel) {
tmp := onlineKernels
onlineKernelsLock.Unlock()
for _, kernel := range tmp {
if kernel.ID == kernelID {
if kernel.ID == KernelID {
continue
}
@ -740,14 +740,14 @@ func connectSyncWebSocket() {
}()
}
var kernelID = gulu.Rand.String(7)
var KernelID = gulu.Rand.String(7)
func dialSyncWebSocket() (c *websocket.Conn, err error) {
//endpoint := "ws://127.0.0.1:64388" + "/apis/siyuan/dejavu/ws"
endpoint := util.AliyunWebSocketServer + "/apis/siyuan/dejavu/ws"
header := http.Header{
"x-siyuan-uid": []string{Conf.User.UserId},
"x-siyuan-kernel": []string{kernelID},
"x-siyuan-kernel": []string{KernelID},
"x-siyuan-ver": []string{util.Ver},
"x-siyuan-os": []string{runtime.GOOS},
"x-siyuan-hostname": []string{util.GetDeviceName()},