Commit Graph

1597 Commits (960e727f877a002e6e75b7fc09ae25dce370d5c7)

Author SHA1 Message Date
Ryan Wang ab888119ef
refactor: use new apis to refactor themes management (#820)
#### What type of PR is this?

/kind improvement

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

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

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

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

#### Screenshots:

#### Special notes for your reviewer:

重点测试:

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

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

```release-note
重构 Console 端主题的设置表单逻辑。
```
2023-01-30 06:36:10 +00:00
BugKing a2935de6ef
fix: add word break for long toast body (#829)
#### What type of PR is this?

/kind bug

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

解决提示信息过长时不能完全展示的问题。

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

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

#### Screenshots:

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

#### Special notes for your reviewer:

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

```release-note
fix: add word break for long toast body
```
2023-01-19 08:58:14 +00:00
Airbo ZH 397e050010
fix: use comment.metadata.name instead of index as the key of comments list (#830)
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->

#### What type of PR is this?
/kind bug
<!--
添加其中一个类别:
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind optimization
适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

#### What this PR does / why we need it:
修复后台删除评论后会导致下方头像错误的bug
#### Which issue(s) this PR fixes:

Fixes https://github.com/halo-dev/halo/issues/3170
<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.
用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->


#### Screenshots:
![becd4362a1064b5cba0a26298df8d8e](https://user-images.githubusercontent.com/50261327/213245296-c304bd40-2a1c-4e10-a7b0-7160fd0ac259.png)
![96585c0a721ffed8be07781b0dd612c](https://user-images.githubusercontent.com/50261327/213245315-e7f7ac1b-a4f0-4d33-9ba3-0c0b6b3c7259.png)

<!--
如果此 PR 有 UI 的改动,最好截图说明这个 PR 的改动。
If there are UI changes to this PR, it is best to take a screenshot to illustrate the changes to this PR.
eg.
Before:
![screenshot-before](https://user-images.githubusercontent.com/screenshot.png)
After:
![screenshot-after](https://user-images.githubusercontent.com/screenshot.png)
-->

#### Special notes for your reviewer:

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

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

```release-note
修复后台删除评论后会导致下方头像错误的bug
```
2023-01-19 04:06:14 +00:00
Ryan Wang 0fa6909a8f
feat: update theme requires field and supports show failed message (#826)
#### What type of PR is this?

/kind feature

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

修改主题的 `spec.require` 字段为 `spec.requires`,以及支持显示错误信息。适配:https://github.com/halo-dev/halo/pull/3150

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

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

#### Screenshots:

<img width="1692" alt="image" src="https://user-images.githubusercontent.com/21301288/212800478-0fe53ae8-4e31-4810-89aa-4b06d1b700fb.png">
<img width="1056" alt="image" src="https://user-images.githubusercontent.com/21301288/212800550-7edd7c0a-564c-4df4-baee-b3ffe6b3352d.png">

#### Special notes for your reviewer:

测试方式:

1. Halo 切换到 https://github.com/halo-dev/halo/pull/3150 分支。
2. Console 需要 `pnpm install`。
3. 修改主题的 `spec.requires`,根据 https://github.com/halo-dev/halo/pull/3150 中的测试条件修改这个值。
4. 检查是否可以显示异常版本信息。

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

```release-note
Console 端支持显示主题的版本异常信息
```
2023-01-19 02:58:14 +00:00
Ryan Wang dd4ab873c1
perf: change attachment list layout to list mode (#827)
#### What type of PR is this?

/kind improvement

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

目前暂时没有缩略图功能,上传大量的大型图片很容易造成浏览器崩溃,故我们临时将附件管理的默认视图模式改为列表模式。

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

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

#### Screenshots:

<img width="1692" alt="image" src="https://user-images.githubusercontent.com/21301288/212832865-f1f22ce2-860f-497a-b091-b4552458bd77.png">


#### Special notes for your reviewer:

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


```release-note
Console 附件管理的默认视图模式改为列表模式。
```
2023-01-18 09:40:15 +00:00
Ryan Wang 04819c12a8
perf: improve plugin loading (#823)
#### What type of PR is this?

/kind improvement

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

优化 Console 端加载插件资源的逻辑。

1. 查询接口改为自定义接口,传入 enabled 参数进行筛选。
2. 修改符合 Console 插件的筛选判断。
3. 隐藏加载异常的提示。

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

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

#### Special notes for your reviewer:

测试方式:

1. 安装若干带有 Console 端拓展的插件,比如:https://github.com/halo-sigs/plugin-stackedit
2. 检查是否有加载成功。
3. 创建一个没有插件访问权限的角色。
4. 登录之后检查是否有无权限提示。

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


```release-note
优化 Console 端加载插件资源的逻辑。
```
2023-01-16 08:40:14 +00:00
Ryan Wang 9d5529b827
feat: add full-functional post category select component for formkit (#818)
#### What type of PR is this?

/kind feature

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

添加功能更为全面的文章分类选择器,支持以下特性:

1. 按层级展示分类
2. 支持搜索
3. 选中结果支持显示层级

todo list:

- [x] 样式整理
- [x] 支持创建新分类

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

Fixes https://github.com/halo-dev/halo/issues/2670
Fixes https://github.com/halo-dev/halo/issues/2485

#### Screenshots:

<img width="832" alt="image" src="https://user-images.githubusercontent.com/21301288/211768419-087d9727-1468-41a1-868a-62d90eef9cca.png">
<img width="858" alt="image" src="https://user-images.githubusercontent.com/21301288/211768478-dcc70d79-127b-42b0-ae44-e48a6a22273a.png">


#### Special notes for your reviewer:

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

```release-note
重构 Console 端的文章分类选择器。
```
2023-01-16 08:02:13 +00:00
Ryan Wang b132a950a8
feat: make sidebar logo link to home page (#822)
#### What type of PR is this?

/kind feature

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

将侧边栏的 Logo 链接到首页。

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

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

#### Screenshots:

<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/212281869-19729c60-8e5c-4a50-b087-55b360b1aedb.png">

#### Special notes for your reviewer:

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

```release-note
支持点击 Console 侧边栏 Logo 跳转到首页
```
2023-01-16 03:26:13 +00:00
vayci c55f662d05
feat: update comment list sorter (#821)
#### What type of PR is this?

/kind feature

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

修改评论列表默认排序规则,以实现最新评论或最新回复的评论总显示在最前

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

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

#### Screenshots:

![image](https://user-images.githubusercontent.com/17878156/212250458-edaeb149-8c3f-411d-b72b-5a70677cd300.png)

#### Special notes for your reviewer:

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

```release-note
修改评论列表默认排序规则,排序方式新增“最后回复时间”排序方式
```
2023-01-16 03:10:13 +00:00
Ryan Wang fffbd4aa51
feat: add full-functional post tag select component for formkit (#817)
#### What type of PR is this?

/kind feature

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

添加功能更为全面的文章标签选择器,解决在标签过多场景下的适用性问题,支持以下特性:

1. 支持搜索标签。
2. 支持没有搜索结果的时候创建新标签。
3. 支持单选和多选。

> 当前并未考虑实现一个通用的标签创建组件,仅为文章考虑。

todo list:

- [x] 样式整理
- [x] 重命名组件名

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

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

#### Screenshots:

<img width="796" alt="image" src="https://user-images.githubusercontent.com/21301288/211768172-b8dbf1c2-5f7c-4411-b8cc-f0070320649d.png">
<img width="725" alt="image" src="https://user-images.githubusercontent.com/21301288/211768235-8d587374-abad-40c9-b9e0-ea2b27e58495.png">


#### Special notes for your reviewer:

1. 创建若干文章,并进行标签设置的操作。
2. 测试标签选择,搜索,创建,删除,取消选择等操作。

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


```release-note
重构 Console 端的文章标签选择器。
```
2023-01-16 02:58:13 +00:00
Ryan Wang 6e6b35b252
chore: bump vite version to 4 (#819)
#### What type of PR is this?

/kind improvement

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

升级 Vite 到 Vite 4,请看:

- https://github.com/vitejs/vite/blob/main/packages/vite/CHANGELOG.md#400-2022-12-09
- https://cn.vitejs.dev/guide/migration.html

无破坏更新。

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

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

#### Special notes for your reviewer:

测试方式:

1. 测试开发环境和生产环境是否加载正常即可。
2. 测试包含 Console 的插件是否正常加载。

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

```release-note
升级 Console 项目的 Vite 版本到 Vite 4
```
2023-01-13 05:30:11 +00:00
Ryan Wang 2ef02f2e80
refactor: refactor the page management and remove the function page (#816)
#### What type of PR is this?

/kind api-change
/kind improvement

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

1. 重构页面管理,移除功能页面的功能,改为由插件自行配置菜单。
2. 改进自定义页面的 UI 权限绑定,不会再出现没有勾选相关角色,但仍然显示左侧**页面**菜单的问题。

原由请看:https://github.com/halo-dev/halo/issues/3124

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

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

#### Screenshots:

<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480169-fd0490a6-bd1a-447c-bde4-155a16355734.png">

插件需要自己定义菜单配置,如:

<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/211480228-146e6b53-9da4-4a60-b691-dd183f0a45c7.png">

```diff
export default definePlugin({
-  name: "PluginLinks",
   components: {},
   routes: [
     {
       parentName: "Root",
       route: {
-        path: "/pages/functional/links",
+        path: "/links",
         name: "Links",
         component: LinkList,
         meta: {
           permissions: ["plugin:links:view"],
+          menu: {
+            name: "链接",
+            group: "content",
+            icon: markRaw(RiLinksLine),
+          },
         },
       },
     },
   ],
-  extensionPoints: {
-    "page:functional:create": () => {
-      return [
-        {
-          name: "链接",
-          url: "/links",
-          path: "/pages/functional/links",
-          permissions: ["plugin:links:view"],
-        },
-      ];
-    },
-  },
 });
```

#### Special notes for your reviewer:

测试方式:

1. 测试左侧菜单的页面入口是否正常。
2. 创建一个新的角色,不勾选页面的查看权限,登录后检查是否可以在左侧菜单看到页面选项。
3. 测试插件添加菜单是否正常,可测试插件:[plugin-links-1.0.0-SNAPSHOT-plain.jar.zip](https://github.com/halo-dev/console/files/10379709/plugin-links-1.0.0-SNAPSHOT-plain.jar.zip)


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

```release-note
重构页面管理,移除功能页面的功能。
```
2023-01-10 10:44:40 +00:00
longjuan 8068a57afa
fix: timeout error caused by upload processing for more than 30 seconds (#813)
<!--  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?

<!--
添加其中一个类别:
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind optimization
适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->
/kind improvement
#### What this PR does / why we need it:
Remove the timeout error prompt caused by the upload server processing for more than 30 seconds
#### 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/3041
#### Screenshots:

<!--
如果此 PR 有 UI 的改动,最好截图说明这个 PR 的改动。
If there are UI changes to this PR, it is best to take a screenshot to illustrate the changes to this PR.
eg.
Before:
![screenshot-before](https://user-images.githubusercontent.com/screenshot.png)
After:
![screenshot-after](https://user-images.githubusercontent.com/screenshot.png)
-->
![image](https://user-images.githubusercontent.com/28662535/210917239-b4b050f8-766f-4289-9ba2-ccb99bb6ac55.png)
![image](https://user-images.githubusercontent.com/28662535/210917273-c6291485-f420-4f02-a7c8-2b4b286110d4.png)


#### Special notes for your reviewer:
测试:
上传大文件让后端处理过程超过30秒,观察是否报错
或使用[修改后的插件](https://github.com/longjuan/halo-plugin-s3os/actions/runs/3852075387)上传到对象存储,观察61秒后是否上传成功
#### 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
去除上传文件处理时间超过30秒后的报错
```
2023-01-06 03:10:37 +00:00
vayci 564327d3c7
fix: remove login form icon, fix icon lose warning (#812)
#### What type of PR is this?

/kind optimization

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

remove login form icon, fix icon lose dev tool console warning

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

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

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

```release-note
NONE
```
2022-12-30 09:22:33 +00:00
Ryan Wang ee660d77e2
chore: release 2.1.0 (#811)
#### What type of PR is this?

/kind improvement

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

发布 Console 2.1.0

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

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

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

```release-note
None
```
2022-12-30 02:32:33 +00:00
Ryan Wang ad5348d63d
feat: add target attribute setting for menu item (#805)
#### What type of PR is this?

/kind feature

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

支持为菜单项设置链接打开方式。 适配:https://github.com/halo-dev/halo/pull/3072

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

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

#### Screenshots:

<img width="714" alt="image" src="https://user-images.githubusercontent.com/21301288/209922511-120bc82c-4d13-4dd8-9829-0ba173cdc377.png">


#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/3072 的分支。
2. Console 需要 `pnpm install`
3. 创建若干菜单项,并设置打开方式。
4. 检查是否设置正确。

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

```release-note
菜单项支持设置打开方式
```
2022-12-29 13:50:33 +00:00
Ryan Wang 565efcb3ac
refactor: editor provider switching (#803)
#### 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/3060

#### Screenshots:

<img width="1662" alt="image" src="https://user-images.githubusercontent.com/21301288/209756212-b14725da-3d89-4416-8860-e75cdb270b75.png">

#### Special notes for your reviewer:

测试方式:

1. 此改动针对文章和自定义页面的编辑。
2. 测试新建页面选择编辑器是否正常。
3. 测试重新进入新建页面,编辑器是否自动选择为了上一次的编辑器。
4. 测试发布文章或者自定义页面之后,重新编辑时,是否选择了正确的编辑器。

编辑器插件可使用:

1. https://github.com/halo-sigs/plugin-bytemd
2. https://github.com/halo-sigs/plugin-stackedit

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

```release-note
重构 Console 端选择编辑器的方式,支持记住上一次的选择。
```
2022-12-29 13:46:34 +00:00
Ryan Wang 89ee700f9d
fix: preferred-editor annotation is not set when editing old posts (#806)
#### What type of PR is this?

/kind bug

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

修复编辑旧文章时,没有为文章设置 `content.halo.run/preferred-editor` 的元数据的问题。

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

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

#### Special notes for your reviewer:

测试方式:

1. 在有旧数据的情况下切换到此 PR。
2. 编辑一篇旧的文章后保存。
3. 打开文章设置,检查元数据中是否包含了 `content.halo.run/preferred-editor`

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


```release-note
None
```
2022-12-29 13:42:34 +00:00
Ryan Wang 4cb3a72f51
fix: login in safari browser has no effect (#804)
#### What type of PR is this?

/kind bug

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

修复在 Safari 浏览器登录之后无反应的问题。

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

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

#### Special notes for your reviewer:

测试方式:

1. 在 Safari 浏览器上测试登录之后是否有跳转到仪表盘即可。

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

```release-note
修复 Console 端在 Safari 浏览器登录之后无反应的问题
```
2022-12-29 13:28:33 +00:00
Ryan Wang a7341df0b5
fix: saving an post causes the publish time to be lost (#807)
#### 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/3080

#### Special notes for your reviewer:

测试方式:

1. 创建若干文章。
2. 返回到文章管理列表。
3. 打开任意文章的设置。
4. 检查发布时间是否回显,然后保存。
5. 保存之后检查发布时间是否还存在。

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

```release-note
修复 Console 端保存文章设置导致发布时间丢失的问题。
```
2022-12-29 13:10:33 +00:00
Ryan Wang 4661c5ed66
fix: logged-in users cannot access the profile page (#796)
#### 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/3027

#### Special notes for your reviewer:

/hold

等待 https://github.com/halo-dev/halo/issues/3035 解决。

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


```release-note
修复 Console 端已登录用户无法访问个人资料页面的问题。
```
2022-12-29 13:04:32 +00:00
Ryan Wang f8fe630d4c
chore: release 2.1.0-rc.1 (#802)
#### What type of PR is this?

/kind improvement

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

发布 Console 2.1.0-rc.1

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

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

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


```release-note
None
```
2022-12-26 15:50:31 +00:00
Ryan Wang 8d3c289559
feat: add annotations form for more extension (#801)
#### What type of PR is this?

/kind feature

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

为更多模型添加 Annotation Form 的支持。此 PR 包括:

1. 自定义页面。
2. 文章分类。
3. 文章标签。
4. 菜单项。
5. 用户。

此 PR 是对 https://github.com/halo-dev/console/pull/770 的补充。

#### Special notes for your reviewer:

测试方式:

1. 将一下内容放到任意一个主题下,后缀为 `yaml`,文件名随意。
    ```yaml
    spec:
      targetRef:
        group: content.halo.run
        kind: Post
      formSchema:
        - $formkit: "text"
          name: "download"
          label: "下载地址"
        - $formkit: "text"
          name: "version"
          label: "版本"
    apiVersion: v1alpha1
    kind: AnnotationSetting
    metadata:
      generateName: annotation-
    ---
    spec:
      targetRef:
        group: content.halo.run
        kind: SinglePage
      formSchema:
        - $formkit: "text"
          name: "download"
          label: "下载地址"
        - $formkit: "text"
          name: "version"
          label: "版本"
    apiVersion: v1alpha1
    kind: AnnotationSetting
    metadata:
      generateName: annotation-
    
    ---
    spec:
      targetRef:
        group: content.halo.run
        kind: Category
      formSchema:
        - $formkit: "text"
          name: "download"
          label: "下载地址"
        - $formkit: "text"
          name: "version"
          label: "版本"
    apiVersion: v1alpha1
    kind: AnnotationSetting
    metadata:
      generateName: annotation-
    ---
    spec:
      targetRef:
        group: content.halo.run
        kind: Tag
      formSchema:
        - $formkit: "text"
          name: "download"
          label: "下载地址"
        - $formkit: "text"
          name: "version"
          label: "版本"
    apiVersion: v1alpha1
    kind: AnnotationSetting
    metadata:
      generateName: annotation-
    ---
    spec:
      targetRef:
        group: ""
        kind: MenuItem
      formSchema:
        - $formkit: "text"
          name: "icon"
          label: "图标"
        - $formkit: "text"
          name: "version"
          label: "版本"
    apiVersion: v1alpha1
    kind: AnnotationSetting
    metadata:
      generateName: annotation-

    ```
3. 后端需要使用 https://github.com/halo-dev/halo/pull/3028
4. 测试上述提到的模型的 Annotations 表单。
5. 检查是否可以设置正常。

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

```release-note
None
```
2022-12-26 15:32:31 +00:00
Ryan Wang d60931bae5
feat: add AnnotationsForm Component to edit extension annotations (#770)
#### What type of PR is this?

/kind feature

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

提供一个 Annotations 编辑组件,支持由主题或者插件提供表单定义,也支持使用者自定义 key-value,用于扩展资源字段。

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

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

#### Screenshots:

<img width="789" alt="image" src="https://user-images.githubusercontent.com/21301288/209517622-80111fd2-8e79-480f-8ca0-9f7073300b2b.png">


#### Special notes for your reviewer:

测试方式:

1. 将一下内容放到任意一个主题下,后缀为 `yaml`,文件名随意。
    ```yaml
    spec:
      targetRef:
        group: content.halo.run
        kind: Post
      formSchema:
        - $formkit: "text"
          name: "download"
          label: "下载地址"
        - $formkit: "text"
          name: "version"
          label: "版本"
    apiVersion: v1alpha1
    kind: AnnotationSetting
    metadata:
      generateName: annotation-
    ```
3. 后端需要使用 https://github.com/halo-dev/halo/pull/3028
4. 测试为文章设置 Annotations 和自定义的 Annotations。
5. 检查是否可以设置正常。


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

```release-note
文章设置支持设置元数据。
```
2022-12-26 14:08:32 +00:00
Ryan Wang eccb6e639a
perf: asynchronously load the default editor (#800)
#### What type of PR is this?

/kind improvement

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

默认编辑器改为异步的形式加载。

优化前后对比:

优化前编译:

<img width="480" alt="image" src="https://user-images.githubusercontent.com/21301288/209529091-07216f42-8668-46fc-80e6-03db5504e576.png">

优化后编译:

<img width="510" alt="image" src="https://user-images.githubusercontent.com/21301288/209529001-31537104-cada-4e3c-b521-8849b53281ce.png">

优化前首次加载:

<img width="1069" alt="image" src="https://user-images.githubusercontent.com/21301288/209529285-a62cfe92-5aa0-47f6-ad7e-9f0210ca97b6.png">

优化后首次加载:

<img width="1067" alt="image" src="https://user-images.githubusercontent.com/21301288/209529349-24aa99b9-5b52-4d44-8144-60028332e9cd.png">

最终会在打开文章编辑页面的时候加载编辑器资源:

![2022-12-26 17 06 45](https://user-images.githubusercontent.com/21301288/209529486-d579b51c-cb14-4a30-a3be-649bfe284300.gif)

> 这个 Gif 的演示做了节流处理来模拟服务器带宽的情况。在带宽不良的情况下会显示加载动画以提示使用者正在加载编辑器。

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

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

#### Special notes for your reviewer:

测试方式:

1. 插件默认编辑器是否正常加载以及功能是否正常即可。

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

```release-note
Console 端的默认编辑器改为异步加载,优化整体的加载性能。
```
2022-12-26 13:34:32 +00:00
Ryan Wang a48c33d9ba
refactor: remove the ability to edit user using yaml (#799)
#### What type of PR is this?

/kind improvement

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

移除使用 yaml 编辑用户信息的功能。

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

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

#### Special notes for your reviewer:

None

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

```release-note
移除 Console 端使用 yaml 编辑用户信息的功能
```
2022-12-26 10:36:32 +00:00
Ryan Wang 023831cdd4
refactor: attachment upload component (#784)
#### What type of PR is this?

/kind improvement

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

优化上传附件的组件和附件库选择组件。

1. 附件上传支持缓存选择的分组和策略。
2. 附件上传支持选择分组。
3. 移除附件选择组件的上传 tab,改为和附件库管理中一样的上传组件。

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

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

#### Screenshots:

<img width="722" alt="image" src="https://user-images.githubusercontent.com/21301288/208612167-c7082be4-0fb8-4caa-b246-d15bac525e86.png">

#### Special notes for your reviewer:

测试方式:

1. 测试在附件管理中上传附件的功能是否正常。
2. 测试在附件选择组件中上传附件的功能是否正常。

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

```release-note
优化 Console 端上传附件的功能,支持缓存选择的分组和策略。
```
2022-12-26 06:32:32 +00:00
Ryan Wang b29a72d7a5
perf: asynchronously load the emoji data of the comment reply component (#798)
#### What type of PR is this?

/kind improvement

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

优化评论回复组件的 emoji 数据加载,改为异步的方式。

构建结果对比:

优化前:

<img width="475" alt="image" src="https://user-images.githubusercontent.com/21301288/209430764-25e42624-25d7-4466-a184-4fc82d310e12.png">

优化后:

<img width="473" alt="image" src="https://user-images.githubusercontent.com/21301288/209430752-1bc064e5-f3bd-42f4-b93c-8f2e200a00e3.png">

首次请求对比:

优化前:

<img width="1067" alt="image" src="https://user-images.githubusercontent.com/21301288/209430904-79c9c403-a627-44ea-a97b-13e653230b23.png">

优化后:

<img width="1066" alt="image" src="https://user-images.githubusercontent.com/21301288/209430936-e446659c-a20a-437c-bd9f-4408279410af.png">

最终会在打开 emoji 组件的时候才加载 emoji 数据:

<img width="1460" alt="image" src="https://user-images.githubusercontent.com/21301288/209430963-f2cb66c6-c0e3-4cc5-8906-66db94d40ca8.png">


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

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

#### Special notes for your reviewer:

测试方式:

1. 检查回复组件的 Emoji 选择功能是否正常即可。

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

```release-note
Console 端的评论回复 Emoji 组件数据改为异步加载,优化整体的加载性能。
```
2022-12-26 06:20:32 +00:00
Ryan Wang 5d45e9577e
refactor: layouts of role editing form (#795)
#### What type of PR is this?

/kind improvement
/milestone 2.1.x

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

重构角色编辑的表单,取消多选项卡的设计。

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

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

#### Screenshots:

![2022-12-23 12 09 52](https://user-images.githubusercontent.com/21301288/209269275-6cb4f729-1549-423f-bd45-74e3241e68a7.gif)

#### Special notes for your reviewer:

测试方式:

1. 测试新建和编辑角色。
2. 检查功能是否符合预期。

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

```release-note
重构 Console 端角色编辑的表单,取消多选项卡的设计。
```
2022-12-26 06:10:31 +00:00
Ryan Wang da06195d08
perf: automatic refresh of the list of users and roles (#797)
#### What type of PR is this?

/kind improvement
/milestone 2.1.x

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

优化用户和角色列表,如果包含正在删除的内容会自动刷新。

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

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


#### Special notes for your reviewer:

测试方式:

1. 创建若干角色和用户。
2. 测试删除之后是否会自动刷新列表。

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


```release-note
优化 Console 端的用户和角色列表,如果包含正在删除的内容会自动刷新。
```
2022-12-25 05:04:31 +00:00
Ryan Wang f7ece9135a
refactor: add validation for post and singlePage settings form (#791)
#### What type of PR is this?

/kind improvement

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

重构文章和自定义页面的设置表单,支持提交时验证表单。

> 因为之前的多选项卡设计导致无法同时验证所有表单,所以这个 PR 重构了表单的布局。

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

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

#### Screenshots:

![2022-12-21 17 23 22](https://user-images.githubusercontent.com/21301288/208870059-5039a565-def2-4622-9a78-de30dceb4d65.gif)

#### Special notes for your reviewer:

测试方式:

1. 测试在内容编辑页面和列表打开文章和自定义页面的设置表单。
2. 检查表单验证是否有效。

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


```release-note
重构 Console 端文章和自定义页面的设置表单布局,支持提交时验证表单。
```
2022-12-24 04:14:30 +00:00
Ryan Wang 9c29538c7a
perf: improve the layout of the post list (#789)
#### 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/2963

#### Screenshots:

<img width="717" alt="image" src="https://user-images.githubusercontent.com/21301288/208836747-c6f97d7f-487a-4984-aa54-ee0d3c5b535a.png">

#### Special notes for your reviewer:

测试方式:

1. 添加若干个文字数量较多的分类。
2. 观察文章列表的样式是否有问题。

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

```release-note
优化 Console 端文章管理列表的布局,修复当分类设置过多时的样式问题。
```
2022-12-22 08:42:30 +00:00
chengfeiyue c6a0f2d0ac
Differentiate the title of adding and editing menu and menu item (#794)
#### 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/3022

#### Special notes for your reviewer:

测试方式:新增菜单和菜单项。然后再编辑菜单和菜单项,查看title是否一样

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

```release-note
None
```
2022-12-22 08:04:29 +00:00
Ryan Wang 4029dd8282
feat: add support for setting console's favicon (#788)
#### What type of PR is this?

/kind feature

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

Console 支持使用系统设置中的 Favicon。

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

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

#### Screenshots:

![2022-12-20 19 40 48](https://user-images.githubusercontent.com/21301288/208658754-d62f9d46-7f15-412f-80e2-17fd9729ca8f.gif)


#### Special notes for your reviewer:

测试方式:

1. 进入系统设置。
2. 设置任意一个图片为 Favicon。
3. 观察 Console 的站标是否被修改。

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

```release-note
Console 端支持设置 Favicon
```
2022-12-22 07:58:31 +00:00
Ryan Wang 4666d4fa07
fix: activated theme not loaded after initialization (#790)
#### What type of PR is this?

/kind bug

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

修复首次初始化之后,Console 没有加载已激活主题的问题。

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

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

#### Special notes for your reviewer:

测试方式:

1. 使用全新的环境
2. 参考 https://docs.halo.run/developer-guide/core/build 构建可执行 JAR。
3. 运行 Halo,初始化之后检查 Console 主题页面是否已经加载了已经激活的主题。

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

```release-note
修复首次初始化之后,Console 没有加载已激活主题的问题。
```
2022-12-22 04:16:30 +00:00
Ryan Wang a396aad87f
feat: add editor extension point (#781)
#### What type of PR is this?

/kind feature

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

添加编辑器的扩展点,用于扩展集成其他编辑器。

定义一个扩展点的方式:

```ts
export default definePlugin({
  extensionPoints: {
    "editor:create": () => {
      return [
        {
          name: "stackedit",
          displayName: "StackEdit",
          component: markRaw(StackEdit),
          rawType: "markdown",
        },
      ];
    },
  },
});
```

其中 `component` 字段即编辑器组件对象,需要包含 `raw`、`content` 的 prop。

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

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

#### Screenshots:

<img width="1664" alt="image" src="https://user-images.githubusercontent.com/21301288/208406097-60258cba-cff6-436f-bd50-6d8c27ea9a53.png">
<img width="1662" alt="image" src="https://user-images.githubusercontent.com/21301288/208406174-d4649365-3448-4581-a452-f9781502eac6.png">
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/208407570-db10e956-cd6a-4e0d-801e-b794ad0261bc.png">
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/208407607-fd595957-5278-40c2-a3b5-fb73c1de429c.png">

#### Special notes for your reviewer:

目前可用于测试的插件:

1. [plugin-stackedit-1.0.0-SNAPSHOT.jar.zip](https://github.com/halo-dev/console/files/10258488/plugin-stackedit-1.0.0-SNAPSHOT.jar.zip)
2. [plugin-bytemd-1.0.0-SNAPSHOT.jar.zip](https://github.com/halo-dev/console/files/10258490/plugin-bytemd-1.0.0-SNAPSHOT.jar.zip)

测试方式:

1. Console 需要 `pnpm build:packages`。
2. 在 Console 的插件管理上传以上插件。
3. 新建若干文章,使用不同的编辑器。
4. 检查是否能够正常发布和编辑。
5. 检查编辑的时候,是否正确使用了之前的编辑器。
6. 检查主题端是否渲染正常。

一些实现细节:

1. 为了支持更新文章时能够选择发布时的编辑器,会在 post 的 `metadata.annotations` 添加一条 `content.halo.run/preferred-editor` 用于标记使用的什么编辑器。如果编辑器不存在,会使用 content 的 `rawType` 来匹配。
2. 目前没有全局默认编辑器设置,只能在新建文章的时候选择。

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

```release-note
Console 端支持扩展集成其他编辑器
```
2022-12-22 04:14:29 +00:00
Ryan Wang d575b6698b
perf: remove permalink of deleted single page (#792)
#### What type of PR is this?

/kind improvement

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

移除自定义页面回收站中自定义页面的固定链接跳转入口。

#### Screenshots:

<img width="515" alt="image" src="https://user-images.githubusercontent.com/21301288/209045397-14a63c58-5f9f-49a4-8d4b-ed0e78496cda.png">


#### Special notes for your reviewer:

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


```release-note
None
```
2022-12-22 04:12:30 +00:00
Ryan Wang ed07cd2958
fix: system settings form could not be loaded (#787)
#### 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/3001

#### Special notes for your reviewer:

测试方式:

1. 测试系统设置页面的选项卡切换和保存功能。

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

```release-note
修复 Console 端系统设置页面切换选项卡无法正常加载表单的问题。
```
2022-12-20 11:44:29 +00:00
Ryan Wang ca4749432e
perf: add more operation feedback prompt (#785)
#### 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/2979

#### Special notes for your reviewer:

测试方式:

1. 测试 Console 端所有页面的操作。
2. 观察是否有反馈。

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

```release-note
完善 Console 端的部分操作反馈提示
```
2022-12-20 11:04:29 +00:00
Ryan Wang 2c3147a5a2
fix: the flickering issue of tooltip (#782)
#### What type of PR is this?

/kind improvement

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

修复 `v-tooltip` 指令的元素闪烁问题。

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

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

#### Screenshots:

![2022-12-19 21 52 11](https://user-images.githubusercontent.com/21301288/208441007-2bffe6f6-0b48-4a90-86a0-31ce622f04bf.gif)

#### Special notes for your reviewer:

测试方式:

1. 创建一篇文章,仅保存不发布。
2. 回到文章管理列表,可以看到标题旁边有一个状态点,鼠标移入会显示提示。
3. 观察是否出现闪烁的问题。

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

```release-note
优化 Console 端状态提示的样式
```
2022-12-20 02:25:42 +00:00
Ryan Wang 0a7cbd3018
feat: add support for resetting configmap of plugin and theme (#777)
#### What type of PR is this?

/kind feature

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

支持重置主题和插件的设置选项。适配 https://github.com/halo-dev/halo/pull/2964

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

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

#### Screenshots:

<img width="366" alt="image" src="https://user-images.githubusercontent.com/21301288/208022668-288fb8c5-ddd1-456c-9633-ec8865f3b1ba.png">

#### Special notes for your reviewer:

测试方式:

1. 安装若干带有设置选项主题和插件。
2. 进入主题和插件设置,改变部分设置并保存。
3. 重置主题和插件的设置,然后进入设置表单,检查是否已经恢复为了默认。

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

```release-note
支持重置主题和插件的设置选项。
```
2022-12-19 08:25:47 +00:00
Ryan Wang 57f4f2226f
perf: merge plugin uninstallation options button (#779)
#### 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/2978

#### Screenshots:

before:

![image](https://user-images.githubusercontent.com/21301288/208060524-fa9de196-ccd2-43dc-82e7-21eefddec44b.png)


after:

<img width="466" alt="image" src="https://user-images.githubusercontent.com/21301288/208060456-77514178-1935-43f4-9d50-13bc606d5573.png">


#### Special notes for your reviewer:

测试方式:

1. 测试插件卸载的两种选项是否功能正常。

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

```release-note
优化 Console 端的插件卸载选项布局
```
2022-12-19 03:26:10 +00:00
Ryan Wang 03d2b5ae43
perf: optimize the operation button style of the entity component (#780)
#### What type of PR is this?

/kind improvement

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

优化 Entity 组件(数据列表)的操作按钮样式。

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

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

#### Screenshots:

before:

![image](https://user-images.githubusercontent.com/21301288/208065926-9e0fb332-4075-43cf-b75f-4d040c80ccfa.png)


after:

<img width="1658" alt="image" src="https://user-images.githubusercontent.com/21301288/208066185-a48d5f84-e451-4fc7-9eea-b152ddb8db86.png">



#### Special notes for your reviewer:

None

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


```release-note
优化 Console 端数据列表的操作按钮样式
```
2022-12-19 03:10:12 +00:00
Ryan Wang c95af5bad1
chore: bump @halo-dev/richtext-editor to fix iframe display and add HTML syntax highlighting (#773)
#### What type of PR is this?

/kind improvement

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

升级 `@halo-dev/richtext-editor` 版本,解决以下问题:

1. 修复嵌入网页不会回显的问题。 c8cfe8f7b1
2. 添加 HTML 语法的代码块高亮。 8d27ae81ee

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

Fixes https://github.com/halo-dev/halo/issues/2924
Fixes https://github.com/halo-dev/halo/issues/2913

#### Special notes for your reviewer:

测试方式:

1. 需要 `pnpm install`
2. 插件编辑器的代码块是否有 HTML 语言选项。
3. 插入一个嵌入网页的编辑块,保存文章之后再次进入编辑页面,检查加载是否正常。

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

```release-note
None
```
2022-12-16 03:08:12 +00:00
Ryan Wang 19fdf2564e
docs: update github workflow badge (#775)
#### What type of PR is this?

/kind improvement

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

<img width="585" alt="image" src="https://user-images.githubusercontent.com/21301288/208009902-aa2b9139-b0e4-48a1-92f4-964242ae14cf.png">

see https://github.com/badges/shields/issues/8671

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


```release-note
None
```
2022-12-16 02:54:11 +00:00
Ryan Wang 6ac0816380
feat: add enable and upgrade support for theme list (#774)
#### What type of PR is this?

/kind improvement

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

1. 在主题管理列表添加启用和升级的支持。
2. 优化主题页面右上角的按钮布局
3. 优化主题管理的代码结构。

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

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

#### Screenshots:

<img width="1515" alt="image" src="https://user-images.githubusercontent.com/21301288/207893631-6db10293-d0ee-4af4-9c43-f137055df28e.png">
<img width="1665" alt="image" src="https://user-images.githubusercontent.com/21301288/207894016-dd1a5d27-9fff-4211-8869-381208932eaf.png">


#### Special notes for your reviewer:

测试方式:

1. 进入主题管理,点击右上角的主题管理。
4. 测试单个主题的启用和升级是否符合预期。

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

```release-note
Console 端的主题管理列表添加启用和升级的支持。
```
2022-12-16 02:46:11 +00:00
wzrove 75f2cb0540
feat: stop Implicit submission (#766)
<!--  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
/area console
<!--
添加其中一个类别:
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind optimization
适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

#### What this PR does / why we need it:
阻止表单的[隐式提交](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#implicit-submission)

>For the purpose of the previous paragraph, an element is a field that blocks implicit submission of a element if it is an element whose [form owner](https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#form-owner) is that element and whose attribute is in one of the following states: [Text](https://html.spec.whatwg.org/multipage/input.html#text-(type=text)-state-and-search-state-(type=search)), [Search](https://html.spec.whatwg.org/multipage/input.html#text-(type=text)-state-and-search-state-(type=search)), [URL](https://html.spec.whatwg.org/multipage/input.html#url-state-(type=url)), [Telephone](https://html.spec.whatwg.org/multipage/input.html#telephone-state-(type=tel)), [Email](https://html.spec.whatwg.org/multipage/input.html#email-state-(type=email)), [Password](https://html.spec.whatwg.org/multipage/input.html#password-state-(type=password)), [Date](https://html.spec.whatwg.org/multipage/input.html#date-state-(type=date)), [Month](https://html.spec.whatwg.org/multipage/input.html#month-state-(type=month)), [Week](https://html.spec.whatwg.org/multipage/input.html#week-state-(type=week)), [Time](https://html.spec.whatwg.org/multipage/input.html#time-state-(type=time)), [Local Date and Time](https://html.spec.whatwg.org/multipage/input.html#local-date-and-time-state-(type=datetime-local)), [Number](https://html.spec.whatwg.org/multipage/input.html#number-state-(type=number))

当form的子元素只有一个且tyep为 ` "text","search","url","email","password","date","month","week","time","datetime-local","number"`其中任一。 阻止键入`enter` 触发`submit` ,做法是在from表单上监听键盘事件,然后阻止。

#### 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/2893

#### Screenshots:

<!--
如果此 PR 有 UI 的改动,最好截图说明这个 PR 的改动。
If there are UI changes to this PR, it is best to take a screenshot to illustrate the changes to this PR.
eg.
Before:
![screenshot-before](https://user-images.githubusercontent.com/screenshot.png)
After:
![screenshot-after](https://user-images.githubusercontent.com/screenshot.png)
-->

#### Special notes for your reviewer:

+ 进入[测试页面](https://formkit.com/playground?fkv=1.0.0-beta.12&fileTab=Playground.vue&files=JTVCJTdCJTIybmFtZSUyMiUzQSUyMlBsYXlncm91bmQ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TIwJTdEJTVDbiUyMCUyMCUyMCUyMCU3RCklM0IlNUNuJTIwJTIwJTdEJTVDbiU3RCUzQiU1Q24lNUNuJTVDbmV4cG9ydCUyMGRlZmF1bHQlMjAlN0IlNUNuJTIwJTIwcGx1Z2lucyUzQSUyMCU1QmlucHV0UHJldmVudEZuJTIwJTVEJTVDbiU3RCU1Q24lMjIlMkMlMjJyZW1vdmFibGUlMjIlM0F0cnVlJTJDJTIyYWRkZWQlMjIlM0F0cnVlJTdEJTVE&imports=JTdCJTIybmFtZSUyMiUzQSUyMkltcG9ydE1hcCUyMiUyQyUyMmVkaXRvciUyMiUzQSUyMiU3QiU1Q24lMjAlMjAlNUMlMjJ2dWUlNUMlMjIlM0ElMjAlNUMlMjJodHRwcyUzQSUyRiUyRmNkbi5qc2RlbGl2ci5uZXQlMkZucG0lMkZ2dWUlNDAzJTJGZGlzdCUyRnZ1ZS5lc20tYnJvd3Nlci5taW4uanMlNUMlMjIlNUNuJTdEJTVDbiUyMiU3RA)
+ 点击表单元素,表单元素聚焦之后,之后键入`enter`观察是否触发`submit`
+ 打开`formkit.config.js`tab, 放开注释,阻止事件行为。重复第二点。观察`submit`事件。
#### 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
 禁止使用 Enter 提交,需要使用组合键(Ctrl + Enter)
```
2022-12-16 02:24:10 +00:00
Ryan Wang 101e91a761
perf: improve the prompt for upload failure of the upload component (#769)
#### 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/2933
Ref https://github.com/halo-dev/halo/issues/2932 https://github.com/halo-dev/halo/issues/2931

#### Screenshots:

<img width="794" alt="image" src="https://user-images.githubusercontent.com/21301288/207272593-b94efb0a-7033-4ec1-b1eb-f2e3871b34f0.png">
<img width="674" alt="image" src="https://user-images.githubusercontent.com/21301288/207272682-0c223d29-8c4f-45b0-a8d5-2432a97835c6.png">


#### Special notes for your reviewer:

测试方式:

1. 进入附件上传、插件安装、主题安装界面。
2. 上传不符合规则的文件,比如主题可以上传一个不是主题的 zip 或者 Halo 1.x 版本的 zip。
3. 观察是否有异常提示。

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

```release-note
优化 Console 端上传组件的异常提示信息。
```
2022-12-14 09:14:29 +00:00
Ryan Wang da24914275
chore: add @wzrove to reviewer list (#714) (#771)
#### What type of PR is this?

/kind improvement


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

将 @wzrove 添加到 Reviewer 列表。

贡献列表:

- https://github.com/halo-dev/console/pulls?q=+is%3Apr+author%3Awzrove+
- https://github.com/halo-dev/halo/issues?q=is%3Aissue+author%3Awzrove+

欢迎 @wzrove 加入,期望一起维护和审查保证 Console 的质量。

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

```release-note
None
```
2022-12-14 02:08:48 +00:00
wzrove 4a5d95706e
chore: use lint-staged to improve dx (#768)
#### What type of PR is this?

/kind improvement


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

优化创建 commit 前的 prettier 和 ESLint 流程,使用 [lint-staged](https://www.npmjs.com/package/lint-staged),可以仅处理在 Git 缓存区的文件。

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

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

#### Screenshots:

#### Special notes for your reviewer:

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


```release-note
None
```
2022-12-13 15:38:48 +00:00