Commit Graph

118 Commits (release-2.6)

Author SHA1 Message Date
Ryan Wang 65b27eed6c
chore: release 2.6.0 (#4021)
#### What type of PR is this?

/area core

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

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

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

```release-note
None
```
2023-06-01 03:08:12 +00:00
Ryan Wang b37ec04c87
perf: improve the experience of redirection after login (#4014)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.6.x

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

优化 Console 端登录之后重定向的体验,解决在重定向时会重新显示登录页面的问题。

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

Fixes #4010 

#### Special notes for your reviewer:

测试方式与 https://github.com/halo-dev/halo/pull/3989 相同。

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

```release-note
None
```
2023-05-31 06:55:01 +00:00
Ryan Wang ee1ea06171
fix: text content overflowing the container in the dialog component (#4007)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.6.x

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

修复 Console 端 Dialog 对话框组件中的文字内容可能会溢出容器的问题。

before:

<img width="623" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/ca9817c6-66e4-41f0-8112-4308913efcf2">

after:

<img width="666" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/9d64ee23-124c-434a-b8da-669cfd727dd0">


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

Fixes #4006 

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

```release-note
修复 Console 端 Dialog 对话框组件中的文字内容可能会溢出容器的问题。
```
2023-05-29 11:38:56 +00:00
Ryan Wang e95caa2c21
refactor: use createWebHistory instead of createWebHashHistory (#4005)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.6.x

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

将 Console 的 Router 模式从 Hash History 改为 Web History。可以让路由看起来更加简洁,也方便在后端或者页面上构建路由。

文档:https://router.vuejs.org/zh/guide/essentials/history-mode.html

#### Special notes for your reviewer:

测试 Console 的各个页面是否正常访问即可。

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

```release-note
修改 Console 的路由模式为 HTML5 模式。
```
2023-05-29 08:48:55 +00:00
Ryan Wang 67e13546ae
chore: bump up version to 2.6.0-rc.1 (#3998)
#### What this PR does / why we need it:

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

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

```release-note
None
```
2023-05-26 15:06:13 +00:00
guqing 710261b035
feat: add the ability to install plugins remotely via URI (#3963)
#### What type of PR is this?
/kind feature
/area core
/area console
/milestone 2.6.x
/kind api-change

#### What this PR does / why we need it:
支持通过 URI 远程安装和升级插件

how to test it?
1. 测试插件安装
```shell
curl -u admin:admin -X POST http://localhost:8090/apis/api.console.halo.run/v1alpha1/plugins/-/install-from-uri --data '{
  "uri": "https://halo.run/apis/api.store.halo.run/v1alpha1/applications/app-KhIVw/releases/app-release-canxF/download/app-release-canxF-znFre"
}'
```
2. 测试插件升级
```shell
curl -u admin:admin -X POST http://localhost:8090/apis/api.console.halo.run/v1alpha1/plugins/PluginFeed/upgrade-from-uri --data '{
  "uri": "https://halo.run/apis/api.store.halo.run/v1alpha1/applications/app-KhIVw/releases/app-release-canxF/download/app-release-canxF-znFre"
}'
```
#### Which issue(s) this PR fixes:
Fixes #2292

#### Does this PR introduce a user-facing change?
```release-note
支持通过 URI 远程安装和升级插件
```
2023-05-26 14:54:16 +00:00
guqing da5fb1a252
feat: implement a feature for previewing posts and single pages (#3983)
#### What type of PR is this?
/kind feature
/area core
/area console
/milestone 2.6.x

#### What this PR does / why we need it:
新增文章和自定义页面预览功能

提供了以下两个路由用于预览,必须登录且是对应文章或自定义页面的 contributors 才能访问,如果不是 contributor 则先得到没有权限访问异常,如果有权限访问但预览文章不存在则得到 404
- 文章预览 `GET /preview/posts/{name}`
- 自定义页面预览 `GET /preview/singlepages/{name}`

两个路由都可以通过查询参数 snapshotName 来指定需要预览的内容快照,它是可选的,默认为当前正在编辑的内容

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

Fixes #2349

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

```release-note
新增文章和自定义页面预览功能
```
2023-05-25 14:54:18 +00:00
Ryan Wang 533f0cfa66
feat: prompt to upgrade theme when installing existing theme (#3970)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.6.x

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

支持在安装已存在主题时提示是否升级主题。

<img width="611" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/2e99c781-96b6-4900-9a37-2d472ad65411">
<img width="604" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/a7bfa9d8-1522-417f-91b4-6ea3f75f693e">


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

Fixes #3969 

#### Special notes for your reviewer:

测试方式:

1. 通过本地上传和远程下载的方式重复安装某个主题,观察是否可以正常提示升级以及测试升级是否正常。

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

```release-note
Console 端支持安装已存在主题时提示升级主题。
```
2023-05-25 14:40:18 +00:00
Ryan Wang 6dd98d2c0c
feat: add min and max props for repeater input (#3965)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.6.x

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

Console 端的 FormKit Repeater 输入框支持 min 和 max 参数用于限制项目数量。

<img width="630" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/541da770-0439-4731-a796-a58277c33e05">

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

Fixes #3449 

#### Special notes for your reviewer:

定义方式:

```yaml
- $formkit: repeater
  name: test_repeater
  label: 测试 Repeater
  min: 2
  max: 3
  children:
    - $formkit: text
      name: test_text
      label: 测试 Text
    - $formkit: select
      name: test_select
      label: 测试 Select
      options:
        - value: prose-gray
          label: prose-gray
        - value: prose-slate
          label: prose-slate
        - value: prose-zinc
          label: prose-zinc
        - value: prose-neutral
          label: prose-neutral
        - value: prose-stone
          label: prose-stone
```

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

```release-note
Console 端的 FormKit Repeater 输入框支持 min 和 max 参数用于限制项目数量。
```
2023-05-25 14:38:19 +00:00
Ryan Wang 537d511cc0
feat: login page supports redirect_uri parameter (#3989)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.6.x

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

Console 端的登录页面支持登录之后重定向到某个链接(通过 redirect_uri 参数)。

支持一下链接形式:

1. 相对地址,比如 `/console#/plugins`、`/apps/app-links`
2. 绝对地址,仅限于同源地址,不支持非同源地址的重定向。

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

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

#### Special notes for your reviewer:

测试方式:

1. 在未登录的情况下访问如 `http://127.0.0.1:8090/console#/theme` 地址,观察登录之后是否会返回到这个页面。
2. 手动在登录页面构造如 `https://127.0.0.1:8090/console#/login?redirect_uri=/` 的地址,观察登录之后是否会跳转。

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

```release-note
Console 端的登录页面支持登录之后重定向到某个站内链接。
```
2023-05-25 14:30:18 +00:00
Ryan Wang 846138fe8c
chore: bump uppy packages (#3980)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.6.x

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

升级 Uppy 的所有 packages。

#### Special notes for your reviewer:

测试所有上传弹框是否可以正常使用即可。

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

```release-note
None
```
2023-05-25 13:38:18 +00:00
guqing d5f6dc2207
refactor: sorting parameters to maintain a unified API style (#3956)
#### What type of PR is this?
/kind improvement
/area core
/area console
/kind api-change
/milestone 2.6.x

#### What this PR does / why we need it:
重构排序参数以统一自定义 APIs 的风格
- 文章的排序参数字段名改为 `creationTimestamp`、`publishTime` 查询参数示例为 sort=creationTimestamp,desc
- 自定义页面排序参数字段名同文章
- 评论排序参数字段名为 `creationTimestamp`,`replyCount`,`lastReplyTime` 查询参数示例为 sort=creationTimestamp,desc

需要 Console 适配
#### Which issue(s) this PR fixes:

Fixes #3464

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

```release-note
重构排序参数以统一自定义 APIs 的风格
```
2023-05-25 12:42:17 +00:00
Ryan Wang a6c923d83d
chore: bump eslint and prettier related packages version (#3981)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.6.x

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

升级 ESLint 和 Prettier 相关的包。

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

```release-note
None
```
2023-05-22 08:56:05 +00:00
翟佳宇 c22f158fa3
fix: fix plugin detail page protocol name duplication issue (#3977)
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->

#### What type of PR is this?
/kind bug
<!--
添加其中一个类别:
Add one of the following kinds:

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

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

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

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

修复插件详情页面协议名字重复出现的问题

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

<!--
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/3971

#### 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
NONE
```
2023-05-22 03:01:47 +00:00
翟佳宇 c3d01dd7c4
perf: improve the logic of input selection for category and tag (#3978)
<!--  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
<!--
添加其中一个类别:
Add one of the following kinds:
/kind improvement
/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:

改善分类和标签选择性输入框的输入逻辑

![Kapture 2023-05-22 at 01 20 41](https://github.com/halo-dev/halo/assets/106857035/cf2d60f5-9ec5-4e5c-99e2-e3cd7a97d692)


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

#### 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
NONE
```
2023-05-22 02:46:45 +00:00
b1d95fe06d
fix: add keyword search functionality to AuthProvider list (#3974)
#### What type of PR is this?

/kind bug

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

添加关键字搜索功能到认证方式列表

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

Fixes #3948

#### Special notes for your reviewer:

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


```release-note
修复 Console 端认证方式列表无法使用搜索的问题。
```
2023-05-19 16:29:50 +00:00
guqing 170cf4e412
feat: add the ability to install themes remotely via URI (#3939)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.6.x
/kind api-change

#### What this PR does / why we need it:
支持通过 URI 远程安装和升级主题

how to test it?
1. 测试主题安装
```shell
curl -u admin:admin -X POST http://localhost:8090/apis/api.console.halo.run/v1alpha1/themes/-/install-from-uri --data '{
  "uri": "https://halo.run/apis/api.store.halo.run/v1alpha1/applications/app-eiTyL/releases/app-release-QSyjc/download/app-release-QSyjc-JOSOB"
}'
```
2. 测试主题升级
```shell
curl -u admin:admin -X POST http://localhost:8090/apis/api.console.halo.run/v1alpha1/themes/guqing-higan/upgrade-from-uri --data '{
  "uri": "https://halo.run/apis/api.store.halo.run/v1alpha1/applications/app-eiTyL/releases/app-release-QSyjc/download/app-release-QSyjc-JOSOB"
}'
```
#### Which issue(s) this PR fixes:

Fixes #2291

#### Does this PR introduce a user-facing change?
```release-note
支持通过 URI 远程安装和升级主题
```

---------
Co-authored-by: Ryan Wang <i@ryanc.cc>
2023-05-19 02:10:24 +00:00
Ryan Wang 8deea08231
refactor: abnormal status display of plugin management (#3945)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.6.x

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

重构 Console 端插件异常状态的判断和显示,改动如下:

1. 移除插件名称旁边的启用状态。
2. 切换按钮的状态是期望值,意思就是不与插件实际状态一致。
3. 小红点出现的时机为:插件的实际状态与期望状态不一致以及插件本身出了异常。
4. 插件详情页面支持横幅显示插件异常状态。

<img width="1358" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/42408d1f-7975-4aef-9373-d828994501b3">
<img width="1383" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/033efdef-470b-4570-94c1-da64d9ea0db9">

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

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

#### Special notes for your reviewer:

测试方式:

1. 想办法将插件状态变成异常,比如在开发环境将 runtime-mode 改为 deployment。
2. 检查 Console 端插件管理中的 UI 表现是否和上面的描述一致。

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

```release-note
重构 Console 插件管理的异常状态显示。
```
2023-05-17 03:54:15 +00:00
Ryan Wang 017d5b8d8f
chore: async api client (#3941)
#### What type of PR is this?

/kind improvement
/area console

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

同步 api client。

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

```release-note
None
```
2023-05-16 10:18:51 +00:00
Ryan Wang 0ff11db111
refactor: improve the accessibility of action items in some data list (#3919)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.6.x

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

1. 移除 Entity 组件最外层容器的手型样式,避免出现可点击性的误导。
2. 为部分数据列表项操作提供更多的访问选项。
    1. 文章 / 页面列表添加编辑按钮。
    2. 插件列表项添加详情按钮。
    3. 附件列表项添加详情按钮。

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

Fixes #3914 

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

```release-note
优化 Console 端部分数据列表的可访问性
```
2023-05-16 10:16:55 +00:00
Li 136bd4e91f
fix: theme page displays error without management permissions. (#3938)
#### What type of PR is this?
/kind bug
/area console
/milestone 2.6.x

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

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

Fixes #3933 

#### Special notes for your reviewer:

1. 创建一个拥有主题查看而没有主题管理权限的角色,并为某个用户分配这个角色。
2. 使用该用户登录 console,点击主题选项卡查看控制台是否报错。

#### Does this PR introduce a user-facing change?
```release-note
修复没有主题管理权限时,进入主题功能页面报错的问题。
```
2023-05-15 06:43:55 +00:00
Ryan Wang 017bb55521
chore: bump pnpm version to 8 (#3935)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.6.x

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

升级 pnpm 的版本为 pnpm 8,更新 pnpm-lock.yaml 文件。

GitHub Actions 的改动将在 https://github.com/halo-sigs/actions

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

Fixes #3934 

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

```release-note
None 
```
2023-05-11 08:50:21 +00:00
Ryan Wang 48863addba
refactor: remove the codemirror of the component package and change it to built-in (#3926)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.6.x

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

从 `@halo-dev/components` 包中移除 VCodemirror 组件,改为由 Console 内置。因为观察到 VCodemirror 暂时无法支持 Tree Shaking,即代表如果在其他地方引入了 `@halo-dev/components`,就算没有使用 VCodemirror 组件,也会构建到生产产物。

此外,内置到 Console 之后,改为了异步加载此组件,即进入到使用了 VCodemirror 的组件的页面才会加载相应资源。

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

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

#### Special notes for your reviewer:

测试方式:

1. Console 需要 `pnpm build:packages`
2. 测试系统设置中的代码注入部分,观察输入框是否加载正常即可。

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

```release-note
None
```
2023-05-11 04:12:21 +00:00
Ryan Wang 9a52cebd1d
refactor: make tanstack query's network mode option to always (#3928)
#### What type of PR is this?

/kind improvement
/area core
/milstone 2.6.x

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

将 TanStack Query 的 Network Mode 设置为 always,防止在无网络的情况下,开发环境也无法请求数据。

#### Special notes for your reviewer:

测试方式:断网之后使用开发模式访问 Console,观察请求是否正常发送即可。

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

```release-note
None
```
2023-05-11 02:44:20 +00:00
Ryan Wang acceeee59c
fix: the label of some radio is displayed incorrectly (#3878)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.6.x

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

修复部分 FormKit 的 radio 表单项的 label 设置不正确的问题。目前影响范围:

1. 使用了 type 为 `menuCheckbox`  `menuRadio` 并将 validation 设置为了 `required`。

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

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

Fixes #3876 

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

```release-note
修复部分 FormKit 的 radio 表单项的 label 设置不正确的问题。
```
2023-05-04 07:58:39 +00:00
Ryan Wang 3bfecd2b38
fix: failed to initialize the preset plugins (#3894)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.6.x

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

修复初始化时,预设插件安装失败的问题,目前的解决方案是重试安装操作。

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

Fixes #3893 

#### Special notes for your reviewer:

测试方式:

1. 建议参考 https://docs.halo.run/developer-guide/core/build 构建成 Docker 镜像再测试。
2. 测试初始化完成之后,预设插件是否正确安装以及启动即可。

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

```release-note
修复在初始化时,预设插件可能初始化失败的问题。
```
2023-05-04 07:54:38 +00:00
Ryan Wang 0f039225ab
fix: user avatar link does not support relative paths (#3880)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.6.x

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

修复用户头像不支持相对链接的问题。

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

Fixes #3879 

#### Special notes for your reviewer:

测试方式:

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

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

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

<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->

#### What type of PR is this?
/kind bug
<!--
添加其中一个类别:
Add one of the following kinds:

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

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

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

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

解决插件列表渲染问题

#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/3866
<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

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

#### Special notes for your reviewer:


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



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

<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->

```release-note
NONE
```
2023-05-03 15:56:33 +00:00
Ryan Wang ec5599068c
chore: bump up version to 2.5.1 (#3874)
#### What this PR does / why we need it:

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

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

```release-note
None
```
2023-04-28 07:56:19 +00:00
Ryan Wang 0794644dbd
chore: bump up version to 2.5.0 (#3870)
#### What this PR does / why we need it:

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

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

```release-note
None
```
2023-04-28 02:40:17 +00:00
Ryan Wang 795d4f9261
chore: bump up version to 2.5.0-rc.2 (#3864)
#### What this PR does / why we need it:

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

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

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

/kind bug
/area console
/milestone 2.5.x

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

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

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

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

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

```release-note
None
```
2023-04-26 13:14:15 +00:00
Ryan Wang 7b8613049a
feat: add supports for copying attachment permalink (#3835)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.5.x

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

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

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

Fixes #3801 

#### Special notes for your reviewer:

测试方式:

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

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

```release-note
Console 端的附件详情支持复制链接的功能。
```
2023-04-26 07:32:12 +00:00
Ryan Wang 18c0ced64e
chore: bump up version to 2.5.0-rc.1 (#3845)
#### What this PR does / why we need it:

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

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

```release-note
None
```
2023-04-24 12:28:16 +00:00
Ryan Wang 2dcbceea5e
fix: distance between the login form and the top of the page (#3821)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.5.0

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

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

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

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

#### Special notes for your reviewer:

测试方式:

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

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

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

/kind improvement
/area console
/milestone 2.5.x

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

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

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

Fixes #3833 

#### Special notes for your reviewer:

测试方式:

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

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

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

/kind bug
/area console
/milestone 2.5.x

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

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

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

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

Fixes #3479 

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

```release-note
修复 Console 端的文章分类和标签选择组件在 Repeater 组件中,下拉框无法完整显示的问题。
```
2023-04-24 09:56:13 +00:00
guqing fc77d51c48
refactor: add custom API for create user (#3803)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.5.x
/kind api-change

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

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

#### Does this PR introduce a user-facing change?
```release-note
优化用户账号创建流程
```
2023-04-24 08:19:42 +00:00
Ryan Wang d441e4731e
feat: add accepts and min,max props for attachment selector modal component (#3827)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.5.x

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

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

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

FormKit 中使用:

1. Component

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

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

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

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

#### Special notes for your reviewer:

测试方式:

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

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

```release-note
Console 端的附件选择组件支持 accepts、min、max 参数用来限定文件格式和数量。
```
2023-04-24 07:45:44 +00:00
Ryan Wang 66eb0bb622
perf: enable hardware acceleration for attachment images (#3831)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

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

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

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

before:

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

after:

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

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

Fixes #3830 

#### Special notes for your reviewer:

测试方式:

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

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

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

/kind improvement
/area console
/milestone 2.5.x

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

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

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

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

Fixes #3823 

#### Special notes for your reviewer:

测试方式:

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

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

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

/kind improvement
/area console

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

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

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

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

/kind feature
/area console
/milestone 2.5.x

Fixes #3734

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

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

before:

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


after:

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

可以测试的 FormKit Schema:

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


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

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

/kind improvement
/area console
/milestone 2.5.x

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

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

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

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

/kind bug
/area console
/milestone 2.5.x

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

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

#### Special notes for your reviewer:

测试方式:

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

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

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

/kind feature
/area console
/milestone 2.5.0

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

为 Console 端添加 Description 组件。

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

Fixes #3790 

#### Special notes for your reviewer:

测试方式:

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

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


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

/kind bug
/area console
/milestone 2.5.x

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

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

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


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

Fixes #3793 

#### Special notes for your reviewer:

测试方式:

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

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

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

/kind improvement
/area console
/milestone 2.5.x

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

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

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

#### Special notes for your reviewer:

测试方式:

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

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

```release-note
优化 Console 端上传附件的弹框,支持点击完成按钮以关闭弹框。
```
2023-04-21 12:33:41 +00:00
Ryan Wang 7afb3b8687
feat: import zh_TW locale for uppy component (#3785)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.5.x

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

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

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

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

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

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

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

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

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

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

#### How to use it?

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

Or:

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

Or:

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

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

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

#### Special notes for your reviewer:

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

```release-note
新增是否生成相对地址的配置
```
2023-04-19 07:54:24 +00:00