Commit Graph

4241 Commits (3bfecd2b38ce182179604790a15de9a5e119a0e3)

Author SHA1 Message Date
guqing 3a1587bab5
refactor: add creationTime field for comment extension to resolve migration issue (#3341)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x
/kind api-change

#### What this PR does / why we need it:
1. spec 中新增 creationTime
2. 旧数据的 spec.creationTime 默认等于 approvedTime
3. 按照 metadata.creationTimestamp 排序的使用 spec.creationTime 代替

how to test it?
1. 使用迁移插件迁移看评论和回复的排序是否正确
2. 使用评论插件创建评论和回复看顺序是否正确
#### Which issue(s) this PR fixes:
Fixes #3330

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

```release-note
评论和回复新增创建时间以兼容迁移数据的排序
```
2023-02-23 10:06:12 +00:00
guqing 6c2064f1e0
feat: plugin supports configuration when not started (#3355)
#### What type of PR is this?
/kind feature
/milestone 2.3.x
/area core
/area plugin

#### What this PR does / why we need it:
顺便重构了一下插件 Reconciler ,否则经常容易出 bug,刚好一起测试一下免得反复整体测试这一块。
1. 插件 status 里的 message 和 reason 之前是直接放在 status 里的,现在改为一个 ConditionList, 最新的始终在 ConditionList 的第一个,这可以避免插件启动成功时还能在 message 上看到错误信息会很奇怪
2. 插件的 Setting 只会在卸载时删除,停止时不进行删除
3. 插件启动和停止状态的调和能从 CREATED、DISABLED、RESOLVED、STARTED、STOPPED、FAILED 这些状态之间进行循环过渡,如插件当前状态为 CREATED 期望达到 STARTED 则可能会经历 CREATED -> RESOLVED -> STARTED( -> FAILED) 这些过渡, 逻辑更清晰

Console 需要适配:
1. 需要去掉插件启动时才加载 Setting 的判断,让其在插件停用时也能加载
2. 需要修改发生错误时的字段取值,显示 conditons[0] 
#### Which issue(s) this PR fixes:

Fixes #3352

#### Special notes for your reviewer:
how to test it?
1. 测试在开发模式和生产模式下插件启用/设置/配置是否正常
2. 测试开发模式下插件启动失败后修复问题重启 halo 后能否正常启用
3. 测试插件卸载后 setting 是否被正确删除
4. 测试插件 logo 相对路径和 url 是否都能正常显示
5. 测试评论插件启动成功后主题端是否能显示评论列表(验证扩展点加载是否正常)
6. 测试插件配置了 settingName 但没有对应的 Setting 时的情况看 Reconciler 重试时间是否增长

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

```release-note
允许插件在未启动时更改设置
```
2023-02-23 09:26:12 +00:00
Li 2dba8d0dbb fix: default value of formkit schema is not initialize in annotation form (halo-dev/console#880)
#### What type of PR is this?
/kind bug
/milestone 2.3.x
/area console

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

#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3357

#### Special notes for your reviewer:
测试使用主题/插件自定义的元数据信息,是否能够在 console 中显示默认值。

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

```release-note
使用主题/插件配置的元数据将能够展示默认值
```
2023-02-23 09:16:11 +00:00
Ryan Wang fbcd6bf037 refactor: use tanstack query to refactor attachments-related fetching (halo-dev/console#878)
#### What type of PR is this?

/kind improvement

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

使用 [TanStack Query](https://github.com/TanStack/query) 重构附件相关数据请求的相关逻辑。

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

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

#### Special notes for your reviewer:

测试方式:

1. 测试附件管理页面的筛选、存储策略、分组等业务。
2. 测试附件选择模态框组件。

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

```release-note
None
```
2023-02-23 09:08:12 +00:00
Ryan Wang 40580151d5 perf: improve the validation rules for username (halo-dev/console#868)
#### What type of PR is this?

/kind improvement

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

优化用户名的校验规则,目前采用 DNS 名称的规则,即:必须以字母(a-z或A-Z)开头,并包含字母数字字符(a-z,A-Z,0-9)和连字符(-)。每一段名称以字母结尾(a-z或A-Z)。名称以点(.)分隔

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

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

#### Screenshots:

#### Special notes for your reviewer:

测试方式:

1. 新建用户,检查用户名输入规则是否符合预期。

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

```release-note
优化 Console 端新建用户时,用户名的校验规则。
```
2023-02-23 07:22:11 +00:00
John Niang 03ec23f90f
Bump up checkout and setup-java actions (#3368) 2023-02-22 23:03:48 +08:00
Ryan Wang 376b855f5b refactor: use tanstack query to refactor plugins fetching (halo-dev/console#876)
#### What type of PR is this?

/kind improvement

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

使用 [TanStack Query](https://github.com/TanStack/query) 重构插件管理列表的数据请求相关逻辑。

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

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

#### Special notes for your reviewer:

测试方式:

1. 需要 `pnpm install`
2. 插件管理页面,安装若干插件。
3. 测试分页、条件筛选等逻辑是否正常。

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

```release-note
None
```
2023-02-22 08:00:12 +00:00
2139244a62
fix: initializes a ghost user by default to replace that the users that has been deleted (#3344)
#### What type of PR is this?

/kind bug

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

系统默认初始化一个 ghost 用户,用于表示用户已删除。

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

Fixes #3317

```release-note
NONE
```
2023-02-21 09:14:11 +00:00
Ryan Wang dd6e102023 feat: provide Chinese translation for the system's role template (halo-dev/console#870)
#### 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/2848

#### Screenshots:

<img width="1414" alt="image" src="https://user-images.githubusercontent.com/21301288/220069394-6af6922b-28b2-4818-ab58-dcfb69b6b53b.png">


#### Special notes for your reviewer:

测试方式:

1. 需要 `pnpm install`
2. 检查角色详情页面和新建页面的角色模板描述是否为中文。

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

```release-note
Console 端为系统内提供的角色模板提供中文翻译
```
2023-02-21 05:16:10 +00:00
Ryan Wang a9331f5482 perf: add supports for storing navbar position (halo-dev/console#865)
#### 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/3240

#### Screenshots:

before:

![2023-02-20 12 12 05](https://user-images.githubusercontent.com/21301288/220007834-12658cf2-e8a8-42ea-93b1-2c58419edbac.gif)


after:

![2023-02-20 12 11 19](https://user-images.githubusercontent.com/21301288/220007742-58471b69-cfd1-4576-babd-5516d2c0de1d.gif)


#### Special notes for your reviewer:

测试方式:

1. 调整浏览器高度,让侧边栏菜单区域出现滚动条。
2. 测试点击底部的任意菜单项,跳转页面之后,观察滚动条是否与之前的位置保持一致。

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


```release-note
Console 端侧边栏滚动条支持缓存位置,防止切换路由时重置滚动条位置。
```
2023-02-21 03:56:10 +00:00
Ryan Wang c23e659b79 perf: improve the layout of post tags (halo-dev/console#869)
#### 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/2926
Fixes https://github.com/halo-dev/halo/issues/3301

#### Screenshots:

<img width="1408" alt="image" src="https://user-images.githubusercontent.com/21301288/220048436-aed6e0b1-8fc7-4365-98c9-db4aef29205e.png">

#### Special notes for your reviewer:

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

```release-note
优化 Console 端文章管理的标签布局
```
2023-02-21 03:46:10 +00:00
Ryan Wang 76bbe52dde feat: add supports for display database info in actuator page (halo-dev/console#872)
#### 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/3263

#### Screenshots:

<img width="1413" alt="image" src="https://user-images.githubusercontent.com/21301288/220119998-dcf58a6e-cbe5-46ed-9fda-67d0ce5b85c1.png">

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/3351 分支。
2. 进入系统概览页面,检查是否有数据库信息。

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

```release-note
Console 端的系统概览页面支持显示数据库信息
```
2023-02-21 03:36:10 +00:00
Ryan Wang ce604e602d feat: prompt to upgrade plugin when installing existing plugin (halo-dev/console#871)
#### 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/3164

#### Screenshots:

<img width="1411" alt="image" src="https://user-images.githubusercontent.com/21301288/220118697-12fbd7a7-57e6-47bb-a03b-b9c280571687.png">

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/3350 分支。
2. 在插件为 deployment 模式下启动 Halo。
3. 安装任意一个插件,然后继续上传安装相同插件。
4. 观察是否提示升级此插件。

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

```release-note
Console 端安装已存在插件时,支持提示并升级插件。
```
2023-02-21 03:14:09 +00:00
Li e49baa1cf8
feat: add database endpoint for actuator (#3351)
#### What type of PR is this?
/kind feature

/milestone 2.3.x

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

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

Fixes #3263

#### Special notes for your reviewer:
测试方法:
1. 使用超级管理员登录
2. 查看接口 /actuator/info 查看是否存在 database 字段。
#### Does this PR introduce a user-facing change?


```release-note
NONE
```
2023-02-21 03:06:10 +00:00
John Niang 7e09cdcbf0
Refine problem detail when plugin is already installed (#3350)
#### What type of PR is this?

/kind improvement
/area core

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

This PR refines problem detail of PluginAlreadyExistsException. Please note the new type `https://halo.run/probs/plugin-alreay-exists` and additional property `pluginName` of problem detail.

Meanwhile 

- Before

    ```json
    {
      "type": "about:blank",
      "title": "Plugin Already Exists Error",
      "status": 400,
      "detail": "Plugin PluginCommentWidget already exists.",
      "instance": "/apis/api.console.halo.run/v1alpha1/plugins/install",
      "requestId": "880fe8cd-5",
      "timestamp": "2023-02-20T10:17:21.541104Z"
    }
    ```

- After

    ```json
    {
      "type": "https://halo.run/probs/plugin-alreay-exists",
      "title": "Plugin Already Exists Error",
      "status": 400,
      "detail": "Plugin PluginCommentWidget already exists.",
      "instance": "/apis/api.console.halo.run/v1alpha1/plugins/install",
      "pluginName": "PluginCommentWidget",
      "requestId": "880fe8cd-5",
      "timestamp": "2023-02-20T10:17:21.541104Z"
    }
    ```
#### Which issue(s) this PR fixes:

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

#### Special notes for your reviewer:

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

```release-note
优化插件重复安装错误提示。
```
2023-02-21 02:28:11 +00:00
28f631fec5 fix: hide the ghost user from the user list (halo-dev/console#866)
What type of PR is this?
/kind bug

What this PR does / why we need it:
将ghost用户从用户列表隐藏。

Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3317

```release-note
NONE
```
2023-02-20 13:14:20 +00:00
Ryan Wang 1b97167b29 feat: add supports for download log file in actuator page (halo-dev/console#867)
#### 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/3188

#### Screenshots:

<img width="1676" alt="image" src="https://user-images.githubusercontent.com/21301288/220023373-44616cd3-b42a-466a-a928-9abce78cc16d.png">

#### Special notes for your reviewer:

测试方式:

1. 进入系统概览页面,点击运行日志的下载按钮。
2. 检查是否成功下载了日志文件。

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

```release-note
Console 端的系统概览页面支持下载运行日志。
```
2023-02-20 08:00:20 +00:00
Li db4142787e
feat: open actuator logfile endpoint for prod (#3345)
<!--  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 feature
<!--
添加其中一个类别:
Add one of the following kinds:

/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement

适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:

/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

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

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

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

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

Fixes #3188 

#### Special notes for your reviewer:
测试方式:
1. 使用 prod 模式启动项目,使用超级管理员登陆
2. 访问 /actuator/logfile 查看是否有日志显示。

#### 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-02-20 07:34:18 +00:00
Ryan Wang c54c00fce1 perf: default editor's toc supports showing empty states (halo-dev/console#864)
#### 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/3335

#### Screenshots:

<img width="1420" alt="image" src="https://user-images.githubusercontent.com/21301288/220002675-e16829f0-1c33-4030-a76b-4720dc7d7a69.png">

#### Special notes for your reviewer:

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

```release-note
Console 端默认编辑器的大纲列表支持显示空状态
```
2023-02-20 06:30:18 +00:00
7c075dc5d7
Add custom endpoint for listing user conditionally (#3320)
#### What type of PR is this?

/kind bug

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

为后端用户管理提供更多筛选接口,包括关键词、角色、创建时间排序

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

Fixes #3290

```release-note
NONE
```
2023-02-20 04:18:18 +00:00
Ryan Wang dd5c5a5bcb feat: user management supports conditional filtering and sorting (halo-dev/console#862)
#### What type of PR is this?

/kind feature

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

用户管理列表支持条件筛选和排序,适配:https://github.com/halo-dev/halo/pull/3320

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

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

#### Screenshots:

<img width="922" alt="image" src="https://user-images.githubusercontent.com/21301288/219578426-de396dfb-7ece-496e-b740-d7a36321eafb.png">

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/3320 分支。
2. Console 需要 `pnpm build:packages`
3. 测试用户管理的关键词、条件、排序筛选是否工作正常。

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

```release-note
Console 端的用户列表支持条件筛选和排序。
```
2023-02-20 04:18:18 +00:00
Ryan Wang 4fe31cbdcd feat: add supports for preview audio and video file in attachment detail (halo-dev/console#841)
#### 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/1923

#### Screenshots:

<img width="1011" alt="image" src="https://user-images.githubusercontent.com/21301288/217746883-92c46d4e-a51d-4b53-ae8e-f647a47b216f.png">
<img width="1010" alt="image" src="https://user-images.githubusercontent.com/21301288/217746922-9b014974-71aa-4d54-aa42-be2ae03647a1.png">


#### Special notes for your reviewer:

测试方式:

1. 上传若干视频和音频文件,检查是否可以正常播放即可。


可供测试的文件:[音视频测试.zip](https://github.com/halo-dev/console/files/10694553/default.zip)

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

```release-note
Console 端的附件详情支持预览音视频文件。
```
2023-02-17 07:50:13 +00:00
Ryan Wang 11dffceab6 feat: add layer-closeable prop for modal (halo-dev/console#861)
#### What type of PR is this?

/kind feature

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

VModal 组件支持设置是否允许点击蒙层以关闭模态框,并将所有包含表单的模态框设置为不允许点击蒙层关闭。

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

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

#### Screenshots:

![2023-02-17 12 08 56](https://user-images.githubusercontent.com/21301288/219547318-d7c59742-8546-4bc8-9d49-fcff4053602f.gif)


#### Special notes for your reviewer:

测试方式:

1. 打开 Console 端任意一个表单模态框,测试点击表单外部区域是否会关闭弹框。

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


```release-note
优化 Console 端部分包含表单的模态框,默认不允许点击外部区域关闭模态框。
```
2023-02-17 06:52:13 +00:00
Ryan Wang a00a302554 chore: adjust the log level and delete useless logs (halo-dev/console#860)
#### What type of PR is this?

/kind improvement

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

调整部分日志级别,以及删除部分无用的日志。

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

```release-note
None
```
2023-02-17 06:36:15 +00:00
Ryan Wang 497e79cb08 chore: move @halo-dev/api-client package to console (halo-dev/console#854)
#### What type of PR is this?

/kind improvement

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

将 https://github.com/halo-sigs/api-client 移动到 Console 的仓库进行管理。

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

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

#### Special notes for your reviewer:

测试方式:

1. 需要先 `pnpm install && pnpm build:packages`
2. 测试开发环境(pnpm dev)和构建之后(pnpm build)是否能够正常使用。

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

```release-note
None
```
2023-02-17 06:30:13 +00:00
Ryan Wang 8d4fffb277 perf: improve error message of login (halo-dev/console#851)
#### What type of PR is this?

/kind improvement

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

改进登录异常的提示信息,目前大致分为三种:

1. 用户名或密码错误
2. 跨域或网络请求异常
3. CSRF Token 失效

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

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

#### Screenshots:

<img width="1402" alt="image" src="https://user-images.githubusercontent.com/21301288/218319203-19517ab7-7740-41f9-8579-f10a60aa6e51.png">
<img width="1673" alt="image" src="https://user-images.githubusercontent.com/21301288/218319221-2fc332f4-4de7-4417-a277-0c4a396d6389.png">


#### Special notes for your reviewer:

测试方式:

1. 进入浏览器控制台清理 Cookie,以测试 CSRF Token 失效的情况。
2. 使用 3000 端口访问 Console,以测试跨域的情况。
3. 观察以上两种情况的登录请求异常提示信息是否符合要求。

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

```release-note
优化 Console 端登录请求异常的提示
```
2023-02-17 06:28:18 +00:00
guqing 3cde340b71
fix: route for the tag is not registered when halo starts (#3322)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.3.x

#### What this PR does / why we need it:
1. 去掉原 TagReconciler 的 requeue 逻辑,来临时解决大量 tag 时 reconciler 空转导致 cpu 下不来的问题,参考: https://github.com/halo-dev/halo/issues/3311
2. 增加 TagRouteReconciler 在启动时注册路由

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

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?
```release-note
修复 #3316 引入的 tags 标签的路由没有注册的问题
```
2023-02-15 13:52:12 +00:00
Ryan Wang dd161eec19
perf: disable syncAllOnStart for tag reconciler (#3316)
#### What type of PR is this?

/kind improvement

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

暂时禁用 Tag Reconciler 在启动的时候同步。(临时解决方案)

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

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

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


```release-note
禁用系统启动时同步标签文章数的功能
```
2023-02-15 10:16:12 +00:00
Ryan Wang e9970b203a perf: mute the fetch roles request (halo-dev/console#857)
#### What type of PR is this?

/kind improvement

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

静默请求所有角色信息,用于显示 displayName。(临时解决方案)

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


```release-note
None
```
2023-02-15 09:08:11 +00:00
guqing e71b79b1cf
refactor: status update when setting not found (#3314)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
状态更新时检查是否与之前状态相同,目前先这样解决后续等 status 的 update 出来以后再重构一下 plugin 的 status 结构。

测试:
测试插件在开发模式和生产模式下填写 settingName 后有/无对应 settingName 资源的插件启动情况,看 PluginReconciler 出错时是否很快
步骤:
1. 开发模式下,插件的 plugin.yaml 配置了 settingName 但没有创建名称为 settingName 对应的 Setting 资源看插件启动时控制台是否出现很快的错误日志,期望出现错误的时间间隔会逐渐变长。
2. 与步骤一相同,但 settingName 对应有 Setting 模型的 yaml,期望插件正常启动且能保存配置
3. 生产模式启动插件重复步骤 1 和 2

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?
```release-note
None
```
2023-02-15 07:30:20 +00:00
longjuan 9dee9b0409
fix: incorrect number of comments (#3295)
<!--  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
/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:
Fixed incorrect number of comments after comment deletion.
#### 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/3287

#### 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
修复删除评论后Console端文章和单页评论数量不正确
```
2023-02-15 06:52:12 +00:00
Ryan Wang fce581bd2d fix: the issue that role display name (halo-dev/console#847)
#### 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/3257

#### Screenshots:

<img width="1668" alt="image" src="https://user-images.githubusercontent.com/21301288/218020794-696420c4-69bb-4422-9409-482bb2aff708.png">


#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到:https://github.com/halo-dev/halo/pull/3280
2. 检查 Console 端显示的系统角色是否正常。
3. 新建若干自定义角色,检查名称是否正常。

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

```release-note
优化 Console 端用户角色标识的显示名称。
```
2023-02-15 05:58:12 +00:00
John Niang 5f7ea18f7c
Auto rename attachment if it exists (#3305)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.3.x

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

Before this PR, halo will throw an FileAlreadyExists exception if users upload file which already exists.

But now, we will rename the attachment automatically on filename conflict. e.g.:

```bash
halo.run -> halo-xyz.run
.run -> xyz.run
halo -> halo-xyz
```

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

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

#### Special notes for your reviewer:

![image](https://user-images.githubusercontent.com/16865714/218670068-87389289-1248-48e8-82a4-1bcf939e64e3.png)

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

```release-note
附件已存在时自动重命名
```
2023-02-15 05:38:12 +00:00
e485acef66
perf: associate ghost user with posts on user deletion. (#3293)
#### What type of PR is this?

/kind bug

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

文章发布用户被删除后,设置这篇文章的发布人为Ghost

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

Fixes #3265

```release-note
NONE
```
2023-02-15 05:36:14 +00:00
Ryan Wang 93dc2f59be perf: improve word-break style for comment content (halo-dev/console#852)
#### 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/3294

#### Screenshots:

before:

<img width="1016" alt="image" src="https://user-images.githubusercontent.com/21301288/218379816-73a39f13-32f7-40a8-a65d-9e7f6f691f71.png">

after:

<img width="1416" alt="image" src="https://user-images.githubusercontent.com/21301288/218379719-f86193c0-d6d7-4aa6-ad5c-d538c215e80b.png">

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


```release-note
修复 Console 的评论管理中内容文字过长导致样式异常的问题。
```
2023-02-13 08:30:20 +00:00
Ryan Wang 09d097a193 chore: add @LIlGG to reviewers list (halo-dev/console#850)
#### What type of PR is this?

/kind improvement

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

将 @LIlGG 添加到 Reviewer 列表。

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

```release-note
None
```
2023-02-13 03:48:18 +00:00
Ryan Wang da43031de2 perf: improve the indexing threshold for the fuse search engine (halo-dev/console#849)
#### What type of PR is this?

/kind improvement

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

优化 Console 端使用 fuse.js 搜索引擎的搜索阈值,解决搜索关键词匹配的问题。

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

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

#### Screenshots:

before:

![image](https://user-images.githubusercontent.com/21301288/218301830-9cc0ac6e-994c-4994-9701-28e50cc90fa3.png)

after:

<img width="676" alt="image" src="https://user-images.githubusercontent.com/21301288/218301848-0883bbe7-f2ad-4ccb-8802-74920d76ebe0.png">


#### Special notes for your reviewer:

测试方式:

1. 检查 Console 端全局搜索,以及用户/权限管理的搜索是否符合预期。

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

```release-note
优化 Console 端全局搜索的匹配规则。
```
2023-02-13 03:46:22 +00:00
Ryan Wang 6963167a61 chore: fix lint issue (halo-dev/console#848)
#### What type of PR is this?

/kind improvement

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

移除未使用的导入和变量。

<img width="824" alt="image" src="https://user-images.githubusercontent.com/21301288/218025655-d5da2012-fe78-4bfe-9138-3015e97a25e4.png">

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


```release-note
None
```
2023-02-13 03:44:26 +00:00
Ryan Wang 26f29b20c7
chore: add @LIlGG to reviewers list (#3292)
#### What type of PR is this?

/kind improvement

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

将 @LIlGG 添加到 Reviewer 列表。

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

```release-note
None
```
2023-02-13 01:48:18 +00:00
Ryan Wang 3de9f7f80e
perf: refine display name of system default role (#3280)
#### 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/3257

#### Screenshots:

<img width="1668" alt="image" src="https://user-images.githubusercontent.com/21301288/218020794-696420c4-69bb-4422-9409-482bb2aff708.png">


#### Special notes for your reviewer:

see 

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

```release-note
为系统初始化的角色添加显示名称
```
2023-02-10 08:38:16 +00:00
guqing e9389ac1d8
refactor: lru cache key for template engine manager (#3243)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x

#### What this PR does / why we need it:
修改 TemplateEngineManager 中 LRU cache 的缓存 key
see #3242 for more details.

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

#### Special notes for your reviewer:
how to test it?
1. 安装几个主题测试预览功能是否正常
2. 特别关注激活主题的预览,激活主题的预览和激活主题直接访问使用的不同的 TemplateEngine

/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?
```release-note
None
```
2023-02-10 07:40:15 +00:00
Ryan Wang 411ca714c6 perf: hide anonymousUser in user management list (halo-dev/console#844)
#### What type of PR is this?

/kind improvement

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

在用户管理列表隐藏 anonymousUser 用户,anonymousUser 暂时没有实际用途。

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

Fixes https://github.com/halo-dev/halo/issues/2775#issuecomment-1425129852

#### Screenshots:

<img width="1410" alt="image" src="https://user-images.githubusercontent.com/21301288/217997078-5e2e0724-5f22-45dc-a9c6-ee42254c9bd7.png">


#### Special notes for your reviewer:

测试方式:

1. 进入 Console 的用户管理,检查是否有名为 Anonymous User 的用户即可。

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

```release-note
在 Console 端的用户管理中隐藏 `Anonymous User` 用户。
```
2023-02-10 04:32:15 +00:00
longjuan ffca4e195b fix: menu scroll bar is blocked (halo-dev/console#845)
#### What type of PR is this?
/kind improvement
/area console


#### What this PR does / why we need it:
使左侧菜单栏滚动条不被遮挡
#### Which issue(s) this PR fixes:

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

#### Screenshots:
![image](https://user-images.githubusercontent.com/28662535/217997111-36676220-b539-417d-b606-a1fe336c9474.png)
![image](https://user-images.githubusercontent.com/28662535/217997152-165bb976-8cfa-480a-b27a-6478c2bad568.png)
![image](https://user-images.githubusercontent.com/28662535/217997216-820de8fb-9526-4e23-9fec-17e8f2e8ebab.png)

#### Special notes for your reviewer:
分为logo、可滚动(搜索、菜单)、用户信息三部分,不妥就关闭这个PR吧
#### Does this PR introduce a user-facing change?

```release-note
完整显示左侧菜单栏滚动条
```
2023-02-10 04:26:15 +00:00
Ryan Wang 2aa80cfffd
docs: update readme (#3256)
#### What type of PR is this?

/kind documentation

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

更新产品的一句话定位。

```release-note
None
```
2023-02-10 02:46:14 +00:00
findwinds 56aa7de85a
Fix random list problem of tags and categories (#3261)
<!--  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:
replaced flatMap with flatMapSequential to ensure that the list of tags and categories shown in console post order is not random

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

#### Special notes for your reviewer:
/cherrypick release-2.0
/cherrypick release-2.1

#### 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-09 04:24:13 +00:00
guqing 7453b93b1d
fix: default value cannot be read when the setting is not created because of asynchrony (#3236)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.2.x
/cherry-pick release-2.2
#### What this PR does / why we need it:
修复插件安装时有几率出现设置没有默认值导致无法保存的问题

see https://github.com/halo-dev/halo/issues/3224#issuecomment-1418825809 for more details

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

Fixes #3224

#### Special notes for your reviewer:
how to test it?
1. 安装 https://github.com/halo-sigs/plugin-feed 插件并立即启用(或以开发模式)
2. 到此插件设置**始终**能查询到默认值并且能保存

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

```release-note
修复插件安装时有几率出现设置没有默认值导致无法保存的问题
```
2023-02-08 07:16:13 +00:00
Ryan Wang d0acbee6dd perf: improve usage of the card component in some pages (halo-dev/console#839)
#### What type of PR is this?

/kind improvement

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

优化部分页面 VCard 组件的用法,修复样式问题。

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

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

#### Screenshots:

before:

<img width="1417" alt="image" src="https://user-images.githubusercontent.com/21301288/217179383-d1dff4f5-4350-4881-aed6-c6bf2cc184c5.png">

after:

<img width="1430" alt="image" src="https://user-images.githubusercontent.com/21301288/217179173-f61cf787-f34f-43a3-88c3-08fac6c31879.png">

#### Special notes for your reviewer:

测试方式:

1. 检查主题详情页面、插件详情页面、系统设置页面的内容区域,底部的圆角是否生效。

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

```release-note
优化 Console 端主题详情、插件详情、系统设置中卡片组件的样式。
```
2023-02-08 06:24:13 +00:00
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