#### What type of PR is this?
/area console
/kind improvement
/milestone 2.8.x
#### What this PR does / why we need it:
完善备份恢复界面的 i18n。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.8.x
#### What this PR does / why we need it:
在恢复备份的界面,改为需要先点击开始恢复按钮再显示上传区域。
#### Which issue(s) this PR fixes:
Fixes#4295
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.8.x
#### What this PR does / why we need it:
为 Dialog 组件添加 showCancel 属性用于控制是否显示取消按钮,某些场景下 Dialog 只是用于提示切必须点击确定。
此外,还对以下位置做了对应修改:
1. 进入文章编辑时检查编辑器是否存在的弹框,只允许点击确定并返回。
2. 备份恢复完成之后点击确定关闭 Halo。
#### Does this PR introduce a user-facing change?
```release-note
Console 端的 Dialog 组件添加 showCancel 属性用于控制是否显示取消按钮。
```
#### What type of PR is this?
/area console
/area editor
/milestone 2.8.x
/kind feature
#### What this PR does / why we need it:
升级默认编辑器以支持:
1. 重构 Block 操作区域逻辑,防止误操作。 Fixes https://github.com/halo-dev/halo/issues/4164
2. 支持设置文字背景颜色和字体颜色。
3. iframe block 支持主动刷新页面。 https://github.com/halo-dev/halo/issues/4227
4. 在顶部工具栏的区域添加工具箱。
5. 支持设置字体大小。
#### Does this PR introduce a user-facing change?
```release-note
升级默认编辑器版本,支持设置字体颜色、大小等功能,优化使用体验。
```
#### What type of PR is this?
/area theme
/milestone 2.8.x
#### What this PR does / why we need it:
升级默认主题版本至 1.5.0
https://github.com/halo-dev/theme-earth/releases/tag/v1.5.0
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.8.x
/area theme
#### What this PR does / why we need it:
按条件渲染评论组件以简化主题端对评论组件是否显示的条件控制
使用了评论标签的模板页面都能直接使用 `${haloCommentEnabled}` 取值能得到评论组件是否可见的结果为`true/false` 用于在需要级联条件渲染的组件上使用,如:
```html
<!-- 评论组件不可见时不渲染标题 -->
<p th:if="${haloCommentEnabled}">评论</p>
<halo:comment />
```
how to test it?
在主题端未加渲染条件时:
1. 测试全局评论组件是否开启的设置是否有效
2. 测试文章和自定义页面是否开启评论的设置是否有效
3. 测试评论组件启用和停止时评论组件的渲染是否正确
4. 测试 `${haloCommentEnabled}` 结果是否正确
#### Which issue(s) this PR fixes:
Fixes#4137
#### Does this PR introduce a user-facing change?
```release-note
按条件渲染评论组件以简化主题端对评论组件是否显示的条件控制
```
#### What type of PR is this?
/kind feature
/area core
/area plugin
#### What this PR does / why we need it:
Plugin developers are able to define own UsernamePasswordAuthenticationManager to take charge of username password authentication.
1. If the manager fails to handle, the default authentication manager will be used.
2. If the manager returns `Mono.empty()`, the default authentication manager will be used.
For example:
```java
@Component
public class LdapAuthenticationManager
extends UserDetailsRepositoryReactiveAuthenticationManager
implements UsernamePasswordAuthenticationManager {
public LdapAuthenticationManager(ReactiveUserDetailsService userDetailsService) {
super(userDetailsService);
}
@Override
protected Mono<UserDetails> retrieveUser(String username) {
return super.retrieveUser(username);
}
}
```
#### Which issue(s) this PR fixes:
See https://github.com/halo-dev/halo/issues/4207#issuecomment-1643042348 for more.
#### Does this PR introduce a user-facing change?
```release-note
提供用户名密码认证扩展
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.8.x
#### What this PR does / why we need it:
If content is terminated with an error, the file already wrote partially into attachment folder won't be cleaned.
Imagine a scenario where we check that the content size is not larger than 2MB when we write content to the attachments folder. Once the limit is reached, files that have been partially written should be cleaned instead of being kept.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind cleanup
/area core
/milestone 2.8.x
#### What this PR does / why we need it:
Bump plugin preset. See https://github.com/halo-sigs/plugin-comment-widget/releases/tag/v1.7.0 for more.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/area core
/milestone 2.8.x
#### What this PR does / why we need it:
Support resolving static resources at halo work directory `${halo.work-dir}/static/`.
Please note that we only support adding static resources at hand by logging in the server.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4087
#### Special notes for your reviewer:
1. Create a file `index.html` at `${halo.work-dir}/static`
2. Edit the file with any content
3. Browse with `http://localhost:8090/index.html`
#### Does this PR introduce a user-facing change?
```release-note
支持静态资源映射
```
#### What type of PR is this?
/kind improvement
/area console
/area core
#### What this PR does / why we need it:
此 PR 对用户头像上传的方式进行了重构,移除了原有的头像链接及上传至附件库的方案。允许具有用户管理权限的用户对其他用户的头像进行修改和移除。
Core:
新增了 `/apis/api.console.halo.run/v1alpha1/users/-/avatar` 的 `POST` 以及 `DELETE` 接口,用来上传用户的头像及删除当前用户的头像。
Console:
新增对用户头像进行裁剪的功能,并调用上传接口保存用户头像。
需等待 #4247 合并
#### Which issue(s) this PR fixes:
Fixes#2688
See #4251
See #4247
#### Special notes for your reviewer:
1. 测试上传、删除头像接口是否能够正常执行。
2. 查看当前用户的头像是否能够设置成功。
3. 查看附件库中,当前用户的头像文件是否为 0 或 1 个。
#### Does this PR introduce a user-facing change?
```release-note
支持裁剪、上传和删除用户头像。
```
#### What type of PR is this?
/kind feature
/area core
#### What this PR does / why we need it:
Currently, we cannot pass a sort parameter into extensions' list API, so the result of the API is unsortable.
This PR add the support for that API. e.g.:
```bash
curl -X 'GET' \
'http://localhost:8090/api/v1alpha1/annotationsettings?sort=metadata.name,desc' \
-H 'accept: */*'
```
#### Does this PR introduce a user-facing change?
```release-note
Extension 查询接口支持排序参数。
```
#### What type of PR is this?
/kind cleanup
/area core
/milestone 2.8.x
#### What this PR does / why we need it:
Upgrade Spring Boot 3.1.2. See https://github.com/spring-projects/spring-boot/releases/tag/v3.1.2 for more.
#### Does this PR introduce a user-facing change?
```release-note
升级 Spring Boot 至 3.1.2。
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.8.x
#### What this PR does / why we need it:
移除用户编辑表单中用户名的校验规则,在这个表单中,用户名本身就是不能修改的,所以不需要验证。移除之后还能够解决旧版本 Halo 升级之后无法修改资料的问题。(旧版本没有用户名校验)
#### Which issue(s) this PR fixes:
Fixes#4269
#### Does this PR introduce a user-facing change?
```release-note
移除 Console 端用户编辑表单中用户名的校验规则,防止旧版本 Halo 升级之后无法修改资料。
```
#### What type of PR is this?
/area console
/kind feature
/milestone 2.8.x
#### What this PR does / why we need it:
在附件数据管理列表页面路由中记录查询条件,包括分页信息、筛选信息等。可以保证在刷新浏览器窗口或者从编辑页面返回时保留之前的查询状态。
<img width="1714" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/cd3ab1da-ac5c-48c7-a8f2-83f2f86a47bc">
#### Special notes for your reviewer:
需要测试:
1. 附件管理列表的所有筛选项是否可以正常工作。
2. 尝试设置部分筛选,然后刷新页面,观察筛选条件是否正常保留。
#### Does this PR introduce a user-facing change?
```release-note
Console 端的附件管理列表支持在地址栏记录筛选条件。
```
#### What type of PR is this?
/kind improvement
/area core
/area plugin
/milestone 2.8.x
#### What this PR does / why we need it:
修复由于多线程环境下导致的插件卸载时的路由异常问题
改动描述:
为了确保在多线程环境下访问 ExtensionContextRegistry 类的注册表时的线程安全。通过添加读写锁,可以保证在读取和写入PluginApplicationContext 时只有一个线程可以访问,从而避免了多个线程同时访问注册表时可能出现的竞态条件和数据不一致的问题。同时,更新了 register、remove、getByPluginId、containsContext 和 getPluginApplicationContexts 方法,以在访问注册表时获取和释放适当的锁,从而确保了线程安全。
问题原因:
当插件卸载时,卸载动作在 Reconciler 线程中执行而路由访问是在 reactor 的 NonBlockingThread 线程执行,当 PluginCompositeRouterFunction 的 routerFunctions() 方法从 ExtensionContextRegistry 中获取所有 PluginApplicationContext 并持有还未处理完成时由于 PluginReconciler 中执行了卸载插件逻辑而将某个 PluginApplicationContext 关闭从而让 PluginCompositeRouterFunction 中持有到的对象引用发生变化出现数据不一致问题导致出现 `PluginApplicationContext@14971c8e has been closed already` 异常。
解决方案:
所以此修改让读取和写入PluginApplicationContext 时只有一个线程可以访问来解决此问题
how to test it?
测试开发模式下卸载插件时是否会出现如 #4242 中所描述的异常信息
#### Which issue(s) this PR fixes:
Fixes#4242
#### Does this PR introduce a user-facing change?
```release-note
修复由于多线程环境下导致的插件卸载时的路由异常问题
```
#### What type of PR is this?
/kind bug
/kind improvement
/area core
/milestone 2.8.x
#### What this PR does / why we need it:
修复插件被卸载时 delete 生命周期方法不会被触发的问题
how to test it?
1. 测试开发模式下卸载插件,delete 生命周期方法被触发且不会误删项目目录
2. 测试生产模式下插件卸载,文件正确被删除且触发 delete 生命生命周期方法
#### Which issue(s) this PR fixes:
Fixes#4238
#### Does this PR introduce a user-facing change?
```release-note
修复插件被卸载时 delete 生命周期方法不会被触发的问题
```
#### What type of PR is this?
/area console
/kind bug
/milestone 2.8.x
#### What this PR does / why we need it:
修复在非安全域名下,SearchInput 组件无法正常渲染的问题,因为使用了 crypto 接口来随机生成表单的 id。但 crypto 在非安全域名下无法被调用,参考:https://developer.mozilla.org/en-US/docs/Web/API/Crypto
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4250
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area console
/kind feature
/milestone 2.8.x
#### What this PR does / why we need it:
在评论数据管理列表页面路由中记录查询条件,包括分页信息、筛选信息等。可以保证在刷新浏览器窗口或者从其他页面返回的时候不丢失筛选条件。
<img width="1544" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/39573c8d-f664-40d1-8248-90443179ac73">
#### Special notes for your reviewer:
需要测试:
1. 评论管理列表的所有筛选项是否可以正常工作。
2. 尝试设置部分筛选,然后刷新页面,观察筛选条件是否正常保留。
#### Does this PR introduce a user-facing change?
```release-note
Console 端的评论管理列表支持在地址栏记录筛选条件。
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.8.x
#### What this PR does / why we need it:
优化评论扩展点的使用方式
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.8.x
#### What this PR does / why we need it:
优化去除 Html Meta 重复标签的正则表达式
see #4234 for more details.
#### Which issue(s) this PR fixes:
Fixes#4234
#### Does this PR introduce a user-facing change?
```release-note
优化去除 Html Meta 重复标签的正则表达式
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.8.x
#### What this PR does / why we need it:
重构 Console 端文章管理列表的代码结构,封装列表项为单个组件。
#### Special notes for your reviewer:
需要测试文章管理的功能是否正常。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.8.x
#### What this PR does / why we need it:
重构 Console 端页面管理列表的代码结构,封装列表项为单个组件。
#### Special notes for your reviewer:
需要测试页面管理的功能是否正常。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/area core
#### What this PR does / why we need it:
为附件库增加过滤条件,过滤 labels 中包含 `halo.run/hidden` 的分组及其附件。
#### Which issue(s) this PR fixes:
Fixes#4251
#### Special notes for your reviewer:
保证默认情况下附件能够正常访问即可。
或者为分组增加 `halo.run/hidden` label,之后查看接口中是否不包含具有目标分组及其附件。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area console
/milestone 2.8.x
#### What this PR does / why we need it:
修复文章状态筛选在刷新页面之后无法回显的问题。
#### Which issue(s) this PR fixes:
see https://github.com/halo-dev/halo/pull/4219#issuecomment-1641310000
#### Special notes for your reviewer:
需要测试:
1. 在文章管理页面选择某个状态筛序项,观察数据是否正常。
2. 刷新页面,观察筛选项是否回显。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area console
/kind feature
/milestone 2.8.x
#### What this PR does / why we need it:
在 Console 端关于用户密码输入的部分添加基本的验证,目前的规则是:
1. 必填,且不能全为空格符
2. 长度为 5-100
3. 字符串前后不能有空格
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4203
#### Special notes for your reviewer:
按照以上规则测试即可。
#### Does this PR introduce a user-facing change?
```release-note
Console 端关于用户密码输入的部分添加基本的验证
```
#### What type of PR is this?
/area console
/kind feature
/milestone 2.8.x
#### What this PR does / why we need it:
在页面数据管理列表页面路由中记录查询条件,包括分页信息、筛选信息等。可以保证在刷新浏览器窗口或者从编辑页面返回时保留之前的查询状态。
<img width="1597" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/5e14019b-9751-4a3f-b5c4-ec28b8ba4380">
#### Special notes for your reviewer:
需要测试:
1. 页面管理列表的所有筛选项是否可以正常工作。
2. 尝试设置部分筛选,然后刷新页面,观察筛选条件是否正常保留。
3. 尝试设置部分筛选,然后选择任意一个页面进行编辑,观察发布之后是否正常返回到管理列表,并正确设置了查询参数。
#### Does this PR introduce a user-facing change?
```release-note
Console 端的页面管理列表支持在地址栏记录筛选条件。
```
#### What type of PR is this?
/kind feature
/area console
#### What this PR does / why we need it:
为 formkit 添加一个 `attachmentPolicySelect` 类型的下拉选择框组件,用来供用户选择附件策略。
同时也添加了一个 `attachmentGroupSelect` 类型的下拉选择框组件,用来供用户选择附件分组。
#### Which issue(s) this PR fixes:
Fixes#4247
#### Special notes for your reviewer:
使用 formkit 组件时将 type 修改为 `attachmentPolicySelect` 或 `attachmentGroupSelect`,查看是否能够展示一个可以选择附件策略或附件分组的组件,
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.8.x
#### What this PR does / why we need it:
优化 Console 端对异步数据轮询的间隔时间
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4214
#### Does this PR introduce a user-facing change?
```release-note
优化 Console 端对异步数据轮询的间隔时间
```
#### What type of PR is this?
/area console
/kind bug
/milestone 2.8.x
#### What this PR does / why we need it:
修复主题设置选项卡切换的延迟问题。
#### Which issue(s) this PR fixes:
Fixes#4239
#### Special notes for your reviewer:
需要测试:
1. 进入主题设置,尝试对设置选项卡进行切换,观察选项卡和实际的设置表单是否一致。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/area plugin
/milestone 2.7.x
#### What this PR does / why we need it:
修复生产模式下插件安装时的位置信息为绝对路径会影响迁移的问题
how to test it?
1. 生产模式下安装插件看 annotation 中 `plugin.halo.run/plugin-path` 的值是否为相对于 pluginsRoot 的相对路径
2. 在生产模式下在 main 分支启动后安装的插件切换到此 PR 后 `plugin.halo.run/plugin-path` 是否变为相对路径
#### Which issue(s) this PR fixes:
Fixes#4178
#### Does this PR introduce a user-facing change?
```release-note
修复生产模式下插件安装时的位置信息为绝对路径会影响迁移的问题
```
#### What type of PR is this?
/area console
/kind feature
/milestone 2.8.x
#### What this PR does / why we need it:
支持在编辑文章时切换编辑器,不再限制仅新建时允许切换。但需要注意的是,目前只支持同类型的编辑器切换(rawType)。
#### Which issue(s) this PR fixes:
Fixes#4176
#### Special notes for your reviewer:
测试方式:
1. 安装多个编辑器插件,可以在 https://github.com/halo-sigs/awesome-halo 中查找。
2. 测试在新建文章时是否能够正常切换编辑器。
3. 测试在修改文章时能够正常切换同类型的编辑器。
#### Does this PR introduce a user-facing change?
```release-note
Console 端编辑文章时允许同类型的编辑器切换。
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
添加[爱发电](https://afdian.net/a/halo-dev)的赞助入口,以及在 README 上添加 Sponsors 图像,此图像会在 https://github.com/halo-sigs/sponsor-images 仓库中自动更新。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area console
/kind bug
/milestone 2.8.x
#### What this PR does / why we need it:
修复系统设置面板和插件设置面板无法正常显示的问题,此问题由 https://github.com/halo-dev/halo/pull/4102 中升级了 `@vueuse/router` 导致。
#### Which issue(s) this PR fixes:
Fixes#4221
#### Special notes for your reviewer:
需要测试:
1. 测试系统设置能否正常工作。
2. 测试插件的设置能否正常工作。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area console
/kind feature
/milestone 2.8.x
#### What this PR does / why we need it:
全局注册 AnnotationsForm 组件,以暴露给插件使用,让插件可以实现为模型设置 annotations 数据的功能。
#### Which issue(s) this PR fixes:
Fixes#4183
#### Does this PR introduce a user-facing change?
```release-note
Console 端全局注册 AnnotationsForm 组件,以暴露给插件使用
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.8.x
#### What this PR does / why we need it:
简化系统设置页面,选项卡的状态管理逻辑,放弃动态路由的模式,改为使用路由查询参数代替。
原由:https://github.com/halo-dev/halo/pull/4041#issuecomment-1622921084
#### Special notes for your reviewer:
需要测试:
1. 测试系统设置页面能否正常工作即可。
#### Does this PR introduce a user-facing change?
```release-note
重构 Console 端系统设置页面的路由结构
```
#### What type of PR is this?
/area console
/kind feature
/milestone 2.8.x
#### What this PR does / why we need it:
在文章数据管理列表页面路由中记录查询条件,包括分页信息、筛选信息等。可以保证在刷新页面或者从文章编辑页面返回时保留之前的查询状态。
<img width="1758" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/270948d6-d585-4b36-ad3a-93064cf47548">
TODO:
- [x] 记录筛选条件,因为路由参数只能使用基本类型,但是原来的筛选条件的变量都是完整对象。
#### Which issue(s) this PR fixes:
Fixes#4098
#### Special notes for your reviewer:
需要测试:
1. 文章管理列表的所有筛选项是否可以正常工作。
2. 尝试设置部分筛选,然后刷新页面,观察筛选条件是否正常保留。
#### Does this PR introduce a user-facing change?
```release-note
Console 端的文章管理列表支持在地址栏记录筛选条件。
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.8.x
#### What this PR does / why we need it:
重构 Console 端数据列表的筛选项 UI,并提供全局的筛选列表组件和搜索输入框组件。
> 在此 PR 同时重构了插件列表和用户列表用于验证,其他页面后续提 PR 修改。
<img width="1657" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/ffa42184-46e6-4cb0-b39f-bd7b18869697">
重构之后可以获得:
1. 更好的代码组织。
2. 更好的使用体验。
3. UI 更加容易适配移动端。
#### Which issue(s) this PR fixes:
Fixes#4181
#### Special notes for your reviewer:
需要测试:
1. 测试插件管理和用户管理的数据列表筛选和关键词搜索功能是否正常。
#### Does this PR introduce a user-facing change?
```release-note
重构 Console 端数据列表的筛选项 UI,并提供全局的筛选列表组件和搜索输入框组件。
```
#### What type of PR is this?
/kind cleanup
/area core
#### What this PR does / why we need it:
- Update README
- Bump version to 2.8.0-SNAPSHOT
#### Does this PR introduce a user-facing change?
```release-note
None
```