Commit Graph

4731 Commits (15f7fe2d4fdd2a10a73b7a7e11cdb6ed66466cab)

Author SHA1 Message Date
Ryan Wang 141e22e2c6
feat: add mouse scrolling handler for tabs component (#4453)
#### 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 组件支持通过鼠标滚动选项卡。
```
2023-08-25 08:38:15 +00:00
guqing 5c115563e0
feat: add API to obtain the bundled js file for all enabled plugins (#3444)
#### 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 文件的加载方式
```
2023-08-25 07:28:11 +00:00
Takagi ec0187d8aa
fix: the search for comments by username yields empty results (#4481)
#### 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
解决评论列表根据评论者条件筛选时为空的问题
```
2023-08-25 06:32:11 +00:00
Hilary Liu 42ef7265c7
feat: store attachment view type to localStorage (#4477)
#### 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 端附件管理的显示模式支持缓存到浏览器。
```
2023-08-24 14:38:14 +00:00
BugKing ab5c7da66b
docs: add ProductHunt badge in README.md (#4463)
<!--  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
```
2023-08-23 06:28:14 +00:00
John Niang 67a101efeb
Fix the problem that it is always in deleting phase after deleting backups (#4462)
#### 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
修复因备份数据状态不正常导致无法正常删除备份的问题。
```
2023-08-23 04:16:13 +00:00
guqing 3e5e50fea5
fix: incorrect started plugin records obtained from plugin manager (#4454)
#### 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
```
2023-08-23 03:28:13 +00:00
Ryan Wang 6326ec1d86
refactor: improve plugin upgrade related code to resolve performance issue (#4410)
#### 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 端插件管理列表的性能
```
2023-08-22 08:12:12 +00:00
guqing b437756157
refactor: optimize plugin status updates in plugin reconciler (#4403)
#### 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
```
2023-08-21 06:46:12 +00:00
XinKeng 8ea397da5c
perf: increasing the editor performance (#4445)
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
增强默认编辑器在文章内容过大时的性能。
```
2023-08-20 17:14:12 +00:00
Ryan Wang 43e1e446b6
feat: add reveal button for password input (#4434)
#### 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 类型输入框添加统一的显示/隐藏明文按钮。
```
2023-08-16 06:38:11 +00:00
Ryan Wang 8678d614e2
chore: bump formkit version to 0.18.0 (#4428)
#### What type of PR is this?

/area console
/kind bug
/milestone 2.9.x

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

升级 FormKit 依赖至 [0.18.0](https://formkit.com/changelog#_0180-beta-18)

修复[升级到 0.17.5](https://github.com/halo-dev/halo/pull/4411) 之后输入框失去焦点之后无法提交的问题。

see https://github.com/halo-dev/halo/issues/4424#issuecomment-1677331547

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

Fixes #4424 

#### Special notes for your reviewer:

需要测试各个输入框是否正常工作。

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

```release-note
升级 FormKit 的依赖至 0.18.0
```
2023-08-16 03:30:12 +00:00
Ryan Wang 58679b2811
chore: bump vue related packages version (#4427)
#### 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 以及相关的依赖。
```
2023-08-16 02:16:25 +00:00
guqing bdb8d10ea0
fix: incorrect scope for haloCommentEnabled template variable (#4385)
#### 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
修复评论启用状态的主题模板变量名作用域不正确的问题
```
2023-08-15 10:04:12 +00:00
Takagi bce65c4947
fix: handle external exceptions when uploading files (#4431)
#### 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
修复上传文件时由于外部异常而导致进度条不变的问题
```
2023-08-15 10:02:12 +00:00
Takagi 6282efbe70
fix: redirection fails after login (#4423)
#### 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 重定向链接进行编码
```
2023-08-15 09:00:13 +00:00
Takagi 5779f01161
pref: allow annotations value to be empty (#4419)
#### 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
将元数据值更改为非必填
```
2023-08-14 14:08:13 +00:00
John Niang 8e3bd7f3d8
Support getting backup root path in plugin (#4422)
#### 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
支持在插件中获取备份文件根目录。
```
2023-08-14 11:38:11 +00:00
Ryan Wang 905e867eb3
chore: bump formkit version to 0.17.5 (#4411)
#### 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
```
2023-08-13 14:40:12 +00:00
John Niang c80c5e23c6
Refactor the transformation between data buffers and input stream (#4391)
#### 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 而导致接口卡住的问题。
```
2023-08-12 09:14:11 +00:00
guqing 5690de3f24
refactor: improve the system initialization process (#4306)
* 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>
2023-08-11 09:10:35 +08:00
John Niang 1172f4a98c
Support restarting Halo (#4361)
#### 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。
```
2023-08-09 06:04:11 +00:00
John Niang b9b663e124
Move Backup extension into api module (#4392)
#### 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
```
2023-08-09 02:48:11 +00:00
Takagi 3ec409100b
fix: resolve the issue of ineffective duplicate key validation in AnnotationsForm (#4369)
#### 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 校验无效的问题。
```
2023-08-08 07:04:12 +00:00
John Niang 20df302ef5
Upgrade to SpringDoc 2.2.0 for OpenAPI 3.1 support (#4384)
#### 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
```
2023-08-08 07:02:12 +00:00
Takagi 9774530abd
fix: add random uuid to resolve the issue of id conflicts (#4371)
#### 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
```
2023-08-04 03:11:48 +00:00
Takagi 9b8b4294e5
pref: scroll to the error location when form submission validation fails (#4358)
#### 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
当表单填写错误时,将会自动滚动至错误项。
```
2023-08-03 07:51:27 +00:00
dependabot[bot] 355fb860e5
chore(deps-dev): bump @antfu/utils from 0.7.2 to 0.7.5 in /console (#4363)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-03 15:37:16 +08:00
Takagi 2ee51b0c56
fix: resolve the issue of users being able to delete themselves. (#4355)
#### 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
在用户列表中禁用选中当前用户
```
2023-08-03 07:23:32 +00:00
BugKing 8773f94a8d
docs: add appstore link in readme (#4370)
<!--  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
```
2023-08-03 06:05:26 +00:00
dependabot[bot] 6b748efeaf
chore(deps-dev): bump vite from 4.0.4 to 4.0.5 in /console (#4362)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 4.0.4 to 4.0.5.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v4.0.5/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v4.0.5/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-08-02 21:50:26 +08:00
Ryan Wang 734adeb373
chore: use rollup-plugin-gzip instead of vite-compression-plugin (#4354)
#### 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
```
2023-08-02 13:12:25 +00:00
Roozen f148b1f7b7
chore: move the ExtensionVoOperator to the api directory so that the plugin can implement the interface (#4356)
<!--  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
```
2023-08-02 05:16:02 +00:00
John Niang 7efd29e722
Prepare for developing Halo 2.9.0 (#4344)
#### 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
```
2023-08-01 07:33:45 +00:00
Ryan Wang ebe77ad697
chore: bump console version to prepare release 2.8 (#4341)
#### 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
```
2023-08-01 02:48:16 +00:00
Ryan Wang 370b44f9b5
fix: not reset permission after cloning a role (#4333)
#### 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
修复创建角色时,如果基于某个角色创建,实际权限可能不会更新的问题。
```
2023-08-01 02:46:20 +00:00
知雨 81e985f2af
chore: update zh-tw translation for refresh search engine operation (#4335)
#### 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
优化刷新搜索引擎索引的文案。
```
2023-08-01 02:32:17 +00:00
知雨 181420be7a
chore: update zh-cn translation for refresh search engine operation (#4334)
#### 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
优化刷新搜索引擎索引的文案。
```
2023-08-01 02:30:19 +00:00
Erzbir 897b603ea9
fix: page does not refresh or get wrong page when turn page (#4331)
#### 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
预览附件点击 "下一个" 或者 "上一个" 翻页后, 预览页面不正常刷新
```
2023-07-31 03:42:40 +00:00
Erzbir 8e0538e0d0
fix: click "next" on the last attachment will get null (#4328)
#### 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 端在最后一个附件点击下一项按钮时得到空结果的问题。
```
2023-07-29 09:12:18 +00:00
John Niang 5a18adcdd0
Prepare for releasing 2.8.0-rc.2 (#4323)
#### 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
```
2023-07-28 07:17:18 +00:00
Ryan Wang 38664d45ef
refactor: remove the duplicate button to create a backup (#4322)
#### 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 
```
2023-07-28 03:33:09 +00:00
Ryan Wang 02c47f552a
refactor: refactor pagination component to support display total items (#4303)
#### 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 的分页组件,以支持显示数据总条数。
```
2023-07-28 03:15:08 +00:00
Ryan Wang 4733008e16
fix: content cache was not cleaned up after the new post was saved (#4316)
#### 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
修复新建文章发布或者保存之后,浏览器中的内容缓存没有清空的问题。
```
2023-07-28 03:09:09 +00:00
John Niang 54925efdd4
Remove route when single pages become unpublished (#4318)
#### 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
修复页面取消发布后访问仍然出现页面未找到错误。
```
2023-07-28 03:05:09 +00:00
John Niang 576a3763fd
Add error prompt when downloading backup files that do not exist (#4298)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.8.x

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

Currently, we have not process the deletion of backup files when downloading theme. This PR will handle the situation.

Please see the example result:

```bash
curl -s -u admin:admin -H "Accept-Language: zh" http://localhost:8090/apis/api.console.migration.halo.run/v1alpha1/backups/backup-waELO/files/20230725225726-backup-waELO.zip | jq .
{
  "type": "about:blank",
  "title": "资源不存在",
  "status": 404,
  "detail": "备份文件不存在或已删除。",
  "instance": "http://localhost:8090/apis/api.console.migration.halo.run/v1alpha1/backups/backup-waELO/files/20230725225726-backup-waELO.zip",
  "requestId": "8654fdc6-1478",
  "timestamp": "2023-07-25T15:26:56.771260Z"
}
```

```bash
curl -s -u admin:admin -H "Accept-Language: en" http://localhost:8090/apis/api.console.migration.halo.run/v1alpha1/backups/backup-waELO/files/20230725225726-backup-waELO.zip | jq .
{
  "type": "about:blank",
  "title": "Resource Not Found",
  "status": 404,
  "detail": "The backup file does not exist or has been deleted.",
  "instance": "http://localhost:8090/apis/api.console.migration.halo.run/v1alpha1/backups/backup-waELO/files/20230725225726-backup-waELO.zip",
  "requestId": "4f58e158-1480",
  "timestamp": "2023-07-25T15:27:18.451308Z"
}
```

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

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

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

```release-note
None
```
2023-07-28 03:03:09 +00:00
Ryan Wang e0d79cc2b2
fix: user detail page switching does not take effect (#4321)
#### 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
修复用户详情页面切换用户之后,数据不更新的问题。
```
2023-07-28 02:57:10 +00:00
Ryan Wang eced9365a2
fix: unable to expand the replies list of the comment (#4305)
#### 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 的评论有新回复时,无法展开回复列表的问题。
```
2023-07-28 02:35:09 +00:00
Ryan Wang 57ec43bedc
feat: add download tips in plugin and theme installation modal (#4314)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.8.x

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

在安装主题和插件的界面中添加下载源的提示。

<img width="631" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/f28d0f24-8c65-4589-a5c0-32fea3a2bd2b">

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

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

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

```release-note
在安装主题和插件的界面中添加下载源的提示。
```
2023-07-28 02:21:09 +00:00
John Niang 150e9975ba
Suppress compilation warnings and remove deprecated method and classes (#4308)
#### 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
```
2023-07-27 08:59:19 +00:00