#### What type of PR is this?
/kind bug
/area core
/milestone 2.19.x
#### What this PR does / why we need it:
修复 postFinder 的 list 排序参数不生效的问题
此问题由于 https://github.com/halo-dev/halo/pull/6531 导致
#### Which issue(s) this PR fixes:
Fixes#6534
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.19.0
#### What this PR does / why we need it:
This PR refactors LuceneSearchEngine to let IndexWriter and SearcherManager load lazily to prevent LockObtainFailedException from performing a rolling update.
#### Which issue(s) this PR fixes:
Fixes#6541
#### Special notes for your reviewer:
1. Use MySQL or PostgreSQL as database for Halo
2. Start an instance of Halo
3. Try to initialize Halo and search posts
4. Change the `server.port` and start another instance of Halo
5. Check the status of another instance
#### Does this PR introduce a user-facing change?
```release-note
修复滚动更新时无法启动新的 Halo 实例的问题
```
#### What type of PR is this?
/kind cleanup
/kind improvement
/area core
/milestone 2.19.0
#### What this PR does / why we need it:
This PR refactors some requests with sort parameter by reusing SortableRequest, and refactors some queries with indexer.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area ui
/kind improvement
/milestone 2.19.0
#### What this PR does / why we need it:
简化文章设置表单的部分表单项。
<img width="760" alt="image" src="https://github.com/user-attachments/assets/337a728e-8cc6-4c9e-aa85-dc4c64b72de5">
#### Does this PR introduce a user-facing change?
```release-note
简化文章设置表单的部分表单项。
```
#### What type of PR is this?
/kind bug
/area ui
/milestone 2.19.x
#### What this PR does / why we need it:
解决 formkit select 远程请求时的参数错误问题。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area ui
/milestone 2.19.x
#### What this PR does / why we need it:
使用 #6473 中重构的 Formkit Select 组件来实现用户、文章、页面等各种业务搜索组件。
Fixes https://github.com/halo-dev/halo/issues/4931
#### How to test it?
测试各类搜索组件是否正常可用。
测试从旧版本升级后,原有数据是否可以正常显示。
#### Does this PR introduce a user-facing change?
```release-note
使用重构的 Formkit Select 组件来实现业务选择器。
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.19.x
#### What this PR does / why we need it:
重命名缩略图大小的参数名以便和主题端 finder 用法保持一致
同时确保通过 encode 或者没有 encode 的 uri 都可以获取到缩略图
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/milestone 2.19.x
/area core
#### What this PR does / why we need it:
为 postFinder 添加一个统一参数的 list 方法并支持传递排序参数
Fixes https://github.com/halo-dev/halo/issues/4933
#### Does this PR introduce a user-facing change?
```release-note
为 postFinder 添加一个统一参数的 list 方法并支持传递排序参数
```
#### What type of PR is this?
/area ui
/kind feature
/milestone 2.19.0
#### What this PR does / why we need it:
重构用户筛选组件,支持远程搜索,避免在用户量大的时候产生性能问题。
<img width="383" alt="image" src="https://github.com/user-attachments/assets/3f878b0b-3da0-48fe-97ee-add115d23801">
#### Does this PR introduce a user-facing change?
```release-note
重构用户筛选组件,支持远程搜索。
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.19.0
#### What this PR does / why we need it:
This PR corrects list options builder for listing aggregated roles, because I wrongly used the label selector in <https://github.com/halo-dev/halo/pull/6471>.
#### Special notes for your reviewer:
1. Try to install the plugin <https://www.halo.run/store/apps/app-YXyaD>
2. Enable the plugin and enable setting `匿名评论需要验证码`
3. **Anonymous** request any of posts with comment enabled
4. Check the captcha in comment area
#### Does this PR introduce a user-facing change?
```release-note
修复可能无法正常访问插件提供的接口的问题
```
#### What type of PR is this?
/area ui
/kind bug
/milestone 2.19.0
#### What this PR does / why we need it:
修复 H2 数据库提示判断有误的问题。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.19.x
#### What this PR does / why we need it:
构建完索引后增加数据量一致性校验的步骤
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.19.0
#### What this PR does / why we need it:
升级预设插件的版本。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area core
/kind feature
/milestone 2.19.x
#### What this PR does / why we need it:
升级默认主题的版本为 [1.9.0](https://github.com/halo-dev/theme-earth/releases/tag/v1.9.0)。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.19.0
#### What this PR does / why we need it:
After merging https://github.com/halo-dev/halo/pull/6512 and https://github.com/halo-dev/halo/pull/6511, unit tests fail due to the changes of <05b73ceeec>.
This PR fixes the problem by letting `run.halo.app.infra.exception.handlers.ProblemDetailErrorAttributes` extend `org.springframework.boot.web.reactive.error.DefaultErrorAttributes`.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind api-change
/kind feature
/area core
#### What this PR does / why we need it:
see #2335
增加将第三方资源转存为附件资源的接口。
`/apis/api.console.halo.run/v1alpha1/attachments/-/upload-from-url`
UC:
`/apis/uc.api.content.halo.run/v1alpha1/attachments/-/upload-from-url`
其中参数为
```json
{
"url": "string",
"filename": "string",
"groupName": "string",
"policyName": "string"
}
```
#### How to test it?
测试能否将第三方接口的资源保存至附件中。
测试各类附件,例如图片、视频、文本等。
#### Does this PR introduce a user-facing change?
```release-note
增加通过链接转存第三方资源至附件库的接口
```
#### What type of PR is this?
/kind improvement
/area editor
/area ui
#### What this PR does / why we need it:
此 PR 重构了默认编辑器中代码块的相关代码,使编辑器能够被插件扩展。这样做的优点是当用户使用例如 [highlightjs](https://github.com/halo-sigs/plugin-highlightjs) 这类的高亮插件时,可以保证在 Console 端选择的语言及主题可以在主题端完美适配。
具体做了以下几处重构:
1. 在默认编辑器的代码块中,不再提供高亮样式,代码块高亮将完全交由插件来适配。(但可以在默认的代码块中自定义输入语言,主题端自行处理)。
2. 为了防止出现重复的插件功能,将会根据插件优先级及加载顺序(后加载优先级高于先加载),对同类型且同名的插件进行过滤,只保留一个。
3. 重构代码块 `Select` 组件,使得选择语言或主题更加方便。
4. 为代码块提供主题的扩展设置项。
建议在此 PR 合并之后,由 Halo 默认提供一个高亮插件作为预设插件,这样可以用于解决原有功能升级之后丢失的问题。
<img width="1067" alt="image" src="https://github.com/user-attachments/assets/f9e2c5eb-a48a-4d2c-9fee-442e9d16ef19">
#### How to test it?
测试是否会改变已有代码块的语言等。
测试使用第三方插件之后,是否具有高亮。
设置高亮语言后,保存并刷新,查看高亮语言是否存在。主题同理。
查看主题端是否能够正常渲染。
#### Does this PR introduce a user-facing change?
```release-note
重构默认编辑器代码块使其能够被插件扩展。
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.19.0
#### What this PR does / why we need it:
See https://github.com/spring-projects/spring-boot/releases/tag/v3.3.3 for more.
#### Does this PR introduce a user-facing change?
```release-note
升级 Spring Boot 至 3.3.3
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.19.0
#### What this PR does / why we need it:
This PR refactors "Template Not Found Exception" into "NotFoundException" to prevent too many exception stacktraces in logs file.
#### Which issue(s) this PR fixes:
Fixes#6501
#### Special notes for your reviewer:
1. Activate default theme
2. Request <http://localhost:8090/categories>
3. See the result
#### Does this PR introduce a user-facing change?
```release-note
优化当主题模板找不到的异常提示
```
#### What type of PR is this?
/area ui
/kind improvement
/milestone 2.19.x
#### What this PR does / why we need it:
在初始化页面添加使用 H2 数据库的警告。
<img width="773" alt="image" src="https://github.com/user-attachments/assets/3be83064-2075-4d3d-9511-9c67ffb68076">
#### Special notes for your reviewer:
需要测试在首次安装的时候使用 H2 数据库时,初始化页面是否有警告界面。
#### Does this PR introduce a user-facing change?
```release-note
在初始化页面添加使用 H2 数据库的警告。
```
#### What type of PR is this?
/area ui
/kind bug
/milestone 2.19.x
#### What this PR does / why we need it:
修复备份相关的 API 接口地址错误的问题,此问题由 https://github.com/halo-dev/halo/pull/6486 引入,后端修改地址之后,前端没有对应修改。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area ui
/milestone 2.19.x
#### What this PR does / why we need it:
升级 tiptap 相关依赖至 [2.6.5](https://github.com/ueberdosis/tiptap/releases/tag/v2.6.5)
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area ui
/kind improvement
/milestone 2.19.x
#### What this PR does / why we need it:
优化插件是否需要重载页面的判断条件,否则从低版本升级到 2.19 时,所有插件都会提示需要重载。
因为在 https://github.com/halo-dev/halo/pull/6470 中修改了 bundle.js 的结构,但升级到 2.19 之后可能并不会及时抛弃 bundle.js 的缓存,因为插件本身的 version 并没有改变,bundle.js 的 hash 参数也不会改变。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area editor
/milestone 2.19.x
#### What this PR does / why we need it:
使用白名单校验替换原有的黑名单校验,解决 a 标签潜在的安全问题。
移除自定义的解决方案,使用 Tiptap 所提供的白名单方案。
#### How to test it?
测试 a 标签的 href 链接是否会受到 xss 的影响。
同时测试 #5479 的情况是否还会发生。即默认富文本编辑器中当链接为纯数字时是否还会报错。
#### Does this PR introduce a user-facing change?
```release-note
使用白名单校验 a 标签的 href 用于解决潜在的安全问题。
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.19.x
#### What this PR does / why we need it:
修复切换账号登录时设备信息更新不正确的问题
原因:
1. 使用 admin 账号登录,此时会记录 device_id 的 cookie
2. 退出登录,device_id 会保留在 cookie 中并随着新账号带到服务端
3. 服务端根据 device_id 查询当前设备是否有对应的记录,但是没有校验用户名是否与当前登陆的一致然后就去更新登录时间
4. 正确的处理是校验 device_id 是否有与之对应的记录并且用户名相同,如果不相同则认为是新设备重新生成 device_id
**how to test it?**
1. 先清理 cookie 然后使用一个账号登录
2. 退出登陆并切换新账号登录
3. 检查新登录的账号的设备信息是否正确
#### Does this PR introduce a user-facing change?
```release-note
修复切换账号登录时设备信息更新不正确的问题
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.19.x
#### What this PR does / why we need it:
修复文章的上一篇下一篇链接包含了隐藏分类下的文章
#### Does this PR introduce a user-facing change?
```release-note
修复文章的上一篇下一篇链接包含了隐藏分类下的文章
```
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
This PR refactors searching roles by using index mechanism to speed up every request and fix the problem of not being able to grant roles to users sometimes.
#### Which issue(s) this PR fixes:
Fixes#5807
Fixes https://github.com/halo-dev/halo/issues/4954
Fixes https://github.com/halo-dev/halo/issues/5057
#### Does this PR introduce a user-facing change?
```release-note
修复有时无法给用户赋权限的问题
```
#### What type of PR is this?
/kind cleanup
/area core
/milestone 2.19.x
#### What this PR does / why we need it:
清理没有用到的索引
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area ui
/kind improvement
/milestone 2.19.x
#### What this PR does / why we need it:
Bump vite-related dependencies
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.19.x
#### What this PR does / why we need it:
优化用户创建
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area ui
/kind improvement
/milestone 2.19.x
#### What this PR does / why we need it:
使用 patch 接口重构菜单项拖动排序等功能。
#### Which issue(s) this PR fixes:
None
#### Special notes for your reviewer:
需要测试菜单项的拖动排序功能是否符合预期。
#### Does this PR introduce a user-facing change?
```release-note
使用 patch 接口重构菜单项拖动排序功能。
```
#### What type of PR is this?
/area ui
/kind improvement
/milestone 2.19.x
#### What this PR does / why we need it:
使用 patch 接口重构文章的恢复、可见性修改等逻辑。
#### Which issue(s) this PR fixes:
None
#### Special notes for your reviewer:
测试文章删除、恢复、可见性修改功能是否符合预期。
#### Does this PR introduce a user-facing change?
```release-note
使用 patch 接口重构文章的恢复、可见性修改等逻辑。
```
#### What type of PR is this?
/area ui
/kind improvement
/milestone 2.19.x
#### What this PR does / why we need it:
使用 patch 接口重构分类拖动排序功能。
#### Which issue(s) this PR fixes:
None
#### Special notes for your reviewer:
需要测试文章分类的拖动排序功能是否符合预期。
#### Does this PR introduce a user-facing change?
```release-note
使用 patch 接口重构分类拖动排序功能。
```
#### What type of PR is this?
/area ui
/kind improvement
/milestone 2.19.x
#### What this PR does / why we need it:
使用 patch 接口重构页面的删除、可见性修改等逻辑。
#### Which issue(s) this PR fixes:
None
#### Special notes for your reviewer:
测试页面删除、可见性修改功能是否符合预期。
#### Does this PR introduce a user-facing change?
```release-note
使用 patch 接口重构页面的删除、可见性修改等逻辑。
```
#### What type of PR is this?
None
#### What this PR does / why we need it:
Updated the issue template and added a reminder to disable all plugins to troubleshoot the problem.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area ui
/milestone 2.19.x
#### What this PR does / why we need it:
将主题预览中的保存功能固定在底部,方便当主题设置项过多时进行保存。
为了不影响保存功能,因此此 PR 移除了本来在左下角悬浮的选择主题按钮。选择主题可以直接在右上角进行点击。
#### Which issue(s) this PR fixes:
Fixes#6448
#### Does this PR introduce a user-facing change?
```release-note
在主题预览界面中将保存按钮固定在底部
```