Commit Graph

4163 Commits (2d56aaeb93d84aab8c147f5d5a366361c1d787d1)

Author SHA1 Message Date
guqing ca4e93d4bb
refactor: initialize default config value by settings after plugin installation (#3161)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.2.x

#### What this PR does / why we need it:
插件安装后根据配置的 settingName 读取默认值创建 ConfigMap
如果配置了 settingName 而没有配置 configMapName 则会自动填充为 uuid 并创建一个 ConfigMap
#### Which issue(s) this PR fixes:

Fixes #3160

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
插件安装后自动初始化 Setting 的默认值
```
2023-01-19 08:56:15 +00:00
John Niang 2241c08371
Fix the problem of not using error template in theme (#3166)
#### What type of PR is this?

/kind bug
/area core

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

Currently, if there is no `error.html` error template in theme, but there is a `404.html` error template, this will not work correctly.

We always get rendering result from global error template `error.html`.

This PR mainly provides a `ThemeTemplateAvailabilityProvider` to check if the template is available in theme instead of in globally predefined templates.

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

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

#### Special notes for your reviewer:

1. Download and install any theme
2. Check the theme folder
3. Check folder `templates/error`
4. Try to remove `templates/error/error.html` template file
5. Create `templates/error/404.html`
6. Request a page which does not exist
7. See the result

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

```release-note
解决主题自定义错误模板不生效的问题。
```
2023-01-19 07:46:14 +00:00
Airbo ZH 637320c344 fix: use comment.metadata.name instead of index as the key of comments list (halo-dev/console#830)
<!--  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 optimization
适当添加其中一个或多个类别(可选):
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:
修复后台删除评论后会导致下方头像错误的bug
#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/3170
<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.
用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->


#### Screenshots:
![becd4362a1064b5cba0a26298df8d8e](https://user-images.githubusercontent.com/50261327/213245296-c304bd40-2a1c-4e10-a7b0-7160fd0ac259.png)
![96585c0a721ffed8be07781b0dd612c](https://user-images.githubusercontent.com/50261327/213245315-e7f7ac1b-a4f0-4d33-9ba3-0c0b6b3c7259.png)

<!--
如果此 PR 有 UI 的改动,最好截图说明这个 PR 的改动。
If there are UI changes to this PR, it is best to take a screenshot to illustrate the changes to this PR.
eg.
Before:
![screenshot-before](https://user-images.githubusercontent.com/screenshot.png)
After:
![screenshot-after](https://user-images.githubusercontent.com/screenshot.png)
-->

#### 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
修复后台删除评论后会导致下方头像错误的bug
```
2023-01-19 04:06:14 +00:00
Ryan Wang f702de4ad1 feat: update theme requires field and supports show failed message (halo-dev/console#826)
#### What type of PR is this?

/kind feature

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

修改主题的 `spec.require` 字段为 `spec.requires`,以及支持显示错误信息。适配:https://github.com/halo-dev/halo/pull/3150

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

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

#### Screenshots:

<img width="1692" alt="image" src="https://user-images.githubusercontent.com/21301288/212800478-0fe53ae8-4e31-4810-89aa-4b06d1b700fb.png">
<img width="1056" alt="image" src="https://user-images.githubusercontent.com/21301288/212800550-7edd7c0a-564c-4df4-baee-b3ffe6b3352d.png">

#### Special notes for your reviewer:

测试方式:

1. Halo 切换到 https://github.com/halo-dev/halo/pull/3150 分支。
2. Console 需要 `pnpm install`。
3. 修改主题的 `spec.requires`,根据 https://github.com/halo-dev/halo/pull/3150 中的测试条件修改这个值。
4. 检查是否可以显示异常版本信息。

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

```release-note
Console 端支持显示主题的版本异常信息
```
2023-01-19 02:58:14 +00:00
Ryan Wang ac21464968 perf: change attachment list layout to list mode (halo-dev/console#827)
#### What type of PR is this?

/kind improvement

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

目前暂时没有缩略图功能,上传大量的大型图片很容易造成浏览器崩溃,故我们临时将附件管理的默认视图模式改为列表模式。

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

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

#### Screenshots:

<img width="1692" alt="image" src="https://user-images.githubusercontent.com/21301288/212832865-f1f22ce2-860f-497a-b091-b4552458bd77.png">


#### Special notes for your reviewer:

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


```release-note
Console 附件管理的默认视图模式改为列表模式。
```
2023-01-18 09:40:15 +00:00
guqing da07d75df3
feat: support validate requires version for theme (#3150)
#### What type of PR is this?
/kind feature
/milestone 2.2.x
/kind api-change

#### What this PR does / why we need it:
主题支持 requires 版本验证
- 主题安装和更新时会校验 requires,如果不通过则抛出异常。
- 主题重载或者 halo 升级后导致主题 requires 不满足条件,则会在 status 中将 phase 标记为 failed

⚠️ 特别说明:
- 由于之前主题的 require 字段沿用了 1.x 版本,并没有发现与插件的 requires 属性命名不相同,因此添加了一个 requires 属性,并将 require 标记为过时,后续移除它,这个改动不算是破坏性,但如果主题需要版本校验则需要更改 theme.yaml 为 requires
- 校验后如果有错误则 console 端应该提示主题升级,这样可以避免用户不知情导致很长时间主题端模板都渲染错误问题。可以通过判断 status.phase 是否为 FAILED 来展示 conditions 的第一个 item 的信息。
- 例如 halo 升级后 requires 不满足条件这种情况,并且这个主题被启用,也不会去取消激活(requires 不满足条件不会导致主题无法激活)。

**Console 需要做适配**
综上,console 应该需要:
- 修改 `Halo 版本要求` 的字段取值,从 *require* -> *requires*
- 提供错误信息展示,让用户知道主题不适配应该升级等错误。

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

#### Special notes for your reviewer:
how to test it?
- 测试安装、升级在 requires 满足条件和不满足时的状况是否符合描述中所述情况。
- 主题重载时加载了一个新的 requires 值触发不满足系统要求条件会在 status 中有错误信息,但不影响主题激活

/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
主题支持 requires 版本验证,原 Halo 版本要求属性从 require 更名为 requires
```
2023-01-18 07:40:15 +00:00
longjuan cb850a85c9
improve the sorting rules of archives by using reverse year order (#3158)
<!--  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
/area core
<!--
添加其中一个类别:
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:
Display archives in reverse chronological order.
#### Which issue(s) this PR fixes:

<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes https://github.com/halo-dev/halo/issues/3157

#### Special notes for your reviewer:
改进前:
![image](https://user-images.githubusercontent.com/28662535/212591149-68683249-76a4-4cba-8b02-9a58901709ec.png)

改进后:
![image](https://user-images.githubusercontent.com/28662535/212591100-2c155cb7-832f-4c19-96bd-b783810138ce.png)

#### 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-01-17 01:44:14 +00:00
Ryan Wang 77a5e99b6a perf: improve plugin loading (halo-dev/console#823)
#### What type of PR is this?

/kind improvement

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

优化 Console 端加载插件资源的逻辑。

1. 查询接口改为自定义接口,传入 enabled 参数进行筛选。
2. 修改符合 Console 插件的筛选判断。
3. 隐藏加载异常的提示。

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

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

#### Special notes for your reviewer:

测试方式:

1. 安装若干带有 Console 端拓展的插件,比如:https://github.com/halo-sigs/plugin-stackedit
2. 检查是否有加载成功。
3. 创建一个没有插件访问权限的角色。
4. 登录之后检查是否有无权限提示。

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


```release-note
优化 Console 端加载插件资源的逻辑。
```
2023-01-16 08:40:14 +00:00
Ryan Wang c8dfdc85b2 feat: add full-functional post category select component for formkit (halo-dev/console#818)
#### What type of PR is this?

/kind feature

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

添加功能更为全面的文章分类选择器,支持以下特性:

1. 按层级展示分类
2. 支持搜索
3. 选中结果支持显示层级

todo list:

- [x] 样式整理
- [x] 支持创建新分类

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

Fixes https://github.com/halo-dev/halo/issues/2670
Fixes https://github.com/halo-dev/halo/issues/2485

#### Screenshots:

<img width="832" alt="image" src="https://user-images.githubusercontent.com/21301288/211768419-087d9727-1468-41a1-868a-62d90eef9cca.png">
<img width="858" alt="image" src="https://user-images.githubusercontent.com/21301288/211768478-dcc70d79-127b-42b0-ae44-e48a6a22273a.png">


#### Special notes for your reviewer:

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

```release-note
重构 Console 端的文章分类选择器。
```
2023-01-16 08:02:13 +00:00
John Niang a81380ef8e
Fix the problem of getting authentication while rendering error page (#3152)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.2.x

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

This PR mainly customizes AnonymousAuthenticationWebFilter and SpringSecurityDialect to make authentication visible in exception web handler. So that we can get SecurityContext while rendering error page.

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

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

#### Test steps

1. Start Halo
2. Request a page which is not found
3. See upper right corner icon
    ![image](https://user-images.githubusercontent.com/16865714/212372504-b489507a-2d85-4f1a-a210-9653ad2fa8c2.png)

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

```release-note
修复错误模板渲染无法获取登录信息的问题
```
2023-01-16 06:10:12 +00:00
Ryan Wang 3288bed3fa feat: make sidebar logo link to home page (halo-dev/console#822)
#### What type of PR is this?

/kind feature

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

将侧边栏的 Logo 链接到首页。

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

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

#### Screenshots:

<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/212281869-19729c60-8e5c-4a50-b087-55b360b1aedb.png">

#### Special notes for your reviewer:

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

```release-note
支持点击 Console 侧边栏 Logo 跳转到首页
```
2023-01-16 03:26:13 +00:00
vayci 233295e8f1 feat: update comment list sorter (halo-dev/console#821)
#### What type of PR is this?

/kind feature

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

修改评论列表默认排序规则,以实现最新评论或最新回复的评论总显示在最前

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

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

#### Screenshots:

![image](https://user-images.githubusercontent.com/17878156/212250458-edaeb149-8c3f-411d-b72b-5a70677cd300.png)

#### Special notes for your reviewer:

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

```release-note
修改评论列表默认排序规则,排序方式新增“最后回复时间”排序方式
```
2023-01-16 03:10:13 +00:00
vayci e03aa4ef72
feat: update default comment sorter (#3149)
#### What type of PR is this?

/kind feature
/kind improvement

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

Update comments default sorter for console

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

Fixes #3138 

#### Special notes for your reviewer:

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

```release-note
修改评论列表默认排序规则:依据最后回复时间及评论创建时间进行排序
```
2023-01-16 02:58:13 +00:00
Ryan Wang e0df9ade6e feat: add full-functional post tag select component for formkit (halo-dev/console#817)
#### What type of PR is this?

/kind feature

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

添加功能更为全面的文章标签选择器,解决在标签过多场景下的适用性问题,支持以下特性:

1. 支持搜索标签。
2. 支持没有搜索结果的时候创建新标签。
3. 支持单选和多选。

> 当前并未考虑实现一个通用的标签创建组件,仅为文章考虑。

todo list:

- [x] 样式整理
- [x] 重命名组件名

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

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

#### Screenshots:

<img width="796" alt="image" src="https://user-images.githubusercontent.com/21301288/211768172-b8dbf1c2-5f7c-4411-b8cc-f0070320649d.png">
<img width="725" alt="image" src="https://user-images.githubusercontent.com/21301288/211768235-8d587374-abad-40c9-b9e0-ea2b27e58495.png">


#### Special notes for your reviewer:

1. 创建若干文章,并进行标签设置的操作。
2. 测试标签选择,搜索,创建,删除,取消选择等操作。

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


```release-note
重构 Console 端的文章标签选择器。
```
2023-01-16 02:58:13 +00:00
longjuan 575fc95876
improve the sorting rules for themes side posts using publishTime (#3148)
<!--  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
/area core
<!--
添加其中一个类别:
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:
Provide administrators with the ability to adjust the order of articles by modifying the publish time.

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

<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes https://github.com/halo-dev/halo/issues/3143

#### Special notes for your reviewer:
修改前:
![image](https://user-images.githubusercontent.com/28662535/212074405-e0a351fe-9293-4a4f-af9c-41f720512f9b.png)
修改后:
![image](https://user-images.githubusercontent.com/28662535/212074498-1091bb62-700e-4e1f-872a-46687cdbd81c.png)

#### 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-01-16 02:54:13 +00:00
John Niang d6ff0fd83c
Simplify TemplateEngine due to upgrade of thymeleaf (#3146)
#### What type of PR is this?

/kind improvement
/area core

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

When we [implemented theme mechanism](https://github.com/halo-dev/halo/pull/2280), some problems of thymeleaf came up in front of us, especially TemplateEngine. So we copied full code of SpringTemplateEngine and SpringWebFluxTemplateEngine and made minor changes to adapt our requirements.

Fortunately, issue https://github.com/thymeleaf/thymeleaf/issues/901 I fired has been fixed, and we have a chance to optimize this part of the code.

See https://github.com/halo-dev/halo/issues/3070 for more.

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

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

#### Special notes for your reviewer:

Hope reviewers test various endpoints.

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

```release-note
None
```
2023-01-14 07:22:13 +00:00
Ryan Wang c06affb46b chore: bump vite version to 4 (halo-dev/console#819)
#### What type of PR is this?

/kind improvement

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

升级 Vite 到 Vite 4,请看:

- https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md#400-2022-12-09
- https://cn.vitejs.dev/guide/migration.html

无破坏更新。

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

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

#### Special notes for your reviewer:

测试方式:

1. 测试开发环境和生产环境是否加载正常即可。
2. 测试包含 Console 的插件是否正常加载。

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

```release-note
升级 Console 项目的 Vite 版本到 Vite 4
```
2023-01-13 05:30:11 +00:00
guqing 5c29ab5750
feat: support validate requires version for plugin (#3114)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.2.x

#### What this PR does / why we need it:
插件安装和升级支持版本校验

BTW: 此 PR 中 PluginReconciler 有一些异常提示是没有加 i18n 的,主要是考虑 Reconciler 与请求不挂钩,无法获取到 request 上下文的 Locale,如果用 Locale.getDefault() 那么后续用户切换语言时也更改不到已经持久化到数据库中的错误信息,可能得靠客户端翻译异常。

参考文档:
- [semver-expressions-api-ranges](https://github.com/zafarkhaja/jsemver#semver-expressions-api-ranges)
- [integrating-with-actuator.build-info](https://docs.spring.io/spring-boot/docs/current/gradle-plugin/reference/htmlsingle/#integrating-with-actuator.build-info)
- [BuildInfoContributor](https://github.com/spring-projects/spring-boot/blob/v3.0.1/spring-boot-project/spring-boot-actuator/src/main/java/org/springframework/boot/actuate/info/BuildInfoContributor.java)

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

#### Special notes for your reviewer:
how to test it?
- 开发模式下不会校验插件填写的 requires,但通过接口安装和升级都会统一校验。
- 在 deployment 模式下安装插件和升级插件会根据 halo 的版本校验插件的 spec.requires 是否符合要求,参考 [semver-expressions-api-ranges](https://github.com/zafarkhaja/jsemver#semver-expressions-api-ranges)。
- 如果 spec.requires 为 `*` 则表示允许所有,如果填写为具体的版本号,例如 requires: "2.2.0" 则隐式表示为 `>=2.2.0`。

可以测试这几种情况是否符合期望。

/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?
```release-note
插件安装和升级支持版本校验
```
2023-01-13 02:50:12 +00:00
John Niang 2a70d59350
Adapt spring.web.resources.cache configuration (#3130)
#### What type of PR is this?

/kind improvement
/area core

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

This PR adapt web properties to control cache of static resources.

Users who want to disable cache can configure like this:

```yaml
spring:
  web:
    resources:
      cache:
        cachecontrol:
          no-cache: true
        use-last-modified: false
```

By default, we have disabled cache in development environment.

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

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

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

```release-note
None
```
2023-01-11 02:38:40 +00:00
Ryan Wang 589bd0d1b4 refactor: refactor the page management and remove the function page (halo-dev/console#816)
#### What type of PR is this?

/kind api-change
/kind improvement

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

1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。

原由请看:https://github.com/halo-dev/halo/issues/3124

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

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

#### Screenshots:

<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">

插件需要自己定义菜单配置,如:

<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">

```diff
export default definePlugin({
-  name: "PluginLinks",
   components: {},
   routes: [
     {
       parentName: "Root",
       route: {
-        path: "/pages/functional/links",
+        path: "/links",
         name: "Links",
         component: LinkList,
         meta: {
           permissions: ["plugin:links:view"],
+          menu: {
+            name: "链接",
+            group: "content",
+            icon: markRaw(RiLinksLine),
+          },
         },
       },
     },
   ],
-  extensionPoints: {
-    "page:functional:create": () => {
-      return [
-        {
-          name: "链接",
-          url: "/links",
-          path: "/pages/functional/links",
-          permissions: ["plugin:links:view"],
-        },
-      ];
-    },
-  },
 });
```

#### Special notes for your reviewer:

测试方式:

1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)


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

```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
guqing 92e57b056b
feat: display unapproved comments created by the current user (#3102)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.2.x
#### What this PR does / why we need it:
主题端显示当前用户创建的未审核通过的评论/回复

在开启了评论审核功能的前提下:
- 如果非匿名用户在主题端创建的评论或回复必须审核通过才能显示。
- 如果用户登录后评论或回复会被立即展示在列表,但仅限创建者可见,审核通过后对所有人可见。
#### Which issue(s) this PR fixes:

Fixes #2731

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?
```release-note
主题端支持显示当前用户创建的未审核的评论
```
2023-01-09 08:20:39 +00:00
guqing 64ed793efd
refactor: support extending jar directories for plugin class loader (#3108)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.2.x

#### What this PR does / why we need it:
修复引入外部依赖的插件以开发模式启动时会出现 NoClassDefFoundError 的问题
see #3107 for more detail.

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

#### Special notes for your reviewer:
how to test it?
以插件 development 模式启动以下两个插件观察是否正常启动:
- https://github.com/halo-sigs/plugin-s3
- https://github.com/halo-sigs/plugin-alioss

期望没有 `Caused by: java. lang. NoClassDefFoundEenon` 错误,且插件正确启动。

/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?
```release-note
修复引入外部依赖的插件以开发模式启动时会出现 NoClassDefFoundError 的问题
```
2023-01-09 08:16:39 +00:00
longjuan 4785660b18 fix: timeout error caused by upload processing for more than 30 seconds (halo-dev/console#813)
<!--  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?

<!--
添加其中一个类别:
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind optimization
适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->
/kind improvement
#### What this PR does / why we need it:
Remove the timeout error prompt caused by the upload server processing for more than 30 seconds
#### Which issue(s) this PR fixes:

<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.
用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes https://github.com/halo-dev/halo/issues/3041
#### Screenshots:

<!--
如果此 PR 有 UI 的改动,最好截图说明这个 PR 的改动。
If there are UI changes to this PR, it is best to take a screenshot to illustrate the changes to this PR.
eg.
Before:
![screenshot-before](https://user-images.githubusercontent.com/screenshot.png)
After:
![screenshot-after](https://user-images.githubusercontent.com/screenshot.png)
-->
![image](https://user-images.githubusercontent.com/28662535/210917239-b4b050f8-766f-4289-9ba2-ccb99bb6ac55.png)
![image](https://user-images.githubusercontent.com/28662535/210917273-c6291485-f420-4f02-a7c8-2b4b286110d4.png)


#### Special notes for your reviewer:
测试:
上传大文件让后端处理过程超过30秒,观察是否报错
或使用[修改后的插件](https://github.com/longjuan/halo-plugin-s3os/actions/runs/3852075387)上传到对象存储,观察61秒后是否上传成功
#### 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
去除上传文件处理时间超过30秒后的报错
```
2023-01-06 03:10:37 +00:00
guqing 9740de8d4a
feat: add the lastModifyTime attribute for post and single page (#3101)
#### What type of PR is this?
/kind improvement
/milestone 2.2.x

#### What this PR does / why we need it:
文章和自定义页面支持展示最后修改时间
- 文章发布后会同步 post.spec.releasedSnapshot 记录的最后修改时间到 post.status.lastModifyTime,自定义页面亦如是。
- 主题端可以通过 `${item.status.lastModifyTime}` 获取(item表示文章或自定义页面 Vo)。
#### Which issue(s) this PR fixes:

Fixes #3090 

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
文章和自定义页面支持展示最后修改时间
```
2023-01-05 02:40:36 +00:00
John Niang 4533a83c0a
Refine docker-run command in README.md (#3098)
#### What type of PR is this?

/kind documentation

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

- Use arguments instead of environments.
- Change Docker image halo:2.0 into halo:2.1

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

```release-note
None
```
2023-01-03 07:34:35 +00:00
vayci eba653346e fix: remove login form icon, fix icon lose warning (halo-dev/console#812)
#### What type of PR is this?

/kind optimization

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

remove login form icon, fix icon lose dev tool console warning

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

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

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

```release-note
NONE
```
2022-12-30 09:22:33 +00:00
John Niang 9676ccee0e
Bump version to 2.2.0-SNAPSHOT for next iteration (#3087)
#### What type of PR is this?

/kind cleanup
/area core

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

Bump version to 2.2.0-SNAPSHOT for next iteration.

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

```release-note
None
```
2022-12-30 04:52:37 +00:00
Ryan Wang 9245e8e7c9
chore: bump theme-earth to 1.1.1 (#3082)
#### What type of PR is this?

/kind improvement

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

将 theme-earth 默认主题升级到 1.1.1

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


```release-note
None
```
2022-12-30 02:36:34 +00:00
Ryan Wang cd3ac7b351 chore: release 2.1.0 (halo-dev/console#811)
#### What type of PR is this?

/kind improvement

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

发布 Console 2.1.0

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

Ref https://github.com/halo-dev/halo/issues/3077

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

```release-note
None
```
2022-12-30 02:32:33 +00:00
Ryan Wang 036fe91e8f feat: add target attribute setting for menu item (halo-dev/console#805)
#### What type of PR is this?

/kind feature

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

支持为菜单项设置链接打开方式。 适配:https://github.com/halo-dev/halo/pull/3072

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

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

#### Screenshots:

<img width="714" alt="image" src="https://user-images.githubusercontent.com/21301288/209922511-120bc82c-4d13-4dd8-9829-0ba173cdc377.png">


#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/3072 的分支。
2. Console 需要 `pnpm install`
3. 创建若干菜单项,并设置打开方式。
4. 检查是否设置正确。

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

```release-note
菜单项支持设置打开方式
```
2022-12-29 13:50:33 +00:00
Ryan Wang a8d3072a15 refactor: editor provider switching (halo-dev/console#803)
#### What type of PR is this?

/kind improvement

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

重构编辑器的选择方式,改为在编辑页面选择,并支持缓存上一次的选择。

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

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

#### Screenshots:

<img width="1662" alt="image" src="https://user-images.githubusercontent.com/21301288/209756212-b14725da-3d89-4416-8860-e75cdb270b75.png">

#### Special notes for your reviewer:

测试方式:

1. 此改动针对文章和自定义页面的编辑。
2. 测试新建页面选择编辑器是否正常。
3. 测试重新进入新建页面,编辑器是否自动选择为了上一次的编辑器。
4. 测试发布文章或者自定义页面之后,重新编辑时,是否选择了正确的编辑器。

编辑器插件可使用:

1. https://github.com/halo-sigs/plugin-bytemd
2. https://github.com/halo-sigs/plugin-stackedit

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

```release-note
重构 Console 端选择编辑器的方式,支持记住上一次的选择。
```
2022-12-29 13:46:34 +00:00
Ryan Wang 3e10162d22 fix: preferred-editor annotation is not set when editing old posts (halo-dev/console#806)
#### What type of PR is this?

/kind bug

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

修复编辑旧文章时,没有为文章设置 `content.halo.run/preferred-editor` 的元数据的问题。

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

Ref https://github.com/halo-dev/halo/issues/3080

#### Special notes for your reviewer:

测试方式:

1. 在有旧数据的情况下切换到此 PR。
2. 编辑一篇旧的文章后保存。
3. 打开文章设置,检查元数据中是否包含了 `content.halo.run/preferred-editor`

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


```release-note
None
```
2022-12-29 13:42:34 +00:00
guqing cc891d6655
feat: add annotations expression object for thymeleaf (#3076)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.1.x
#### What this PR does / why we need it:
新增操作 annotations 的表达式对象
在 thymeleaf 模板中使用示例:
```html
<p th:text="${#annotations.get(user, 'background')}"></p>
<p th:text="${#annotations.getOrDefault(user, 'background', 'default-value')}"></p>
<p th:text="${#annotations.contains(user, 'background')}"></p>
```
#### Which issue(s) this PR fixes:

Fixes #3073

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?
```release-note
新增 Annotations 表达式对象用于在 thymeleaf 中操作自定义模型的 annotations
```
2022-12-29 13:30:34 +00:00
Ryan Wang 955d5bf27b fix: login in safari browser has no effect (halo-dev/console#804)
#### What type of PR is this?

/kind bug

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

修复在 Safari 浏览器登录之后无反应的问题。

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

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

#### Special notes for your reviewer:

测试方式:

1. 在 Safari 浏览器上测试登录之后是否有跳转到仪表盘即可。

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

```release-note
修复 Console 端在 Safari 浏览器登录之后无反应的问题
```
2022-12-29 13:28:33 +00:00
Ryan Wang 69ab794b6d fix: saving an post causes the publish time to be lost (halo-dev/console#807)
#### What type of PR is this?

/kind bug

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

修复保存文章设置导致发布时间丢失的问题。

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

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

#### Special notes for your reviewer:

测试方式:

1. 创建若干文章。
2. 返回到文章管理列表。
3. 打开任意文章的设置。
4. 检查发布时间是否回显,然后保存。
5. 保存之后检查发布时间是否还存在。

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

```release-note
修复 Console 端保存文章设置导致发布时间丢失的问题。
```
2022-12-29 13:10:33 +00:00
Ryan Wang 9abdee50b4 fix: logged-in users cannot access the profile page (halo-dev/console#796)
#### What type of PR is this?

/kind bug

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

修复已登录用户无法访问个人资料页面的问题。

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

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

#### Special notes for your reviewer:

/hold

等待 https://github.com/halo-dev/halo/issues/3035 解决。

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


```release-note
修复 Console 端已登录用户无法访问个人资料页面的问题。
```
2022-12-29 13:04:32 +00:00
John Niang 77dd5b24dd
Cache static resources, including plugin, theme, console, attachment (#3074)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.1.x

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

Add cache control and last modified headers for responses of static resources.

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

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

#### Special notes for your reviewer:

We can check the response header of statis resources to know if the cache control is working correctly.

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

```release-note
完善静态资源的缓存策略
```
2022-12-29 10:14:32 +00:00
guqing 9d0ad5de26
refactor: remove finalizer when resources deleted completely (#3065)
#### What type of PR is this?
/kind improvement
/area core

#### What this PR does / why we need it:
主题卸载时等待删除关联资源后再清除 Finalizer
see #2967 for more detail.
https://github.com/halo-dev/halo/issues/2967#issuecomment-1354384978

#### Which issue(s) this PR fixes:
how to test it?
- 在主题中多添加一个 AnnotationSetting 资源 yaml,测试主题删除是否正常。
- 对包 `org.springframework.retry` 开启 debug 日志后能在删除主题时看到类似如下日志:
```
16:33:02.822 [Test worker] DEBUG org.springframework.retry.support.RetryTemplate - Retry: count=0
16:33:03.128 [Test worker] DEBUG org.springframework.retry.support.RetryTemplate - Checking for rethrow: count=1
```
Fixes #2967
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
主题卸载时等待删除关联资源后再清除 Finalizer
```
2022-12-29 10:12:36 +00:00
Ryan Wang b667e988df
feat: add target attribute for menu item (#3072)
#### What type of PR is this?

/kind feature

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

为 MenuItem 模型添加 a 标签的 target 属性设置。

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

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

#### Special notes for your reviewer:

测试方式请看:https://github.com/halo-dev/console/pull/805

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

```release-note
菜单项支持设置打开方式
```
2022-12-29 10:10:33 +00:00
guqing 5dbd5a06ed
Avoid NPE problems when querying the list of posts in the console (#3068)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.1.x

#### What this PR does / why we need it:
迁移后文章过多,当文章的 Reconciler 还没有执行完时访问 Console 端文章列表会因为 post.status  为 Null 出现 NPE 问题
使用文章的 status 时需要对其进行判空

/cherry-pick release-2.0
#### Which issue(s) this PR fixes:

Fixes #3066

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-12-29 09:42:33 +00:00
John Niang 313605d52c
Provide an endpoint to update user profile (#3067)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.1.x

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

Provide an endpoint to update current user profile instead of whole user data.

##### Request example

```bash
curl -X 'PUT' \
  'http://localhost:8090/apis/api.console.halo.run/v1alpha1/users/-' \
  -H 'accept: */*' \
  -H 'Content-Type: */*' \
  -d '{
  "spec": {
    "displayName": "JohnNiang",
    "email": "johnniang@halo.run",
    "password": "xxx",
    "registeredAt": "2022-12-19T03:46:54.809770900Z",
    "twoFactorAuthEnabled": false,
    "disabled": false
  },
  "status": {
    "permalink": "http://localhost:8090/authors/admin"
  },
  "apiVersion": "v1alpha1",
  "kind": "User",
  "metadata": {
    "finalizers": [
      "user-protection"
    ],
    "name": "admin",
    "annotations": {
      "rbac.authorization.halo.run/role-names": "[\"super-role\"]"
    },
    "version": 3,
    "creationTimestamp": "2022-12-19T03:46:54.911951800Z"
  }
}'
```

##### Response example

```json
{
  "spec": {
    "displayName": "JohnNiang",
    "email": "johnniang@halo.run",
    "password": "{bcrypt}$2a$10$IBV8/q7Q6Fj78Ls5AG1eBO0bCQ.rM6vli5pAVexf/gqu.hNfjJxaq",
    "registeredAt": "2022-12-19T03:46:54.809770900Z",
    "twoFactorAuthEnabled": false,
    "disabled": false
  },
  "status": {
    "permalink": "http://localhost:8090/authors/admin"
  },
  "apiVersion": "v1alpha1",
  "kind": "User",
  "metadata": {
    "finalizers": [
      "user-protection"
    ],
    "name": "admin",
    "annotations": {
      "rbac.authorization.halo.run/role-names": "[\"super-role\"]"
    },
    "version": 5,
    "creationTimestamp": "2022-12-19T03:46:54.911951800Z"
  }
}
```

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

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

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

```release-note
提供更新当前登录用户信息功能
```
2022-12-29 03:16:33 +00:00
Ryan Wang eb80400ade chore: release 2.1.0-rc.1 (halo-dev/console#802)
#### What type of PR is this?

/kind improvement

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

发布 Console 2.1.0-rc.1

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

Ref https://github.com/halo-dev/halo/issues/3050

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


```release-note
None
```
2022-12-26 15:50:31 +00:00
Ryan Wang 93f8a6caff feat: add annotations form for more extension (halo-dev/console#801)
#### What type of PR is this?

/kind feature

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

为更多模型添加 Annotation Form 的支持。此 PR 包括:

1. 自定义页面。
2. 文章分类。
3. 文章标签。
4. 菜单项。
5. 用户。

此 PR 是对 https://github.com/halo-dev/console/pull/770 的补充。

#### Special notes for your reviewer:

测试方式:

1. 将一下内容放到任意一个主题下,后缀为 `yaml`,文件名随意。
    ```yaml
    spec:
      targetRef:
        group: content.halo.run
        kind: Post
      formSchema:
        - $formkit: "text"
          name: "download"
          label: "下载地址"
        - $formkit: "text"
          name: "version"
          label: "版本"
    apiVersion: v1alpha1
    kind: AnnotationSetting
    metadata:
      generateName: annotation-
    ---
    spec:
      targetRef:
        group: content.halo.run
        kind: SinglePage
      formSchema:
        - $formkit: "text"
          name: "download"
          label: "下载地址"
        - $formkit: "text"
          name: "version"
          label: "版本"
    apiVersion: v1alpha1
    kind: AnnotationSetting
    metadata:
      generateName: annotation-
    
    ---
    spec:
      targetRef:
        group: content.halo.run
        kind: Category
      formSchema:
        - $formkit: "text"
          name: "download"
          label: "下载地址"
        - $formkit: "text"
          name: "version"
          label: "版本"
    apiVersion: v1alpha1
    kind: AnnotationSetting
    metadata:
      generateName: annotation-
    ---
    spec:
      targetRef:
        group: content.halo.run
        kind: Tag
      formSchema:
        - $formkit: "text"
          name: "download"
          label: "下载地址"
        - $formkit: "text"
          name: "version"
          label: "版本"
    apiVersion: v1alpha1
    kind: AnnotationSetting
    metadata:
      generateName: annotation-
    ---
    spec:
      targetRef:
        group: ""
        kind: MenuItem
      formSchema:
        - $formkit: "text"
          name: "icon"
          label: "图标"
        - $formkit: "text"
          name: "version"
          label: "版本"
    apiVersion: v1alpha1
    kind: AnnotationSetting
    metadata:
      generateName: annotation-

    ```
3. 后端需要使用 https://github.com/halo-dev/halo/pull/3028
4. 测试上述提到的模型的 Annotations 表单。
5. 检查是否可以设置正常。

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

```release-note
None
```
2022-12-26 15:32:31 +00:00
John Niang da55532777
Refine exception detail with i18n (#3042)
#### What type of PR is this?

/kind feature
/kind api-change
/area core
/milestone 2.1.x

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

- Configuring message source location and name enables i18n message resolution.
- Simple global error handler.
- Refactor some exceptions with `ResponseStatusException` to control what HTTP status and problem detail need to be returned.

**TODO**

- [x] Add more UTs.
#### Which issue(s) this PR fixes:

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

#### Special notes for your reviewer:

Steps to test:

1. Try to refine `src/main/resources/config/i18n/messages_zh.properties` and switch Browser language with Chinese.
2. Delibrately make a mistake as you wish and see the error tips in console.
3. Try to access one page which doesn't exist and see the rendered result.

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

```release-note
完成系统异常的国际化
```
2022-12-26 14:10:31 +00:00
Ryan Wang edd2d90c5b feat: add AnnotationsForm Component to edit extension annotations (halo-dev/console#770)
#### What type of PR is this?

/kind feature

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

提供一个 Annotations 编辑组件,支持由主题或者插件提供表单定义,也支持使用者自定义 key-value,用于扩展资源字段。

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

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

#### Screenshots:

<img width="789" alt="image" src="https://user-images.githubusercontent.com/21301288/209517622-80111fd2-8e79-480f-8ca0-9f7073300b2b.png">


#### Special notes for your reviewer:

测试方式:

1. 将一下内容放到任意一个主题下,后缀为 `yaml`,文件名随意。
    ```yaml
    spec:
      targetRef:
        group: content.halo.run
        kind: Post
      formSchema:
        - $formkit: "text"
          name: "download"
          label: "下载地址"
        - $formkit: "text"
          name: "version"
          label: "版本"
    apiVersion: v1alpha1
    kind: AnnotationSetting
    metadata:
      generateName: annotation-
    ```
3. 后端需要使用 https://github.com/halo-dev/halo/pull/3028
4. 测试为文章设置 Annotations 和自定义的 Annotations。
5. 检查是否可以设置正常。


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

```release-note
文章设置支持设置元数据。
```
2022-12-26 14:08:32 +00:00
Ryan Wang 3a1c264afb
chore: update default theme package (#3051)
#### What type of PR is this?

/kind improvement

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

更新默认主题。 https://github.com/halo-dev/theme-earth/releases/tag/v1.1.0

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

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

#### Special notes for your reviewer:

None

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

```release-note
更新默认主题的版本
```
2022-12-26 13:56:31 +00:00
guqing ddf47f6600
feat: add annotation setting extension (#3028)
#### What type of PR is this?
/kind feature
/milestone 2.1.x
/area core

#### What this PR does / why we need it:
新增 AnnotationSetting 自定义模型以扩展自定义元数据设置表单

主题安装/更新/重载时都会重新加载与 theme.yaml 同层级的其他 yaml,但只会保存 kind 为 Setting 和 AnnotationSetting的,主题卸载时会删除这些 yaml 资源

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

Fixes #3005

#### Special notes for your reviewer:
how to test it?
- 修改影响到了主题安装、更新、重载和删除,需要检查这些功能是否正确加载了 Setting 和 AnnotationSetting
- 插件启动时初始化的 AnnotationSetting 在插件停止时会被删除
- 主题添加了 annotation setting 资源,使用非超级管理员也可以获取

/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
新增 AnnotationSetting 以扩展自定义元数据设置表单
```
2022-12-26 13:54:36 +00:00
Ryan Wang fb1465484a perf: asynchronously load the default editor (halo-dev/console#800)
#### What type of PR is this?

/kind improvement

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

默认编辑器改为异步的形式加载。

优化前后对比:

优化前编译:

<img width="480" alt="image" src="https://user-images.githubusercontent.com/21301288/209529091-07216f42-8668-46fc-80e6-03db5504e576.png">

优化后编译:

<img width="510" alt="image" src="https://user-images.githubusercontent.com/21301288/209529001-31537104-cada-4e3c-b521-8849b53281ce.png">

优化前首次加载:

<img width="1069" alt="image" src="https://user-images.githubusercontent.com/21301288/209529285-a62cfe92-5aa0-47f6-ad7e-9f0210ca97b6.png">

优化后首次加载:

<img width="1067" alt="image" src="https://user-images.githubusercontent.com/21301288/209529349-24aa99b9-5b52-4d44-8144-60028332e9cd.png">

最终会在打开文章编辑页面的时候加载编辑器资源:

![2022-12-26 17 06 45](https://user-images.githubusercontent.com/21301288/209529486-d579b51c-cb14-4a30-a3be-649bfe284300.gif)

> 这个 Gif 的演示做了节流处理来模拟服务器带宽的情况。在带宽不良的情况下会显示加载动画以提示使用者正在加载编辑器。

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

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

#### Special notes for your reviewer:

测试方式:

1. 插件默认编辑器是否正常加载以及功能是否正常即可。

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

```release-note
Console 端的默认编辑器改为异步加载,优化整体的加载性能。
```
2022-12-26 13:34:32 +00:00
Ryan Wang b46b003283 refactor: remove the ability to edit user using yaml (halo-dev/console#799)
#### What type of PR is this?

/kind improvement

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

移除使用 yaml 编辑用户信息的功能。

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

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

#### Special notes for your reviewer:

None

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

```release-note
移除 Console 端使用 yaml 编辑用户信息的功能
```
2022-12-26 10:36:32 +00:00
Ryan Wang 4879d31d61 refactor: attachment upload component (halo-dev/console#784)
#### What type of PR is this?

/kind improvement

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

优化上传附件的组件和附件库选择组件。

1. 附件上传支持缓存选择的分组和策略。
2. 附件上传支持选择分组。
3. 移除附件选择组件的上传 tab,改为和附件库管理中一样的上传组件。

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

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

#### Screenshots:

<img width="722" alt="image" src="https://user-images.githubusercontent.com/21301288/208612167-c7082be4-0fb8-4caa-b246-d15bac525e86.png">

#### Special notes for your reviewer:

测试方式:

1. 测试在附件管理中上传附件的功能是否正常。
2. 测试在附件选择组件中上传附件的功能是否正常。

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

```release-note
优化 Console 端上传附件的功能,支持缓存选择的分组和策略。
```
2022-12-26 06:32:32 +00:00