Commit Graph

4241 Commits (3bfecd2b38ce182179604790a15de9a5e119a0e3)

Author SHA1 Message Date
John Niang 2cd501955f
Bump Spring Boot to 3.0.0-RC2 (#2692)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0

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

Bump Spring Boot to 3.0.0-RC2. 

See https://github.com/spring-projects/spring-boot/releases/tag/v3.0.0-RC2 for more.

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

```release-note
升级 Spring Boot 至 3.0.0-RC2
```
2022-11-11 10:50:15 +00:00
guqing 7e592a3835
feat: add plugin finder for theme-side (#2683)
#### What type of PR is this?
/kind feature
/milestone 2.0
/area core
#### What this PR does / why we need it:
主题端提供判断插件是否已经启用的方法

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

#### Special notes for your reviewer:
how to test it?
在主题端使用 `${pluginFinder.available(your-plugin-name)}`  来查看某个插件是否已经启用,如果是则得到 true ,否则 false,如果插件没有安装也得到 false

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

```release-note
主题端支持获取插件启用状态
```
2022-11-11 02:26:11 +00:00
Ryan Wang 55b6d77c80 refactor: post and singlePage publishing (halo-dev/console#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
guqing 3adf5b8a95
refactor: change from manual publishing to automatic publishing (#2659)
#### What type of PR is this?
/kind improvement
/milestone 2.0
/area core
/kind api-change

#### What this PR does / why we need it:
- 通过修改 `spec.publish=true` 且 `spec.releasedSnapshot = spec.headSnapshot` 来实现通过 reconciler 异步发布
- Snapshot 中的 subjectRef 类型改为了 Ref 类型,因为之前的 Snapshot.SubjectRef 只包含了 kind 和 name 可能会冲突

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

Fixes #2650

#### Special notes for your reviewer:
how to test it?
1. 通过 `POST /apis/console.halo.run/v1alpha1/posts` 创建文章并将 `spec.publish=true`,创建后查询可以看到 `spec.baseSnapshot`、`spec.headSnapshot`、`spec.releasedSnapshot` 三个值都相等,且 `status.phase=PUBLISHED`(此过程相当于创建即发布没有保存过程)
2. 先通过 `POST /apis/console.halo.run/v1alpha1/posts` 创建一篇草稿(`spec.publish=false`),在获取它并设置 `spec.publish=true` ,更新后期望文章为发布状态 `spec.headSnapshot`, `spec.releasedSnapshot` 都不等于空且等于 `spec.baseSnapshot`),且 `spec.version=1`(此过程相当于先保存后发布且之前从未发布过)
3. 在步骤2的基础上修改`spec.releasedSnapshot=spec.headSnapshot`并更新,期望 `spec.version=2`且`spec.releasedSnapshot` 对应的 Snapshot 数据具有 publishTime(此过程相当于发布后编辑内容在发布的场景)
4. 自定义页面亦如是

/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?
```release-note
重构文章发布以解决创建与发布 API 几乎同时调用时无法成功发布文章的问题
```
2022-11-10 14:44:10 +00:00
Ryan Wang 6bb7af1762 refactor: post editor (halo-dev/console#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
guqing 5c05554bd8
feat: total pages returned from paging results (#2669) 2022-11-10 14:31:33 +08:00
Ryan Wang 7c621c8afa feat: add setup primary menu support (halo-dev/console#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
guqing a2bb3d4a00
feat: add setting item for primary menu selector (#2667) 2022-11-09 16:01:44 +08:00
Ryan Wang aa7d302f05 refactor: refactoring the logic for get the setup state of the system (halo-dev/console#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
guqing 8d6838a956
refactor: add page size configuration for post (#2660) 2022-11-08 10:01:50 +08:00
guqing 36613c0442
refactor: ThemeLinkBuilder needs to rely on external url (#2661) 2022-11-08 09:33:38 +08:00
John Niang 84b28cec16
Build console with release tag when releasing (#2665) 2022-11-07 16:03:15 +08:00
Ryan Wang d88d8678ab perf: improve theme preview modal (halo-dev/console#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
guqing f22a401092
fix: while cycles cause high cpu usage (#2663)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.0
#### What this PR does / why we need it:
修复日志 while 循环导致 cpu 占用高的问题

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

```release-note
None
```
2022-11-07 03:54:11 +00:00
Ryan Wang 9c76162e0d chore: release 2.0.0-alpha.4 (halo-dev/console#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 4c74f04076 perf: optimize the style of fieldset in the form (halo-dev/console#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 31ee229624 perf: optimize the creation of attachment storage policies (halo-dev/console#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 8c1739a5c8 fix: some vue warn in browser dev console (halo-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
guqing 9b4ed96e2a
fix: cannot stop thread when system is interrupted (#2639)
#### What type of PR is this?
/kind bug
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
修复 Halo 异常停止时日志服务线程无法中断的问题

#### Special notes for your reviewer:
how to test it?
使用 mysql 启动 halo 但不启动 mysql,此时 halo 会无法链接 mysql
期望现象:Halo 服务终止,异常现象:Halo 抛异常但 Netty 服务器不会停止

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

```release-note
修复 Halo 异常停止时日志服务线程无法中断的问题
```
2022-11-03 06:32:19 +00:00
Ryan Wang 9ac08e2f54 refactor: update the field of the plugin logo (halo-dev/console#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
guqing 73df5e4576
feat: create reverse proxy for logo when plugin created (#2652)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0
#### What this PR does / why we need it:
插件 logo 支持配置外部 URL 或相对于 resources 的路径

Console 端展示插件 logo 时使用的字段需要使用 status.logo 而非 spec.logo
#### Which issue(s) this PR fixes:
Fixes #2651

#### Special notes for your reviewer:
how to test it?
1. 插件配置 logo 为外部 url 例如 https://guqing.xyz/avatar
2. 安装此插件后不会注册 ReverseProxy 规则
3. logo 配置为相对于 resources 的路径例如:/logo.png
4. 安装此插件后可以访问到 /plugins/{your-plugin-name}/assets/logo.png
5. 开发模式启动插件后,修改了 plugin.yaml 中的 spec.logo 则也会更新 ReverseProxy 的 rule

/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?
```release-note
插件 Logo 支持配置外部 URL 或相对于 resources 的路径
```
2022-11-03 02:48:21 +00:00
Ryan Wang 8dd2df3a27 feat: support for managing recycle bin posts and single pages (halo-dev/console#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 4f315f98f7 feat: add setup post/singlePage/category custom templates support (halo-dev/console#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
guqing 1078145b18
feat: support custom rendering templates configure through themes (#2638)
#### What type of PR is this?
/kind feature
/milestone 2.0
/area core
#### What this PR does / why we need it:
文章/自定义页面/分类支持通过主题配置多套渲染模板
首先需要在 theme.yaml 中声明模板,以文章为例:
```yaml
apiVersion: theme.halo.run/v1alpha1
kind: Theme
metadata:
  name: fake-theme-name
spec:
  # ...
  customTemplates:
    # 支持通过以下形式配置 post, category, page 
    post:
      - name: 新闻
        description: 新闻类型的文章模板
        screenshot: foo.png
        # file 路径相对于主题目录的 templates 目录,.html 后缀可以带也可以省略
        # 默认 thymeleaf 查找 html 文件,除非修改了 thymeleaf suffix 配置
        file: post_news.html
```
当文章页选择模板时便可得到下拉列表以配置使用哪个模板 see https://github.com/halo-dev/halo/issues/2322#issuecomment-1215135195
选择了模板之后将模板名存储到 post 的 spec.template 中,渲染时便会首先使用 spec.template,如果该模板不存在则渲染默认模板
#### Which issue(s) this PR fixes:

Fixes #2569

#### Special notes for your reviewer:
how to test it?
1. 创建一篇文章并发布
2. 安装一个主题并查看文章详情,默认渲染主题提供的 post.html 页面
3. 修改此文章的 spec.template 字段为一个新的 html 例如 spec.template=post_docs
4. 查看该文章的详情页会渲染为 post_docs.html
5. 分类、自定义页面亦如是

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

```release-note
文章/自定义页面/分类支持通过主题配置多套渲染模板
```
2022-11-02 06:22:17 +00:00
guqing c0986a4b4c
refactor: permalink automatically appends external url if it is configured (#2641)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0
#### What this PR does / why we need it:
如果配置了 halo.externalUrl 则 permalink 生成时会自动加上 external url

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

Fixes #

#### Special notes for your reviewer:
how to test it?
1. 配置 `halo.externalUrl` 并启动
2. 创建几篇文章、标签、分类、自定义页面
3. console 端能看到访问路径自动带上了 external url 并且通过访问路径能正确访问到相应资源

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

```release-note
文章/分类/标签的访问路径自动追加外部访问地址
```
2022-11-01 15:22:16 +00:00
guqing 1be6a07d96
refactor: avoid NPE caused by children field data problem (#2645)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
菜单和分类数列表加强健壮性,防止因为 children 字段存在垃圾数据时导致 NPE 问题
#### Which issue(s) this PR fixes:
a part of #2643

#### Special notes for your reviewer:
how to test it?
1. 创建一个层级结构菜单,比如
```
A
|-B
|-C
```
2. 删除菜单 C 然后访问主题端首页不会发生以下异常信息
```
Caused by: java.lang.NullPointerException: Cannot invoke "run.halo.app.theme.finders.vo.MenuItemVo.setParentName(String)" because "childNode" is null
```

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

```release-note
修复获取菜单和分类列表时会出现 NPE 的问题
```
2022-11-01 13:30:16 +00:00
guqing c3a3281fcc
fix: labels update for post and singlepage (#2648)
#### What type of PR is this?
/kind bug
/area core
/milestone 2.0
#### What this PR does / why we need it:
修复文章和自定义页面的 labels 在文章标记为删除状态时没有更新的问题
#### Which issue(s) this PR fixes:
A part of  #2647

#### Special notes for your reviewer:
how to test it?
1. 创建文章
2. 由于没有发布,此时访问文章的 permalink 访问不到
3. 发布文章,可以正常访问
4. 更新文章的 `spec.deleted=true`,在访问文章期望404,并且 `metadata.labels` 中的数据正确
5. 自定义页面亦如是

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

```release-note
None
```
2022-11-01 13:12:16 +00:00
Ryan Wang 6e21f559e5 fix: show publish time instead of creation time for post list (halo-dev/console#676) 2022-11-01 18:00:42 +08:00
Ryan Wang 5605759e49
perf: use the new formkit custom input for system setting forms schema (#2646)
#### What type of PR is this?

/kind improvement
/milestone 2.0
/area core

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

更新系统设置的表单定义,为 Logo / Favicon 使用新的选择附件输入框,为代码注入部分设置使用新的代码编辑器输入框。

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

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

#### Special notes for your reviewer:

/hold

请等待以下 PR 合并:

- https://github.com/halo-dev/console/pull/674
- https://github.com/halo-dev/console/pull/672
- https://github.com/halo-dev/console/pull/675

测试方式:

1. Console 需要使用最新的 main 分支。
2. 测试系统设置中的 Logo / Favicon 和代码注入部分的设置项是否正常使用。

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

```release-note
更新系统设置的表单定义,提供更便捷的代码和附件选择输入框。
```
2022-11-01 06:36:16 +00:00
Ryan Wang 25f47bf598 feat: add preset language support for codemirror components (halo-dev/console#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 9a24604a6b feat: add formkit custom input of attachment (halo-dev/console#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 f77be1ecb7 feat: add formkit custom input of codemirror (halo-dev/console#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 ea3620f2c5 perf: improve the layout and style of forms (halo-dev/console#673)
Change form style from horizontal to vertical.
2022-10-31 16:01:28 +08:00
guqing b63131c36e
feat: support obtaining the previous post and next post according to post name (#2636)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.0

#### What this PR does / why we need it:
支持通过文章名称获取上一篇和下一篇文章数据

本 PR 通过实现一个固定大小的滑动窗口数据结构来通过传入的文章名称获取上一篇和下一篇文章
例如当具有一系列文章名为 [a, b, c, d, e, f, g]
查询文章名为 d 的文章的上一篇和下一篇则使用一个固定大小为 3 的滑动窗口, 示意图如下
<img width="526" alt="image" src="https://user-images.githubusercontent.com/38999863/198243133-20f77431-1107-4526-9f4f-6a11c68204e7.png">
通过窗口右移来调整当窗口圈住所需元素 D 时且 元素 D 的位置不是窗口的最后一个元素时得到一个想要的窗口
此时:
1. 如果 D 位于 window 中的第一个元素则 D 没有上一篇
2. 如果 D 位于 window 中间则 window 的第一个元素为 D 的上一篇,最后一个元素为下一篇
3. 如果 D 位于 window 的最后一个位置,则 D 没有下一篇
#### Which issue(s) this PR fixes:

Fixes #2635

#### Special notes for your reviewer:
how to test it?
1. 创建几篇文章然后发布
4. 能通过 `${postFinder.cursor(your-post-name)}` 来获取到带有上一页下一页的文章数据
5. 当文章处于第一条时没有上一页,当文章处于最后一页时没有下一页(可以通过`${postCursor.hasPrevious()}` 和 `${postCursor.hasNext()}` 判断按钮是否展示)

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

```release-note
支持通过文章名称获取上一篇和下一篇文章数据
```
2022-10-31 07:44:16 +00:00
John Niang 8b038c1e0a
Update README.md due to 2.0.0-alpha.3 released (#2634)
#### What type of PR is this?

/kind documentation

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

Bump image tag in docker command.

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

```release-note
None
```
2022-10-26 09:36:09 +00:00
Ryan Wang b11ca066b0 chore: release 2.0.0-alpha.3 (halo-dev/console#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 3d293a5a46 fix: logo cannot be displayed after the build (halo-dev/console#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 d7159eb9d3 chore: bump dependencies (halo-dev/console#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
guqing 84617c3e96
refactor: ignore trailing separator for permalink router (#2632)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0
#### What this PR does / why we need it:
permalink 路由匹配时自动忽略末尾分隔符
例如
/archives  匹配到 /archives
/archives/ 匹配到 /archives

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

```release-note
None
```
2022-10-26 07:24:10 +00:00
guqing fa3e0c44f4
refactor: use LinkedHashMultimap to replace MultiValueMap (#2629)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0
#### What this PR does / why we need it:
ReverseProxyRouterFunctionRegistry 的注册方法之前使用了一个 LinkedMultiValueMap<String, String>,相当于是一个 Map<String, List<String>>,当插件启动后扫描到 ReverseProxy 资源保存到数据库会触发 ReverseProxyReconciler 调用`ReverseProxyRouterFunctionRegistry#register`,如果此时插件的 PluginApplicationContext 还没有被创建好,register 时会在中途因为获取不到 PluginApplicationContext 而失败然后 requeue,而 LinkedMultiValueMap 此时已经保存了一条记录 requeue后再执行 LinkedMultiValueMap(即`Map<String, List<String>>`) 这个 value 是一个 List 需要更多的判断来防止重复,需要用一个 Map<String, Set<String>>这样的结构来保证 requeue 时 ReverseProxyRouterFunctionRegistry 中集合结构之前的数据一致性这样更方便,所以将从 spring 的 LinkedMultiValueMap 切换到  guava 提供的 LinkedHashMultimap(它的结构是Map<K, Set<V>)

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

```release-note
None
```
2022-10-26 05:00:11 +00:00
Ryan Wang 6272e8e710 refactor: upload component changed from filepond to uppy (halo-dev/console#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
John Niang ee032f8cb9
Bump jasync-r2dbc-mysql to 2.1.7 (#2631)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0

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

Please refer to <https://github.com/jasync-sql/jasync-sql/releases/tag/2.1.7>.

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

```release-note
None
```
2022-10-26 04:24:09 +00:00
John Niang 403f1bd7b2
Bump SpringDoc to 2.0.0-RC1 (#2628)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0

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

Please refer to <https://github.com/springdoc/springdoc-openapi/releases/tag/v2.0.0-RC1>.

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

```release-note
None
```
2022-10-26 04:22:14 +00:00
Ryan Wang 03aeb707f6
chore: disable thymeleaf cache in dev profile (#2630)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

在 dev 的配置文件中禁用 Thymeleaf 的模板缓存。

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo 

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

```release-note
在 dev 的配置文件中禁用 Thymeleaf 的模板缓存。
```
2022-10-26 04:20:09 +00:00
John Niang d9cb6bf732
Provide an endpoint to upgrade plugin (#2624)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.0

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

Provide an endpoint to upgrade plugin by uploading a new jar file.

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

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

#### Special notes for your reviewer:

1. Install an old plugin
2. Update the plugin and package again
3. Upgrade the plugin and see the result

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

```release-note
提供插件更新功能
```
2022-10-26 04:02:10 +00:00
Ryan Wang a23c4318cc feat: add upgrade plugin support (halo-dev/console#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
guqing 3ec7e31cac
refactor: fill in the name of the rendered template as the template id to the view model (#2626)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
渲染模板页面时将被渲染的模板名称填充到试图模型中作为 templateId
为什么需要它:
1. thymeleaf 渲染模板可以使用 fragment,此时在 thymeleaf 的 IElementTagProcessor 等处理器中获取到的 template name不一定是例如 post.html这样的名称
2. 比如渲染文章模板 post.html 而 #2569 计划将要在 theme.yaml 中通过配置允许用户选择文章所渲染的模板,因为无法确定渲染模板的标志,例如有些处理器想在文章页插入 head 这样的需求就需要知道哪个模板是文章页。see also [issuecomment-1215135195](https://github.com/halo-dev/halo/issues/2322#issuecomment-1215135195)
所以目前想到的是通过在 render 时填充一个 templateId 到 view model 中标识模板身份
#### Which issue(s) this PR fixes:

Fixes #2621

#### Special notes for your reviewer:
how to test it?
见 issue #2621

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

```release-note
修复设置了文章的 htmlMetas 字段但没有在页面的 head 注入标签的问题
```
2022-10-26 03:12:10 +00:00
Ryan Wang 4ca853e159 refactor: load the logo as an inline svg (halo-dev/console#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
guqing 7c3fc3ac02
refactor: plugin reconciler to fix entry path when optimistic lock occurred (#2625)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0
#### What this PR does / why we need it:
重构 PluginReconciler,避免因为每一段逻辑的执行时间太长而增加乐观锁错误的发生概率
修复判断逻辑问题导致启动时因为发生乐关锁错误造成没有填充 entry 和 stylesheet 字段的问题
#### Which issue(s) this PR fixes:
Fixes #2616

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

```release-note
None
```
2022-10-26 03:10:13 +00:00
guqing 160dd909cc
feat: provides the route of the post archive page for theme-side (#2598)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.0

#### What this PR does / why we need it:
提供文章归档页

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

Fixes #2548

#### Special notes for your reviewer:

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

```release-note
为主题提供文章归档页
```
2022-10-25 07:46:12 +00:00