Commit Graph

4094 Commits (ce9c33c8163a3078aca12f3efaee41401970f7fa)

Author SHA1 Message Date
Ryan Wang 0260b0265f perf: fix CLS issue of actuator page (halo-dev/console#840)
#### What type of PR is this?

/kind improvement

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

修复 Actuator 页面抖动的问题。

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

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

#### Special notes for your reviewer:

测试方式:

1. 测试进入系统概览页面是否会出现 https://github.com/halo-dev/halo/issues/3225 中提到的页面抖动问题。

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

```release-note
修复 Console 端进入系统概览页面会抖动的问题。
```
2023-02-07 08:16:12 +00:00
guqing 6809dbb251
fix: plugin status check to prevent inconsistent status (#3235)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
当开发模式启动时上传 JAR 运行插件会出现插件不存在的异常,但由于 PluginReconciler 中检查状态不一致后 return 在 optional 语句中只是让当前 optional 后面的代码停止执行,还会继续执行 optional 外面的代码导致 status 的异常信息不一致,进而 object equals 始终为 false 而无法让 reconciler 终止运行导致循环。

此 PR 调整了一下代码位置,进入 reconciler 时先进行检查,如果不满足则不执行后面的代码同时将信息写入 plugin.status 让用户知晓。

此问题是修改了 Reconciler 判断逻辑后出现的 https://github.com/halo-dev/halo/pull/3210 ,因此不影响之前的代码只针对当前 2.3.x

#### Special notes for your reviewer:
how to test it?
1. 模拟一个插件找不到的错误场景例如以生产模式启动插件但配置 fixed-plugin 指定为插件项目目录
2. 启动 Halo 看 Reconciler 是否会一直在控制台输出日志
3. 卸载它能成功

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

```release-note
None
```
2023-02-07 07:10:14 +00:00
John Niang df9b04c4d5
Reduce the number of queries to resolve theme (#3238)
#### What type of PR is this?

/kind improvement
/area core

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

Save ThemeContext into ServerWebExchange to reduce the number of queries to resolve theme from 2(or 3) to 1.

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

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

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

```release-note
优化查询主题的查询次数
```
2023-02-07 06:40:12 +00:00
infanx 83436770fd fix: the width of the code input type is not full (halo-dev/console#838)
#### What type of PR is this?
/kind bug


#### What this PR does / why we need it:
修复 Console 端 FormKit 的 Code 输入类型宽度异常

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

Fixes # https://github.com/halo-dev/halo/issues/3227

#### Special notes for your reviewer:

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

```release-note
修复 Console 端 FormKit 的 Code 输入框宽度未占满的问题
```
2023-02-07 06:04:12 +00:00
John Niang df97ee8629
Refine exception message of duplicate key (#3219)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.3.x

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

I create another exception `DuplicateNameException` to map `org.springframework.dao.DuplicateKeyException` when creating extensions.

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

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

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

#### Special notes for your reviewer:

1. Try to create an user which name has already exist
2. See the error

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

```release-note
优化名称重复的错误提示
```
2023-02-03 09:50:11 +00:00
longjuan 29b55acd78 fix: native login box pops up when the session expires (halo-dev/console#836)
<!--  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 console
<!--
添加其中一个类别:
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:
添加`X-Requested-With=XMLHttpRequest`请求头,以阻止spring security 带上`WWW-Authenticate`响应头导致弹出原生登录框。
#### 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/3213

#### 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)
-->

#### Special notes for your reviewer:
使session过期后(直接删除cookie的session或重启后端),继续操作console端,预期不会弹出原生登录框且console端原有的重新登录form正常弹出。
详情https://spring.io/guides/tutorials/spring-security-and-angular-js/ 中搜索X-Requested-With
#### 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-02-03 08:06:11 +00:00
John Niang 4636990d5c
Fix the problem that publishing post always fails (#3210)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.3.x

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

1. Refactor Queue in Controller. I add dirty set of request to avoid lost of new request from other places instead of reconciler.
2. Enhance equals and hashcode methods to ensure we can ignore updates of same extensions.

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

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

#### Special notes for your reviewer:

Please take some time to test publishing posts.

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

```release-note
修复发布文章时经常出现错误的问题
```
2023-02-02 12:16:10 +00:00
guqing 0fd023b8f6
fix: plugin disappeared after plugin with same name reinstalled (#3198)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.2.x

#### What this PR does / why we need it:
修复重复安装插件时 JAR 文件被删除的问题

需要注意的场景:
prod 模式下,假如安装一个 sitemap 插件,版本为 1.0.0 ,而此时 plugins 目录已经存在同名文件 sitemap-1.0.0.jar 文件但 sitemap 的 plugin.yaml 没有被持久化过,则能正常安装,旧的 JAR 文件被覆盖。

see #3159 for more details
#### Which issue(s) this PR fixes:

Fixes #3159

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

```release-note
修复重复安装插件时 JAR 文件被删除的问题
```
2023-02-02 02:44:11 +00:00
John Niang 764b664fd8
Bump Halo version to 2.3.0-SNAPSHOT for main branch (#3201)
#### What type of PR is this?

/kind cleanup
/area core

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

Bump Halo version to 2.3.0-SNAPSHOT and update README.md

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

```release-note
None
```
2023-02-01 08:04:09 +00:00
Ryan Wang 47e1bea2f2 chore: release 2.2.0 (halo-dev/console#835)
#### What type of PR is this?

/kind improvement

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

发布 Console 2.2.0

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


```release-note
None
```
2023-02-01 02:52:10 +00:00
Ryan Wang ef687542b7 feat: default editor supports pasting or dragging pictures to upload (halo-dev/console#825)
#### 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/3109
Fixes https://github.com/halo-dev/halo/issues/2946

#### Screenshots:


#### Special notes for your reviewer:

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


```release-note
Console 端的默认编辑器支持拖拽或者粘贴图片上传
```
2023-02-01 02:50:10 +00:00
Ryan Wang 6044001c9b fix: theme page cannot be opened after the development environment is initialized (halo-dev/console#833)
#### 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/3187

#### Special notes for your reviewer:

测试方式:

1. 在开发环境使用全新的数据库初始化。
2. 检查是否能够正常的访问主题管理页面。

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

```release-note
None
```
2023-02-01 02:48:10 +00:00
John Niang 0c18fb3ec4
Fix the problem of not initializing default theme correctly (#3194)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.2.x

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

Make requires field of Theme not required.

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

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

#### Special notes for your reviewer:

1. Clear Halo working directory
2. Start Halo freshly

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

```release-note
None
```
2023-01-31 14:18:10 +00:00
Ryan Wang 3f5ca2b39f chore: bump @halo-dev/richtext-editor to supports more feature about media (halo-dev/console#834)
#### What type of PR is this?

/kind feature

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

升级默认编辑器版本,改动请查阅:

1. https://github.com/halo-sigs/richtext-editor/pull/4
2. https://github.com/halo-sigs/richtext-editor/pull/3
3. https://github.com/halo-sigs/richtext-editor/pull/2

#### Special notes for your reviewer:

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

```release-note
升级 Console 端默认编辑器版本,以支持图片位置和大小设置、插入音视频等功能。
```
2023-01-31 14:10:09 +00:00
John Niang c079762f65
Upgrade Lucene to 9.5.0 (#3190)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.2.x

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

See https://lucene.apache.org/core/9_5_0/MIGRATE.html for more.

#### Special notes for your reviewer:

Please confirm that the search widget is working fine.

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

```release-note
升级依赖 Lucene 至 9.5.0
```
2023-01-31 07:14:09 +00:00
John Niang f851b1ba53
Upgrade pf4j to 3.9.0 (#3191)
#### What type of PR is this?

/kind imporvement
/area core
/milestone 2.2.x

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

See 2d3cf24fed/CHANGELOG.md (390---2023-01-30) for more.

#### Special notes for your reviewer:

Please confirm that the plugin module is working fine.

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

```release-note
升级依赖 PF4J 至 3.9.0
```
2023-01-31 06:10:10 +00:00
John Niang b0be55cfad
Upgrade jasync-sql to 2.1.23 (#3192)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.2.x

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

See https://github.com/jasync-sql/jasync-sql/releases/tag/2.1.23 for more.

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

```release-note
升级依赖 jasync-sql 至 2.1.13
```
2023-01-31 05:54:09 +00:00
Ryan Wang c2e967c377 feat: add actuator view page (halo-dev/console#832)
#### What type of PR is this?

/kind feature

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

添加 Actuator 信息查看页面。适配 https://github.com/halo-dev/halo/pull/3182

todo:

- [x] 页面入口

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

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

#### Screenshots:

![image](https://user-images.githubusercontent.com/21301288/215386617-e3aafc6d-777d-49e8-93c9-b9432623e98e.png)


#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/3182 分支。
2. Console 需要 `pnpm build:packages`
3. 访问 http://localhost:8090/console#/actuator

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

```release-note
Console 端添加系统信息查看页面
```
2023-01-31 03:24:09 +00:00
John Niang ef45f396d8
Upgrade SpringDoc to 2.0.2 (#3186)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.2.x

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

See <https://github.com/springdoc/springdoc-openapi/releases/tag/v2.0.2> and <https://github.com/springdoc/springdoc-openapi/releases/tag/v2.0.1> for more.

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

```release-note
升级依赖 SpringDoc 至 2.0.2
```
2023-01-31 03:04:09 +00:00
John Niang bb7fe81343
Add spring-context-indexer to speed up startup (#3185)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.2.x

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

See https://docs.spring.io/spring-framework/docs/current/reference/html/core.html#beans-scanning-index for more.

#### Special notes for your reviewer:

This might help a little, bu we have to.

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

```release-note
None
```
2023-01-31 02:58:09 +00:00
Ryan Wang 4c816dcde1 refactor: change api of fetching post and singlepage content (halo-dev/console#828)
#### What type of PR is this?

/kind improvement

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

修改获取文章和自定义页面内容的 API,用于适配:https://github.com/halo-dev/halo/pull/3168

#### Special notes for your reviewer:

测试方式:

1. 测试文章和自定义页面编辑时,能否正常获取内容即可。

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

```release-note
None
```
2023-01-31 02:52:09 +00:00
John Niang 1810255aea
Provide system config endpoint (#3182)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.2.x

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

Provide `globalconfig` actuator endpoint to let console and theme know how to do according various system configuration. The endpoint allows anonymous users to access, but other actuator endpoints can be accessed by admin users.

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

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

#### Special notes for your reviewer:

Try to request <http://localhost:8090/actuator/globalinfo> and see the result.

```json
{
   "externalUrl":"http://localhost:8090",
   "timeZone":"Asia/Shanghai",
   "locale":"en_US",
   "allowComments":true,
   "allowRegistration":false
}
```

You can request <http://localhost:8090/actuator/info> to see more detail as well.

```json
{
  "git": {
    "branch": "feat/system-info",
    "commit": {
      "id": "ca4e93d",
      "time": "2023-01-19T08:56:15Z"
    }
  },
  "build": {
    "artifact": "halo",
    "name": "halo",
    "time": "2023-01-29T15:04:42.151Z",
    "version": "2.2.0-SNAPSHOT",
    "group": "run.halo.app"
  },
  "java": {
    "version": "17.0.6",
    "vendor": {
      "name": "Amazon.com Inc.",
      "version": "Corretto-17.0.6.10.1"
    },
    "runtime": {
      "name": "OpenJDK Runtime Environment",
      "version": "17.0.6+10-LTS"
    },
    "jvm": {
      "name": "OpenJDK 64-Bit Server VM",
      "vendor": "Amazon.com Inc.",
      "version": "17.0.6+10-LTS"
    }
  },
  "os": {
    "name": "Windows 11",
    "version": "10.0",
    "arch": "amd64"
  }
}
```

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

```release-note
提供系统配置详情端口
```
2023-01-30 07:20:11 +00:00
guqing 3bd0a09764
perf: optimize snapshot queries for post and single page (#3168)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.2.x
/kind api-change

#### What this PR does / why we need it:
优化文章和自定义页面的内容查询

- 文章新增 `GET /posts/{name}/release-content` 和 `GET /posts/{name}/head-content` 自定义 APIs
- 自定义页面新增 `GET /posts/{name}/release-content` 和 `GET /posts/{name}/head-content` 自定义 APIs

⚠️ 移除了 ContentEndpoint,如果 Console 调用过 `/apis/api.console.halo.run/contents/{name}` 查询内容则需要用文章或自定义页面的自定义APIs 替代

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

Fixes #3140
Fixes https://github.com/halo-dev/halo/issues/3026

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

```release-note
优化文章和自定义页面的内容查询
```
2023-01-30 07:18:15 +00:00
Ryan Wang 241ad3cc2f feat: add supports for automatic slug generation (halo-dev/console#831)
#### What type of PR is this?

/kind feature
/milestone 2.2.x

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

文章、独立页面、分类、标签支持自动生成别名。

策略:

1. 仅在创建时会自动根据标题或者名称自动生成别名,编辑时如果需要重新生成,可以点击输入框右侧的按钮。
2. 中文会被转为拼音并用 - 隔开,需要注意多音字的情况,目前无法保证多音字是否符合预期。
3. 使用了 https://www.npmjs.com/package/transliteration 库。

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

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

#### Screenshots:

<img width="782" alt="image" src="https://user-images.githubusercontent.com/21301288/213849446-18d70974-7b2c-420c-bd50-93d2c3193895.png">

#### Special notes for your reviewer:

测试方式:

1. 需要 `pnpm install`
4. 测试文章、独立页面、分类、标签创建时,是否可以自动设置别名。
5. 测试别名输入框右侧的生成别名按钮是否正常工作。
6. 测试分类和标签选择器创建新分类或标签时,是否正确设置了别名。

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

```release-note
Console 端的文章、独立页面、分类、标签支持自动生成别名
```
2023-01-30 06:52:11 +00:00
Ryan Wang 82db7d0afd refactor: use new apis to refactor plugins management (halo-dev/console#824)
#### What type of PR is this?

/kind improvement
/milestone 2.2.x

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

使用新的 API 来管理插件,用于区分插件管理和配置相关的权限。适配:https://github.com/halo-dev/halo/pull/3142

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

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

#### Screenshots:

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/3142 分支。
2. Console 需要 `pnpm install`。
1. 插件设置项,需要测试保存,安装新插件之后表单是否正常。
3. 创建一个角色,测试仅有管理/查看插件的角色,登录之后检查是否符合预期。

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

```release-note
重构 Console 端插件的设置表单逻辑。
```
2023-01-30 06:38:12 +00:00
Ryan Wang 577c0f5e35 refactor: use new apis to refactor themes management (halo-dev/console#820)
#### What type of PR is this?

/kind improvement

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

使用新的 API 来管理主题,用于区分主题管理和配置相关的权限。适配:https://github.com/halo-dev/halo/pull/3135

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

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

#### Screenshots:

#### Special notes for your reviewer:

重点测试:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/3135 分支。
2. Console 需要 `pnpm install`。
1. 主题设置项,需要测试保存,安装新主题之后表单是否正常。
3. 创建一个角色,测试仅有管理/查看主题的角色,登录之后检查是否符合预期。

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

```release-note
重构 Console 端主题的设置表单逻辑。
```
2023-01-30 06:36:10 +00:00
guqing 1d4f65c0cf
feat: add some APIs to separate plugin-related Setting and ConfigMap permissions (#3142)
#### What type of PR is this?
/kind improvement
/area core
/kind api-change
/milestone 2.2.x

#### What this PR does / why we need it:
添加自定义 APIs 以分离插件对 Setting 和 ConfigMap 权限的依赖

⚠️ 此 PR 新增了 APIs,需要 Console 对其进行适配,插件查询 Setting、ConfigMap 的 APIs 需要更改。

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

A part of https://github.com/halo-dev/halo/issues/3069

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

#### Special notes for your reviewer:
how to test it?
- 测试 GET /plugins/{name}/setting 是否能正确获取到插件名称对应的主题的 Setting。
- 测试 GET /plugins/{name}/config 是否能正确获取到插件名称对应的主题的 ConfigMap。
- 测试 PUT /plugins/{name}/config 是否能更新插件的 ConfigMap,如果名称不匹配则抛出异常。
切换用户为其分配主题的查看权限可以有权限调用以上描述的 GET 请求的 endpoints,管理权限可以调用 PUT /plugins/{name}/config。
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
添加自定义 APIs 以分离插件对 Setting 和 ConfigMap 权限的依赖
```
2023-01-30 06:28:11 +00:00
guqing 7f4b3a1330
feat: add some APIs to separate theme-related Setting and ConfigMap permissions (#3135)
#### What type of PR is this?
/kind feature
/milestone 2.2.x
/area core
/kind api-change

#### What this PR does / why we need it:
添加自定义 APIs 以分离主题对 Setting 和 ConfigMap 权限的依赖

⚠️ 此 PR 新增了 APIs,需要 Console 对其进行适配,主题菜单下获取激活主题的 API 以及查询主题 Setting、ConfigMap 的 APIs 需要更改。

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

A part of #3069

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

#### Special notes for your reviewer:
how to test it?
- 测试 `GET /themes/-/activation` 此 endpoint 是否能正确获取到激活主题信息
- 测试 `GET /themes/{name}/setting` 是否能正确获取到主题名称对应的主题的 Setting,如果 name 为 `-` 表示查询当前激活主题的 Setting
- 测试 `GET /themes/{name}/config` 是否能正确获取到主题名称对应的主题的 ConfigMap, 如果 name 为 `-` 表示查询当前激活主题的 ConfigMap。
- 测试 `PUT themes/{name}/config` 是否能更新主题的 ConfigMap,如果名称不匹配则抛出异常。
切换用户为其分配主题的查看权限可以有权限调用以上描述的 GET 请求的 endpoints,管理权限可以调用 `PUT themes/{name}/config`。
- 测试 `PUT /themes/{name}/activation` 是否能设置激活主题。

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

```release-note
添加自定义 APIs 以分离主题对 Setting 和 ConfigMap 权限的依赖
```
2023-01-30 06:26:12 +00:00
John Niang 536218d702
Upgrade Spring Boot to 3.0.2 (#3176)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.2.x

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

Upgrade Spring Boot to 3.0.2. 

See https://github.com/spring-projects/spring-boot/releases/tag/v3.0.2 for more.

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

```release-note
升级依赖 Spring Boot 至 3.0.2
```
2023-01-30 03:44:12 +00:00
John Niang 7188464bc1
Fix the problem of slug name with percent sign when publishing post (#3179)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.2.x

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

Remove URI decode operation while inserting key into RadixRouterTree to avoid repeat decode.

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

Fixes #3178 

#### Special notes for your reviewer:

1. Set slug name to `1%1` when creating a post
2. Publish it
3. Browse the post

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

```release-note
修复因别名包含百分号导致无法正常访问的问题
```
2023-01-30 03:16:11 +00:00
BugKing 1884edda57 fix: add word break for long toast body (halo-dev/console#829)
#### 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/3163

#### Screenshots:

![image](https://user-images.githubusercontent.com/27671436/213079369-0c5db4cf-fa3d-44a3-bd53-d98ae79a6bcf.png)

#### Special notes for your reviewer:

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

```release-note
fix: add word break for long toast body
```
2023-01-19 08:58:14 +00:00
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