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

This commit is contained in:
Vanessa 2026-02-13 10:58:14 +08:00
commit 32694808f7
6 changed files with 142 additions and 7 deletions

View file

@ -0,0 +1,33 @@
## Overview
This version improves some details.
## Changelogs
Below are the detailed changes in this version.
### Enhancement
* [Warn users of compatibility issues when used on non-Chromium-based browsers](https://github.com/siyuan-note/siyuan/issues/16981)
* [Improve HTML formula clipping](https://github.com/siyuan-note/siyuan/issues/16998)
* [Remove the inbox in the publish service](https://github.com/siyuan-note/siyuan/issues/16999)
* [Improve editing toolbar on mobile browsers](https://github.com/siyuan-note/siyuan/issues/17006)
* [Improve cursor position after Esc closes the formula edit box](https://github.com/siyuan-note/siyuan/issues/17024)
### Bugfix
* [Rebuilding the index caused a crash](https://github.com/siyuan-note/siyuan/issues/17001)
* [Kernel crash when WPS opens Excel asset](https://github.com/siyuan-note/siyuan/pull/17011)
* [Missing hyperlink address](https://github.com/siyuan-note/siyuan/issues/17017)
* [Document content not updated after snapshot rollback](https://github.com/siyuan-note/siyuan/issues/17026)
* [Database search box shortcut key error](https://github.com/siyuan-note/siyuan/issues/17014)
### Development
* [Fix the issue of the kernel API `updateBlock` clearing document data](https://github.com/siyuan-note/siyuan/issues/16995)
* [Plugin supports saving data in subdirectories](https://github.com/siyuan-note/siyuan/pull/17007)
## Download
* [B3log](https://b3log.org/siyuan/en/download.html)
* [GitHub](https://github.com/siyuan-note/siyuan/releases)

View file

@ -0,0 +1,33 @@
## 概述
此版本改進了一些細節。
## 變更記錄
以下是此版本中的詳細變更。
### 改進功能
* [在非 Chromium 核心的瀏覽器中使用時提醒相容性問題](https://github.com/siyuan-note/siyuan/issues/16981)
* [改進 HTML 公式剪藏](https://github.com/siyuan-note/siyuan/issues/16998)
* [在發布服務中移除收集箱](https://github.com/siyuan-note/siyuan/issues/16999)
* [改進行動瀏覽器上的編輯工具列](https://github.com/siyuan-note/siyuan/issues/17006)
* [改進 Esc 關閉公式編輯框後的遊標位置](https://github.com/siyuan-note/siyuan/issues/17024)
### 修復缺陷
* [重建索引導致崩潰](https://github.com/siyuan-note/siyuan/issues/17001)
* [WPS 開啟 Excel 資源時內核崩潰](https://github.com/siyuan-note/siyuan/pull/17011)
* [超連結網址遺失](https://github.com/siyuan-note/siyuan/issues/17017)
* [回溯快照後文件內容未更新](https://github.com/siyuan-note/siyuan/issues/17026)
* [資料庫搜尋框組合鍵異常](https://github.com/siyuan-note/siyuan/issues/17014)
### 開發重構
* [修復內核 API `updateBlock` 清除文件資料的問題](https://github.com/siyuan-note/siyuan/issues/16995)
* [插件支援將資料保存在子目錄](https://github.com/siyuan-note/siyuan/pull/17007)
## 下載
* [B3log](https://b3log.org/siyuan/download.html)
* [GitHub](https://github.com/siyuan-note/siyuan/releases)

View file

@ -0,0 +1,33 @@
## 概述
此版本改进了一些细节。
## 变更记录
以下是此版本中的详细变更。
### 改进功能
* [在非 Chromium 内核的浏览器中使用时提醒兼容性问题](https://github.com/siyuan-note/siyuan/issues/16981)
* [改进 HTML 公式剪藏](https://github.com/siyuan-note/siyuan/issues/16998)
* [在发布服务中移除收集箱](https://github.com/siyuan-note/siyuan/issues/16999)
* [改进移动浏览器上的编辑工具栏](https://github.com/siyuan-note/siyuan/issues/17006)
* [改进 Esc 关闭公式编辑框后的光标位置](https://github.com/siyuan-note/siyuan/issues/17024)
### 修复缺陷
* [重建索引导致崩溃](https://github.com/siyuan-note/siyuan/issues/17001)
* [WPS 打开 Excel 资源时内核崩溃](https://github.com/siyuan-note/siyuan/pull/17011)
* [超链接地址丢失](https://github.com/siyuan-note/siyuan/issues/17017)
* [回滚快照后文档内容未更新](https://github.com/siyuan-note/siyuan/issues/17026)
* [数据库搜索框组合键异常](https://github.com/siyuan-note/siyuan/issues/17014)
### 开发重构
* [修复内核 API `updateBlock` 清除文档数据的问题](https://github.com/siyuan-note/siyuan/issues/16995)
* [插件支持将数据保存在子目录](https://github.com/siyuan-note/siyuan/pull/17007)
## 下载
* [B3log](https://b3log.org/siyuan/download.html)
* [GitHub](https://github.com/siyuan-note/siyuan/releases)

View file

@ -52,3 +52,7 @@ func SetTreeData(rootID string, raw []byte) {
func RemoveTreeData(rootID string) {
treeCache.Del(rootID)
}
func ClearTreeCache() {
treeCache.Clear()
}

View file

@ -797,6 +797,12 @@ func VacuumDataIndex() {
}
func FullReindex() {
util.PushEndlessProgress(Conf.language(35))
cache.ClearTreeCache()
cache.ClearDocsIAL()
cache.ClearBlocksIAL()
task.AppendTask(task.DatabaseIndexFull, fullReindex)
task.AppendTask(task.DatabaseIndexRef, IndexRefs)
go func() {
@ -804,8 +810,6 @@ func FullReindex() {
ResetVirtualBlockRefCache()
}()
task.AppendTaskWithTimeout(task.DatabaseIndexEmbedBlock, 30*time.Second, autoIndexEmbedBlock)
cache.ClearDocsIAL()
cache.ClearBlocksIAL()
task.AppendTask(task.ReloadUI, util.ReloadUI)
}
@ -816,9 +820,6 @@ func fullReindex() {
pushSQLInsertBlocksFTSMsg, pushSQLDeleteBlocksMsg = false, false
}()
util.PushEndlessProgress(Conf.language(35))
defer util.PushClearProgress()
FlushTxQueue()
if err := sql.InitDatabase(true); err != nil {

View file

@ -28,6 +28,7 @@ import (
"net"
"os"
"path/filepath"
"strings"
"time"
"github.com/88250/gulu"
@ -104,7 +105,7 @@ func validateCert(certPath string) bool {
}
// Check if certificate contains all current IP addresses
currentIPs := GetServerAddrs()
currentIPs := extractIPsFromServerAddrs()
certIPMap := make(map[string]bool)
for _, ip := range cert.IPAddresses {
certIPMap[ip.String()] = true
@ -182,7 +183,7 @@ func generateServerCert(certPath, keyPath string, caCert *x509.Certificate, caKe
net.IPv6loopback,
}
localIPs := GetServerAddrs()
localIPs := extractIPsFromServerAddrs()
for _, ipStr := range localIPs {
ipStr = trimIPv6Brackets(ipStr)
if ip := net.ParseIP(ipStr); ip != nil {
@ -335,3 +336,33 @@ func trimIPv6Brackets(ip string) string {
}
return ip
}
// extractIPsFromServerAddrs extracts IP addresses from server URLs returned by GetServerAddrs()
// GetServerAddrs() returns URLs like "http://192.168.1.1:6806", this function extracts just the IP part
func extractIPsFromServerAddrs() []string {
serverAddrs := GetServerAddrs()
var ips []string
for _, addr := range serverAddrs {
addr = strings.TrimPrefix(addr, "http://")
addr = strings.TrimPrefix(addr, "https://")
if strings.HasPrefix(addr, "[") {
// IPv6 address with brackets
if idx := strings.Index(addr, "]:"); idx != -1 {
addr = addr[1:idx]
} else if strings.HasSuffix(addr, "]") {
addr = addr[1 : len(addr)-1]
}
} else {
// IPv4 address or IPv6 without brackets
if idx := strings.LastIndex(addr, ":"); idx != -1 {
if strings.Count(addr, ":") == 1 {
// IPv4 with port
addr = addr[:idx]
}
}
}
ips = append(ips, addr)
}
return ips
}