Commit Graph

4346 Commits (01b81f1afca0facf4e1ac3c164de26655cccb28d)

Author SHA1 Message Date
John Niang 3b61807e8b
Fix the problem of being able to search deleted posts (#3877)
#### What type of PR is this?

/kind bug
/kind improvement
/area core

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

This PR refactors post reconciler to reduce post updates and refines post events.

Previously, we need 3 - 4 updates per reconciliation, but now we only need 1. And all events collected in reconciler will be fired after updating post.

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

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

#### Special notes for your reviewer:

0. Install search plugin
1. Create a public post and publish it
2. Search posts
3. Try to make the post private
4. Search posts
5. Try to make the post public
6. Search posts
7. Try to delete the post
8. Search posts
9. Try to recover the post
10. Search posts

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

```release-note
修复依然能搜索到已删除文章的问题
```
2023-05-09 02:49:43 +00:00
John Niang 0564c5dc35
Upgrade version to 2.6.0-SNAPSHOT (#3916)
#### What type of PR is this?

/kind chore
/area core

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

Upgrade version to 2.6.0-SNAPSHOT for next development iteration.

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

```release-note
None
```
2023-05-09 02:17:43 +00:00
John Niang 7d27cc9712
Change the type of site.url to URL instead of URI (#3910)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.6.x

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

This PR make the type of `site.url` to URL instead of URI. If we don't configure `halo.external-url`, the request URI will be used.

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

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

#### Special notes for your reviewer:

Add the line below into any templates:

```html
<b th:text="${site.url}"></b>
```

And check if the output is correct by accessing `http://localhost:8090` or `http://127.0.0.1:8090` or `http://192.168.xxx.xxx:8090` when `halo.external-url` is not set.

Check if the output is correct by accessing `http://localhost:8090` or `http://127.0.0.1:8090` or `http://192.168.xxx.xxx:8090` when `halo.external-url` is set to `https://halo.run/`.

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

```release-note
修复 site.url 解析有误的问题
```
2023-05-08 10:21:41 +00:00
John Niang 8ffdb5ed1b
Fix the problem of resolving authentication in template when using curl or ab command (#3909)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.6.x

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

When we use curl or ab command to access any pages rendered by thymeleaf at first up, we will get the error described in <https://github.com/halo-dev/halo/issues/3861>.

This PR will resolve the problem by checking null value.

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

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

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

```release-note
解决访问页面无法渲染的问题
```
2023-05-08 08:47:41 +00:00
Ryan Wang acceeee59c
fix: the label of some radio is displayed incorrectly (#3878)
#### 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`。

![image](https://user-images.githubusercontent.com/21301288/235104292-5324be1d-af48-4c7f-8f31-30a9b3dc9c02.png)

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

Fixes #3876 

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

```release-note
修复部分 FormKit 的 radio 表单项的 label 设置不正确的问题。
```
2023-05-04 07:58:39 +00:00
Ryan Wang 3bfecd2b38
fix: failed to initialize the preset plugins (#3894)
#### 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
修复在初始化时,预设插件可能初始化失败的问题。
```
2023-05-04 07:54:38 +00:00
guqing a8250500fc
refactor: add system initialization check and redirect to console if not initialized (#3892)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.5.2
#### What this PR does / why we need it:
添加系统初始化检查,如果未初始化则重定向到控制台。

此检查只针对首页,当用户访问首页时检查到未初始化则跳转到 Console 让用户初始化以优化没有数据时的访问体验。

SetupStateCache 用于缓存系统初始化状态,当数据库状态改变时会更新缓存以优化性能,避免每次访问首页都查询数据。

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

A part of #3230

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

```release-note
添加系统初始化检查,如果未初始化则重定向到控制台
```
2023-05-04 07:40:38 +00:00
Ryan Wang 0f039225ab
fix: user avatar link does not support relative paths (#3880)
#### 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 #3879 

#### Special notes for your reviewer:

测试方式:

1. 创建或者编辑用户资料。
2. 从附件库选择头像,检查是否可以通过表单验证。

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

```release-note
修复创建用户或者修改用户资料时,头像链接不支持相对链接的问题。
```
2023-05-04 02:35:08 +00:00
zjy4fun 395794674c
fix: solve logo render error of plugin list (#3888)
解决删除某个插件项导致其他插件项渲染失败的问题

<!--  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:
Fixes https://github.com/halo-dev/halo/issues/3866
<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->

#### Special notes for your reviewer:


https://user-images.githubusercontent.com/106857035/235871211-ee469964-d7b3-41d3-ac9b-6997872ac507.mp4



#### 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-05-03 15:56:33 +00:00
Ryan Wang ec5599068c
chore: bump up version to 2.5.1 (#3874)
#### What this PR does / why we need it:

修改版本号,准备发布 2.5.1。

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

```release-note
None
```
2023-04-28 07:56:19 +00:00
guqing 6789d4c90f
refactor: compatibility issues with plugins lacking loadLocation after upgrading (#3873)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.5.x

#### What this PR does / why we need it:
修复插件缺失路径信息升级后无法使用的兼容性问题

how to test it?
1. 生产模式安装插件
2. 更新插件将插件中的 status.loadLocation 和 metadata.annotations["plugin.halo.run/plugin-path"] 删除
3. 查看插件功能是否正常
#### Does this PR introduce a user-facing change?

```release-note
修复插件缺失路径信息升级后无法使用的兼容性问题
```
2023-04-28 07:40:19 +00:00
Ryan Wang 0794644dbd
chore: bump up version to 2.5.0 (#3870)
#### What this PR does / why we need it:

修改版本号,准备发布 2.5.0。

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

```release-note
None
```
2023-04-28 02:40:17 +00:00
Ryan Wang 6209afb912
chore: update default theme to 1.3.0 (#3868)
#### What type of PR is this?

/kind improvement

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

升级默认主题的版本为 1.3.0:https://github.com/halo-dev/theme-earth/releases/tag/v1.3.0

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

```release-note
None
```
2023-04-28 02:36:17 +00:00
Ryan Wang a0265d2e6b
fix: permalink of singlePage cannot contain special characters (#3867)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.5.x

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

修复页面的链接不能包含特殊字符的问题。

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

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

#### Special notes for your reviewer:

测试方式:

1. 创建一个页面。
2. 尝试设置别名为中文或者其他字符。
3. 尝试包含多个 `/` 分隔符。
4. 尝试访问页面,检查是否能够正常访问。

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

```release-note
修复页面链接包含中文等字符后无法访问的问题。
```
2023-04-28 02:24:17 +00:00
Li d9f2f77bc2
feat: add filtering conditions to the list of comment components (#3842)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.5.x

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

为评论接口增加排序条件。当前只增加了根据创建时间进行正/倒序排列,后续持续进行补充。

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

Fixes #3364 

#### Special notes for your reviewer:
调用评论列表接口。增加排序条件 `sort=creationTimestamp,desc` ,查看列表是否正确排序。

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

```release-note
为评论列表接口增加按照创建时间进行最新/最早排序
```
2023-04-27 08:02:23 +00:00
guqing 8619d96f6a
refactor: optimizing plugin upgrade steps (#3838)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.5.x

#### What this PR does / why we need it:
优化插件的升级流程

how to test it?
1. 测试正常的插件升级是否正常
2. 测试插件升级失败后插件是否会被卸载的问题
3. 测试没有 version 的插件安装是否能成功
4. 在插件目录不会多出一个名为 `{升级插件名称}-null.jar` 的文件

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

Fixes #3839

#### Does this PR introduce a user-facing 
```release-note
优化插件的升级流程
```
2023-04-27 03:50:15 +00:00
Ryan Wang 795d4f9261
chore: bump up version to 2.5.0-rc.2 (#3864)
#### What this PR does / why we need it:

修改版本号,准备发布 2.5.0-rc.2。

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

```release-note
None
```
2023-04-26 13:56:14 +00:00
Ryan Wang abd0f42dab
fix: loading state is not restored when Dialog's onConfirm method has exception (#3852)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.5.x

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

修复在 Dialog 组件中,如果 onConfirm 方法出现异常,按钮加载状态没有复原的问题。

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

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

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

```release-note
None
```
2023-04-26 13:14:15 +00:00
John Niang 4cd6c2f67c
Fix the problem of being able to search private posts after making post private (#3859)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.5.x

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

This PR adds PostVisibleChangedEvent to synchronizing post indices when post visible is changed, whether from public to private or from private to public.

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

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

#### Special notes for your reviewer:

1. Install Search plugin
2. Create a post
3. Try to search the post
4. Make post private
5. Try to search the post
6. Make post public
7. Try to search the post

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

```release-note
修复隐藏的文章已然能够被搜索到问题
```
2023-04-26 10:50:14 +00:00
Ryan Wang 7b8613049a
feat: add supports for copying attachment permalink (#3835)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.5.x

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

添加复制附件链接的功能,支持三种格式:URL、HTML 格式、Markdown 格式。

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

Fixes #3801 

#### Special notes for your reviewer:

测试方式:

1. 上传若干不同格式的附件。
2. 打开附件详情,检查列出的格式是否正确。
3. 检查复制链接的内容是否正确。

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

```release-note
Console 端的附件详情支持复制链接的功能。
```
2023-04-26 07:32:12 +00:00
John Niang 814dc8921a
Upgrade plugin presets (#3854)
#### What type of PR is this?

/kind cleanup
/area core

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

Upgrade to plugin-sitemap 1.0.2 and plugin-feed 1.1.1.

```bash
❯ ./gradlew :application:downloadPluginPresets  
Starting a Gradle Daemon, 1 incompatible Daemon could not be reused, use --status for details

> Task :application:downloadPluginPresets
Download https://github.com/halo-sigs/plugin-search-widget/releases/download/v1.0.0/plugin-search-widget-1.0.0.jar
Download https://github.com/halo-sigs/plugin-comment-widget/releases/download/v1.5.0/plugin-comment-widget-1.5.0.jar
Download https://github.com/halo-sigs/plugin-sitemap/releases/download/v1.0.2/plugin-sitemap-1.0.2.jar
Download https://github.com/halo-sigs/plugin-feed/releases/download/v1.1.1/plugin-feed-1.1.1.jar

BUILD SUCCESSFUL in 4s
8 actionable tasks: 1 executed, 7 up-to-date
```

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

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

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

```release-note
升级预设插件
```
2023-04-26 07:06:12 +00:00
guqing ed3a618ed4
fix: NPE when navigation post not exists (#3847)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.5.x

#### What this PR does / why we need it:
修复文章上下篇数据查询 NPE 问题

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

```release-note
None
```
2023-04-24 13:20:14 +00:00
Ryan Wang 18c0ced64e
chore: bump up version to 2.5.0-rc.1 (#3845)
#### What this PR does / why we need it:

修改版本号,准备发布 2.5.0-rc.1。

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

```release-note
None
```
2023-04-24 12:28:16 +00:00
guqing e412866749
feat: add public APIs for client side (#3787)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.5.x
/kind api-change

#### What this PR does / why we need it:
为客户端提供一套 APIs

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

#### Does this PR introduce a user-facing change?
```release-note
为访客端提供一套完整的 API
```
2023-04-24 12:16:15 +00:00
guqing d589ce56cc
fix: different jar file with the same name appears in the plugins directory after a failed installation (#3841)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.5.x

#### What this PR does / why we need it:
修复插件安装后无法启动会导致卸载后插件 JAR 文件残留的问题

how to test it?
1. 安装一个无法启动的插件,比如在插件声明周期方法中抛一个异常
2. 启动插件,然后卸载插件看插件 JAR 是否被正确删除
3. 如果是插件开发模式则不会删除文件

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

Fixes #3840

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

```release-note
修复插件安装后无法启动会导致卸载后插件 JAR 文件残留的问题
```
2023-04-24 10:20:06 +00:00
Ryan Wang 2dcbceea5e
fix: distance between the login form and the top of the page (#3821)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.5.0

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

修复登录表单与顶部间距异常的问题,并解决在 https://github.com/halo-dev/halo/pull/3756 中提到的在低分辨率屏幕下,语言选择和表单元素重叠的问题。

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

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

#### Special notes for your reviewer:

测试方式:

1. 检查登录页面的表单是否和以前的版本一致即可。
2. 可以尝试调整浏览器的缩放大小,检查是否有样式问题。

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

```release-note
None
```
2023-04-24 10:04:05 +00:00
Ryan Wang d0cc9005b0
perf: improve router scrollBehavior configuration (#3834)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

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

修改 Vue Router 的 scrollBehavior 配置,添加是否是不同路由的跳转,如果是才会在跳转之后滚动到页面顶部。可以解决在 https://github.com/halo-dev/halo/issues/3833 中提到的打开附件详情之后,列表滚动到顶部的问题。这是因为在打开附件详情的时候会修改路由的参数。

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

Fixes #3833 

#### Special notes for your reviewer:

测试方式:

1. 上传若干附件,滚动到列表底部。
2. 然后打开某个附件详情,观察列表是否自动滚动到了顶部,如果没有,则修改有效。

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

```release-note
None
```
2023-04-24 10:00:55 +00:00
Ryan Wang 1681be36d6
fix: category select dropdown cannot be fully displayed in repeater component (#3819)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.5.x

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

修复文章分类和标签选择组件在 Repeater 组件中,下拉框无法完整显示的问题。

<img width="598" alt="image" src="https://user-images.githubusercontent.com/21301288/233818471-0334b449-e2eb-44aa-a5ce-ed9a4ad54e8b.png">

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

Fixes #3479 

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

```release-note
修复 Console 端的文章分类和标签选择组件在 Repeater 组件中,下拉框无法完整显示的问题。
```
2023-04-24 09:56:13 +00:00
guqing ce60aab9d3
refactor: exception message when theme installation failed (#3826)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.5.x

#### What this PR does / why we need it:
优化由于缺少资源文件而安装失败时的异常提示信息
<img width="689" alt="image" src="https://user-images.githubusercontent.com/38999863/233826417-355a6899-578f-4d0b-a9ab-7664e4cd1bf7.png">
#### Which issue(s) this PR fixes:
Fixes #3825

#### Does this PR introduce a user-facing change?
```release-note
None
```
2023-04-24 09:19:33 +00:00
guqing fc77d51c48
refactor: add custom API for create user (#3803)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.5.x
/kind api-change

#### What this PR does / why we need it:
提供自定义 API 用于创建用户账号
简化了创建用户账号需要先创建账号,再分配角色再重置密码的复杂流程。
需要 Console 端适配此 PR

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

#### Does this PR introduce a user-facing change?
```release-note
优化用户账号创建流程
```
2023-04-24 08:19:42 +00:00
John Niang 6ca2cabffb
Upgrade to Spring Boot 3.0.6 (#3832)
#### What type of PR is this?

/kind cleanup
/area core

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

Upgrade to Spring Boot 3.0.6.

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

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

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

```release-note
升级 Spring Boot 至 3.0.6
```
2023-04-24 07:47:43 +00:00
Ryan Wang d441e4731e
feat: add accepts and min,max props for attachment selector modal component (#3827)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.5.x

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

附件选择组件(AttachmentSelectorModal)支持 accepts、min、max 参数用来限定文件格式和数量。同时也为 FormKit 的 attachment 类型添加同样的参数。

另外,Console 的部分表单也跟着做了修改,包括:文章/页面设置中的封面图、系统设置中的 Favicon 和 Logo、分类/标签编辑表单中的封面图、用户资料的头像。

FormKit 中使用:

1. Component

    ```vue
    <FormKit
      name="cover"
      type="attachment"
      :accepts="['image/*']"
    ></FormKit>
    ```

2. Schema
    
    ```yaml
    - $formkit: attachment
      name: cover
      accepts:
        - 'image/*'
    ```

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

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

#### Special notes for your reviewer:

测试方式:

1. 按照上述 FormKit 中的使用方式,自行在主题或者插件配置文件中测试。
2. 测试 Console 中修改的表单:文章/页面设置中的封面图、系统设置中的 Favicon 和 Logo、分类/标签编辑表单中的封面图、用户资料的头像。(均设置为仅允许选择图片(image/*)和最多选择一个(max=1))。

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

```release-note
Console 端的附件选择组件支持 accepts、min、max 参数用来限定文件格式和数量。
```
2023-04-24 07:45:44 +00:00
John Niang 60040ae428
Fix the problem of upgrading plugins with same version (#3836)
#### What type of PR is this?

/kind bug
/area plugin
/area core

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

Close file system after reading plugin descriptor.

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

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

#### How to test?

1. Build a plugin and install it
2. Update plugin.yaml of the plugin, rebuild and upgrade it
3. Check the change you modified

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

```release-note
修复无法正常升级插件的问题
```
2023-04-24 07:43:43 +00:00
Ryan Wang 66eb0bb622
perf: enable hardware acceleration for attachment images (#3831)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

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

为附件库的图片渲染添加硬件加速(GPU)的支持,可以改善在附件库包含大量大图时的操作体验,能够缓解卡顿的问题。不过最终还是需要 https://github.com/halo-dev/halo/issues/2387 的支持。

测试(一共 60 张图片,合计 230m):

before:

<img width="766" alt="image" src="https://user-images.githubusercontent.com/21301288/233842635-3181df5d-fd26-44f1-aa30-314a3dba05a6.png">

after:

<img width="858" alt="image" src="https://user-images.githubusercontent.com/21301288/233842542-38a43b82-6452-4728-81ab-45f0cf528465.png">

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

Fixes #3830 

#### Special notes for your reviewer:

测试方式:

1. 上传若干大图,对比修改前对附件库的操作,以及在文章中选择附件。

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

```release-note
优化 Console 端附件库的图片渲染性能。
```
2023-04-24 03:20:19 +00:00
Ryan Wang 5c308993c6
feat: add required indicator for formkit label (#3824)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

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

为 FormKit 表单中包含了 required 验证的表单元素的 label 添加指示器(*),优化可访问性。

<img width="694" alt="image" src="https://user-images.githubusercontent.com/21301288/233822533-6a30b43e-738a-47f3-92c1-045d34cc1ba3.png">

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

Fixes #3823 

#### Special notes for your reviewer:

测试方式:

1. 检查 Console 端的表单中必填项的 label 是否添加了 * 即可。

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

```release-note
为 FormKit 表单中包含了 required 验证的表单元素的 label 添加指示器(*),优化可访问性。
```
2023-04-23 06:49:28 +00:00
Ryan Wang 629a620668
chore: set eslint max-warnings option and remove unused imports (#3822)
#### What type of PR is this?

/kind improvement
/area console

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

调整 ESLint 的执行参数,添加 max-warnings 为 0,意味着在提交或者运行 CI 的时候不再允许包含 warning 级别的检测。

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

```release-note
None
```
2023-04-23 04:37:33 +00:00
Ryan Wang 9e0fc8283f
feat: improve layout and styles of group formkit input (#3786)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.5.x

Fixes #3734

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

为 FormKit 的 group 输入组件重构布局和样式。

before:

<img width="591" alt="image" src="https://user-images.githubusercontent.com/21301288/232968801-c15bfdcc-5bbe-493e-8a96-a7ff3442e52d.png">


after:

<img width="580" alt="image" src="https://user-images.githubusercontent.com/21301288/232968757-8892f386-3ff2-4147-b1f7-cbfbcfd5bc6e.png">

可以测试的 FormKit Schema:

```yaml
- $formkit: group
  name: author
  label: 作者
  children:
    - $formkit: text
      name: name
      label: 名称
    - $formkit: text
      name: email
      label: Email
```


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

```release-note
为 Console 端 FormKit 的 group 输入组件重构布局和样式。
```
2023-04-23 04:27:32 +00:00
Ryan Wang 61f4729d87
chore: bump tanstack query version and disable refetchOnWindowFocus option by default (#3771)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

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

升级 @tanstack/vue-query 的版本至 [v4.29.1](https://github.com/TanStack/query/releases/tag/v4.29.1),并默认将 `refetchOnWindowFocus` 选项设置为 false。此选项的作用是当窗口重新聚焦时,刷新当前页面请求的状态(重新请求接口),目前暂时不需要使用它。

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

```release-note
升级 Console 端 `@tanstack/vue-query` 依赖的版本至 [v4.29.1](https://github.com/TanStack/query/releases/tag/v4.29.1)
```
2023-04-23 03:37:56 +00:00
Ryan Wang c6f0ac7e71
fix: not reload page after upgrading a plugin (#3781)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.5.x

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

修复升级插件之后没有自动刷新页面的问题,一般情况来说,升级插件之后需要重载插件 Console 部分的资源。

#### Special notes for your reviewer:

测试方式:

1. 以 deployment 模式启动 Halo
2. 测试升级插件之后是否有正常刷新页面

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

```release-note
修复 Console 端升级插件之后没有自动刷新页面的问题。
```
2023-04-23 03:37:39 +00:00
Ryan Wang eec1d0758e
feat: add description component (#3792)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.5.0

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

为 Console 端添加 Description 组件。

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

Fixes #3790 

#### Special notes for your reviewer:

测试方式:

1. 检查主题管理、插件详情、认证方式详情页面的样式是否异常即可。

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


```release-note
为 Console 端添加 Description 组件。
```
2023-04-23 02:49:32 +00:00
Ryan Wang 676df239ea
fix: role templates in the plugin detail page is not loaded. (#3794)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.5.x

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

修复插件页面中的角色模板在首次进入页面时,无法加载的问题。

<img width="984" alt="image" src="https://user-images.githubusercontent.com/21301288/233105675-8677b92b-e055-4b62-bfad-2947303ad901.png">


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

Fixes #3793 

#### Special notes for your reviewer:

测试方式:

1. 安装一个带有角色模板的插件,比如:https://github.com/halo-sigs/plugin-links
2. 进入插件详情页面,观察角色模板是否显示正确。

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

```release-note
修复 Console 端插件详情页面中角色模板无法正常加载的问题。
```
2023-04-22 03:07:41 +00:00
Ryan Wang 50832a09df
perf: close attachment upload modal after click complete button (#3784)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

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

支持在附件上传弹框中点击完成按钮关闭弹框。

<img width="647" alt="image" src="https://user-images.githubusercontent.com/21301288/232964793-d4e94e7a-fc81-4d1b-b0fc-b93d8f5bc537.png">

#### Special notes for your reviewer:

测试方式:

1. 测试上传完附件之后,点击完成按钮,观察是否关闭上传弹框即可。

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

```release-note
优化 Console 端上传附件的弹框,支持点击完成按钮以关闭弹框。
```
2023-04-21 12:33:41 +00:00
guqing f076fc5740
refactor: add validation for initializing super admin username (#3744)
#### What type of PR is this?
/kind improvement
/area core

#### What this PR does / why we need it:
对初始超级管理员用户名增加合法性校验

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

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

```release-note
对初始超级管理员用户名增加合法性校验
```
2023-04-21 03:20:12 +00:00
John Niang 11a5807682
Enable defining Reconciler in plugin (#3789)
#### What type of PR is this?

/kind feature
/area core
/area plugin

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

This PR adds reconciliation mechanism for plugin. After that, we could define a `Reconciler<Request>` like the following when developing plugin:

```java
@Slf4j
@Component
public class ApplicationReconciler implements Reconciler<Reconciler.Request> {

    @Override
    public Result reconcile(Request request) {
        log.info("Application {} changed.", request);
        return Result.doNotRetry();
    }

    @Override
    public Controller setupWith(ControllerBuilder builder) {
        return builder
            .extension(new Application())
            .workerCount(1)
            .build();
    }
}
```

You can reconcile any extensions as needed.

Meanwhile, all plugins will be stopped when Halo is shutting down.

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

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

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

```release-note
支持在插件中定义 Reconciler
```
2023-04-19 10:42:25 +00:00
Ryan Wang 7afb3b8687
feat: import zh_TW locale for uppy component (#3785)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.5.x

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

为上传组件 Uppy 导入中文繁体的语言包。

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

Ref https://github.com/halo-dev/halo/pull/3672

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

```release-note
None
```
2023-04-19 10:40:24 +00:00
guqing 5477e30781
refactor: optimize the exception information (#3747)
#### What type of PR is this?
/kind improvement
/area core

#### What this PR does / why we need it:
优化异常信息
- 5xx 服务器内部错误不显示异常详情到页面,如主题模板表达式错误
- 访问 `GET /apis/api.halo.run/v1alpha1/comments` 提示 400 且不会打印异常堆栈
- 访问不存在的主题静态资源提示 404 且不会打印异常堆栈,如 `GET /themes/guqing-higan/assets/dist/style1.css`

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

#### Does this PR introduce a user-facing change?
```release-note
None
```
2023-04-19 10:26:24 +00:00
John Niang a94c0c7f85
Add property halo.use-absolute-permalink to control permalink generation (#3772)
#### What type of PR is this?

/kind improvement
/kind api-change
/area core
/milestone 2.5.x

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

Add property `halo.use-absolute-permalink`(default is `false`) to control permalink generation. Leave `halo.external-url` as `null` by default.

Meanwhile, I enhanced `ExternalUrlSupplier#getURL` to get URL from not only properties but only http request.

#### How to use it?

```yaml
halo:
  use-absolute-permalink: false
```

Or:

```yaml
halo:
  external-url: https://halo.run/
  use-absolute-permalink: false
```

Or:

```yaml
halo:
  external-url: https://halo.run/
  use-absolute-permalink: true
```

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

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

#### Special notes for your reviewer:

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

```release-note
新增是否生成相对地址的配置
```
2023-04-19 07:54:24 +00:00
Ryan Wang 762747624f
docs: update SECURITY.md for Halo 2.x (#3780)
#### What type of PR is this?

/kind documentation

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

更新 SECURITY.md 文档中支持的版本。

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

```release-note
None
```
2023-04-19 02:47:00 +00:00
Ryan Wang f87295e5c8
perf: reload page after active theme (#3779)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

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

在主题列表激活主题之后,自动刷新页面。

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

Fixes #3778 

#### Special notes for your reviewer:

测试方式:

1. 打开主题列表,选择任意主题激活,观察是否刷新页面。

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

```release-note
优化 Console 端激活主题的流程,支持激活后自动刷新页面
```
2023-04-19 02:23:00 +00:00
Ryan Wang 0fb3496aed
perf: automatically close the installation modal after installing the theme (#3777)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

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

优化安装主题和升级主题的流程,支持在升级或者安装之后自动关闭弹框以及刷新数据。

#### Special notes for your reviewer:

测试方式:

1. 测试升级或者安装新主题之后是否关闭弹框以及是否有提示即可。

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

```release-note
优化 Console 端安装和升级主题的流程,支持自动关闭安装弹框和显示反馈提示
```
2023-04-19 02:21:05 +00:00