Commit Graph

1458 Commits (83ad16cd3f9713dc7683cdfceb8d64a9bf774572)

Author SHA1 Message Date
Ryan Wang 83ad16cd3f
feat: add support for automatic label color calculation for post tags (#721)
#### What type of PR is this?

/kind feature
/milestone 2.0.0-rc.2

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

添加自动计算文章标签文字颜色的支持。在之前的版本中,因为引入 colorjs.io 导致在构建之后无法显示标签,目前 colorjs.io 已经修复此问题,此 PR 回归之前的支持。

- https://github.com/LeaVerou/color.js/releases/tag/v0.4.2
- https://github.com/LeaVerou/color.js/pull/239

#### Special notes for your reviewer:

测试方式:

1. 创建若干文章标签,设置不同的背景色,观察文字颜色是否会自动与背景颜色形成反差。
2. 使用 `pnpm build` 构建生产版本,在 Halo 的配置文件中配置 `halo.console.location` 到 Console 的 `dist` 目录。
3. 检查 Console 文章列表中的标签是否显示正常。

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


```release-note
Console 端添加自动计算文章标签文字颜色的支持。
```
2022-11-28 06:36:16 +00:00
BugKing df180c0d81
perf: unify the copywriting style of confirms (#723)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

修改了各个删除操作提示弹框的信息,统一了文本风格。
原本存在 `是否确认删除xxx?` 和 `确定删除xxx吗?` 两种风格,统一为后一种风格。

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

```release-note
优化 Console 端确认弹框的提示文案。
```
2022-11-28 06:20:17 +00:00
Ryan Wang 69d4116b72
chore: bump @halo-dev/api-client for reload theme api (#711)
#### What type of PR is this?

/kind api-change
/milestone 2.0

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

升级 `@halo-dev/api-client` 以适配 https://github.com/halo-dev/halo/pull/2745

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

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

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/issues/2735 分支。
2. Console 需要 `pnpm install`
3. 安装一个主题,并尝试修改 `theme.yaml` 和 `settings.yaml`,然后再主题详情页面点击 `刷新设置表单` 的按钮,检查改动是否被更新。

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

```release-note
None
```
2022-11-28 02:50:17 +00:00
Ryan Wang ba81da7f7a
chore: bump @halo-dev/richtext-editor version (#719)
#### What type of PR is this?

/kind improvement
/milestone 2.0.0-rc.2

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

升级 `@halo-dev/richtext-editor` 版本以支持图片放大缩小、嵌入网页、表格。

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

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

#### Screenshots:

<img width="1377" alt="image" src="https://user-images.githubusercontent.com/21301288/204129594-6b4c2b4e-4eb4-4cf5-b1ca-39097843fadf.png">
<img width="1375" alt="image" src="https://user-images.githubusercontent.com/21301288/204129660-e7c415eb-db70-405b-97cc-2ed05bcaa034.png">


#### Special notes for your reviewer:

测试方式:

1. 需要 `pnpm install`
2. 测试编辑器的图片放大缩小、嵌入网页、表格等功能。

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

```release-note
Console 端编辑器支持图片放大缩小、嵌入网页、表格。
```
2022-11-28 01:34:16 +00:00
Ryan Wang a5b9a54fe3
chore: add @Aanko to reviewer list (#714)
#### What type of PR is this?

/kind improvement

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

将 @Aanko 添加到 Reviewer 列表。

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

```release-note
None
```
2022-11-26 02:56:10 +00:00
Ryan Wang 31b5aedd9d
chore: release 2.0.0-rc.1 (#710)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

修改版本号以发布 Console 2.0.0-rc.1

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

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

```release-note
None
```
2022-11-24 15:17:06 +00:00
Ryan Wang 7f4ee54ffb
perf: back to post list when post is first created (#709)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

首次创建文章或者自定义页面时,跳转回管理列表,与编辑保持一致。

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:创建一篇新的文章或自定义页面,点击发布,观察是否返回到了管理列表。

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

```release-note
None
```
2022-11-24 14:59:06 +00:00
Ryan Wang db187f14eb
fix: splash screen issue caused by refreshing the list at regular intervals (#708)
#### What type of PR is this?

/kind bug
/milestone 2.0

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

修复因为 https://github.com/halo-dev/console/pull/703 中添加了 Loading 动画但是没有考虑到定时刷新列表导致页面闪动的问题。

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:删除任意资源,检查列表定时刷新的时候是否出现 loading 状态。

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

```release-note
None
```
2022-11-24 14:51:07 +00:00
Ryan Wang becafc2cbd
chore: bump dependencies (#707)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

升级所有依赖的 patch 版本。

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

```release-note
None
```
2022-11-24 13:29:06 +00:00
Ryan Wang fb4499a6aa
feat: add query attachments by ungrouped parameter support (#706)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

附件管理支持通过参数筛选出未分组的附件。适配 https://github.com/halo-dev/halo/pull/2752

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

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

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2752 分支。
2. Console 需要 `pnpm install`
3. 上传若干未分组附件,然后切换到未分组的标签,检查是否查询正确。
4. 将部分附件移动至某个分组,在切换到未分组的标签,检查附件是否正确。

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


```release-note
附件管理支持未分组的筛选条件。
```
2022-11-24 13:17:05 +00:00
Ryan Wang d0efecc9b3
perf: filter dropdown selector (#704)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

优化文章管理的分类/标签/作者的筛选下拉框样式,以及支持搜索。

#### Screenshots:

<img width="525" alt="image" src="https://user-images.githubusercontent.com/21301288/203499340-b7c59b2f-9be8-4804-9e21-9c5bfbca99bc.png">


#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:检查文章管理的分类 / 标签 / 作者筛选功能是否正常。

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

```release-note
优化文章管理的分类/标签/作者的筛选下拉框样式,以及支持搜索。
```
2022-11-24 05:51:01 +00:00
Ryan Wang e509ff3306
refactor: add loading states for data list (#703)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

优化列表的加载,添加加载动画,解决加载完成之后界面闪动的问题。

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

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

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

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

```release-note
优化列表的加载,添加加载动画,解决加载完成之后界面闪动的问题。
```
2022-11-24 03:46:10 +00:00
Ryan Wang d8805f30a0
refactor: managing logged-in user states with pinia (#699)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

使用 Pinia 管理已授权用户信息,并提供判断是否是 `anonymousUser` 的方式。

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

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试流程:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2729 的分支。
2. 测试 Console 端的登录、退出等流程。

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

```release-note
None
```
2022-11-23 08:39:29 +00:00
Ryan Wang b79eccb6a2
perf: improve the list filter style and support clear all (#702)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

优化 Console 数据列表的筛选标签样式,以及支持清空所有筛选条件。

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

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

#### Screenshots:

<img width="1663" alt="image" src="https://user-images.githubusercontent.com/21301288/203353043-b5e7631f-cc02-4368-b770-42b53e1dbf78.png">

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. 测试文章、自定义页面、附件、插件、评论管理中的筛选功能。

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

```release-note
优化 Console 数据列表的筛选标签样式,以及支持清空所有筛选条件。
```
2022-11-23 04:59:28 +00:00
Ryan Wang 2350f541d7
perf: set maximum width for entity-field to prevent text overflow (#700)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

为 `VEntityField` 组件设置最大宽度,防止内容过多导致 UI 异常。

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

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

#### Screenshots:

<img width="534" alt="image" src="https://user-images.githubusercontent.com/21301288/203077107-55cbb951-5ea4-4699-8368-023c60ae9054.png">

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. Console 需要 `pnpm build:packages`
2. 新增任意资源,设置超长的内容,检查列表的样式是否异常。

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

```release-note
为 `VEntityField` 组件设置最大宽度,防止内容过多导致 UI 异常。
```
2022-11-23 04:57:31 +00:00
Ryan Wang 906fdf7c98
perf: adding the necessary validation to the forms (#701)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

完善 Console 中表单的验证规则。

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

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

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

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

```release-note
完善 Console 中表单的验证规则。
```
2022-11-23 03:00:19 +00:00
Ryan Wang 062e45477c
feat: post editor page supports the parameter of returnToView (#698)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

文章和独立页面的编辑页面支持 `returnTo` 参数,用于指定发布完成之后的跳转地址。

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

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

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. 选择任意文章进入编辑页面。
2. 在地址栏添加 `&returnTo=http://localhost:8090`
3. 发布文章,观察是否跳转到了 `http://localhost:8090`

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

```release-note
文章和独立页面的编辑页面支持 `returnTo` 参数。
```
2022-11-21 07:14:28 +00:00
Ryan Wang 9175cd63e5
chore: release 2.0.0-beta.2 (#697)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

发布 Console 2.0.0-beta.2

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

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

```release-note
None
```
2022-11-18 13:36:23 +00:00
Ryan Wang 8deb8ee3bb
refactor: save and publishing logic for post and single page (#696)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

优化文章和自定义页面的保存内容和发布逻辑。详情可查阅:https://github.com/halo-dev/halo/pull/2709

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试流程:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2709 分支。
2. 测试文章和自定义页面的新建、更新内容,以及发布。

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

```release-note
优化文章和自定义页面的保存内容和发布逻辑。
```
2022-11-18 13:16:23 +00:00
Ryan Wang eef8dc3d43
feat: add delete attachment group and policy support (#695)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

支持删除附件分组和存储策略。

删除策略的逻辑为:删除前会根据策略查询附件,如果有附件,则无法删除,否则可以删除。

删除附件的逻辑为:

1. 选择`删除并将附件移动至未分组`时,会在前端批量调用更新附件的接口,将所有附件的 `groupRef` 置空。
2. 选择`删除并同时删除附件`时,会在前端批量调用删除附件接口。

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

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

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. 需要执行 `pnpm build:packages`
2. 创建若干存储策略,并在部分存储策略中上传附件,再对存储策略做删除处理,需要满足以下情况:
    1. 已包含附件的策略会提示不允许删除。
    2. 未包含附件的策略可以删除
3. 创建若干分组,并在部分分组中上传附件,再对分组做删除处理,需要满足以下情况:
    1. 选择`删除并将附件移动至未分组`时,检查分组是否被删除,且里面的附件是否已经被移动到未分组。
    2. 选择`删除并同时删除附件`时,检查分组是否被删除,且里面的附件是否被删除。


#### 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
支持删除附件分组和存储策略。
```
2022-11-18 07:22:22 +00:00
Ryan Wang 616bdc8307
refactor: use generateName instead of uuid to generate metadata.name (#688)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

使用 metadata.generateName 代替 uuid 为 metadata.name 生成值。

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

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. 需要 `pnpm install`
2. 测试登录以及所有需要创建更新资源的业务模块。

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

```release-note
None
```
2022-11-18 06:00:23 +00:00
Ryan Wang 1b8805a340
feat: attachment management support sorting (#694)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

附件管理支持排序筛选,适配:https://github.com/halo-dev/halo/pull/2705

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

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

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2705 分支。
2. Console 需要 `pnpm install`
3. 上传若干附件,检查排序筛选之后的结果是否符合预期。

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

```release-note
附件管理支持排序筛选
```
2022-11-17 02:50:22 +00:00
Ryan Wang d8a8d96708
chore: bump dependencies (#689)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

更新所有依赖的修订版本。

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

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

```release-note
更新所有依赖的修订版本。
```
2022-11-17 02:38:22 +00:00
Ryan Wang 8386e14301
feat: add formkit custom input of repeater (#692)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

为 FormKit 添加 Repeater 输入类型,用于让用户动态操作一个对象数组。

使用方式可以查阅:https://github.com/ruibaby/halo-console/tree/feat/formkit-repeater/docs/custom-formkit-input#repeater

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

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

#### Screenshots:

<img width="635" alt="image" src="https://user-images.githubusercontent.com/21301288/201640327-5eb0489a-2193-445d-9dfe-7405ae75a297.png">

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. 按照 https://github.com/ruibaby/halo-console/tree/feat/formkit-repeater/docs/custom-formkit-input#repeater 文档,在主题或者插件中使用 FormKit Schema 的形式定义设置表单,然后对表单进行保存等设置,检查是否符合预期。
2. 或者使用 https://github.com/halo-sigs/theme-earth/tree/refactor/setting-spec 主题进行测试,这个分支已经对社交媒体和侧边栏进行了适配。可以在主题设置中测试社交媒体和侧边栏配置,检查在主题端的效果。

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

```release-note
为 FormKit 添加 Repeater 输入类型。
```
2022-11-15 07:48:17 +00:00
Ryan Wang e72a175f49
chore: release 2.0.0-beta.1 (#691)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

发布 Console 2.0.0-beta.1

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

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

```release-note
None
```
2022-11-11 16:14:13 +00:00
Ryan Wang 9ac9e1312d
refactor: post publishing (#690)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

重构文章发布/取消发布/放入回收站的逻辑。适配 https://github.com/halo-dev/halo/pull/2675

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2675 的分支。
2. Console 需要 `pnpm install`。
3. 测试文章发布/取消发布/放入回收站。

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

```release-note
None
```
2022-11-11 16:10:12 +00:00
Ryan Wang fe89862552
refactor: remove formkit auto-animate addon (#687)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

移除 FormKit 的 Auto Animate 扩展,因为如果使用了这个扩展,在动态加载表单元素的时候可能会导致 UI 大范围的抖动。而且此扩展比较不可控,无法对其表现进行修改。

#### Screenshots:

before:

![2022-11-10 12 00 58](https://user-images.githubusercontent.com/21301288/200997699-af36cd8c-e56d-4d3b-a4ea-f4d34bfb6903.gif)

![2022-11-10 12 02 23](https://user-images.githubusercontent.com/21301288/200997830-0b2539c8-214f-4399-a33e-c2ebd02f1e93.gif)


#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

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

```release-note
移除表单中的动画效果
```
2022-11-11 14:02:11 +00:00
Ryan Wang fb446d382f
refactor: post and singlePage publishing (#685)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

重构文章和自定义页面的发布流程。

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

1. 修改文章、自定义页面标识发布状态的字段名。
2. 修改初始化页面中创建文章和自定义页面的逻辑,取消使用发布接口,改为直接将 `spec.publish` 设置为 `true`
3. 列表支持检测发布状态。

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2659 分支。
2. Console 需要 `pnpm install && pnpm build:packages`
3. 测试文章和自定义页面的发布、保存等流程。需要完整测试整个流程。

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

```release-note
None
```
2022-11-10 16:24:10 +00:00
Ryan Wang f3e44717ee
refactor: post editor (#670)
#### What type of PR is this?

/kind improvement

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

升级 `@halo-dev/richtext-editor`。重构编辑器的结构,目前可以在外部添加菜单项和指令,意味着可以被扩展。

添加 tiptap 拓展的方式:

```
pnpm install @tiptap/extension-character-count
```

然后在创建 Editor 实例的时候需要将拓展添加到 extensions 数组,如:

```ts
const editor = useEditor({
  content: props.modelValue,
  extensions: [
    ...
    ExtensionCharacterCount,
  ],
});
```

最终如果要通过我们的插件机制来拓展编辑器,那么就需要对 extensions 提供可拓展点。

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

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

```release-note
None
```
2022-11-10 06:50:09 +00:00
Ryan Wang e93a6fbb4f
feat: add setup primary menu support (#684)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

支持设置主菜单。 适配 https://github.com/halo-dev/halo/pull/2667

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

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

#### Screenshots:

<img width="503" alt="image" src="https://user-images.githubusercontent.com/21301288/200283150-1292821e-ad4b-4909-865b-fcdba94ae4c2.png">

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. Halo 需要使用 https://github.com/halo-dev/halo/pull/2667 分支。
2. 在 Console 的菜单管理新建若干个菜单。
3. 选择一个菜单点击更多按钮,再点击设置为主菜单按钮,检查是否生效。

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

```release-note
菜单管理支持设置主菜单。 
```
2022-11-10 02:34:09 +00:00
Ryan Wang e0ca6186ab
refactor: refactoring the logic for get the setup state of the system (#686)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

重构获取系统初始化状态的方式,之前会在每个路由切换前获取,在一定程度上会导致路由切换时卡顿。此 PR 改为仅在首次加载页面的时候调用接口获取,并保留状态由 pinia 管理。

#### Special notes for your reviewer:

测试方式:

1. 需要使用未初始化的 Halo。
2. 测试在未初始化前是否会自动切换到初始化页面。
3. 测试初始化之后是否还会跳转到初始化页面。

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

```release-note
None
```
2022-11-09 07:10:12 +00:00
Ryan Wang fdf964b18d
perf: improve theme preview modal (#683)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

重构主题预览弹框,支持选择主题以及针对主题进行设置。

todolist:

- [x] 支持保存之后自动刷新预览区域。
- [x] 优化 Tabs 组件,支持横向滚动以解决设置项过多时,选项卡的样式问题。

#### Screenshots:

https://user-images.githubusercontent.com/21301288/200233823-fe317efe-536a-47a9-9495-efdde39be7ca.mp4


#### Special notes for your reviewer:

测试方式:

1. 需要先执行 `pnpm build:packages`
2. 进入主题管理,点击右上角的预览即可打开主题预览窗口

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

```release-note
重构主题预览弹框,支持选择主题以及针对主题进行设置。
```
2022-11-07 07:12:15 +00:00
Ryan Wang bb9124231e
chore: release 2.0.0-alpha.4 (#682)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

发布 Halo 2.0 第四个 alpha 版本的 Console 部分。

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

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

```release-note
None
```
2022-11-04 13:58:09 +00:00
Ryan Wang 2d5f5d1c97
perf: optimize the style of fieldset in the form (#680)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

优化表单中关于 fieldset 的样式。

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

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

#### Screenshots:

before:

<img width="553" alt="image" src="https://user-images.githubusercontent.com/21301288/199667319-f94b962f-f4ba-4eb5-bd56-3224218e0920.png">

after:

<img width="562" alt="image" src="https://user-images.githubusercontent.com/21301288/199667265-d29c5933-2d16-402f-9496-065e9cb73046.png">


#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

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

```release-note
优化表单中关于 fieldset 的样式。
```
2022-11-04 13:44:11 +00:00
Ryan Wang d3d28dd3da
perf: optimize the creation of attachment storage policies (#681)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

优化首次上传附件时,创建存储策略的流程,现在可以直接打开新建策略的表单。

#### Screenshots:

before:

<img width="898" alt="image" src="https://user-images.githubusercontent.com/21301288/199915792-92547e21-ffbb-4c9f-9614-b1f89f7d6f75.png">

after:
<img width="1087" alt="image" src="https://user-images.githubusercontent.com/21301288/199915494-00447427-060a-4744-83b0-d1067e745517.png">


#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. 测试在上传弹窗中新建存储策略。

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


```release-note
优化首次上传附件时,创建存储策略的流程。
```
2022-11-04 08:30:10 +00:00
Ryan Wang b0359c4e17
fix: some vue warn in browser dev console (#679)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

修复一些因使用不当导致的 Vue warn。

#### Screenshots:

<img width="832" alt="image" src="https://user-images.githubusercontent.com/21301288/199663758-e29f48c4-0c33-4c78-913f-2364ce4b5fbe.png">

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

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

```release-note
None
```
2022-11-03 07:26:18 +00:00
Ryan Wang c0f82572e3
refactor: update the field of the plugin logo (#678)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

修改插件 Logo 的使用字段为 `status.logo`。用于适配 https://github.com/halo-dev/halo/pull/2652

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

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

#### Screenshots:

<img width="1663" alt="image" src="https://user-images.githubusercontent.com/21301288/199447142-0c90b200-3976-498e-88e1-dd3c5377ab73.png">

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2652 分支。
2. 检查插件列表的 Logo 是否显示正常。

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

```release-note
None
```
2022-11-03 02:50:17 +00:00
Ryan Wang e3fc14abad
feat: support for managing recycle bin posts and single pages (#677)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

支持管理已删除的文章和自定义页面,优化删除的逻辑。

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

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2648
2. 测试文章和自定义页面的删除功能,以及回收站的管理功能。

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

```release-note
支持管理已删除的文章和自定义页面,优化删除的逻辑。
```
2022-11-02 09:48:23 +00:00
Ryan Wang ff26058fc0
feat: add setup post/singlePage/category custom templates support (#671)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

支持为文章/自定义页面/分类设置自定义模板。适配 https://github.com/halo-dev/halo/pull/2638

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

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

#### Screenshots:

<img width="625" alt="image" src="https://user-images.githubusercontent.com/21301288/198823380-991a702d-aae7-4587-b0f8-81fcb018a1f6.png">

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2638 PR 的分支。
2. 根据 https://github.com/halo-dev/halo/pull/2638 PR 中的描述修改主题配置 `theme.yaml`,添加所需测试的模板配置。
3. 检查 Console 对应的设置项(分类编辑、文章设置、自定义页面)中的自定义模板选择框是否包含配置的模板。
4. 选择配置的模板后保存。检查主题端对应页面是否一致。

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

```release-note
支持为文章/自定义页面/分类设置自定义模板。
```
2022-11-02 06:40:16 +00:00
Ryan Wang 3d638fde37
fix: show publish time instead of creation time for post list (#676) 2022-11-01 18:00:42 +08:00
Ryan Wang 673947b2d0
feat: add preset language support for codemirror components (#675)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

为 Codemirror 组件添加更多预设语言支持,以及支持从外部传入语言包。

目前预设支持:

1. yaml
2. html
3. javascript
4. css
5. json

使用方式:

1. 使用预设

```vue
<script lang="ts" setup>
import { VCodemirror } from "@halo-dev/components"
</script>

<template>
    <VCodemirror language="html" />
</template>
```

2. 外部引入

```bash
pnpm install @codemirror/lang-java
```

```vue
<script lang="ts" setup>
import { VCodemirror } from "@halo-dev/components"
import { java } from "@codemirror/lang-java"
</script>

<template>
    <VCodemirror :language="java()" />
</template>
```

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

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

```release-note
None
```
2022-11-01 06:18:16 +00:00
Ryan Wang 28c95c199f
feat: add formkit custom input of attachment (#674)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

添加选择附件类型的 FormKit 输入框。

在 Vue 单组件中使用:

```vue
<script lang="ts" setup>
const logo = ref("")
</script>

<template>
  <FormKit
    v-model="logo"
    label="Logo"
    type="attachment"
    validation="required"
  />
</template>
```

在 FormKit Schema 中使用(插件 / 主题设置表单定义):

```yaml
- $formkit: attachment
  name: logo
  label: Logo
```


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

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

#### Screenshots:

<img width="671" alt="image" src="https://user-images.githubusercontent.com/21301288/198980581-ba90ec32-f205-4d03-8546-3c93238298e7.png">


#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

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

```release-note
添加选择附件类型的 FormKit 输入框。
```
2022-11-01 03:06:18 +00:00
Ryan Wang 2de0b1f505
feat: add formkit custom input of codemirror (#672)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

添加 Codemirror 类型的 FormKit 输入框。

在 Vue 单组件中使用:

```vue
<script lang="ts" setup>
const code = ref("")
</script>

<template>
  <FormKit
    v-model="code"
    label="页脚代码"
    type="code"
    validation="required"
  />
</template>
```

在 FormKit Schema 中使用(插件 / 主题设置表单定义):

```yaml
- $formkit: code
  name: code
  label: 页脚代码
```

#### Screenshots:

<img width="1331" alt="image" src="https://user-images.githubusercontent.com/21301288/198954003-02ce1972-8f7f-4959-a349-5650d166f3ae.png">

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

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


```release-note
添加 Codemirror 类型的 FormKit 输入框。
```
2022-11-01 02:56:16 +00:00
Ryan Wang d12317b68e
perf: improve the layout and style of forms (#673)
Change form style from horizontal to vertical.
2022-10-31 16:01:28 +08:00
Ryan Wang aff2447201
chore: release 2.0.0-alpha.3 (#669)
#### What type of PR is this?

/milestone 2.0

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

发布 2.0.0-alpha.3

从此版本开始,`@halo-dev/console-shared` 包的版本与 Console 始终保持一致。

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

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

```release-note
None
```
2022-10-26 07:48:10 +00:00
Ryan Wang c393894ca5
fix: logo cannot be displayed after the build (#668)
#### What type of PR is this?

/kind bug
/milestone 2.0

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

修复在 `vite build` 之后无法加载 Logo 的问题。

#### Special notes for your reviewer:

测试方式:

1. `pnpm build`
2. `pnpm preview`
3. 检查登录页面的 Logo 是否正常加载。

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

```release-note
None
```
2022-10-26 07:36:10 +00:00
Ryan Wang fa54dcb29a
chore: bump dependencies (#667)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

依赖升级。

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

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

```release-note
None
```
2022-10-26 07:32:13 +00:00
Ryan Wang 9138284137
refactor: upload component changed from filepond to uppy (#666)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

使用 [uppy](https://github.com/transloadit/uppy) 代替原来的 [filepond](https://github.com/pqina/filepond)。

#### Screenshots:

<img width="1665" alt="image" src="https://user-images.githubusercontent.com/21301288/197812049-44dba688-673a-4636-9ec0-0acba6d9d68b.png">


#### Special notes for your reviewer:

测试方式:

1. Console 需要 `pnpm install`
2. 测试附件上传、主题/插件的安装和更新。

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

```release-note
使用 [uppy](https://github.com/transloadit/uppy) 代替原来的 [filepond](https://github.com/pqina/filepond)。
```
2022-10-26 04:40:10 +00:00
Ryan Wang ac660c2aa2
feat: add upgrade plugin support (#663)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

支持插件升级,适配 https://github.com/halo-dev/halo/pull/2624

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

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

#### Screenshots:
<img width="1663" alt="image" src="https://user-images.githubusercontent.com/21301288/197682557-7e37895e-a6b5-43d6-8d40-2a1c899b9ce1.png">
<img width="1662" alt="image" src="https://user-images.githubusercontent.com/21301288/197682572-4db39f09-efda-4928-9a6d-8593c7c0c790.png">


#### Special notes for your reviewer:

测试方式:

1. Halo 需要使用 https://github.com/halo-dev/halo/pull/2624 PR 的分支。
2. Console 需要 `pnpm install`
3. 修改已安装的插件,构建之后更新插件,检查是否更新成功。


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

```release-note
支持插件升级
```
2022-10-26 03:26:09 +00:00
Ryan Wang 5f5916fd7f
refactor: load the logo as an inline svg (#664)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

以 inline svg 的形式加载 Logo,解决因为加载 svg 文件导致的页面抖动问题。

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:检查登录页面、初始化页面、侧边菜单顶部的 Logo 是否加载正常。

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

```release-note
以 inline svg 的形式加载 Logo,解决因为加载 svg 文件导致的页面抖动问题。
```
2022-10-26 03:10:14 +00:00