Commit Graph

5673 Commits (2a37366c922aced15bd5943f74a5a997238ed945)

Author SHA1 Message Date
John Niang 2a37366c92
Set context ClassLoader to plugin ClassLoader for correct class loading operations (#7725)
#### What type of PR is this?

/kind bug
/area plugin
/milestone 2.21.x

#### What this PR does / why we need it:

This PR fixes the problem that loading resources from class path during static initialization doesn't work.

#### Does this PR introduce a user-facing change?

```release-note
修复部分场景下无法正常启动插件的问题
```
2025-08-29 03:30:15 +00:00
John Niang a32cd4b551
Upgrade to Spring Boot 3.5.5 (#7715)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.21.x

#### What this PR does / why we need it:

This PR is a regular update for Spring Boot. See https://github.com/spring-projects/spring-boot/releases/tag/v3.5.5 for more.

#### Does this PR introduce a user-facing change?

```release-note
升级依赖 Spring Boot 至 3.5.5
```
2025-08-29 03:28:14 +00:00
John Niang 956e23dd7f
Allow deserializing ListResult (#7711)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.21.x

#### What this PR does / why we need it:

This PR allows ListResult to be deserialized with JSON. So we can resolve ListResult response of APIs correctly.

#### Does this PR introduce a user-facing change?

```release-note
None
```
2025-08-21 10:15:48 +00:00
Ryan Wang 4ac80f5eb3
Update comment widget plugin to v3.0.0 (#7705) 2025-08-19 15:32:02 +08:00
Ryan Wang e2bb5ada37
Bump rolldown-vite to 7.1.4 (#7704)
#### What type of PR is this?

/area ui
/milestone 2.21.x

#### What this PR does / why we need it:

Bump rolldown-vite to [7.1.4](https://github.com/vitejs/rolldown-vite/releases/tag/v7.1.4)

#### Does this PR introduce a user-facing change?

```release-note
None
```
2025-08-19 07:05:15 +00:00
Ryan Wang 568ebf5b70
Fix pending comments calculation in post list item (#7703)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.21.x

#### What this PR does / why we need it:

Fix pending comments calculation in post list item

#### Does this PR introduce a user-facing change?

```release-note
None
```
2025-08-19 07:03:16 +00:00
Ryan Wang 157a8eb42d
Support async route permissions in guards (#7700)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.21.x

#### What this PR does / why we need it:

Fix routing navigation issue with async route permission functions

Caused by https://github.com/halo-dev/halo/pull/7688

#### Does this PR introduce a user-facing change?

```release-note
None
```
2025-08-19 07:01:15 +00:00
Ryan Wang 3487132154
Add support for hidden comments (#7679)
* Add 'hidden' field to comment and reply requests

Signed-off-by: Ryan Wang <i@ryanc.cc>

* Add support for filtering comments with hidden

* Specify hidden=false and approved=true for anonymous users

* Set default hidden flag only if null in comments

* Add 'private reply' option to comment modals

* Add private tag for hidden comments and replies

* Allow hiding comments only

* Enhance comment visibility logic to allow owners to view hidden comments

* Remove hidden input for reply form

Signed-off-by: Ryan Wang <i@ryanc.cc>

* Refine i18n

Signed-off-by: Ryan Wang <i@ryanc.cc>

---------

Signed-off-by: Ryan Wang <i@ryanc.cc>
Co-authored-by: John Niang <johnniang@foxmail.com>
2025-08-19 14:47:37 +08:00
Ryan Wang 3f5b69d5d0
Support async permission checks in route menu generator (#7688)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.21.x

#### What this PR does / why we need it:

Support async permission checks in route menu generator

example:

```ts
{
  path: "",
  name: "Foo",
  component: Foo,
  meta: {
    title: "Foo",
    searchable: true,
    permissions: async () => {
      const { data } = await checkPermission();
      return data;
    },
    menu: {
      name: "Foo",
      group: "content",
      icon: markRaw(MingcuteBook2Line),
      priority: 4,
      mobile: false,
    },
  },
}
```

#### Which issue(s) this PR fixes:

Fixes #

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
开发者相关:路由的权限检查支持函数
```
2025-08-17 15:43:10 +00:00
Ryan Wang e6f8783389
Fix role dependency handling in role editing form (#7684)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.21.x

#### What this PR does / why we need it:

See #7676 

#### Which issue(s) this PR fixes:

Fixes #7676 

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
修复角色修改表单中,所选权限可能出现不完整的问题。
```
2025-08-17 15:41:11 +00:00
Ryan Wang 3345ccb035
Merge pull request #7695 from ruibaby/feat/comment-a-target
Allow target attribute on <a> tags in comment sanitizer
2025-08-17 23:38:00 +08:00
Ryan Wang 3105c53b6f
Add external asset transfer for editor attachments (#7687)
#### What type of PR is this?

/area ui
/area editor
/kind feature
/milestone 2.21.x

#### What this PR does / why we need it:

Support transfer external assets in the editor to the attachment library. Currently, it supports individual images, videos, and audio files.

<img width="845" height="167" alt="image" src="https://github.com/user-attachments/assets/930c6207-60f5-491a-afbd-c3f75b0d76a6" />

in progress:

- [ ] Batch transferring of all external assets.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/2335

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
支持转存编辑器中的外部资源到附件库
```
2025-08-17 14:43:09 +00:00
Ryan Wang 7d51f38d96
Include subjectRefKey in comments queryKey (#7685) 2025-08-15 22:55:40 +08:00
Takagi da10ed4cbd
fix: pasting excel text will turn it into an image (#7689)
#### What type of PR is this?

/kind bug
/area editor

#### What this PR does / why we need it:

将粘贴图片上传的选项,改为仅支持单个文件,此举可以解决会将 excel 转为图片的问题。

#### How to test it?

在文章中粘贴 excel 表格中的内容,查看是否转为表格。

#### Does this PR introduce a user-facing change?
```release-note
解决将粘贴 Excel 内容会变为图片的问题。
```
2025-08-15 09:51:02 +00:00
Ryan Wang f5af5a1550
Add subject-based comment list modal (#7681) 2025-08-13 15:43:50 +08:00
Ryan Wang 2bcfbbc371
Optimize comment notification template to support rich text rendering (#7683)
#### What type of PR is this?

/area core
/area ui
/milestone 2.21.x
/kind feature

#### What this PR does / why we need it:

Optimize comment notification template to support rich text rendering

#### Does this PR introduce a user-facing change?

```release-note
None
```
2025-08-13 07:32:50 +00:00
Ryan Wang eddcb5bc38
Allow <s> tag and class attribute on <code> in comments (#7682)
#### What type of PR is this?

/area code
/milestone 2.21.x
/kind improvement

#### What this PR does / why we need it:

Comments are allowed to contain `s` tags and `code` tags with class attributes for the following reasons:

1. `s`: The comment component uses tiptap editor's [strikethrough extension](https://tiptap.dev/docs/editor/extensions/marks/strike#:~:text=while%20you%20type.-,Restrictions,-The%20extension%20will) which enforces the use of `s` tags for strikethrough text and cannot be changed.
2. `code[class]`: Used for code highlighting (class="language-*")

#### Does this PR introduce a user-facing change?

```release-note
None
```
2025-08-13 07:14:50 +00:00
John Niang 6f608f12aa
Fix the problem of memory leak caused by thymeleaf (#7678)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.21.x

#### What this PR does / why we need it:

This PR replaces the dependency `thymeleaf-spring6` to apply the memory leak fix of <https://github.com/halo-dev/thymeleaf/pull/1>.

Please note that this is a temporary fix, and we would revert this PR after Thymeleaf official released a new version including my fix.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/7289

#### Special notes for your reviewer:

1. Execute command ab -c 100 -n 1000 -H 'Accept: text/html' -H 'Cache-Control: no-cache' http://localhost:8090/ and then press Ctrl + C to stop the thread.
2. See logs in Halo

#### Does this PR introduce a user-facing change?

```release-note
修复在特定情况下模板引擎可能出现内存泄漏的问题
```
2025-08-12 10:46:48 +00:00
Ryan Wang 09cd1f7f74
Comments now support rich text formatting display (#7674)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.21.x

#### What this PR does / why we need it:

Comments now support rich text format display.

Still need to:

1. Test for XSS vulnerabilities
2. Optimize content styling
3. Editor

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/7671

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
评论内容支持以富文本格式显示
```
2025-08-12 06:26:47 +00:00
John Niang 535fe01624
Check if the contents of comment and reply are valid before persistence (#7677)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.21.x

#### What this PR does / why we need it:

This PR checks if the contents of comment and reply are valid before persistence to prevent users from XSS attacks.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/7675

#### Special notes for your reviewer:

Try to comment or reply with the contents from <https://cheatsheetseries.owasp.org/cheatsheets/XSS_Filter_Evasion_Cheat_Sheet.html>.

#### Does this PR introduce a user-facing change?

```release-note
检测评论和回复内容是否合法以防止 XSS 攻击
```
2025-08-12 04:08:46 +00:00
Ryan Wang 59030f839a
Refactor SEO meta tag processors and update help texts for ui (#7665)
#### What type of PR is this?

/area core
/kind improvement
/milestone 2.21.x

#### What this PR does / why we need it:

This PR optimizes SEO tag generation with the following changes:

1. Site description and keywords settings now only apply to the homepage and are no longer inserted on other pages.
2. Added meta description tags for category archive pages, using the category description as content.
3. Improved the help text descriptions for SEO options in system settings.

#### Which issue(s) this PR fixes:

Fixes #7662 

#### Does this PR introduce a user-facing change?

```release-note
优化页面的 SEO 标签的生成
```
2025-08-08 12:42:41 +00:00
John Niang 17643bc451
Fix existence check of posts in some cases (#7673)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.21.x

#### What this PR does / why we need it:

This PR fixes the internal check of selector converter `NotEquals`, which might lead to failing check of `metadata.name!=1`.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/7666

#### Does this PR introduce a user-facing change?

```release-note
修复极端场景下无法检查文章别名是否存在的问题
```
2025-08-08 11:22:40 +00:00
John Niang 576dda9d74
Add social login endpoint for remember-me support (#7670)
#### What type of PR is this?

/kind feature
/kind api-change
/area core
/milestone 2.21.x

#### What this PR does / why we need it:

This PR adds a new endpoint `POST /login/social/{auth_provider_name}?remember-me=true` to make the social login support remember-me mechanism. 

#### Does this PR introduce a user-facing change?

```release-note
支持社交登录时选择是否保持登录
```
2025-08-08 11:06:39 +00:00
Ryan Wang 9607ee4912
chore: bump preset plugins and theme version (#7667)
#### What type of PR is this?

/area core
/milestone 2.21.x

#### What this PR does / why we need it:

Bump all preset plugins and theme version

#### Does this PR introduce a user-facing change?

```release-note
None
```
2025-08-06 16:12:38 +00:00
John Niang 3a50fdc4e5
Optimize homepage post loading by eliminating N+1 queries for user data (#7668)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.21.x

#### What this PR does / why we need it:

This PR refactors posts query to reduce database queries significantly.

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/7593

Supersedes https://github.com/halo-dev/halo/pull/7644

#### Does this PR introduce a user-facing change?

```release-note
优化首页、归档页加载速度
```
2025-08-06 16:08:37 +00:00
John Niang 27c18631e0
Upgrade to Gradle 9.0.0 (#7657)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.21.x

#### What this PR does / why we need it:

See https://docs.gradle.org/9.0.0/release-notes.html and https://github.com/gradle/gradle/releases/tag/v9.0.0 for more.

#### Does this PR introduce a user-facing change?

```release-note
升级 Gradle 至 9.0.0
```
2025-08-04 04:04:29 +00:00
John Niang 1643e1de05
Ingore build directory while linting ui project (#7658) 2025-08-04 12:02:07 +08:00
Ryan Wang 5c781d46af
chore: downgrade rolldown-vite to fix chunk issue (#7650) 2025-08-01 08:59:18 +08:00
Ryan Wang 87cb00a2f1
Refactor user batch enable/disable logic and update i18n (#7647) 2025-07-31 22:04:50 +08:00
Ryan Wang 4119e36cd8
chore: update Vite, Vitest, and related dependencies (#7646)
#### What type of PR is this?

/area ui

#### What this PR does / why we need it:

Bump vite related dependencies

#### Does this PR introduce a user-facing change?

```release-note
None
```
2025-07-31 03:32:54 +00:00
John Niang 6f6dbb8cc1
Fix the problem that notification might not work anymore (#7643)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.21.x

#### What this PR does / why we need it:

This PR sets timeout on notification trigger to make sure the procedure won't getting stuck forever.

#### Does this PR introduce a user-facing change?

```release-note
修复运行过程中通知器可能失效的问题
```
2025-07-29 06:51:51 +00:00
John Niang ae9dd6f3d3
Fix the problem that synchronizer might be started multiple times (#7642)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.21.x

#### What this PR does / why we need it:

This PR fixes the problem of starting synchronizer multiple times while configuring multiple workers.

#### Does this PR introduce a user-facing change?

```release-note
None
```
2025-07-29 06:49:50 +00:00
John Niang 177cfcc69c
Upgrade to Spring Boot 3.5.4 (#7640)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.21.x

#### What this PR does / why we need it:

This PR upgrades to Spring Boot [3.5.4](https://github.com/spring-projects/spring-boot/releases/tag/v3.5.4).

#### Does this PR introduce a user-facing change?

```release-note
升级依赖 Spring Boot 至 3.5.4
```
2025-07-28 02:35:47 +00:00
Ryan Wang 2cf0d6853a
feat: add slug existence check when creating posts (#7617)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.21.x

#### What this PR does / why we need it:

This PR adds frontend support for checking whether an slug already exists when creating posts.

Note:

1. The current implementation isn’t perfect, some actions (like clicking the “Publish” button) don’t check for duplicate slug yet.
2. Slug checking in the user center might not be accurate, since it may not have permission to query all posts.

<img width="695" alt="image" src="https://github.com/user-attachments/assets/baa37a82-49c2-43be-a4d8-0e0f22a9d73b" />

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/7615
Fixes https://github.com/halo-dev/halo/issues/3332

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
创建文章时支持检查别名是否重复
```
2025-07-27 05:19:17 +00:00
Ryan Wang cc3b3323c7
feat: add slug existence check when creating categories and tags (#7616)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.21.x

#### What this PR does / why we need it:

This PR adds frontend support for checking if an slug already exists when creating post categories and tags.

<img width="701" alt="image" src="https://github.com/user-attachments/assets/050c2fc3-b82c-42f1-b58e-cf12c6852959" />

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/3172

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
创建文章分类和标签时支持检查别名是否已存在
```
2025-07-27 05:17:16 +00:00
Ryan Wang 395399f078
feat: add thumbnail records modal (#7630)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.21.x

#### What this PR does / why we need it:

Add thumbnail records viewing feature. The main goal is to keep track of failed thumbnail generations, making it easier to check if thumbnails were generated correctly and retry if needed.

<img width="1009" height="859" alt="image" src="https://github.com/user-attachments/assets/d968e416-0b88-45bf-a554-a0c1abcf97a0" />
<img width="1014" height="952" alt="image" src="https://github.com/user-attachments/assets/c5d1a11b-7acc-4ab5-a2da-cf9467cb6b70" />

#### Which issue(s) this PR fixes:

Fixes #

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?

```release-note
支持查看附件缩略图记录
```
2025-07-22 13:54:18 +00:00
Ryan Wang e737d8b0f7
chore: bump vite(rolldown) version to 7.0.10 (#7635)
#### What type of PR is this?

/area ui
/milestone 2.21.x

#### What this PR does / why we need it:

Bump rolldown-vite version to 7.0.10

#### Does this PR introduce a user-facing change?

```release-note
None
```
2025-07-22 12:50:19 +00:00
Ryan Wang 471195d6b0
refactor: add chunked execution mechanism for notification batch deletions (#7634)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.21.x

#### What this PR does / why we need it:

Use `Promise.all` to execute part of the batch deletion logic of the notification in chunks to optimize the execution performance.

#### Which issue(s) this PR fixes:

Fixes #

#### Does this PR introduce a user-facing change?

```release-note
优化通知批量删除的执行性能
```
2025-07-22 12:48:18 +00:00
王炸 5bb7b2826e
Support batch enabling and disabling of users (#7631)
* Support batch enable and disable

* documentation update

* Update ui/src/locales/en.yaml

Co-authored-by: Ryan Wang <i@ryanc.cc>

* Update ui/src/locales/zh-CN.yaml

Co-authored-by: Ryan Wang <i@ryanc.cc>

* Update ui/src/locales/zh-CN.yaml

Co-authored-by: Ryan Wang <i@ryanc.cc>

* Update ui/src/locales/zh-TW.yaml

Co-authored-by: Ryan Wang <i@ryanc.cc>

* Update ui/src/locales/zh-TW.yaml

Co-authored-by: Ryan Wang <i@ryanc.cc>

* batch handling and code reuse

* 1.还原批量删除的分批请求修改
2.使判断当前user启停用状态时条件更加宽松,以解决新增用户后该属性undefined而被过滤的问题。(之前测试时用的数据是之前构建并使用过单独启\禁用的)

---------

Co-authored-by: Ryan Wang <i@ryanc.cc>
2025-07-18 17:32:46 +08:00
ClawCloud-Alan 859b7030c5
Add ClawCloud one-click deployment button to README (#7632)
#### What type of PR is this?

/kind documentation

#### What this PR does / why we need it:

添加 ClawCloud Run 部署按钮,为 Halo 用户提供:

1. **零配置快速体验** - 无需服务器/域名,60秒内启动可用的 Halo 实例
2. **免费体验环境** - 每月免费提供 $5 的账户额度,用户可以持续稳定部署 Halo 博客在 ClawCloud Run 上
3. **原生集成体验** - 自动配置数据库和存储,开箱即用
4. **低门槛验证** - 降低新用户体验成本,促进项目采用率

#### Which issue(s) this PR fixes:

None

#### Special notes for your reviewer:

按钮已添加在部署章节,位于 Gitpod 部署选项之后

#### Does this PR introduce a user-facing change?

```release-note
None
```
2025-07-17 09:57:21 +00:00
XiaoyuPeng a8b885709b
Fix typo for UnpublishPost api description (#7628)
Co-authored-by: pengxiaoyu <pengxiaoyu@shengqugames.com>
2025-07-15 11:54:58 +08:00
Ryan Wang 93ec6e686e
chore: simplify ui scripts (#7626)
#### What type of PR is this?

/area ui
/kind cleanup

#### What this PR does / why we need it:

Simplify ui scripts

#### Does this PR introduce a user-facing change?

```release-note
None
```
2025-07-14 06:49:52 +00:00
王贺 888043dc43
docs: Add GitCode badge (#7619) 2025-07-07 14:36:13 +08:00
Ryan Wang c8eac104fb
chore: bump halo packages version (#7614)
Signed-off-by: Ryan Wang <i@ryanc.cc>
2025-07-04 17:11:58 +08:00
Takagi 6246da9b85
chore: upgrade tiptap to 2.24.1 (#7613)
#### What type of PR is this?

/kind chore
/area editor

#### What this PR does / why we need it:

升级 tiptap 至 2.24.1

#### Does this PR introduce a user-facing change?
```release-note
升级 tiptap 至 2.24.1
```
2025-07-04 05:03:40 +00:00
Ryan Wang 3dd0d00288
fix: menu and post category dragging issue (#7608)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.21.x

#### What this PR does / why we need it:

Fix issue where menu items and post categories could not be reordered via drag-and-drop

#### Which issue(s) this PR fixes:

Fixes #7607 

#### Does this PR introduce a user-facing change?

```release-note
修复菜单项和文章分类可能出现无法拖动排序的问题
```
2025-07-04 04:39:41 +00:00
Ryan Wang a4a418b22e
feat: add support for remote URL attachment downloads (#7602)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.21.x

#### What this PR does / why we need it:

Add support for remote URL attachment downloads

<img width="1031" alt="image" src="https://github.com/user-attachments/assets/f85eee2f-a40b-49ff-9ced-31136f59e67c" />

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/7017

#### Does this PR introduce a user-facing change?

```release-note
支持通过远程地址下载到附件库
```
2025-07-04 04:37:40 +00:00
Golden Supreme Salted Fish 79226998d3
refactor: exclude post preview page from data tracking (#7582)
What type of PR is this?  
/kind bug  
/area core  
/milestone 2.21.x

What this PR does / why we need it:  
Prevents published post view counts from being incorrectly increased when previewing posts in the admin panel.

Previously, the preview mode would load the tracking script, which resulted in inflated view counts. This PR adds a condition to detect preview mode and disables the tracking logic to avoid counting views for unpublished content.

Does this PR introduce user-facing changes?
```release-note
文章预览页面不再统计访问数据
```
2025-07-04 04:33:41 +00:00
Ryan Wang a6322fa023
fix: prevent code input content from being obscured in fullscreen mode (#7599)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.21.x

#### What this PR does / why we need it:

Prevent code input content from being obscured in fullscreen mode

#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/7574

#### Does this PR introduce a user-facing change?

```release-note
修复代码输入框在全屏时,底部内容被遮挡的问题。
```
2025-07-04 04:31:41 +00:00
Ryan Wang a76e64dcda
refactor: make toolbox button expandable on click in editor (#7598)
#### What type of PR is this?

/area ui
/area editor
/milestone 2.21.x
/kind improvement

#### What this PR does / why we need it:

Change the editor's toolbox button to expand on click, rather than on hover, to maintain consistency with other toolbar buttons.

#### Does this PR introduce a user-facing change?

```release-note
将编辑器的工具箱按钮改为点击展开
```
2025-07-04 04:29:40 +00:00