diff --git a/.github/workflows/auto_aur_release_stable.yml b/.github/workflows/auto_aur_release_stable.yml new file mode 100644 index 000000000..09cd65f3c --- /dev/null +++ b/.github/workflows/auto_aur_release_stable.yml @@ -0,0 +1,84 @@ +name: Upload to AUR + +on: + release: + types: [published] + +jobs: + build: + runs-on: ubuntu-latest + steps: + + - name: Check tag aka check release type + id: checktag + run: | + if [[ "${{ github.ref }}" == *"dev"* ]]; then + echo "Skip the workflow as the tag contains 'dev'" + echo "::set-output name=skip::true" + else + echo "Continue the workflow" + echo "::set-output name=skip::false" + fi + shell: bash + + - name: Extract tag name + id: get_version + run: echo ::set-output name=TAG_VERSION::${{ github.event.release.tag_name }} + + - name: Extra tag name without v + id: get_version_without_v + run: echo ::set-output name=TAG_VERSION_WITHOUT_V::$(echo "${{ github.event.release.tag_name }}" | sed 's/^v//') + + - name: Extract package_file_name + id: get_package_file_name + run: echo ::set-output name=PACKAGE_FILE_NAME::siyuan-${{ steps.get_version_without_v.outputs.TAG_VERSION_WITHOUT_V }}-linux.AppImage + + - name: Create PKGBUILD + run: | + cat << EOF >> PKGBUILD + # maintainer: zxkmm (IHp4a21tQGhvdG1haWwuY29t) + # auto running on siyuan official repo + # PKGBUILD is modified from https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=siyuan-appimage + # which is made by vvxxp8 + + pkgname=siyuan_stable + pkgver=${{ steps.get_version.outputs.TAG_VERSION }} + pkgrel=0 + pkgdesc="auto upload to AUR when SiYuan stable release" + arch=("x86_64") + url="https://b3log.org/siyuan" + license=("AGPL-3.0-only") + _pkgname=${{ steps.get_package_file_name.outputs.PACKAGE_FILE_NAME }} + noextract=(${{ steps.get_package_file_name.outputs.PACKAGE_FILE_NAME }}) + options=("!strip" "!debug") + depends=("fuse2") + optdepends=('pandoc: docx export') + source=("\${_pkgname}::https://github.com/siyuan-note/siyuan/releases/download/${{ steps.get_version.outputs.TAG_VERSION }}/${{ steps.get_package_file_name.outputs.PACKAGE_FILE_NAME }}") + sha256sums=('SKIP') + + _installdir=/opt/appimages + + prepare() { + chmod a+x \${_pkgname} + ./\${_pkgname} --appimage-extract >/dev/null + sed -i "s+AppRun+\${_installdir}/siyuan.AppImage+" "squashfs-root/siyuan.desktop" + sed -i "s+^Icon=.*+Icon=siyuan_stable+" "squashfs-root/siyuan.desktop" + } + + package() { + install -Dm755 \${_pkgname} "\${pkgdir}/\${_installdir}/siyuan.AppImage" + install -Dm644 "squashfs-root/resources/stage/icon.png" "\${pkgdir}/usr/share/icons/hicolor/512x512/apps/siyuan_stable.png" + install -Dm644 "squashfs-root/siyuan.desktop" "\${pkgdir}/usr/share/applications/siyuan_stable.desktop" + } + EOF + + - name: Publish AUR package + uses: KSXGitHub/github-actions-deploy-aur@v2.7.1 + with: + pkgname: siyuan_stable + pkgbuild: ./PKGBUILD + commit_username: ${{ secrets.AUR_USERNAME }} + commit_email: ${{ secrets.AUR_EMAIL }} + ssh_private_key: ${{ secrets.AUR_SSH_PRIVATE_KEY }} + commit_message: Update AUR package + ssh_keyscan_types: rsa,dsa,ecdsa,ed25519 diff --git a/app/electron/main.js b/app/electron/main.js index 66a1c1863..045dcc9b5 100644 --- a/app/electron/main.js +++ b/app/electron/main.js @@ -551,7 +551,7 @@ const initKernel = (workspace, port, lang) => { errorWindowId = showErrorWindow("⚠️ 初始化工作空间失败 Failed to create workspace directory", "
初始化工作空间失败。
Failed to init workspace.
"); break; case 26: - errorWindowId = showErrorWindow("🚒 已成功避免潜在的数据损坏
Successfully avoid potential data corruption", "
工作空间下的文件正在被第三方软件(比如同步盘 iCloud/OneDrive/Dropbox/Google Drive/坚果云/百度网盘/腾讯微云等)扫描读取占用,继续使用会导致数据损坏,思源内核已经安全退出。

请将工作空间移动到其他路径后再打开,停止同步盘同步工作空间。如果以上步骤无法解决问题,请参考这里或者发帖寻求帮助。

The files in the workspace are being scanned and read by third-party software (such as sync disk iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun, etc.), continuing to use it will cause data corruption, and the SiYuan kernel is already safe shutdown.

Move the workspace to another path and open it again, stop the sync disk to sync the workspace. If the above steps do not resolve the issue, please look for help or report bugs here.
"); + errorWindowId = showErrorWindow("🚒 已成功避免潜在的数据损坏
Successfully avoid potential data corruption", "
工作空间下的文件正在被第三方软件(比如同步盘 iCloud/OneDrive/Dropbox/Google Drive/坚果云/百度网盘/腾讯微云等)扫描读取占用,继续使用会导致数据损坏,思源内核已经安全退出。

请将工作空间移动到其他路径后再打开,停止同步盘同步工作空间。如果以上步骤无法解决问题,请参考这里或者发帖寻求帮助。

The files in the workspace are being scanned and read by third-party software (such as sync disk iCloud/OneDrive/Dropbox/Google Drive/Nutstore/Baidu Netdisk/Tencent Weiyun, etc.), continuing to use it will cause data corruption, and the SiYuan kernel is already safe shutdown.

Move the workspace to another path and open it again, stop the sync disk to sync the workspace. If the above steps do not resolve the issue, please look for help or report bugs here.
"); break; case 0: break; diff --git a/kernel/go.mod b/kernel/go.mod index 62e5ca0bb..8993a5ea2 100644 --- a/kernel/go.mod +++ b/kernel/go.mod @@ -34,7 +34,7 @@ require ( github.com/goccy/go-json v0.10.2 github.com/gofrs/flock v0.8.1 github.com/gorilla/websocket v1.5.1 - github.com/imroc/req/v3 v3.43.3 + github.com/imroc/req/v3 v3.43.4 github.com/jinzhu/copier v0.4.0 github.com/json-iterator/go v1.1.12 github.com/klippa-app/go-pdfium v1.12.0 @@ -50,11 +50,11 @@ require ( github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06 github.com/sashabaranov/go-openai v1.23.0 github.com/shirou/gopsutil/v3 v3.24.4 - github.com/siyuan-note/dejavu v0.0.0-20240505150554-89d085757f43 + github.com/siyuan-note/dejavu v0.0.0-20240508123239-9af3b3980580 github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4 github.com/siyuan-note/eventbus v0.0.0-20240318125243-801c98e8f025 github.com/siyuan-note/filelock v0.0.0-20240505150405-3de3a406d257 - github.com/siyuan-note/httpclient v0.0.0-20240429013218-3caa1f89f9ed + github.com/siyuan-note/httpclient v0.0.0-20240508122621-884dfb6b5eee github.com/siyuan-note/logging v0.0.0-20240505035402-6430d57006a2 github.com/siyuan-note/riff v0.0.0-20240502024535-718add51db67 github.com/spf13/cast v1.6.0 @@ -80,7 +80,7 @@ require ( github.com/andybalholm/brotli v1.1.0 // indirect github.com/andybalholm/cascadia v1.3.2 // indirect github.com/asaskevich/EventBus v0.0.0-20200907212545-49d423059eef // indirect - github.com/aws/aws-sdk-go v1.52.2 // indirect + github.com/aws/aws-sdk-go v1.52.4 // indirect github.com/bytedance/sonic v1.11.6 // indirect github.com/bytedance/sonic/loader v0.1.1 // indirect github.com/cespare/xxhash/v2 v2.3.0 // indirect @@ -100,7 +100,7 @@ require ( github.com/go-task/slim-sprig/v3 v3.0.0 // indirect github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect github.com/golang/glog v1.2.1 // indirect - github.com/google/pprof v0.0.0-20240430035430-e4905b036c4e // indirect + github.com/google/pprof v0.0.0-20240507183855-6f11f98ebb1c // indirect github.com/google/uuid v1.6.0 // indirect github.com/gopherjs/gopherjs v1.17.2 // indirect github.com/gorilla/context v1.1.2 // indirect @@ -129,7 +129,7 @@ require ( github.com/modern-go/reflect2 v1.0.2 // indirect github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826 // indirect github.com/olekukonko/tablewriter v0.0.5 // indirect - github.com/onsi/ginkgo/v2 v2.17.2 // indirect + github.com/onsi/ginkgo/v2 v2.17.3 // indirect github.com/otiai10/gosseract/v2 v2.4.1 // indirect github.com/pelletier/go-toml/v2 v2.2.2 // indirect github.com/pkg/errors v0.9.1 // indirect @@ -157,12 +157,12 @@ require ( github.com/yusufpapurcu/wmi v1.2.4 // indirect go.uber.org/mock v0.4.0 // indirect golang.org/x/arch v0.8.0 // indirect - golang.org/x/crypto v0.22.0 // indirect - golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f // indirect - golang.org/x/net v0.24.0 // indirect + golang.org/x/crypto v0.23.0 // indirect + golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 // indirect + golang.org/x/net v0.25.0 // indirect golang.org/x/sync v0.7.0 // indirect golang.org/x/sys v0.20.0 // indirect - golang.org/x/tools v0.20.0 // indirect + golang.org/x/tools v0.21.0 // indirect google.golang.org/protobuf v1.34.0 // indirect gopkg.in/yaml.v2 v2.4.0 // indirect gopkg.in/yaml.v3 v3.0.1 // indirect diff --git a/kernel/go.sum b/kernel/go.sum index 7a71265d2..714edb4b9 100644 --- a/kernel/go.sum +++ b/kernel/go.sum @@ -50,8 +50,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.52.2 h1:l4g9wBXRBlvCtScvv4iLZCzLCtR7BFJcXOnOGQ20orw= -github.com/aws/aws-sdk-go v1.52.2/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= +github.com/aws/aws-sdk-go v1.52.4 h1:9VsBVJ2TKf8xPP3+yIPGSYcEBIEymXsJzQoFgQuyvA0= +github.com/aws/aws-sdk-go v1.52.4/go.mod h1:LF8svs817+Nz+DmiMQKTO3ubZ/6IaTpq3TjupRn3Eqk= github.com/bytedance/sonic v1.11.6 h1:oUp34TzMlL+OY1OUWxHqsdkgC/Zfc85zGqw9siXjrc0= github.com/bytedance/sonic v1.11.6/go.mod h1:LysEHSvpvDySVdC2f87zGWf6CIKJcAvqab1ZaiQtds4= github.com/bytedance/sonic/loader v0.1.1 h1:c+e5Pt1k/cy5wMveRDyk2X4B9hF4g7an8N3zCYjJFNM= @@ -161,8 +161,8 @@ github.com/google/go-cmp v0.6.0/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeN github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= github.com/google/gofuzz v1.2.0 h1:xRy4A+RhZaiKjJ1bPfwQ8sedCA+YS2YcCHW6ec7JMi0= github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg= -github.com/google/pprof v0.0.0-20240430035430-e4905b036c4e h1:RsXNnXE59RTt8o3DcA+w7ICdRfR2l+Bb5aE0YMpNTO8= -github.com/google/pprof v0.0.0-20240430035430-e4905b036c4e/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= +github.com/google/pprof v0.0.0-20240507183855-6f11f98ebb1c h1:GCixZ7sgey01Kjw8pxBzCD0uVrubxl8SRzRgI0jwP+A= +github.com/google/pprof v0.0.0-20240507183855-6f11f98ebb1c/go.mod h1:kf6iHlnVGwgKolg33glAes7Yg/8iWP8ukqeldJSO7jw= github.com/google/uuid v1.1.1/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= @@ -193,8 +193,8 @@ github.com/iancoleman/strcase v0.3.0/go.mod h1:iwCmte+B7n89clKwxIoIXy/HfoL7AsD47 github.com/imdario/mergo v0.3.11/go.mod h1:jmQim1M+e3UYxmgPu/WyfjB3N3VflVyUjjjwH0dnCYA= github.com/imdario/mergo v0.3.16 h1:wwQJbIsHYGMUyLSPrEq1CT16AhnhNJQ51+4fdHUnCl4= github.com/imdario/mergo v0.3.16/go.mod h1:WBLT9ZmE3lPoWsEzCh9LPo3TiwVN+ZKEjmz+hD27ysY= -github.com/imroc/req/v3 v3.43.3 h1:WdZhpUev9THtuwEZsW2LOYacl12fm7IkB7OgACv40+k= -github.com/imroc/req/v3 v3.43.3/go.mod h1:SQIz5iYop16MJxbo8ib+4LnostGCok8NQf8ToyQc2xA= +github.com/imroc/req/v3 v3.43.4 h1:NSXlB5dELZuxzGEFRWLWEQ9dQmh8d9pUMPa7MevK1K4= +github.com/imroc/req/v3 v3.43.4/go.mod h1:SQIz5iYop16MJxbo8ib+4LnostGCok8NQf8ToyQc2xA= github.com/jaytaylor/html2text v0.0.0-20180606194806-57d518f124b0/go.mod h1:CVKlgaMiht+LXvHG173ujK6JUhZXKb2u/BQtjPDIvyk= github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056 h1:iCHtR9CQyktQ5+f3dMVZfwD2KWJUgm7M0gdL9NGr8KA= github.com/jaytaylor/html2text v0.0.0-20230321000545-74c2419ad056/go.mod h1:CVKlgaMiht+LXvHG173ujK6JUhZXKb2u/BQtjPDIvyk= @@ -272,8 +272,8 @@ github.com/olahol/melody v1.2.1/go.mod h1:GgkTl6Y7yWj/HtfD48Q5vLKPVoZOH+Qqgfa7Cv github.com/olekukonko/tablewriter v0.0.0-20180506121414-d4647c9c7a84/go.mod h1:vsDQFd/mU46D+Z4whnwzcISnGGzXWMclvtLoiIKAKIo= github.com/olekukonko/tablewriter v0.0.5 h1:P2Ga83D34wi1o9J6Wh1mRuqd4mF/x/lgBS7N7AbDhec= github.com/olekukonko/tablewriter v0.0.5/go.mod h1:hPp6KlRPjbx+hW8ykQs1w3UBbZlj6HuIJcUGPhkA7kY= -github.com/onsi/ginkgo/v2 v2.17.2 h1:7eMhcy3GimbsA3hEnVKdw/PQM9XN9krpKVXsZdph0/g= -github.com/onsi/ginkgo/v2 v2.17.2/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc= +github.com/onsi/ginkgo/v2 v2.17.3 h1:oJcvKpIb7/8uLpDDtnQuf18xVnwKp8DTD7DQ6gTd/MU= +github.com/onsi/ginkgo/v2 v2.17.3/go.mod h1:nP2DPOQoNsQmsVyv5rDA8JkXQoCs6goXIvr/PRJ1eCc= github.com/onsi/gomega v1.33.0 h1:snPCflnZrpMsy94p4lXVEkHo12lmPnc3vY5XBbreexE= github.com/onsi/gomega v1.33.0/go.mod h1:+925n5YtiFsLzzafLUHzVMBpvvRAzrydIBiSIxjX3wY= github.com/open-spaced-repetition/go-fsrs v1.2.1 h1:vY1hSQ3gvHtfnw8ahylcZyyqusKWDkWCd1+ca4lZoSc= @@ -345,16 +345,16 @@ github.com/shopspring/decimal v1.4.0/go.mod h1:gawqmDU56v4yIKSwfBSFip1HdCCXN8/+D 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/simplereach/timeutils v1.2.0/go.mod h1:VVbQDfN/FHRZa1LSqcwo4kNZ62OOyqLLGQKYB3pB0Q8= -github.com/siyuan-note/dejavu v0.0.0-20240505150554-89d085757f43 h1:fp2fGOQDA3sD57DzciLd2DvdVhJL+/E5Wn23k3BxwE8= -github.com/siyuan-note/dejavu v0.0.0-20240505150554-89d085757f43/go.mod h1:wPzMa8827YU1xsH3x/OhnINZyrT98ICjlOOP750Obmk= +github.com/siyuan-note/dejavu v0.0.0-20240508123239-9af3b3980580 h1:lOR8MwzvSEy9VWY/2GGbZVOzxAUqcBGO548aerFkULw= +github.com/siyuan-note/dejavu v0.0.0-20240508123239-9af3b3980580/go.mod h1:64NLvLojiApi1YtQ41+QG8KpDKLDC53NIWnJKFVI/8s= github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4 h1:kJaw5L/evyW6LcB9IQT8PR4ppx8JVqOFP9Ix3rfwSrc= github.com/siyuan-note/encryption v0.0.0-20231219001248-1e028a4d13b4/go.mod h1:UYcCCY+0wh+GmUoDOaO63j1sV5lgy7laLAk1XhEiUis= github.com/siyuan-note/eventbus v0.0.0-20240318125243-801c98e8f025 h1:crQmKw5vZz3MljAP/xKMWY/rksMX634jJK9kcsOIbkw= github.com/siyuan-note/eventbus v0.0.0-20240318125243-801c98e8f025/go.mod h1:1/nGgthl89FPA7GzAcEWKl6zRRnfgyTjzLZj9bW7kuw= github.com/siyuan-note/filelock v0.0.0-20240505150405-3de3a406d257 h1:lA6qBehxciYKye8LpP59LHGC8DQkkJkg7AYA4VoF+g8= github.com/siyuan-note/filelock v0.0.0-20240505150405-3de3a406d257/go.mod h1:vUXGLmTVIg5trcnNWGkMCwc3EuIJaXXx3hQzgno1Hn4= -github.com/siyuan-note/httpclient v0.0.0-20240429013218-3caa1f89f9ed h1:QBPxwSsWnAxxnEKYn3ycvFxj61vfpD8q4zTtLH9iN9w= -github.com/siyuan-note/httpclient v0.0.0-20240429013218-3caa1f89f9ed/go.mod h1:qQsrqhPrCPJwjpHQetGcLCBh7bBCpoJ7P1uXoXJiClY= +github.com/siyuan-note/httpclient v0.0.0-20240508122621-884dfb6b5eee h1:d+Ess3WhPBgA+sRk5WRNYX9QDgPYcg+TN7O9ij5iER4= +github.com/siyuan-note/httpclient v0.0.0-20240508122621-884dfb6b5eee/go.mod h1:x2emxu7dbNWavPoUCczZmV3J+MyHxCrSDuCzSS8pzro= github.com/siyuan-note/logging v0.0.0-20240505035402-6430d57006a2 h1:/2+tlOThVB86RxSLeW0JFw2ISUrH2ZFRg15ULGAUGAE= github.com/siyuan-note/logging v0.0.0-20240505035402-6430d57006a2/go.mod h1:3Osd2/nwzXZFl6ZcDE4hA0HD83Wyv1fds47nVuapyOM= github.com/siyuan-note/riff v0.0.0-20240502024535-718add51db67 h1:YuBxDIIVBOtvQc/ZLi4SOCY0J+QMRnnco4b1Jh9+SL4= @@ -434,10 +434,10 @@ golang.org/x/crypto v0.14.0/go.mod h1:MVFd36DqK4CsrnJYDkBA3VC4m2GkXAM0PvzMCn4JQf golang.org/x/crypto v0.17.0/go.mod h1:gCAAfMLgwOJRpTjQ2zCCt2OcSfYMTeZVSRtQlPC7Nq4= golang.org/x/crypto v0.19.0/go.mod h1:Iy9bg/ha4yyC70EfRS8jz+B6ybOBKMaSxLj6P6oBDfU= golang.org/x/crypto v0.21.0/go.mod h1:0BP7YvVV9gBbVKyeTG0Gyn+gZm94bibOW5BjDEYAOMs= -golang.org/x/crypto v0.22.0 h1:g1v0xeRhjcugydODzvb3mEM9SQ0HGp9s/nh3COQ/C30= -golang.org/x/crypto v0.22.0/go.mod h1:vr6Su+7cTlO45qkww3VDJlzDn0ctJvRgYbC2NvXHt+M= -golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f h1:99ci1mjWVBWwJiEKYY6jWa4d2nTQVIEhZIptnrVb1XY= -golang.org/x/exp v0.0.0-20240416160154-fe59bbe5cc7f/go.mod h1:/lliqkxwWAhPjf5oSOIJup2XcqJaw8RGS6k3TGEc7GI= +golang.org/x/crypto v0.23.0 h1:dIJU/v2J8Mdglj/8rJ6UUOM3Zc9zLZxVZwwxMooUSAI= +golang.org/x/crypto v0.23.0/go.mod h1:CKFgDieR+mRhux2Lsu27y0fO304Db0wZe70UKqHu0v8= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842 h1:vr/HnozRka3pE4EsMEg1lgkXJkTFJCVUX+S/ZT6wYzM= +golang.org/x/exp v0.0.0-20240506185415-9bf2ced13842/go.mod h1:XtvwrStGgqGPLc4cjQfWqZHG1YFdYs6swckp8vpsjnc= golang.org/x/image v0.0.0-20210628002857-a66eb6448b8d/go.mod h1:023OzeP/+EPmXeapQh35lcL3II3LrY8Ic+EFFKVhULM= golang.org/x/image v0.16.0 h1:9kloLAKhUufZhA12l5fwnx2NZW39/we1UhBesW433jw= golang.org/x/image v0.16.0/go.mod h1:ugSZItdV4nOxyqp56HmXwH0Ry0nBCpjnZdpDaIHdoPs= @@ -462,8 +462,8 @@ golang.org/x/net v0.10.0/go.mod h1:0qNGK6F8kojg2nk9dLZ2mShWaEBan6FAoqfSigmmuDg= golang.org/x/net v0.17.0/go.mod h1:NxSsAGuq816PNPmqtQdLE42eU2Fs7NoRIZrHJAlaCOE= golang.org/x/net v0.21.0/go.mod h1:bIjVDfnllIU7BJ2DNgfnXvpSvtn8VRwhlsaeUTyUS44= golang.org/x/net v0.22.0/go.mod h1:JKghWKKOSdJwpW2GEx0Ja7fmaKnMsbu+MWVZTokSYmg= -golang.org/x/net v0.24.0 h1:1PcaxkF854Fu3+lvBIx5SYn9wRlBzzcnHZSiaFFAb0w= -golang.org/x/net v0.24.0/go.mod h1:2Q7sJY5mzlzWjKtYUEXSlBWCdyaioyXzRB2RtU8KVE8= +golang.org/x/net v0.25.0 h1:d/OCCoBEUq33pjydKrGQhw7IlUPI2Oylr+8qLx49kac= +golang.org/x/net v0.25.0/go.mod h1:JkAGAh7GEvH74S6FOH42FLoXpXbE/aqXSrIQjXgsiwM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.1.0/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= @@ -528,8 +528,8 @@ golang.org/x/tools v0.0.0-20190328211700-ab21143f2384/go.mod h1:LCzVGOaR6xXOjkQ3 golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo= golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc= golang.org/x/tools v0.6.0/go.mod h1:Xwgl3UAJ/d3gWutnCtw505GrjyAbvKui8lOU390QaIU= -golang.org/x/tools v0.20.0 h1:hz/CVckiOxybQvFw6h7b/q80NTr9IUQb4s1IIzW7KNY= -golang.org/x/tools v0.20.0/go.mod h1:WvitBU7JJf6A4jOdg4S1tviW9bhUxkgeCui/0JHctQg= +golang.org/x/tools v0.21.0 h1:qc0xYgIbsSDt9EyWz05J5wfa7LOVW0YTLOXrqdLAWIw= +golang.org/x/tools v0.21.0/go.mod h1:aiJjzUbINMkxbQROHiO6hDPo2LHcIPhhQsa9DLh0yGk= golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0= google.golang.org/protobuf v1.34.0 h1:Qo/qEd2RZPCf2nKuorzksSknv0d3ERwp1vFG38gSmH4= diff --git a/kernel/model/attribute_view.go b/kernel/model/attribute_view.go index a7985513f..d30f04f48 100644 --- a/kernel/model/attribute_view.go +++ b/kernel/model/attribute_view.go @@ -1087,10 +1087,22 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View, query s if nil != tableCell.Value && nil != tableCell.Value.Relation { tableCell.Value.Relation.Contents = nil } - case av.KeyTypeText: // 渲染文本列 + case av.KeyTypeText: if nil != tableCell.Value && nil != tableCell.Value.Text { tableCell.Value.Text.Content = util.EscapeHTML(tableCell.Value.Text.Content) } + case av.KeyTypeEmail: + if nil != tableCell.Value && nil != tableCell.Value.Email { + tableCell.Value.Email.Content = util.EscapeHTML(tableCell.Value.Email.Content) + } + case av.KeyTypeURL: + if nil != tableCell.Value && nil != tableCell.Value.URL { + tableCell.Value.URL.Content = util.EscapeHTML(tableCell.Value.URL.Content) + } + case av.KeyTypePhone: + if nil != tableCell.Value && nil != tableCell.Value.Phone { + tableCell.Value.Phone.Content = util.EscapeHTML(tableCell.Value.Phone.Content) + } } treenode.FillAttributeViewTableCellNilValue(tableCell, rowID, col.ID) @@ -2341,6 +2353,12 @@ func addAttributeViewBlock(avID, blockID, previousBlockID, addingBlockID, adding continue } + if av.KeyTypeBlock == newValue.Type { + // 如果是主键的话前面已经添加过了,这里仅修改内容 + blockValue.Block.Content = newValue.Block.Content + break + } + newValue.ID = ast.NewNodeID() newValue.KeyID = keyValues.Key.ID newValue.BlockID = addingBlockID diff --git a/kernel/model/block.go b/kernel/model/block.go index 8dc749a0f..8073bf9b0 100644 --- a/kernel/model/block.go +++ b/kernel/model/block.go @@ -130,12 +130,11 @@ func GetBlockSiblingID(id string) (parent, previous, next string) { } parentListCount := 0 - var parentList, parentListItem, current *ast.Node + var parentListItem, current *ast.Node for p := node.Parent; nil != p; p = p.Parent { if ast.NodeListItem == p.Type { parentListCount++ if 1 < parentListCount { - parentList = p.Parent parentListItem = p break } @@ -143,11 +142,8 @@ func GetBlockSiblingID(id string) (parent, previous, next string) { } } - if nil != parentList { - parent = parentList.ID - if flb := firstChild(parentList); nil != flb { - parent = flb.ID - } + if nil != parentListItem { + parent = parentListItem.ID if parentListItem.Previous != nil { previous = parentListItem.Previous.ID diff --git a/kernel/treenode/node.go b/kernel/treenode/node.go index fd9d5f3b7..72d1a2bb5 100644 --- a/kernel/treenode/node.go +++ b/kernel/treenode/node.go @@ -722,10 +722,22 @@ func renderAttributeViewTable(attrView *av.AttributeView, view *av.View) (ret *a if nil != tableCell.Value && nil != tableCell.Value.Relation { tableCell.Value.Relation.Contents = nil } - case av.KeyTypeText: // 渲染文本列 + case av.KeyTypeText: if nil != tableCell.Value && nil != tableCell.Value.Text { tableCell.Value.Text.Content = util.EscapeHTML(tableCell.Value.Text.Content) } + case av.KeyTypeEmail: + if nil != tableCell.Value && nil != tableCell.Value.Email { + tableCell.Value.Email.Content = util.EscapeHTML(tableCell.Value.Email.Content) + } + case av.KeyTypeURL: + if nil != tableCell.Value && nil != tableCell.Value.URL { + tableCell.Value.URL.Content = util.EscapeHTML(tableCell.Value.URL.Content) + } + case av.KeyTypePhone: + if nil != tableCell.Value && nil != tableCell.Value.Phone { + tableCell.Value.Phone.Content = util.EscapeHTML(tableCell.Value.Phone.Content) + } } FillAttributeViewTableCellNilValue(tableCell, rowID, col.ID)