#### What type of PR is this?
/area console
/kind feature
/milestone 2.9.x
#### What this PR does / why we need it:
Console 端的 Tabs 组件支持通过鼠标滚动选项卡。
![2023-08-21 16 15 46](https://github.com/halo-dev/halo/assets/21301288/8fa56d4d-04d3-47a5-8515-2caf54ac9258)
#### 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 端附件管理的显示模式支持缓存到浏览器。
```
<!-- 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 documentation
<!--
添加其中一个类别:
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:
Add ProductHunt badge in README.md.
```release-note
NONE
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.9.x
#### What this PR does / why we need it:
Before this, if we deleted a backup without filename, the BackupReconciler would get stuck infinitely. And no further backups would be reconciled.
This PR fixes the problem that it is always in deleting phase after deleting backups.
#### Does this PR introduce a user-facing change?
```release-note
修复因备份数据状态不正常导致无法正常删除备份的问题。
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.9.x
#### What this PR does / why we need it:
修复从插件管理器中获取已启动插件的记录不正确的问题
由于 PR #4403 优化了 plugin extension 的 status 与内存状态的同步方式,优先级改为以数据库为准但这样状态维护变得复杂,所以此 PR 还是以内存为准但不同的是:
1. 当状态不一致时在 reconciler 中先将数据库的和内存状态都统一为停止状态即调用 haloPluginManager.stopPlugin 然后将停止状态更新到 status 的 phase 上,在继续后续的逻辑
2. 如果在更新 status 失败时加上重试避免因乐观锁而容易导致插件启动或停止成功但 status 更新失败导致的不一致几率问题。
经过上述两点的双重保障,多次测试后暂没有发现状态不一致的场景
how to test it?
1. 多安装几个插件十个以上最好,测试启动后通过 HaloPluginManager 获取已启动插件名称是否与 Console 已启动插件列表一致
```java
haloPluginManager.getStartedPlugins()
```
2. 对于提供了 console 功能的插件不会出现启动成功但 status 的 entry 为空的情况
#### 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:
优化插件升级相关代码,解决插件管理列表的潜在性能问题。
#### Which issue(s) this PR fixes:
Fixes#4409
#### 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 core
/milestone 2.9.x
#### What this PR does / why we need it:
优化插件 Reconciler 中对 status 的更新
how to test it?
测试插件启动和停止没有问题即可,着重看一下 status 中是否会存在 stylesheet 和 entry 期望有值但却没有值的情况是否会发生
#### Does this PR introduce a user-facing change?
```release-note
None
```
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 core
/milestone 2.9.x
#### What this PR does / why we need it:
修复评论启用状态的主题模板变量名作用域不正确的问题
评论组件标签处理器只会在处理到 `<halo:comment/>` 自定义标签时被执行,而 haloCommentEnabled 状态是评论标签之前使用的那么此时值还没有被评论标签处理器填充所以取不到正确的值,目前的做法是在模板开始解析时填充 haloCommentEnabled 变量到 context,但这样存在的问题时无法判断页面是否使用了评论自定义标签即每个页面都会有这个变量,不过目前没有更好的办法去解决这样的问题。
how to test it?
在模板页面的任意位置使用 `${haloCommentEnabled}` 都能取到正确的值。
#### Which issue(s) this PR fixes:
Fixes#4378
#### 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:
原先使用 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?
/kind feature
/area core
/milestone 2.9.x
#### What this PR does / why we need it:
We already support backup and restore feature in Halo 2.8.0, but we cannot obtain backup files through regular channels in the plugin. For example, we want to upload backup files to OSS in the plugin.
This PR is aimed at solving this problem.
#### 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
```
#### What type of PR is this?
/kind cleanup
/area core
/milestone 2.9.x
#### What this PR does / why we need it:
Before this, If we use a file with length less than 256KB for recovery, the process remains stagnant until we cancel the request.
This PR refactors the transformation between data buffers and input stream and resolve the issue above. We should avoid returning InputStream directly in reactive stream.
- DataBufferUtils before
```java
public static InputStream toInputStream(Flux<DataBuffer> content) throws IOException {
var pos = new PipedOutputStream();
var pis = new PipedInputStream(pos);
write(content, pos)
.doOnComplete(() -> {
try {
pos.close();
} catch (IOException ignored) {
// Ignore the error
}
})
.subscribeOn(Schedulers.boundedElastic())
.subscribe(releaseConsumer(), error -> {
if (error instanceof IOException) {
// Ignore the error
return;
}
log.error("Failed to write DataBuffer into OutputStream", error);
});
return pis;
```
- DataBufferUtils after
```java
public static Mono<InputStream> toInputStream(Publisher<DataBuffer> content,
Scheduler scheduler) {
return Mono.create(sink -> {
try {
var pos = new PipedOutputStream();
var pis = new PipedInputStream(pos);
var disposable = write(content, pos)
.subscribeOn(scheduler)
.subscribe(releaseConsumer(), sink::error, () -> FileUtils.closeQuietly(pos),
Context.of(sink.contextView()));
sink.onDispose(disposable);
sink.success(pis);
} catch (IOException e) {
sink.error(e);
}
});
```
#### Special notes for your reviewer:
Please test for plugins, themes and migrations.
#### Does this PR introduce a user-facing change?
```release-note
解决备份恢复时因文件小于 256KB 而导致接口卡住的问题。
```
* 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 cleanup
/area core
/milestone 2.9.x
#### What this PR does / why we need it:
Move Backup extension into api module to share the extension to plugins.
After this PR is merged, I will publish Halo to maven repository (2.9.0-SNAPSHOT). This way, developers can use the Backup extension in the plugin.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### 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 cleanup
#### What this PR does / why we need it:
This PR upgrades SpringDoc to 2.2.0 for OpenAPI 3.1 support. Please see https://github.com/springdoc/springdoc-openapi/releases/tag/v2.2.0 for more.
#### Special notes for your reviewer:
- Start Halo by using following command:
```bash
./gradlew bootRun --args="--spring.profiles.active=dev --halo.plugin.runtime-mode=deployment"
```
- Try to request <http://localhost:8090/swagger-ui.html> and check if the OpenAPI version is 3.1
#### Does this PR introduce a user-facing change?
```release-note
升级 SpringDoc 至 2.2.0
```
#### 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
在用户列表中禁用选中当前用户
```
<!-- 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 documentation
<!--
添加其中一个类别:
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:
在 Readme 中增加应用市场链接。
<!--
如果当前 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 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
```
<!-- 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:
插件中的VO类目前无法实现接口run.halo.app.theme.finders.vo.ExtensionVoOperator,因为插件的依赖中不存在该接口,导致主题中使用形如`#annotations.get(extension,key)`的语法报错
#### 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-sigs/plugin-links/issues/42)
#### Special notes for your reviewer:
希望更新一下api的依赖包
#### 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 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?
/kind bug
/area core
/milestone 2.8.x
#### What this PR does / why we need it:
- Remove route when single pages become unpublished
- Add some unit tests against the change.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/4309
#### Special notes for your reviewer:
1. Create a single page with slug name `about.html` and publish it.
2. Create a static file `about.html` into static folder`${halo.work-dir}/static/`.
3. Try to request <http://localhost:8090/about.html> and check the result.
4. Unpublish the single page and then do the step 3 again.
#### 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 cleanup
/area core
/milestone 2.8.x
#### What this PR does / why we need it:
- Suppress compilation warnings.
- Remove deprecated methods and classes.
- Remove unused methods.
- Before
```bash
❯ ./gradlew compileJava compileTestJava
> Task :application:compileJava
/Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/core/extension/reconciler/ThemeReconciler.java:48: warning: [removal] ThemePathPolicy in run.halo.app.theme has been deprecated and marked for removal
private final ThemePathPolicy themePathPolicy;
^
/Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/core/extension/reconciler/ThemeReconciler.java:48: warning: [removal] ThemePathPolicy in run.halo.app.theme has been deprecated and marked for removal
private final ThemePathPolicy themePathPolicy;
^
/Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/core/extension/reconciler/ThemeReconciler.java:48: warning: [removal] ThemePathPolicy in run.halo.app.theme has been deprecated and marked for removal
private final ThemePathPolicy themePathPolicy;
^
/Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/core/extension/reconciler/ThemeReconciler.java:48: warning: [removal] ThemePathPolicy in run.halo.app.theme has been deprecated and marked for removal
private final ThemePathPolicy themePathPolicy;
^
/Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/core/extension/reconciler/ThemeReconciler.java:48: warning: [removal] ThemePathPolicy in run.halo.app.theme has been deprecated and marked for removal
private final ThemePathPolicy themePathPolicy;
^
/Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/core/extension/reconciler/ThemeReconciler.java:60: warning: [removal] ThemePathPolicy in run.halo.app.theme has been deprecated and marked for removal
themePathPolicy = new ThemePathPolicy(haloProperties.getWorkDir());
^
/Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/config/WebServerSecurityConfig.java:64: warning: [removal] authorizeExchange() in ServerHttpSecurity has been deprecated and marked for removal
.authorizeExchange().anyExchange()
^
/Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/config/WebServerSecurityConfig.java:65: warning: [removal] and() in ServerHttpSecurity.AuthorizeExchangeSpec has been deprecated and marked for removal
.access(new RequestInfoAuthorizationManager(roleService)).and()
^
/Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/config/WebServerSecurityConfig.java:88: warning: [removal] authorizeExchange() in ServerHttpSecurity has been deprecated and marked for removal
.authorizeExchange().anyExchange().permitAll().and()
^
/Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/config/WebServerSecurityConfig.java:88: warning: [removal] and() in ServerHttpSecurity.AuthorizeExchangeSpec has been deprecated and marked for removal
.authorizeExchange().anyExchange().permitAll().and()
^
/Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/config/WebServerSecurityConfig.java:90: warning: [removal] headers() in ServerHttpSecurity has been deprecated and marked for removal
.headers()
^
/Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/config/WebServerSecurityConfig.java💯 warning: [removal] cache() in ServerHttpSecurity.HeaderSpec has been deprecated and marked for removal
.cache().disable().and()
^
/Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/config/WebServerSecurityConfig.java💯 warning: [removal] and() in ServerHttpSecurity.HeaderSpec has been deprecated and marked for removal
.cache().disable().and()
^
/Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/security/CsrfConfigurer.java:24: warning: [removal] csrf() in ServerHttpSecurity has been deprecated and marked for removal
http.csrf().csrfTokenRepository(CookieServerCsrfTokenRepository.withHttpOnlyFalse())
^
/Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/security/authorization/DefaultRuleResolver.java:58: warning: [removal] visitRulesFor(UserDetails,RuleAccumulator) in AuthorizationRuleResolver has been deprecated and marked for removal
public void visitRulesFor(UserDetails user, RuleAccumulator visitor) {
^
/Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/security/authorization/DefaultRuleResolver.java:43: warning: [removal] rulesFor(UserDetails) in AuthorizationRuleResolver has been deprecated and marked for removal
public PolicyRuleList rulesFor(UserDetails user) {
^
Note: Some input files use or override a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/extension/ReactiveExtensionClientImpl.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
16 warnings
> Task :application:compileTestJava
/Users/johnniang/workspaces/halo-dev/halo/application/src/test/java/run/halo/app/core/extension/reconciler/ThemeReconcilerTest.java:90: warning: [removal] ThemePathPolicy in run.halo.app.theme has been deprecated and marked for removal
final ThemePathPolicy themePathPolicy = new ThemePathPolicy(testWorkDir);
^
/Users/johnniang/workspaces/halo-dev/halo/application/src/test/java/run/halo/app/core/extension/reconciler/ThemeReconcilerTest.java:90: warning: [removal] ThemePathPolicy in run.halo.app.theme has been deprecated and marked for removal
final ThemePathPolicy themePathPolicy = new ThemePathPolicy(testWorkDir);
^
Note: /Users/johnniang/workspaces/halo-dev/halo/application/src/test/java/run/halo/app/security/authorization/RequestInfoResolverTest.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Note: /Users/johnniang/workspaces/halo-dev/halo/application/src/test/java/run/halo/app/migration/BackupReconcilerTest.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
2 warnings
```
- After
```bash
❯ ./gradlew clean compileJava compileTestJava
> Task :api:compileJava
/Users/johnniang/workspaces/halo-dev/halo/api/src/main/java/run/halo/app/extension/Unstructured.java:69: warning: This field does not exist, or would have been excluded anyway.
@EqualsAndHashCode(exclude = "version")
^
Note: /Users/johnniang/workspaces/halo-dev/halo/api/src/main/java/run/halo/app/extension/Unstructured.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
1 warning
> Task :application:compileJava
Note: /Users/johnniang/workspaces/halo-dev/halo/application/src/main/java/run/halo/app/plugin/SpringExtensionFactory.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
> Task :api:compileTestJava
Note: /Users/johnniang/workspaces/halo-dev/halo/api/src/test/java/run/halo/app/infra/utils/JsonUtilsTest.java uses unchecked or unsafe operations.
Note: Recompile with -Xlint:unchecked for details.
BUILD SUCCESSFUL in 7s
22 actionable tasks: 15 executed, 7 up-to-date
```
#### Does this PR introduce a user-facing change?
```release-note
None
```