Commit Graph

4114 Commits (4ce5d0c2cfa05b310ea4de59636c5de392692525)

Author SHA1 Message Date
Ryan Wang 712df0e481 chore: release 2.3.0-rc.1 (halo-dev/console#888)
#### What type of PR is this?

/kind improvement
/milestone 2.3.x

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

发布 2.3.0-rc.1

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


```release-note
None
```
2023-02-24 10:12:13 +00:00
guqing adff2a7194
refactor: default is approved to reply to comments on the console-side (#3363)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x

#### What this PR does / why we need it:
Console 端创建回复不再需要审核
但需要注意的是目前无法区分是否为管理员,所以如果具有评论管理权限的用户在主题端登录回复还是需要审核。

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

#### Special notes for your reviewer:
how to test it?
1. 在主题端创建评论和回复都需要审核
2. 在 console 端回复不需要审核

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

```release-note
Console 端创建回复不再需要审核
```
2023-02-24 18:09:57 +08:00
guqing f1ec6ceeab
chore: add finalizer for ghost and anonymous users (#3386)
#### What type of PR is this?
/kind improvement
/area core

#### What this PR does / why we need it:
为系统默认用户添加系统保护 finalizer,避免被删除

how to test it?
```shell
curl -u username:password --basic 'http://localhost:8090/api/v1alpha1/users/ghost'
curl -u username:password --basic 'http://localhost:8090/api/v1alpha1/users/anonymousUser'
```
将看到 
```json
"finalizers": [
  "...",
  "system-protection"
]
```
#### Which issue(s) this PR fixes:

Fixes #

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

```release-note
None
```
2023-02-24 10:04:17 +00:00
Li 3330ff8c3d
refactor: add version flag to plugin static assets (#3381)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x

#### What this PR does / why we need it:
对插件的静态资源(js, css) 增加 version 版本号,用于解决插件静态资源缓存的问题。另外同时也对插件 Logo 增加了版本号标识。

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

#### Special notes for your reviewer:
验证 Console 端插件静态资源链接是否携带 `version={pluginVersion}` 。

特别的,对于 logo只会增加相对路径下的地址,绝对路径的地址将直接返回原始路径/值。

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

```release-note
为插件静态资源路径增加版本标识以解决缓存更新不及时的问题
```
2023-02-24 18:02:38 +08:00
Ryan Wang a7ddf37fb2 refactor: use tanstack query to refactor singlePage-related fetching (halo-dev/console#886)
#### 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. 测试页面管理列表的数据请求 + 条件筛选无异常即可。

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

```release-note
None
```
2023-02-24 09:58:21 +00:00
Ryan Wang 27ee803263 fix: user filter list will fail to load the avatar after searching (halo-dev/console#885)
#### 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/3361

#### Screenshots:

<img width="455" alt="image" src="https://user-images.githubusercontent.com/21301288/221108789-291999ab-ee4f-478c-900b-4273e3780357.png">

#### Special notes for your reviewer:
 
测试方式:

1. 创建若干用户并设置头像。
2. 打开文章管理的用户筛选项,尝试输入关键词搜索,观察搜索出的用户头像是否加载正常。

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


```release-note
修复 Console 端用户筛选项,输入关键词搜索之后无法加载头像的问题。
```
2023-02-24 09:56:17 +00:00
Ryan Wang 77a5d531b6 perf: hide active button when theme is activated (halo-dev/console#877)
#### 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/3059

#### Screenshots:

<img width="1022" alt="image" src="https://user-images.githubusercontent.com/21301288/220517066-67ee2f25-1b64-47c0-8b4c-3bdd6b3cb9f1.png">

#### Special notes for your reviewer:

测试方式:

1. 在主题管理列表检查已启用主题是否还有启用按钮即可。

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

```release-note
Console 端主题管理列表隐藏已启用主题的启用按钮。
```
2023-02-24 09:54:21 +00:00
Ryan Wang f8ffcaa593 refactor: support configuring plugin when the plugin is stopped (halo-dev/console#875)
#### What type of PR is this?

/kind improvement

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

1. 插件停止时支持配置插件设置项。
2. 修改插件异常信息的获取方式。

适配:https://github.com/halo-dev/halo/pull/3355

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

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

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/3355 分支。
2. Console 需要 `pnpm build:packages`
3. 根据 https://github.com/halo-dev/halo/pull/3355 中的描述进行测试。

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

```release-note
None
```
2023-02-24 09:52:25 +00:00
Ryan Wang 68e667601c refactor: change the creation time field for comments and replies (halo-dev/console#874)
#### What type of PR is this?

/kind improvement

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

修改评论和回复的创建时间字段。适配:https://github.com/halo-dev/halo/pull/3341

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

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

#### Special notes for your reviewer:

None

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

```release-note
None
```
2023-02-24 09:50:28 +00:00
Ryan Wang 792c8cf944 perf: disable the editor from pasting excel tables as pictures (halo-dev/console#873)
#### What type of PR is this?

/kind improvement

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

禁止在编辑器粘贴 Excel 表格时,将表格转为图片的形式上传。

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

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

#### Screenshots:

before:

<img width="818" alt="image" src="https://user-images.githubusercontent.com/21301288/220243681-eb07502a-0fc5-4e69-9cd3-61c3b89cb542.png">

after:

<img width="815" alt="image" src="https://user-images.githubusercontent.com/21301288/220243630-ca7c2700-ff61-4893-a857-94860e4a899b.png">


#### Special notes for your reviewer:

测试方式:

1. 使用 Excel 或者 macOS 下的 Numbers 创建一个表格。
2. 复制整个表格或者某几个单元格,并粘贴到 Halo 的编辑器。
3. 观察是否有将内容转为图片并上传。

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

```release-note
Console 端禁止在编辑器粘贴 Excel 表格以图片的形式上传。
```
2023-02-24 09:48:20 +00:00
Ryan Wang e547540e3a feat: editor supports selecting attachments to be inserted as links (halo-dev/console#863)
#### 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/2673

#### Screenshots:

![2023-02-17 21 02 43](https://user-images.githubusercontent.com/21301288/219660123-b910a4d5-32e6-4606-813e-c081720556d5.gif)

#### Special notes for your reviewer:

测试方式:

1. 测试从附件库选择非图片、视频、音频的时候是否会作为链接插入即可。

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

```release-note
Console 端默认编辑器支持以链接的形式插入非图片、音视频的附件。
```
2023-02-24 09:46:21 +00:00
guqing c8f3229cd6
feat: add role information for user-related custom endpoint (#3372)
#### What type of PR is this?
/kind feature
/kind api-change
/area core
/milestone 2.3.x

#### What this PR does / why we need it:
获取用户信息的 API 响应体包含关联角色信息

- 新增 API `/apis/api.console.halo.run/v1alpha1/users/{name}`
- 修改了 API 的返回值类型 `/apis/api.console.halo.run/v1alpha1/users/-`

由于 API 响应体结构的改变,需要 Console 适配
#### Which issue(s) this PR fixes:

Fixes #3342

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

```release-note
获取用户信息的 API 响应体包含关联角色信息
```
2023-02-24 17:39:34 +08:00
guqing 9fff768134
perf: cannot be accessed for a long time during startup (#3300)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x
#### What this PR does / why we need it:
能通过注册 pattern 作为路由的就直接注册 pattern 以避免 Reconciler 还没结束而无法注册路由导致的访问问题。
1. 文章、标签、分类的 permalink 规则会记录在对应 extension  的 annotations 中为  `content.halo.run/permalink-pattern: some-pattern` ,当系统设置中路由规则改变时会刷一遍这些资源的 `content.halo.run/permalink-pattern` annotation。
3. 自定义页面的访问是通过 SinglePageRoute 控制,它会在 single page 添加、更新、删除时维护 quickRouteMap 的集合,在路由到它时直接通过 request path 查找 map key,找到则直接返回 HandleFunction。
4. 除了自定义页面外其他都是通过 ThemeCompositeRouterFunction 作为路由管理器,系统启动时文章等的 RouterFunction 会被生成并缓存到 cachedRouters 的一个 List 集合中,当路由规则改变会清理它重新赋值。

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

Fixes #3254 

#### Special notes for your reviewer:
how  to test it?
1.  测试首页、文章、标签、分类、归档页、自定义页面和作者页等的访问。
6. 测试添加、删除资源和修改系统路由规则后上述资源的访问。
7. 测试分页路径如 /tags/slug/page/1 的访问。

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

```release-note
 优化启动时页面长时间无法访问的问题
```
2023-02-24 17:38:44 +08:00
guqing ce80ed4283
fix: i18n unit test (#3388)
#### What type of PR is this?
/kind improvement
/area core

#### What this PR does / why we need it:
修复 i18n 的单元测试,在中文或其他除了英语之外的系统语言的环境下断言无法通过
<img width="883" alt="image" src="https://user-images.githubusercontent.com/38999863/221122828-b3cb2139-21ff-4e44-8ee8-62326aa249bc.png">

可以将系统语言设置为其他来测试此 PR 不会出现上述问题即可

#### Does this PR introduce a user-facing change?
```release-note
None
```
2023-02-24 08:40:13 +00:00
John Niang 0d9ec4f197
Report test result using Jacoco plugin (#3385) 2023-02-24 15:51:21 +08:00
Ryan Wang 9ae08cdd9b fix: the issue that the useSlugify hook may cause the value to be undefined (halo-dev/console#884)
#### What type of PR is this?

/kind bug

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

修复新建分类和标签之后再次打开表单,别名显示为 undefined 的问题。

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

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

#### Special notes for your reviewer:

测试方式:

1. 新建分类或者标签,创建完成之后再次打开创建表单,检查别名是否还为 undefined。

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

```release-note
修复 Console 端新建分类和标签之后再次打开表单,别名显示为 undefined 的问题。
```
2023-02-24 07:10:12 +00:00
Ryan Wang 11d9cf669d perf: improve the conditions for categories and tags automatic refresh (halo-dev/console#883)
#### What type of PR is this?

/kind improvement

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

优化分类和标签管理页面自动刷新的条件,现在支持检测 `status.permalink` 是否已经生成完毕,如果没有会自动刷新列表。

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

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

#### Special notes for your reviewer:

测试方式:

1. 测试添加若干分类和标签,观测在没有生成 permalink 的情况下,是否会自动刷新列表。

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

```release-note
优化 Console 端分类和标签管理的自动刷新条件,支持检测固定链接是否已经生成。
```
2023-02-24 06:28:13 +00:00
guqing 7a0ba922af
refactor: APIs returns ghost users when user is deleted (#3373)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.3.x

#### What this PR does / why we need it:
用户被删除时关联到的用户返回 ghost 用户信息

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

Fixes #3356

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?
```release-note
用户被删除时关联到的用户返回 ghost 用户信息
```
2023-02-24 06:24:12 +00:00
Ryan Wang 6e5a78488c refactor: request api of user data (halo-dev/console#882)
#### What type of PR is this?

/kind improvement

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

重构获取用户信息的请求方式,无需再请求所有角色即可获取当前用户的角色信息,适配:https://github.com/halo-dev/halo/pull/3372

相关 PR:https://github.com/halo-dev/console/pull/847

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

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

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/3372 分支。
2. Console 需要 `pnpm install && pnpm build:packages`
3. 测试用户列表、登录、检查角色信息是否显示正确。

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

```release-note
优化 Console 端用户角色标识的显示名称。
```
2023-02-24 06:06:14 +00:00
Ryan Wang 7968ebe1a8 refactor: use tanstack query to refactor post-related fetching (halo-dev/console#879)
#### 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. 测试文章相关联的页面,包括文章管理、分类、标签。

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

```release-note
None
```
2023-02-24 04:10:13 +00:00
John Niang 937573e6b2
Upgrade to Spring Boot 3.0.3 (#3379)
#### What type of PR is this?

/kind cleanup
/area core

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

Upgrade to Spring Boot 3.0.3. See https://github.com/spring-projects/spring-boot/releases/tag/v3.0.3 for more.

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

```release-note
Upgrade to Spring Boot 3.0.3.
```
2023-02-24 03:20:12 +00:00
John Niang ce85b98539
Discard watch when extension status is changed only (#3362)
#### What type of PR is this?

/kind improvement
/area core

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

This PR mainly creates two things:

1. Create JsonExtension to represent any extension and make extension modification more convenient
2. Discard watch when we detect that the extension status is changed only. It's useful to prevent infinite loop of reconciler.

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

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

#### Special notes for your reviewer:

Try to install test plugin from [plugin-comment-widget.zip](https://github.com/halo-dev/halo/files/10799875/plugin-comment-widget.zip) before checking out this PR. You will get a infinite reconciliation loop.

Then, stop the process and checkout this PR and see the result.

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

```release-note
None
```
2023-02-23 10:24:12 +00:00
Ryan Wang b0e60f8b6d refactor: remove default cover from user profile page (halo-dev/console#881)
#### 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/2851

#### Screenshots:

<img width="1680" alt="image" src="https://user-images.githubusercontent.com/21301288/220852412-6732c965-ae43-441e-b99a-af3d6d978d4f.png">


#### Special notes for your reviewer:

None

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

```release-note
移除 Console 端个人资料页面的默认背景图片
```
2023-02-23 10:12:12 +00:00
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