Commit Graph

146 Commits (bb0a5f114a59ffa0354ce4689026f7efa6344b74)

Author SHA1 Message Date
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
Ryan Wang f87295e5c8
perf: reload page after active theme (#3779)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

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

在主题列表激活主题之后,自动刷新页面。

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

Fixes #3778 

#### Special notes for your reviewer:

测试方式:

1. 打开主题列表,选择任意主题激活,观察是否刷新页面。

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

```release-note
优化 Console 端激活主题的流程,支持激活后自动刷新页面
```
2023-04-19 02:23:00 +00:00
Ryan Wang 0fb3496aed
perf: automatically close the installation modal after installing the theme (#3777)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

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

优化安装主题和升级主题的流程,支持在升级或者安装之后自动关闭弹框以及刷新数据。

#### Special notes for your reviewer:

测试方式:

1. 测试升级或者安装新主题之后是否关闭弹框以及是否有提示即可。

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

```release-note
优化 Console 端安装和升级主题的流程,支持自动关闭安装弹框和显示反馈提示
```
2023-04-19 02:21:05 +00:00
Li 01f66cb3b6
fix: outline not displayed when first entering the editor. (#3773)
#### What type of PR is this?
/kind bug
/area console

#### What this PR does / why we need it:
为默认编辑器侦听器增加 `immediate` 属性,使其在创建之后立即执行,生成目录。

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

#### Special notes for your reviewer:
打开已经存在并且具有标题的文章/页面,查看大纲是否正常生成。

#### Does this PR introduce a user-facing change?
```release-note
修复文章/页面已有内容重新编辑时,无法立即显示大纲的问题。
```
2023-04-18 06:34:57 +00:00
Li 0c3e5a760a
fix: error occurred when switching tab in dashboard component. (#3770)
#### What type of PR is this?
/kind bug
/area console

#### What this PR does / why we need it:
修复 Console 端仪表盘添加组件时,切换标签页面报错的问题。

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

#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端仪表盘添加组件时的报错问题。
```
2023-04-18 06:30:57 +00:00
John Niang ed14fcb5f4
Support publishing to maven central repository (#3767)
#### What type of PR is this?

/kind feature
/area core

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

Use Gradle plugin `maven-publish` to publish Halo modules(`platform.application`, `platform.plugin` and `api`) to Maven central repository.

```bash
# Try to publish to Maven local repository.
./gradlew publish
# Really publish to Maven central repository.
./gradlew -Prelease publish -PossrhUsername=username -PossrhPassword=password
```

Note that currently we only support manually publishing.

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

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

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

```release-note
None
```
2023-04-18 14:28:23 +08:00
hughding 8d2f081067
fix: signup form overlaps with locale form. (#3756)
#### What type of PR is this?
/kind improvement
/area console

#### What this PR does / why we need it:
此修改对登录、注册界面原有风格无影响。解决了1920*1080分辨率下,注册界面,“已有账号 立即登录”与“简体中文”文字重叠问题

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

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?
```release-note
解决1920*1080分辨率下,注册界面,“已有账号 立即登录”与“简体中文”文字重叠问题
```
2023-04-18 03:57:28 +00:00
Ryan Wang eb141e4966
refactor: use tanstack query to refactor menu related data fetching (#3714)
#### 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
Fixed https://github.com/halo-dev/halo/issues/3467

#### Special notes for your reviewer:

测试方式:

1. 创建若干菜单和菜单项,检查功能是否正常。

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

```release-note
修复 Console 端菜单项和菜单关联可能发现混乱的问题。
```
2023-04-16 15:12:13 +00:00
Li cab3432d03
fix: repeated display of theme tabs. (#3727)
#### What type of PR is this?

/kind bug
/area console

#### What this PR does / why we need it:
获取主题配置时,重复添加了上次已经获取到的主题配置,导致重复显示。并同步修改了 plugin 中可能出现问题的位置。

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

Fixes #3726 

#### Special notes for your reviewer:
1. 打开 Console 端主题页面
2. 点击右上角预览页面
3. 关闭预览页面,选项卡无重复即为正常。


#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端主题设置中,选项卡会重复显示的问题
```
2023-04-10 07:10:22 +00:00
Ryan Wang b99222e176
fix: the setting form of the preview theme page may not be rendered (#3706)
#### What type of PR is this?

/kind bug

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

修复预览主题页面的设置表单可能因为接口请求速度导致无法正常渲染表单的问题。

<img width="1226" alt="image" src="https://user-images.githubusercontent.com/21301288/230562109-0858098f-c67e-4d93-bebd-a85400de9285.png">

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

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

#### Special notes for your reviewer:

测试方式:

1. 在主题管理页面点击预览按钮,检查设置表单是否可以正常渲染即可。

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

```release-note
修复 Console 端预览主题页面的设置表单可能出现无法渲染的问题。
```
2023-04-07 09:28:45 +00:00
Ryan Wang 9b8cec426f
fix: lost the activated theme settings when saving the system settings (#3691)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.5.x

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

修复保存系统设置之后,启用主题的设置丢失,恢复为了默认主题。原因是因为在 https://github.com/halo-dev/halo/pull/3606 中使用了新的 useSettingFormConvert 方法,但这个方法未考虑到某些 ConfigMap 的分组并未在表单中定义,也就是数据转换方法是以表单的定义为基准,所以丢失了 `theme.active` 设置。

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

Fixes #3673 

#### Special notes for your reviewer:

测试方式:

1. 安装若干主题并启用。
2. 然后去系统设置修改任意数据并保存。
3. 检查主题是否被修改为默认主题。

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

```release-note
修复保存系统设置之后导致激活主题的设置值丢失,恢复为了默认主题的问题。
```
2023-04-05 15:50:16 +00:00
-Shiken- a466ee73c9
add zhTW locale (#3672)
#### What type of PR is this?

/kind feature
/area core

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

Add zhTW locale.

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

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

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

```release-note
提供繁体中文(TW)翻译
```
2023-04-03 15:58:16 +00:00
Ryan Wang a2516dbef4
chore: bump @halo-dev/richtext-editor version to resolve i18n issue (#3682)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x
/cherry-pick release-2.4

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

升级 `@halo-dev/richtext-editor` 的版本以解决编辑器翻译不完整的问题。

see https://github.com/halo-sigs/richtext-editor/pull/7

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

```release-note
升级 `@halo-dev/richtext-editor` 的版本以解决编辑器部分文本翻译不完整的问题。
```
2023-04-03 04:38:12 +00:00
John Niang 36d50e75d3
Configure default external-url as slash (#3655)
#### What type of PR is this?

/kind improvement
/area core

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

Configure default external-url as slash. So that system will generate relative links for all permalinks.

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

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

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

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

```release-note
None
```
2023-04-03 03:50:13 +00:00
Ryan Wang ffeeaa231a
fix: radio value type is incorrect in the form defined by formkit schema (#3668)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.5.x
/cherry-pick release-2.4

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

修复使用了 FormKit Schema 生成的表单中,Radio 输入类型如果值的类型定义为 boolean 类型,但得到的结果为 string 类型的问题。

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

Fixes #3666 

#### Special notes for your reviewer:

测试方式:

1. 安装一个主题设置使用了 Radio 输入类型的主题,比如 https://github.com/halo-dev/halo-theme-anatole
2. 测试保存其中包含了 Radio 输入类型的表单。
3. 刷新页面,检查值回显是否正确。

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

```release-note
修复 Console 端 FormKit Schema 生成的表单中,Radio 输入类型值类型为 boolean 但结果为 string 的问题。
```
2023-04-03 03:48:13 +00:00
Ryan Wang 03f7e583f6
fix: publish time of the post cannot be displayed back (#3671)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.5.x
/cherry-pick release-2.4

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

修复文章设置中的发布时间无法回显导致重新保存时丢失发布时间的问题。

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

Fixes #3669 

#### Special notes for your reviewer:

测试方式:

1. 新建或者修改已有文章的设置。
2. 检查时间输入框的时间是否显示正确。
3. 检查保存之后时间是否显示正确。

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

```release-note
修复 Console 端文章设置中的发布时间无法回显导致重新保存时丢失发布时间的问题。
```
2023-04-03 03:12:14 +00:00
Ryan Wang 0b21758347
fix: route title i18n in global search is not compatible (#3665)
#### What type of PR is this?

/kind bug
/area console
/cherry-pick release-2.4

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

修复后台全局搜索中关于 Console 路由的文字没有适配 i18n 的问题。

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

Fixes #3664 

#### Special notes for your reviewer:

<img width="741" alt="image" src="https://user-images.githubusercontent.com/21301288/229279243-4b727cc7-1790-41b3-a170-4958ce1f65a8.png">

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

```release-note
修复后台全局搜索中关于 Console 路由的文字没有适配 i18n 的问题。
```
2023-04-03 03:08:14 +00:00
Ryan Wang f8e405c8ed
fix: attachment policy editing modal crashes when opened (#3663)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.5.x

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

修复附件存储策略编辑表单无法正常渲染的问题。此问题原因为 Modal 组件使用了 OverlayScrollbars 库来模拟滚动条,但在初始化的时候由于 Body 没有任何子元素,所以导致异常。

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

Fixes #3662 

#### Special notes for your reviewer:

测试是否能够正常打开附件存储策略编辑表单即可。

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

```release-note
修复 Console 端附件存储策略编辑表单无法正常渲染的问题
```
2023-04-03 03:02:12 +00:00
Ryan Wang 74c543ec37
chore: bump console version to 2.4.0 (#3650)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.4.0

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

修改 Console 的版本号为 2.4.0。

修改 `@halo-dev/components` 的版本为 1.3.0

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

```release-note
None
```
2023-03-31 03:10:19 +00:00
Ryan Wang ff5a62b900
chore: generate api client (#3648)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.4.0

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

重新生成 api client。

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

```release-note
None
```
2023-03-31 03:00:20 +00:00
Ryan Wang 2d56aaeb93
refactor: re-design login-related form (#3608)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.4.x

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

重新设计登录页面的样式和用户体验。

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

Fixes #3572 

#### Special notes for your reviewer:

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

```release-note
优化 Console 端登录页面样式
```
2023-03-30 16:10:15 +00:00
Ryan Wang ff466f5de6
feat: add setting locale supports in login page (#3642)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.4.x

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

在登录页面添加语言设置的支持。

<img width="743" alt="image" src="https://user-images.githubusercontent.com/21301288/228879897-17d4a0c4-5d1d-4b5a-bd52-aaa1d5a287d1.png">

#### Special notes for your reviewer:

在登录页面测试语言切换是否生效即可。

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

```release-note
None
```
2023-03-30 15:32:14 +00:00
Ryan Wang 34dea0802e
feat: add role select input type for formkit (#3641)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.4.0

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

添加角色选择的 FormKit 输入类型。

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

Fixes #3637 

#### Special notes for your reviewer:

测试方式:

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
Console 端添加角色选择的 FormKit 输入类型。
```
2023-03-30 15:30:14 +00:00
Ryan Wang 54ca1889ef
perf: improve the conditions for fetching role templates on the plugin details page (#3626)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.4.x

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

优化插件详情页面获取角色模板的条件,不查询 label 中带了 `halo.run/hidden` 的角色模板。

#### Special notes for your reviewer:

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

```release-note
优化 Console 端在插件详情页面上获取角色模板的条件
```
2023-03-30 15:26:14 +00:00
guqing ddca7731dd
feat: support user registration (#3631)
#### What type of PR is this?
/kind feature
/area core
/area console
/milestone 2.4.0

#### What this PR does / why we need it:
新增用户注册功能

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

#### Special notes for your reviewer:

#### Does this PR introduce a user-facing change?
```release-note
新增用户注册功能
```
2023-03-30 09:44:15 +00:00
Ryan Wang a77756abad
refactor: use tanstack query to refactor system setting form fetching (#3606)
#### 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-03-30 08:32:19 +00:00
John Niang 1d9c7343fc
Fix typo: snaphosts -> snapshots (#3618)
#### What type of PR is this?

/kind cleanup
/area core
/area console

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

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

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

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

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

```release-note
None
```
2023-03-30 08:28:16 +00:00
Ryan Wang 841f0293be
feat: support setting language for FormKit and Uppy (#3630)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.4.0

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

FormKit 和 Uppy 上传组件支持同步设置系统语言。

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

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

#### Special notes for your reviewer:

在不同语言的浏览器中测试表单的验证和上传组件的语言是否显示正确即可。

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

```release-note
None
```
2023-03-30 08:08:14 +00:00
Ryan Wang 7cf5e3c39b
perf: improve shadow style of side menu (#3638)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.4.0

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

优化左侧菜单栏边框阴影的样式。

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

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

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

```release-note
优化左侧菜单栏边框阴影的样式。
```
2023-03-30 07:34:14 +00:00
Ryan Wang 04cda52379
chore: add FloatingDropdown to solve compatibility issues (#3622)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.4.x

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

重新在全局注册 FloatingDropdown 组件,因为在 https://github.com/halo-dev/halo/pull/3576 中移除之后,会导致插件无法正常加载 FloatingDropdown 组件,从而带来破坏更新。

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

Fixes #3621 

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

```release-note
None
```
2023-03-30 04:10:13 +00:00
Ryan Wang 0b3343f219
fix: menu scrollbar position cannot be restored after switching routes (#3634)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.4.0

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

修复跳转页面之后无法固定菜单滚动位置的问题。

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

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

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

```release-note
None
```
2023-03-30 03:02:14 +00:00
Ryan Wang af2b946a56
fix: the loading status is not displayed when loading auth providers (#3623)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.4.x

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

修复认证方式管理页面在加载时不显示加载状态的问题。

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

```release-note
None
```
2023-03-29 14:42:18 +00:00
Ryan Wang 8d9be88b94
chore: bump the patch version of all console dependencies (#3617)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.4.x

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

升级 Console 依赖的所有 patch 版本,由于升级了 prettier 的版本,可能发生了规则改变,所以同时包含重新格式化后的文件。

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

```release-note
None
```
2023-03-29 13:44:14 +00:00
Ryan Wang 4c11ccfcd1
perf: improve the display of user auth providers in user details (#3624)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.4.x

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

优化用户详情页面中认证方式的显示逻辑。

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

```release-note
None
```
2023-03-29 13:30:14 +00:00
Ryan Wang 9814053d0e
refactor: use tanstack query to refactor setting-form-related fetching of theme and plugin (#3604)
#### 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-03-29 13:26:13 +00:00
Ryan Wang c9a5a01bf1
chore: bump @halo-dev/richtext-editor version to support i18n (#3613)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.4.x

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

升级 `@halo-dev/richtext-editor` 以支持 i18n。 https://github.com/halo-sigs/richtext-editor/pull/6

<img width="1406" alt="image" src="https://user-images.githubusercontent.com/21301288/228414222-e5014957-1d30-4fdc-9db6-0f79e07a73b5.png">
<img width="1432" alt="image" src="https://user-images.githubusercontent.com/21301288/228414283-a2d401cd-a215-4398-9d8d-b33e7373ee49.png">

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

Ref #3574 

#### Special notes for your reviewer:

在不同语言的浏览器中测试编辑器的语言是否显示正确即可。

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

```release-note
None
```
2023-03-29 06:16:12 +00:00
Ryan Wang 1e6992eef1
fix: post publishing api is requested twice (#3619)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.4.x

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

修复从文章列表打开设置之后保存会调用两次发布接口的问题。

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

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

#### Special notes for your reviewer:

测试从文章列表打开设置后保存是否会调用多次发布接口即可。

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

```release-note
修复 Console 端发布文章可能调用多次接口的问题。
```
2023-03-29 04:56:13 +00:00
123abcabcabcabcba e16fd7565d
feat: add supports for clicking the visibility icon in the post list to modify visibility (#3581)
#### What type of PR is this?

/kind improvement
/area console

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

通过点击“眼睛”图标,可以比较方便地修改文章或者页面的可视性。
<img width="1150" alt="image" src="https://user-images.githubusercontent.com/114651359/227491296-5f96e605-1137-4f6f-b506-d33b329045fc.png">

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

Ref #3501 

#### Special notes for your reviewer:

1.修改了两个页面,路径为:
(1)console/src/modules/contents/pages/SinglePageList.vue
(2)console/src/modules/contents/posts/PostList.vue
2.原本“眼睛”图标是没有设置点击事件的,现在添加了点击改变选中文章或页面可视性的功能。

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

```release-note
action required  当用户点击“眼睛”图标时,会提示用户“可视化修改成功”
```
2023-03-29 03:52:13 +00:00
Ryan Wang d194c34848
fix: the issue of failing to unbind third-party login (#3595)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.4.x

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

修复解绑三方登录失败的问题,原因是解绑接口是 put 请求,但请求接口时用了 post 请求。

#### Special notes for your reviewer:

测试方式:

1. 安装 OAuth2 插件:https://github.com/halo-sigs/plugin-oauth2/pull/3
2. 配置某个三方的 OAuth 登录。
3. 测试在个人资料中的绑定和解绑三方登录。

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

```release-note
None
```
2023-03-27 09:36:02 +00:00
Ryan Wang ab4b7c1f0d
chore: bump console and packages version to 2.4.0-rc.1 (#3596)
#### What type of PR is this?

/area console
/milestone 2.4.0

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

修改 Console 以及其下 packages 的版本为 2.4.0-rc.1

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

```release-note
None
```
2023-03-27 09:28:18 +00:00
Ryan Wang 403702021c
perf: improve the style of the scrollbar (#3587)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.4.x

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

优化页面滚动条的样式,引入 [OverlayScrollbars](https://github.com/KingSora/OverlayScrollbars) 实现类似于 macOS 下的仅滚动时显示滚动条的特性,并保证在各个浏览器的表现一致。

![2023-03-26 13 44 04](https://user-images.githubusercontent.com/21301288/227757677-ca2709be-03bc-4bdd-a74c-2e42a452417a.gif)

#### Special notes for your reviewer:

测试方式:使用不同的浏览器测试滚动条是否可以自动隐藏以及样式是否一致即可。

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

```release-note
优化 Console 端页面滚动条的样式。
```
2023-03-27 09:20:22 +00:00
Ryan Wang da6a458d71
fix: output dir of console (#3591)
#### What type of PR is this?

/kind bug
/area console

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

修正 Console 构建的输出目录,此问题由 https://github.com/halo-dev/halo/pull/3552 导致。

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

```release-note
None
```
2023-03-27 08:34:11 +00:00
Ryan Wang 8ce0913c0e
perf: hide disabled auth providers in user profile (#3561)
#### 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 #3556 

#### Special notes for your reviewer:

测试方式:

1. 安装 OAuth 2 插件:https://github.com/halo-sigs/plugin-oauth2/pull/3
2. 再不做任何配置的情况下,访问已登录用户的个人资料页面,检查是否列出了认证方式。
3. 配置某个认证方式并开启,再检查是否列出了已启用的认证方式。

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

```release-note
None
```
2023-03-27 08:32:12 +00:00
Ryan Wang 9a00a74f06
feat: add dropdown component to refactor the action buttons (#3576)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.4.x

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

在 `@halo-dev/components` 添加 Dropdown 组件用于统一 Console 端所有下拉框的样式和表现,同时方便插件使用。

<img width="1408" alt="image" src="https://user-images.githubusercontent.com/21301288/227758168-ed6f40ef-8627-4d5a-8a4a-476badf5196d.png">
<img width="992" alt="image" src="https://user-images.githubusercontent.com/21301288/227758184-01bf61a0-f778-4ba8-aaea-f6b99715b577.png">

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

Fixes #2987 

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

```release-note
Console 端添加 Dropdown 组件以统一所有下拉框的样式和表现。
```
2023-03-27 08:06:13 +00:00
Ryan Wang fbe8e627e8
perf: hide the switch of local identity authentication (#3562)
#### What type of PR is this?

/kind improvement
/area console 

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

在身份认证的列表中隐藏本地身份认证的启用/禁用开关。

<img width="1402" alt="image" src="https://user-images.githubusercontent.com/21301288/226804384-e12ea447-d7ad-4429-82bc-2621fcca84dc.png">

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

Fixes #3557 

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

```release-note
None 
```
2023-03-27 08:02:20 +00:00
Ryan Wang 5b3b473cb3
refactor: use tanstack query to refactor theme-related fetching (#3588)
#### 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-03-27 07:56:17 +00:00
Ryan Wang bd9f590c1e
perf: improve styles of bottom menu in mobile devices (#3577)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.4.x

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

优化移动端底部菜单栏的布局和样式。

before:

<img width="349" alt="image" src="https://user-images.githubusercontent.com/21301288/227410375-87e7b6bb-1528-425e-ac58-fdba809c2bf3.png">

after:

<img width="394" alt="image" src="https://user-images.githubusercontent.com/21301288/227410199-9fb04304-0ff3-4a8f-9a9f-38a5031b0c05.png">

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

Fixes #3575 

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

```release-note
优化 Console 在移动端下底部菜单栏的布局和样式。
```
2023-03-27 07:50:15 +00:00
Ryan Wang 1c89638f7e
fix: unable to login again after using oauth providers login (#3571)
#### What type of PR is this?

/kind bug
/area console

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

修复使用非本地认证登录之后,无法重新登录的问题。此问题来源是三方登录方式登录之后没有在 localStorage 存入 `logged_in` 的 flag。并且在引入匿名用户之后,本身也不再需要这个 flag。

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

Fixes #3569 

#### Special notes for your reviewer:

测试方式:

1. 使用 https://github.com/halo-sigs/plugin-oauth2/pull/3 插件配置 OAuth 2 的登录方式。
2. 在个人资料中绑定配置的登录方式。
3. 测试登录之后退出,再进行登录。

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

```release-note
None
```
2023-03-23 14:52:34 +00:00
Ryan Wang e759dd505f
feat(components): add disabled prop supports for switch component (#3564)
#### What type of PR is this?

/kind improvement
/area console

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

为 Switch 组件添加 disabled 属性以支持禁用。

<img width="1403" alt="image" src="https://user-images.githubusercontent.com/21301288/226829739-914eca3d-6d33-4d8c-9cc8-fe19b655ad9d.png">

#### Special notes for your reviewer:

1. `cd path/to/console/packages/components`
2. `pnpm story:dev`
3. 测试 Switch 组件的 disabled 属性是否工作正常。

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

```release-note
None
```
2023-03-23 14:16:34 +00:00
Ryan Wang 066e5e9462
perf: improve layout of comment list item (#3563)
#### What type of PR is this?

/kind improvement
/area console

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

优化评论管理列表项的布局,将被评论页面放置在评论内容上方,看起来更加直观。

before:

<img width="1399" alt="image" src="https://user-images.githubusercontent.com/21301288/226825923-6d2fec5b-c2d9-4d32-8502-255afac7d0ca.png">

after:

<img width="1396" alt="image" src="https://user-images.githubusercontent.com/21301288/226825785-db6e8696-4e99-43c2-b7a9-3e8b1edb09d9.png">

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

Fixes <https://github.com/halo-dev/halo/issues/3377>

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

```release-note
优化 Console 端评论管理列表项的布局
```
2023-03-23 14:04:34 +00:00
Ryan Wang 194850bc80
fix: the issue of local cache not being cleared after saving a new post (#3551)
#### What type of PR is this?

/kind bug
/area console

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

修复新建文章或页面保存后,本地内容缓存可能不会及时清空的问题。

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

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

#### Special notes for your reviewer:

测试方式:

1. 连续创建多篇新的文章,然后反复进入新建页面,观察是否有恢复缓存的提示。

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

```release-note
修复新建文章或页面保存后,本地内容缓存可能不会及时清空的问题。
```
2023-03-23 13:52:36 +00:00
Ryan Wang 4ce5d0c2cf
refactor: use tanstack query to refactor user-related fetching (#3548)
#### 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-03-23 13:44:34 +00:00
Ryan Wang 0503c5ff2e
perf: disable browser's autocomplete feature for password input field (#3550)
#### What type of PR is this?

/kind improvement
/area console

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

默认禁用 password 输入框的浏览器自动填充,实现方式为默认给 type 为 password 的 input 添加 `autocomplete="new-passwrod"` 属性。如果需要自动填充,手动为组件添加 `autocomplete` 属性即可。

此改动主要是针对非登录表单场景的密码输入框来做优化,在这些场景下,浏览器如果自动填充用户保存的用户名密码,会带来一定的干扰。

<img width="1103" alt="image" src="https://user-images.githubusercontent.com/21301288/226558568-bf617be7-0cd8-44db-a123-f230a2b88181.png">

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

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

#### Special notes for your reviewer:

1. 登录 Console,并将用户名和密码保存在浏览器的密码管理器。
2. 然后进入任意使用了密码输入框的页面,检查是否自动填充了密码。推荐使用 https://github.com/halo-sigs/plugin-s3 测试。

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

```release-note
禁用非登录场景下,密码输入框的浏览器自动填充
```
2023-03-23 13:42:35 +00:00
Ryan Wang b63d2b882c
feat: add i18n supports for console (#3506)
#### What type of PR is this?

/kind feature

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

为 Console 端添加多语言的支持,并默认提供简体中文和英文的语言包。

todolist:

- [x] 完善 Console 的文字语言包翻译。
- [ ] ~~为后端提供的部分数据支持翻译,比如系统设置的表单定义。(实现方式待讨论,这个 PR 先不支持)~~
- [x] 提供语言设置。

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

Fixes #3346 

#### Special notes for your reviewer:

测试方式:

1. 检查各个页面的文字显示是否正常。
2. 测试中英文环境中是否使用了对应的语言包。

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

```release-note
Console 端支持多语言界面
```
2023-03-23 08:54:33 +00:00
John Niang c400c85922
Refactor project structure for a better development (#3552)
#### What type of PR is this?

/kind cleanup
/area core

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

This PR totally refactor project structure for a better plugin development. Now we can maintain and publish api and platform modules at Halo application side, which will be references by plugins.

Currently, we can execute command `./gradlew clean publish` to publish api and platform modules into **local** Maven repository, so that we can refer these dependencies (`run.halo.tools.platform:plugin:2.4.0-SNAPSHOT` and `run.halo.app:api:2.4.0-SNAPSHOT`) in plugin projects. 

I will make another pull request to publish api library and platforms into Maven central repository.

**Modules explanation**:
- API module contains common classes which might be used by plugins.
- Plugin Platform module contains dependency declarations of other plugin API modules.
- Application Platform module contains dependency declarations application module might uses.

If we want to build application only(exclude check and jar), we have to execute the command below:

```bash
./gradlew clean :application:build -x :application:check -x :application:jar
```

The executable Jar will be generated at folder `application/build/libs/`.

If we want to build a Docker image, we could execute the command below:

```bash
docker build -t johnniang/halo:project-structure .

# Test the Docker image
docker run -it --rm -p8090:8090 johnniang/halo:project-structure
```

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

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

#### Special notes for your reviewer:

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

```release-note
重构项目结构
```
2023-03-23 08:02:33 +00:00
guqing 7ca5270238
feat: support the expansion of other authentication methods (#3520)
#### What type of PR is this?
/kind feature
/milestone 2.4.0
/area core

#### What this PR does / why we need it:
支持扩展其他登录方式:
1. 增加 AdditionalWebFilter 扩展点,插件只需要实现此扩展点完成 Filter 逻辑
2. 增加 DynamicMatcherSecurityWebFilterChain 用于将 `apiFilterChain` 的 `SecurityWebFilterChain` 委托给此类,需要认证的请求都会 DynamicMatcherSecurityWebFilterChain 的过滤器进行处理,所以 `AdditionalWebFilter` 可以通过 order 将扩展的过滤器放到这条链上的任何位置。
3. 将表单登录改为实现扩展点的实现
4. 增加 ExtensionPointDefinition 和 ExtensionDefinition 自定义模型用于对扩展点和扩展进行描述
5. 提供 AuthProvider 自定义模型用于记录支持的登录方式提供商
6. 提供 UserConnection 自定义模型用于将第三方登录账号信息与当前系统账户进行绑定

how to test it?
1. 测试表单登录功能是否正常
2. 测试插件的 plugin-oauth-github 的 PR https://github.com/halo-sigs/plugin-oauth-github/pull/3 功能是否正常

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

Fixes #3423

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

```release-note
支持扩展其他的认证方式
```
2023-03-21 03:54:28 +00:00
Ryan Wang e6d2607516
fix: search issue of post tag selection component (#3540)
#### What type of PR is this?

/kind bug
/area console

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

修复 FormKit 的文章标签搜索组件无法使用搜索功能的问题。

<img width="720" alt="image" src="https://user-images.githubusercontent.com/21301288/226311996-8f31bc6c-784e-4bf0-93da-cdc6db935822.png">

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

Fixed https://github.com/halo-dev/halo/issues/3536

#### Special notes for your reviewer:

测试方式:

1. 在文章设置中,测试标签选择输入框的搜索功能是否正常即可。

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

```release-note
修复文章设置中的标签选择组件无法正常搜索的问题。
```
2023-03-20 11:46:26 +00:00
Ryan Wang 2c3f9ef7dc
chore: remove unused vars and imports to fix eslint warning (#3526)
#### What type of PR is this?

/kind improvement
/area console

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

移除 Console 未使用的变量和导入,解决 ESLint 的警告。

<img width="854" alt="image" src="https://user-images.githubusercontent.com/21301288/225866000-f9448643-064a-4d2b-b023-387f81f0ca8e.png">
<img width="877" alt="image" src="https://user-images.githubusercontent.com/21301288/225866074-ead93a6c-f37f-4711-941c-4bdbbfe0fbe7.png">

```release-note
None
```
2023-03-18 04:34:31 +00:00
Ryan Wang 69f7b18aad
chore: bump formkit version to 0.16.2 (#3527)
#### What type of PR is this?

/kind improvement
/area console

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

升级 FormKit 的版本到 0.16.2。

- https://formkit.com/changelog#0160-beta-16

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

```release-note
升级 Console 端的 FormKit 的版本到 0.16.2。
```
2023-03-18 02:38:33 +00:00
yang b7702efbed
fix: the rawType of Content was not updated when switching editors (#3516)
#### What type of PR is this?

/kind bug


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

修复在新建文章时,首次切换编辑器后没有设置内容 rawType 资源为对应编辑器类型的问题。

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

Fixes #3512 

#### Special notes for your reviewer:

测试方式:

1. 安装任意一个编辑器插件,比如:https://github.com/halo-sigs/plugin-stackedit
1. 新建文章,选择安装的编辑器。
1. 发布文章。
1. 卸载或者停止编辑器。
1. 重新编辑刚刚创建的文章,如果提示 `未找到符合 markdown 格式的编辑器,请检查是否已安装编辑器插件` 则代表正常。

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

```release-note
修复在新建文章时,首次切换编辑器后没有设置内容 rawType 资源为对应编辑器类型的问题。
```
2023-03-15 03:12:26 +00:00
Ryan Wang 684961023b
perf: add supports for force updating of post and single page settings (#3498)
#### What type of PR is this?

/kind improvement

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

支持强制保存文章和单页面的设置,绕开后端 version 锁的机制,因为目前发现在后端 Reconcile 处理文章较慢时会影响文章的保存。

需要注意的是,这是一个不太合理的处理方式,但目前别无选择。

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

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

#### Special notes for your reviewer:

测试方式:

1. 同时打开多个同文章的编辑页面的窗口。
2. 编辑任意一个窗口的文章设置。
3. 然后再去其他窗口保存,观察是否有异常。

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

```release-note
支持强制保存文章和页面的设置,避免因为 Version 锁的机制导致保存失败。
```
2023-03-12 10:42:15 +00:00
longjuan 0384ed7df5
Make login page use custom favicon (#3484)
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->

#### What type of PR is this?
/kind improvement
/area console
/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:
console 端登陆页使用自定义favicon
#### 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/3285

#### Special notes for your reviewer:
在`/actuator/globalinfo`暴露favicon信息,异步获取favicon信息,未获取到数据时浏览器短暂使用默认的`/console/favicon.ico`。
#### 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 端登陆页使用自定义favicon
```
2023-03-09 08:18:12 +00:00
John Niang d192b8c956
Support logging in with encrypted password (#3480)
#### What type of PR is this?

/kind feature
/kind api-change
/area core
/area console
#### What this PR does / why we need it:

This PR creates AuthenticationWebFilter by ourselves instead of using FormLoginSpec directly. Because we have no chance to customize `org.springframework.security.web.server.authentication.ServerAuthenticationConverter` currently.

Meanwhile, we provide CryptoService(RSA) to generate key pair, get public key and decrypt message encrypted by public key.

There is a new endpoint to get public key which is used by console:

```bash
❯ curl localhost:8090/login/public-key -s | jq .
{
  "base64Format": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAouDtdDS751U8NcWfAAQ53ijEtkLnIHh1Thqkq5QHGslq2hBmWnNsIZFnc/bwVp00ImKLV2NtLgOuv5RRNS5iO+oqRvfOGdXLdW2nzqU2towtaMkYTEMJrsNMZp5BUNCGI7Z2xpPBZzvys0d1BvcpNFobX/LkOtcTyfB1DRp9ZAhxRYOZkTkCzaKo+6X11lnMexTsB3exzaXk9rRZ8XoJ+dWT5G0URs/PF2cDkgxuMdOFJzqDsb9HQYGI/etajdCcKs7mZsjmDgse9Cw9/3mgoTNnEGx9Wl89S0P+FJ7T5DALGt3/nSAlzmKdXJNBLf6Q44ogFpTWdq27JpJD3SKicQIDAQAB"
}
```

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

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

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

```release-note
支持登录时密码加密传输
```
2023-03-08 09:52:12 +00:00
Ryan Wang 4ba3cfb64d
feat: add support for refreshing search engine indexes (#3475)
#### What type of PR is this?

/kind feature

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

在 Console 端仪表盘的快捷访问中添加刷新搜索引擎索引的入口。

![2023-03-07 13 48 52](https://user-images.githubusercontent.com/21301288/223332020-6d4e143e-e024-46ce-a84c-96ea3813cec0.gif)

#### Special notes for your reviewer:

1. 测试仪表盘快捷访问中的刷新搜索引擎操作是否可以正常调用接口即可。
2. 分配一个不包含文章管理权限的角色给某个用户,检查是否可以看到这个刷新的入口。

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

```release-note
Console 端仪表盘的快捷访问中添加刷新搜索引擎索引的入口。
```
2023-03-08 09:32:11 +00:00
Ryan Wang 80a3fa803f
chore: bump uppy version to fix crash on chrome browser (#3481)
#### What type of PR is this?

/kind bug

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

修复在非安全情况下(非 HTTPS 环境或本地环境),在 [Chromium](https://www.chromium.org/) 内核的浏览器下拖拽文件上传出现浏览器崩溃的问题。

修复来源:

- https://github.com/transloadit/uppy/releases/tag/uppy%403.6.0
- https://github.com/transloadit/uppy/pull/4310

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

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

#### Screenshots:

before:

![2023-03-08 10 59 02](https://user-images.githubusercontent.com/21301288/223609341-222f62d2-630a-4ee8-ba8f-2fb3c78fcca7.gif)

after:

![2023-03-08 11 00 06](https://user-images.githubusercontent.com/21301288/223609353-857f6559-cc9c-482f-9b46-713430621bb6.gif)

#### Special notes for your reviewer:

测试方式:

1. 需要先执行 `make -C console install` 以更新 Console 的依赖。
2. 使用非 localhost 或者 127.0.0.1 访问 Halo 后台,本地环境可以使用 192.168.x.x 访问。
3. 在 Console 的附件管理测试拖拽文件上传,观察浏览器是否崩溃。

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

```release-note
修复非 HTTPS 环境下,在 Chromium 内核浏览器拖拽上传文件时出现浏览器崩溃的问题。
```
2023-03-08 09:30:13 +00:00
wzrove 6ace36289b
fix: the issue of blank content when opening a saved post in StackEdit editor plugin for editing (#3468)
#### What type of PR is this?
/kind bug

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

在编辑器初始化前赋值,可以保证缓存的历史数据附在StackEdit的url上。

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

Fixes (https://github.com/halo-dev/halo/issues/3105)

#### Screenshots:
![test](https://user-images.githubusercontent.com/88016243/222957520-b7980ff9-aeeb-4e98-9dde-50eb307f02eb.gif)

#### Special notes for your reviewer:

+ 新建文章,切换为 StackEdit 编辑器
+ 输入一些内容保存/发布文章
+ 回到文章列表,重新点进刚才的文章
+ 重复步骤3,输入的内容还在

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


```release-note
修复 Console 端在使用三方编辑器插件编辑文章时可能出现无法加载内容的问题。
```
2023-03-08 02:50:11 +00:00
Ryan Wang bc186a4225
chore: solving the issue of generating API client causing unnecessary diffs (#3465)
#### What type of PR is this?

/kind improvement

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

为 springdoc 添加 `writer-with-order-by-keys` 参数以固定 OpenAPI 中接口的参数顺序,防止重新生成 `api-client` 时因为参数顺序不同而造成不必要的 diff。

#### Special notes for your reviewer:

测试方式:

1. 反复执行 `make -C console api-client-gen`
2. 观察是否有产生 diff

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

```release-note
None
```
2023-03-07 14:14:14 +00:00
John Niang c43a81058a
Refactor workflow for new console project (#3445)
Signed-off-by: johnniang <johnniang@fastmail.com>
2023-03-02 18:07:23 +08:00
johnniang 64919f9a1b Move root to console
Signed-off-by: johnniang <johnniang@fastmail.com>
2023-03-02 15:49:22 +08:00