#### What type of PR is this?
/area console
/kind feature
/milestone 2.9.x
#### What this PR does / why we need it:
支持选择已有备份进行恢复。
<img width="1628" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/5e3169f7-a604-4e20-9c4e-f6bc68c58d59">
#### Special notes for your reviewer:
需要测试在恢复界面通过选择已有备份进行恢复的功能是否正常。
#### Does this PR introduce a user-facing change?
```release-note
系统恢复功能支持选择已有备份进行系统恢复。
```
#### What type of PR is this?
/area editor
/area console
#### What this PR does / why we need it:
1. mac: 在编辑器中添加command+s保存文章
2. windows: 在编辑器中添加ctrl+s保存文章
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4340
#### Does this PR introduce a user-facing change?
```release-note
Console 端支持通过快捷键保存文章
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.9.x
#### What this PR does / why we need it:
重构数据列表操作项和显示字段扩展点的类型定义和条件判断:
1. `EntityDropdownItem` 改为 `OperationItem` 以适配不同的场景,最开始仅仅是为了提供给 Entity 组件,但后面发现如主题管理列表并没有使用 Entity 组件,所以定义统一改为 Operation 。
2. 修改 `OperationItem` 和 `EntityFieldItem` 的 `visible` 字段为 `hidden`,方便渲染的时候判断,并方便调用方默认不设置值。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area console
/kind feature
/milestone 2.9.x
#### What this PR does / why we need it:
主题管理列表项的操作按钮支持被插件扩展。

#### Which issue(s) this PR fixes:
Fixes#4522
#### 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.9.x
#### What this PR does / why we need it:
Halo 在 https://github.com/halo-dev/halo/pull/4452 中为数据列表的操作选项添加了拓展点,用于通过插件扩展操作选项。但忽略了操作选项的组件需要自定义并且自行处理点击事件,这个时候组件应该比较难拿到数据列表项的数据。
此 PR 对此进行优化,在扩展点方法传入了需要的数据。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.9.x
#### What this PR does / why we need it:
禁用 Dropdown 组件的自动销毁 dom 节点功能,以适配 https://github.com/halo-dev/halo/pull/4452 中拓展操作选项的场景。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area console
/kind bug
/milestone 2.9.x
#### What this PR does / why we need it:
修复可能因为 version 锁的原因导致无法正常切换插件状态,现在改为在调用切换状态接口前,获取一次最新的插件信息,并提供了 retry 的配置,即失败之后重试 3 次。
#### Special notes for your reviewer:
测试能否正常切换插件状态即可。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area console
/milestone 2.9.x
#### What this PR does / why we need it:
解决评论管理中,根据是否已审核状态的筛选无效的问题
#### How to test it?
在评论列表上切换审核状态,查看是否有效。
#### Which issue(s) this PR fixes:
Fixes#4494
#### Does this PR introduce a user-facing change?
```release-note
修复评论管理中审核状态筛选无效的问题
```
#### What type of PR is this?
/kind bug
/area console
/milestone 2.9.x
#### What this PR does / why we need it:
更改自动保存的策略,仅当内容具有缓存时才会执行自动保存。
#### How to test it?
新建/更新一篇文章之后,点击发布,查看是否还存在“文章已保存但未发布” 的提示
#### Which issue(s) this PR fixes:
Fixes#4499
#### Does this PR introduce a user-facing change?
```release-note
修复文章发布后,文章列表显示未发布的问题。
```
#### What type of PR is this?
/area console
/kind feature
/milestone 2.9.x
#### What this PR does / why we need it:
备份列表的操作列表支持被插件扩展。
#### Does this PR introduce a user-facing change?
```release-note
Console 端的备份列表的操作按钮列表支持扩展。
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.9.x
#### What this PR does / why we need it:
在 https://github.com/halo-dev/halo/pull/4473 中移除了插件管理的分页功能,但可能会造成列表底部看起来不协调,所以恢复总条数的文字显示。
#### Which issue(s) this PR fixes:
Fixes#4498
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area console
/kind cleanup
#### What this PR does / why we need it:
更新 Console 中 package.json 文件的 repository 设置。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
本 PR 优化了文章、内容编辑时的本地缓存功能,之前内容对于本地缓存的依赖性非常强,因此导致了部分问题,如 #3820 ,本 PR 计划之后本地缓存将仅用于特殊情况下的内容恢复,因此尝试做了如下修改:
1. 当前正在编辑的文章,会在正常模式(切换路由、刷新页面、失去当前窗口焦点、停止编写一定时间均属于正常模式)下进行自动保存后删除本地缓存。
2. 若本地具有缓存,则会在进入编辑页面时,比对一次 content 的 version,若缓存 version 小于线上 version,则抛弃缓存,若一致,则使用缓存。
但经过测试,本 PR 无法解决如下问题:
1. 同时编辑一篇文章时,内容会被覆盖的问题。
2. 对比版本后会抛弃缓存,而实际上应当将本地缓存加入历史版本中。
#### How to test it?
1. 新建一篇文章,编写任意内容,返回文章页查看是否已经具有新的文章,且内容已被保存。
2. 修改一篇文章的内容,然后返回文章页,查看是否不是从缓存中加载。
3. 断网模式下修改一篇文章的内容,然后返回文章页,联网后,再次打开此文章,查看是否显示从缓存中加载。
4. 断网模式下修改一篇文章的内容,然后返回文章页。在另一个浏览器或页面修改此文章并保存后,回到断网页面联网后,查看是否更新为最新内容。
#### Which issue(s) this PR fixes:
Fixes#3820Fixes#4223
#### Does this PR introduce a user-facing change?
```release-note
减少内容编辑对本地缓存依赖,支持内容自动保存至服务端。
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.9.x
#### What this PR does / why we need it:
移除插件管理列表的分页功能,默认列表出所有安装的插件。
#### Which issue(s) this PR fixes:
Fixes#4469
#### Does this PR introduce a user-facing change?
```release-note
移除 Console 端插件管理列表的分页功能,默认列表出所有安装的插件。
```
#### What type of PR is this?
/area console
/kind bug
/milestone 2.9.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 feature
/area core
/milestone 2.9.x
#### What this PR does / why we need it:
Currently, we only support restoring by uploading backup file. Downloading and uploading larger backup files can be cumbersome for users.
This PR supports restoring with downloadable URL or backup name as well.
#### Special notes for your reviewer:
```bash
# Replace ${BACKUP_NAME} by yourself.
curl -u admin:admin 'http://localhost:8090/apis/api.console.migration.halo.run/v1alpha1/restorations' \
-H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundary3Al7pC6AbBNfB1js' \
--data-raw $'------WebKitFormBoundary3Al7pC6AbBNfB1js\r\nContent-Disposition: form-data; name="backupName"\r\n\r\n${BACKUP_NAME}\r\n------WebKitFormBoundary3Al7pC6AbBNfB1js--\r\n'
```
```bash
# Replace ${DOWNLOAD_LINK} by yourself.
curl -u admin:admin 'http://localhost:8090/apis/api.console.migration.halo.run/v1alpha1/restorations' \
-H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundarytv6cqgmANkCpSuZm' \
--data-raw $'------WebKitFormBoundarytv6cqgmANkCpSuZm\r\nContent-Disposition: form-data; name="downloadUrl"\r\n\r\n${DOWNLOAD_LINK}\r\n------WebKitFormBoundarytv6cqgmANkCpSuZm--\r\n'
```
#### Does this PR introduce a user-facing change?
```release-note
新增提供下载链接或者备份名进行系统恢复的功能。
```
#### What type of PR is this?
/area console
/kind cleanup
/milestone 2.9.x
#### What this PR does / why we need it:
升级 Console 端上传组件(Uppy)相关依赖的版本。
#### Does this PR introduce a user-facing change?
```release-note
升级 Console 端上传组件(Uppy)相关依赖的版本。
```
#### What type of PR is this?
/kind bug
/area console
/kind improvement
#### What this PR does / why we need it:
当用户对头像进行删除或修改时,文章页面和用户页面的头像会出现显示错误。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4408
Fixes https://github.com/halo-dev/halo/issues/4352
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端头像组件的图片更新问题
```
<!-- Thanks for sending a pull request! Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->
#### What type of PR is this?
/kind bug
/area console
<!--
添加其中一个类别:
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement
适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->
#### What this PR does / why we need it:
文章标题过长时,面板“最近文章”会存在日期显示不完整
#### Which issue(s) this PR fixes:
<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.
用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes https://github.com/halo-dev/halo/issues/4304
#### Special notes for your reviewer:
目前我的解决方案是将Entity加上一个flex-wrap,这样可以保证日期显示完整,但是这可能导致上下文章的布局结构不统一。不知是否可以采纳。

#### Does this PR introduce a user-facing change?
<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
用户在仪表板页面为`最近文章`设置的宽度不够时,可以显示创建日期
```
<!-- Thanks for sending a pull request! Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->
#### What type of PR is this?
/kind feature
/area console
<!--
添加其中一个类别:
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement
适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->
#### What this PR does / why we need it:
将 AttachmentFileTypeIcon 在 Console 全局进行注册,以在插件中复用此组件。
#### Which issue(s) this PR fixes:
<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.
用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes https://github.com/halo-dev/halo/issues/4413
#### Special notes for your reviewer:
我把组件放到 `@/components` 里了,不合适我改回去
#### Does this PR introduce a user-facing change?
<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
None
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.9.x
#### What this PR does / why we need it:
移除启动/停止插件的确认弹框。
#### Which issue(s) this PR fixes:
Fixes#4471
#### 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.9.x
#### What this PR does / why we need it:
Console 端的 Tabs 组件支持通过鼠标滚动选项卡。

#### Which issue(s) this PR fixes:
Fixes#4353
#### Special notes for your reviewer:
None
#### Does this PR introduce a user-facing change?
```release-note
Console 端的 Tabs 组件支持通过鼠标滚动选项卡。
```
#### What type of PR is this?
/kind feature
/milestone 2.3.x
/area core
#### What this PR does / why we need it:
提供 `/apis/api.console.halo.run/v1alpha1/plugins/bundle.js` 来获取已启用插件的捆绑后的 main.js 和 style.css 文件
#### Which issue(s) this PR fixes:
Fixes#3442
#### Does this PR introduce a user-facing change?
```release-note
优化已启用插件 jsbundle 文件的加载方式
```
#### What type of PR is this?
/kind bug
/area console
/milestone 2.9.x
#### What this PR does / why we need it:
Console 评论列表中,使用用户名查询时携带 kind
#### How to test it?
在 Console 端评论列表,选中右上角评论者,进行选择。
#### Which issue(s) this PR fixes:
Fixes#4465
#### Does this PR introduce a user-facing change?
```release-note
解决评论列表根据评论者条件筛选时为空的问题
```
#### What type of PR is this?
/kind improvement
/kind console
#### What this PR does / why we need it:
修改附件显示模式后,保存状态
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4476
#### Does this PR introduce a user-facing change?
```release-note
Console 端附件管理的显示模式支持缓存到浏览器。
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.9.x
#### What this PR does / why we need it:
优化插件升级相关代码,解决插件管理列表的潜在性能问题。
#### Which issue(s) this PR fixes:
Fixes#4409
#### Special notes for your reviewer:
需要测试插件安装和升级功能
#### Does this PR introduce a user-facing change?
```release-note
优化 Console 端插件管理列表的性能
```
A function to debounce editor updates was added to the DefaultEditor.vue component. This change was necessary to prevent excessive event executions. Now, 'update:raw', 'update:content', and 'update' events will be emitted 250ms after the last update, reducing the number of redundant operations and increasing the editor's performance.
<!-- Thanks for sending a pull request! Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->
#### What type of PR is this?
/kind improvement
<!--
添加其中一个类别:
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement
适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->
#### What this PR does / why we need it:
目前默认编辑器在文章内容过多时,会出现输入延迟。
#### Which issue(s) this PR fixes:
<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.
用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes#4389
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
增强默认编辑器在文章内容过大时的性能。
```
#### What type of PR is this?
/area console
/kind feature
/milestone 2.9.x
#### What this PR does / why we need it:
为 FormKit 的 password 类型输入框添加统一的显示/隐藏明文按钮。
<img width="541" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/2947cef2-258c-434d-9268-c8b5ad26a9f7">
#### Which issue(s) this PR fixes:
Fixes#4382
#### Special notes for your reviewer:
测试密码输入框的显示隐藏明文按钮是否可以正常使用即可。
#### Does this PR introduce a user-facing change?
```release-note
为 FormKit 的 password 类型输入框添加统一的显示/隐藏明文按钮。
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.9.x
#### What this PR does / why we need it:
升级 Vue 至 3.3 以及相关的依赖。
see https://blog.vuejs.org/posts/vue-3-3
#### Which issue(s) this PR fixes:
Fixes#4425
#### Does this PR introduce a user-facing change?
```release-note
升级 Vue 至 3.3 以及相关的依赖。
```
#### What type of PR is this?
/kind bug
/area console
/milestone 2.9.x
#### What this PR does / why we need it:
原先使用 uppy 上传文件时抛出异常时,处理了 Halo 系统内部异常,但并未处理外部抛出的异常,例如反向代理等,因而会导致上传文件时卡在 0% 或者 100%。
更改之后当上传抛出异常时,首先会尝试将异常信息转换为 JSON,如果转换失败,则代表为外部异常,此时会抛出异常信息,异常信息格式为 `status: statusText`。
<img width="1045" alt="image" src="https://github.com/halo-dev/halo/assets/31335418/228a73aa-b22e-40f9-b69d-3180e2f78032">
#### How to test it?
在 Halo 上传接口前增加一层反向代理,并设置最大允许文件值,之后上传超过其值的文件进行尝试,若能够成功抛出异常即可。
#### Which issue(s) this PR fixes:
Fixes#4359
#### Does this PR introduce a user-facing change?
```release-note
修复上传文件时由于外部异常而导致进度条不变的问题
```
#### What type of PR is this?
/kind bug
#### What this PR does / why we need it:
对 console 跳转链接进行编码,用于解决跳转链接中如果携带非标准字符而导致的报错
#### How to test it?
本地开发环境:重定向地址无误且进行了 uri 编码即可。
生产环境:
在 console 后端未登录时,前往应用市场输入网站地址进行安装,之后进行登录,查看是否能够正确跳转。
#### Which issue(s) this PR fixes:
Fixes#4351
#### 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:
由于后端 annotation 的值可以为空,而前端则规定 annotation 值为必填项,因此去除前端必填属性。
#### Which issue(s) this PR fixes:
Fixes#4279
#### Does this PR introduce a user-facing change?
```release-note
将元数据值更改为非必填
```
#### What type of PR is this?
/area console
/kind cleanup
/milestone 2.9.x
#### What this PR does / why we need it:
升级 FormKit 的依赖至 0.17.5
see https://formkit.com/changelog
#### Does this PR introduce a user-facing change?
```release-note
升级 FormKit 的依赖至 0.17.5
```
* refactor: improve the system initialization process
* Sync api-client
Signed-off-by: Ryan Wang <i@ryanc.cc>
* feat: add initialized state to global info
* Refine setup page ui
Signed-off-by: Ryan Wang <i@ryanc.cc>
* refactor: improve the system initialization process
* Refine setup page ui
Signed-off-by: Ryan Wang <i@ryanc.cc>
* Refine setup page ui
Signed-off-by: Ryan Wang <i@ryanc.cc>
* fix: update with initialize state
* Refactor setup
Signed-off-by: Ryan Wang <i@ryanc.cc>
* refactor: initialization state
* Refactor router guards
Signed-off-by: Ryan Wang <i@ryanc.cc>
* Refine i18n
Signed-off-by: Ryan Wang <i@ryanc.cc>
* Refactor init data
Signed-off-by: Ryan Wang <i@ryanc.cc>
* Refactor init data
Signed-off-by: Ryan Wang <i@ryanc.cc>
* Update console/src/views/system/Setup.vue
Co-authored-by: Takagi <mail@e.lixingyong.com>
* refactor: initialization interface
---------
Signed-off-by: Ryan Wang <i@ryanc.cc>
Co-authored-by: Ryan Wang <i@ryanc.cc>
Co-authored-by: Takagi <mail@e.lixingyong.com>
#### What type of PR is this?
/kind feature
/area core
/milestone 2.9.x
#### What this PR does / why we need it:
Support restarting Halo and enable restart endpoint by default.
Restart endpoint detail:
request uri: `/actuator/restart`
request method: `POST`
Please note that memory usage may slightly increase after restarting Halo.
#### Does this PR introduce a user-facing change?
```release-note
支持在线重启 Halo。
```
#### What type of PR is this?
/kind bug
/area console
#### What this PR does / why we need it:
在 AnnotationsForm 新增 customAnnotationsDuplicateKey 校验规则,校验自定义元数据中是否具有重复的 key。
#### Which issue(s) this PR fixes:
Fixes#4367
#### Special notes for your reviewer:
在任意一个使用 AnnotationsForm 的位置,例如`文章设置 - 元数据` 中,新增一个已经存在的 key,查看是否有重复 key 的校验。
#### Does this PR introduce a user-facing change?
```release-note
修复 AnnotationsForm 重复的 key 校验无效的问题。
```
#### What type of PR is this?
/kind bug
/area console
#### What this PR does / why we need it:
为 AnnotationsForm 的 formkit 表单 id 增加 uuid 前缀,防止由于一个页面具有多个 AnnotationsForm 时编号互相冲突。
#### Which issue(s) this PR fixes:
Fixes#4368
#### Special notes for your reviewer:
检查使用 AnnotationsForm 的界面,例如文章、页面设置的元数据处没有出现问题即可。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area console
#### What this PR does / why we need it:
为 `Formkit` 添加自动滚动至错误的插件,当表单校验不通过时,如果错误处被隐藏,则会滚动至错误处。
#### Which issue(s) this PR fixes:
Fixes#4317
#### Special notes for your reviewer:
找到表单中的必选项或其他校验项,尝试填写一个错误的选项。之后滚动表单直到隐藏当前项,此时点击提交,查看是否能够自动滚动至对应的错误项。
#### Does this PR introduce a user-facing change?
```release-note
当表单填写错误时,将会自动滚动至错误项。
```
#### What type of PR is this?
/kind bug
/area console
#### What this PR does / why we need it:
在用户列表中,禁止用户选中自己,以解决用户能够进行视觉上自我删除的 bug。
<img width="1636" alt="image" src="https://github.com/halo-dev/halo/assets/31335418/d95f7cf5-cfea-49fa-8f68-d13c46bc88c1">
#### Which issue(s) this PR fixes:
Fixes#4350
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
```release-note
在用户列表中禁用选中当前用户
```
#### What type of PR is this?
/area console
/kind cleanup
/milestone 2.9.x
#### What this PR does / why we need it:
使用 [rollup-plugin-gzip](https://www.npmjs.com/package/rollup-plugin-gzip) 代替 [vite-compression-plugin](https://www.npmjs.com/package/vite-compression-plugin) 在 Vite 编译后对资源进行 gzip。
原因是 vite-compression-plugin 已经在 npmjs.com 下架。
#### Special notes for your reviewer:
无特别需要注意,CI 能通过就行。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind cleanup
/area core
#### What this PR does / why we need it:
Bump up Halo to `2.9.0-SNAPSHOT` for developing Halo 2.9.0.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind cleanup
#### What this PR does / why we need it:
修改 Console 以及其下 packages 的版本号,发布 Halo 2.8
#### 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:
修复创建角色时,如果基于某个角色创建,实际权限可能不会更新的问题。
#### Special notes for your reviewer:
需要测试:
1. 基于超级管理员创建新角色。
2. 取消勾选一些角色模板。
3. 测试此角色是否存在取消了勾选的角色模板。
#### Does this PR introduce a user-facing change?
```release-note
修复创建角色时,如果基于某个角色创建,实际权限可能不会更新的问题。
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.8.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 console
/milestone 2.8.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 bug
/area console
#### What this PR does / why we need it:
在预览附件时点击 "下一个" 或者 "上一个", 如果这时翻页, 预览页面可能不会刷新, 也可能刷新到其他非预料中的页面
#### Which issue(s) this PR fixes:
Fixes#4330
#### Special notes for your reviewer:
1. 准备附件测试翻页
2. 在第一页的最后一个附件预览中点击 "next", 观察是否正常
3. 在第二页的第一个附件预览中点击 "pre", 观察是否正常
#### Does this PR introduce a user-facing change?
```release-note
预览附件点击 "下一个" 或者 "上一个" 翻页后, 预览页面不正常刷新
```
#### 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:
Fixes#4326
#### 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 cleanup
#### What this PR does / why we need it:
Bump version of console to 2.8.0-rc.2.
#### 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:
移除备份列表空状态的创建备份按钮,防止出现多个创建的按钮。
<img width="1669" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/2f79c05e-090d-4318-bd91-07680bb881be">
#### 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#4268
#### 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 bug
/milestone 2.8.x
#### What this PR does / why we need it:
修复新建文章发布或者保存之后,浏览器中的内容缓存没有清空的问题。
#### Which issue(s) this PR fixes:
Fixes#4310
#### Special notes for your reviewer:
需要测试:
1. 新建一篇文章,测试未保存到服务器时,刷新浏览器,观察内容是否还存在。
2. 保存之后,再次新建文章,观察编辑器是否没有内容。
#### Does this PR introduce a user-facing change?
```release-note
修复新建文章发布或者保存之后,浏览器中的内容缓存没有清空的问题。
```
#### What type of PR is this?
/area console
/kind bug
/milestone 2.8.x
#### What this PR does / why we need it:
修复用户详情页面切换用户之后,数据不更新的问题。操作路径:
1. 进入任意一个用户的资料页面。
2. 点击左下角当前登录用户的个人资料。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4320
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
```release-note
修复用户详情页面切换用户之后,数据不更新的问题。
```
#### 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 https://github.com/halo-dev/halo/issues/4252
#### 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
#### What this PR does / why we need it:
对头像处理组件的 toolbar 进行国际化处理。
#### Which issue(s) this PR fixes:
Fixes#4296
#### 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:
完善备份恢复界面的 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?
/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?
/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?
/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?
/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?
/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?
/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 feature
/area core
/milestone 2.7.x
#### What this PR does / why we need it:
Add role template for managing cache. Anyone with role `role-template-manage-cache` can see the `Refresh Page Cache` button.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4143
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/area core
/milestone 2.7.x
#### What this PR does / why we need it:
Refactor configuration properties to configure caching with separate names, so that we can enable / disable cache with name.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4144
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.7.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 feature
/area core
#### What this PR does / why we need it:
This PR adds dependency [spring-boot-starter-cache](https://docs.spring.io/spring-boot/docs/current/reference/html/io.html#io.caching) as cache framework and [caffeine](https://github.com/ben-manes/caffeine/wiki) as cache implementation to cache template rendering result.
By default, we disable the cache feature. If you want to enable it, please try to configure properties like this:
```yaml
halo:
cache:
disabled: false
```
#### Which issue(s) this PR fixes:
Fixes#2827
#### Special notes for your reviewer:
1. Start Halo
2. Browse any page twice
3. See the difference in request times
#### Does this PR introduce a user-facing change?
```release-note
支持模板渲染结果缓存
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.7.x
/kind api-change
#### What this PR does / why we need it:
统一主题和插件描述文件的部分字段
1. 统一网站字段为 homepage,将主题的 website 标记为过时并兼容为 homepage
2. 主题添加 license 字段
3. 插件添加 repo
#### Which issue(s) this PR fixes:
Fixes#4011
#### Does this PR introduce a user-facing change?
```release-note
统一主题和插件描述文件的部分字段
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.7.x
#### What this PR does / why we need it:
Console 端部分使用了复制功能的页面,所使用的 useClipboard hook 添加 legacy 参数以解决部分浏览器的兼容问题。
#### Which issue(s) this PR fixes:
Fixes#4113
#### Special notes for your reviewer:
1. 使用路由地址(192.168.x.x)访问 Halo。
2. 测试附件详情弹框的链接复制和概览页面中的复制功能是否正常。
#### Does this PR introduce a user-facing change?
```release-note
优化 Console 端部分页面复制功能的兼容性问题。
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.7.x
#### What this PR does / why we need it:
修复在部分移动端浏览器(比如 iOS Safari)中,下拉框组件(VDropdown)的选项点击无效的问题,即没有触发 click 事件。此问题的原因可能是因为我们用的 floating-vue 组件提供的 `v-close-popper` 指令的兼容问题,最小复现:https://stackblitz.com/edit/vitejs-vite-ncpzhj?file=src%2FApp.vue
此 PR 改写了关闭下拉框的方式,不再使用 v-close-popper 指令,而且对其他使用此组件的地方没有破坏性更新。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3689
Ref https://github.com/halo-dev/halo/issues/2699
#### Special notes for your reviewer:
如果有条件可以在移动端测试一下,尤其是 iOS Safari,目前在桌面端 Chrome 的设备模拟中测试正常。
#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端的下拉框组件选项在移动端无法正常点击的问题。
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.7.x
#### What this PR does / why we need it:
为仪表板内置的小组件添加权限设置,解决部分没有权限的用户访问仪表盘提示异常的问题。
#### Which issue(s) this PR fixes:
Fixes#4111
#### 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.7.x
#### What this PR does / why we need it:
维护 Console 端的开发基础设施。
- 升级 TypeScript 以及 Vue 对于 TS 支持的相关包。
- 优化 packages 下所有包的配置,解决构建时生成 d.ts 文件的异常。
- 解决 TS 异常。
#### Special notes for your reviewer:
尝试执行:
1. pnpm build:packages
2. pnpm typecheck
观察是否正常即可。
#### Does this PR introduce a user-facing change?
```release-note
维护 Console 端的开发基础设施。
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.7.x
#### What this PR does / why we need it:
为默认类型的按钮添加鼠标悬浮的样式。
<img width="333" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/922dd681-a2f1-4875-adef-9d1c5a075467">
#### Which issue(s) this PR fixes:
Fixes#4067
#### Does this PR introduce a user-facing change?
```release-note
Console 端默认类型的按钮添加鼠标悬浮的样式。
```
#### What type of PR is this?
/area console
/kind feature
/milestone 2.7.x
#### What this PR does / why we need it:
支持在创建分类的时候选择上级分类。
<img width="805" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/02912f70-4de4-4b8e-bbbe-f973fbd3e684">
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4040
#### 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.7.x
#### What this PR does / why we need it:
在使用某个三方登录的时候,禁用其他三方登录,防止重复点击。
#### Which issue(s) this PR fixes:
Fixes#4064
#### Special notes for your reviewer:
测试方式:
1. 可安装 https://github.com/halo-sigs/plugin-oauth2 进行测试,可以不用配置各个登录方式,只需开启即可。
2. 在登录页面点击某个三方登录方式,观察所有三方登录方式的按钮是否被禁用。
#### Does this PR introduce a user-facing change?
```release-note
优化 Console 端登录页面的三方登录方式按钮,禁用重复点击。
```
#### What type of PR is this?
/kind improvement
/area console
#### What this PR does / why we need it:
去除`index.html`的`lang`属性以避免console端出现翻译提示
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3692
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
```release-note
避免 Console 端出现翻译提示
```
#### What type of PR is this?
/kind feature
/area core
#### What this PR does / why we need it:
This PR introduces https://github.com/resilience4j/resilience4j to archive the feature. The login endpoint has limited login failures at a rate of 3 per minute.
See https://github.com/halo-dev/halo/issues/4044 for more.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4044
#### Special notes for your reviewer:
1. Start Halo.
2. Try to login with incorrect credential 4 times
3. Check the response.
#### Does this PR introduce a user-facing change?
```release-note
增加登录失败次数限制功能
```
#### What type of PR is this?
/area core
#### What this PR does / why we need it:
修改版本号,准备发布 2.6.0。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/area console
/kind improvement
/milestone 2.6.x
#### What this PR does / why we need it:
优化 Console 端登录之后重定向的体验,解决在重定向时会重新显示登录页面的问题。
#### Which issue(s) this PR fixes:
Fixes#4010
#### Special notes for your reviewer:
测试方式与 https://github.com/halo-dev/halo/pull/3989 相同。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.6.x
#### What this PR does / why we need it:
将 Console 的 Router 模式从 Hash History 改为 Web History。可以让路由看起来更加简洁,也方便在后端或者页面上构建路由。
文档:https://router.vuejs.org/zh/guide/essentials/history-mode.html
#### Special notes for your reviewer:
测试 Console 的各个页面是否正常访问即可。
#### Does this PR introduce a user-facing change?
```release-note
修改 Console 的路由模式为 HTML5 模式。
```
#### What type of PR is this?
/kind feature
/area core
/area console
/milestone 2.6.x
#### What this PR does / why we need it:
新增文章和自定义页面预览功能
提供了以下两个路由用于预览,必须登录且是对应文章或自定义页面的 contributors 才能访问,如果不是 contributor 则先得到没有权限访问异常,如果有权限访问但预览文章不存在则得到 404
- 文章预览 `GET /preview/posts/{name}`
- 自定义页面预览 `GET /preview/singlepages/{name}`
两个路由都可以通过查询参数 snapshotName 来指定需要预览的内容快照,它是可选的,默认为当前正在编辑的内容
#### Which issue(s) this PR fixes:
Fixes#2349
#### Does this PR introduce a user-facing change?
```release-note
新增文章和自定义页面预览功能
```
#### What type of PR is this?
/area console
/kind feature
/milestone 2.6.x
#### What this PR does / why we need it:
Console 端的登录页面支持登录之后重定向到某个链接(通过 redirect_uri 参数)。
支持一下链接形式:
1. 相对地址,比如 `/console#/plugins`、`/apps/app-links`
2. 绝对地址,仅限于同源地址,不支持非同源地址的重定向。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3982
#### Special notes for your reviewer:
测试方式:
1. 在未登录的情况下访问如 `http://127.0.0.1:8090/console#/theme` 地址,观察登录之后是否会返回到这个页面。
2. 手动在登录页面构造如 `https://127.0.0.1:8090/console#/login?redirect_uri=/` 的地址,观察登录之后是否会跳转。
#### Does this PR introduce a user-facing change?
```release-note
Console 端的登录页面支持登录之后重定向到某个站内链接。
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.6.x
#### What this PR does / why we need it:
升级 Uppy 的所有 packages。
#### Special notes for your reviewer:
测试所有上传弹框是否可以正常使用即可。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/area console
/kind api-change
/milestone 2.6.x
#### What this PR does / why we need it:
重构排序参数以统一自定义 APIs 的风格
- 文章的排序参数字段名改为 `creationTimestamp`、`publishTime` 查询参数示例为 sort=creationTimestamp,desc
- 自定义页面排序参数字段名同文章
- 评论排序参数字段名为 `creationTimestamp`,`replyCount`,`lastReplyTime` 查询参数示例为 sort=creationTimestamp,desc
需要 Console 适配
#### Which issue(s) this PR fixes:
Fixes#3464
#### Does this PR introduce a user-facing change?
```release-note
重构排序参数以统一自定义 APIs 的风格
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.6.x
#### What this PR does / why we need it:
升级 ESLint 和 Prettier 相关的包。
#### Does this PR introduce a user-facing change?
```release-note
None
```
<!-- Thanks for sending a pull request! Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->
#### What type of PR is this?
/kind bug
<!--
添加其中一个类别:
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement
适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->
#### What this PR does / why we need it:
修复插件详情页面协议名字重复出现的问题
#### Which issue(s) this PR fixes:
<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.
用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes https://github.com/halo-dev/halo/issues/3971
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
NONE
```
<!-- Thanks for sending a pull request! Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->
#### What type of PR is this?
/kind improvement
<!--
添加其中一个类别:
Add one of the following kinds:
/kind improvement
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement
适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->
#### What this PR does / why we need it:
改善分类和标签选择性输入框的输入逻辑

#### Which issue(s) this PR fixes:
<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.
用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes#3959
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->
```release-note
NONE
```
#### What type of PR is this?
/kind bug
#### What this PR does / why we need it:
添加关键字搜索功能到认证方式列表
#### Which issue(s) this PR fixes:
Fixes#3948
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端认证方式列表无法使用搜索的问题。
```
#### What type of PR is this?
/kind improvement
/area console
#### What this PR does / why we need it:
同步 api client。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.6.x
#### What this PR does / why we need it:
1. 移除 Entity 组件最外层容器的手型样式,避免出现可点击性的误导。
2. 为部分数据列表项操作提供更多的访问选项。
1. 文章 / 页面列表添加编辑按钮。
2. 插件列表项添加详情按钮。
3. 附件列表项添加详情按钮。
#### Which issue(s) this PR fixes:
Fixes#3914
#### Does this PR introduce a user-facing change?
```release-note
优化 Console 端部分数据列表的可访问性
```
#### What type of PR is this?
/kind bug
/area console
/milestone 2.6.x
#### What this PR does / why we need it:
#### Which issue(s) this PR fixes:
Fixes#3933
#### Special notes for your reviewer:
1. 创建一个拥有主题查看而没有主题管理权限的角色,并为某个用户分配这个角色。
2. 使用该用户登录 console,点击主题选项卡查看控制台是否报错。
#### Does this PR introduce a user-facing change?
```release-note
修复没有主题管理权限时,进入主题功能页面报错的问题。
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.6.x
#### What this PR does / why we need it:
升级 pnpm 的版本为 pnpm 8,更新 pnpm-lock.yaml 文件。
GitHub Actions 的改动将在 https://github.com/halo-sigs/actions
#### Which issue(s) this PR fixes:
Fixes#3934
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area console
/milestone 2.6.x
#### What this PR does / why we need it:
从 `@halo-dev/components` 包中移除 VCodemirror 组件,改为由 Console 内置。因为观察到 VCodemirror 暂时无法支持 Tree Shaking,即代表如果在其他地方引入了 `@halo-dev/components`,就算没有使用 VCodemirror 组件,也会构建到生产产物。
此外,内置到 Console 之后,改为了异步加载此组件,即进入到使用了 VCodemirror 的组件的页面才会加载相应资源。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3469
#### Special notes for your reviewer:
测试方式:
1. Console 需要 `pnpm build:packages`
2. 测试系统设置中的代码注入部分,观察输入框是否加载正常即可。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milstone 2.6.x
#### What this PR does / why we need it:
将 TanStack Query 的 Network Mode 设置为 always,防止在无网络的情况下,开发环境也无法请求数据。
#### Special notes for your reviewer:
测试方式:断网之后使用开发模式访问 Console,观察请求是否正常发送即可。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area console
/milestone 2.6.x
#### What this PR does / why we need it:
修复部分 FormKit 的 radio 表单项的 label 设置不正确的问题。目前影响范围:
1. 使用了 type 为 `menuCheckbox` `menuRadio` 并将 validation 设置为了 `required`。

#### Which issue(s) this PR fixes:
Fixes#3876
#### Does this PR introduce a user-facing change?
```release-note
修复部分 FormKit 的 radio 表单项的 label 设置不正确的问题。
```
#### What type of PR is this?
/kind bug
/area console
/milestone 2.6.x
#### What this PR does / why we need it:
修复初始化时,预设插件安装失败的问题,目前的解决方案是重试安装操作。
#### Which issue(s) this PR fixes:
Fixes#3893
#### Special notes for your reviewer:
测试方式:
1. 建议参考 https://docs.halo.run/developer-guide/core/build 构建成 Docker 镜像再测试。
2. 测试初始化完成之后,预设插件是否正确安装以及启动即可。
#### Does this PR introduce a user-facing change?
```release-note
修复在初始化时,预设插件可能初始化失败的问题。
```