#### 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 输入框。
```
#### 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
支持通过文章名称获取上一篇和下一篇文章数据
```
#### 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
```
#### 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
```
#### 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
```
#### 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
```
#### 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
```
#### 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
```
#### 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
```
#### 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 的模板缓存。
```
#### 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
提供插件更新功能
```
#### 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 注入标签的问题
```
#### 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 文件导致的页面抖动问题。
```
#### 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
```
#### 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
为主题提供文章归档页
```
#### What type of PR is this?
/kind bug
/milestone 2.0
#### What this PR does / why we need it:
修复文章、自定义页面、评论聚合查询接口排序不固定的问题。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2622
#### Special notes for your reviewer:
测试方式:检查 Console 端的文章、自定义页面、评论、回复的排序是否正常,需要多次刷新检查。
```release-note
修复文章、自定义页面、评论聚合查询接口排序不固定的问题。
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0
#### What this PR does / why we need it:
修复插件卸载时没有连同删除插件 JAR 文件的问题
#### Which issue(s) this PR fixes:
Fixes#2552
#### Special notes for your reviewer:
how to test it?
1. 以 deployment 模式安装一个插件
2. 插件的名称在插件目录是以 {pluginName}-{version}.jar 的方式命名的
3. 卸载插件时会连同删除插件的 JAR 文件
4. 开发模式下不会删除插件文件
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
修复插件卸载时没有连同删除插件 JAR 文件的问题
```
#### What type of PR is this?
/kind feature
/milestone 2.0
#### What this PR does / why we need it:
优化部分数据列表的逻辑,支持在检测出有正在删除的数据时,自动定时刷新列表。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
测试方式:
1. 进入任意一个数据列表,比如文章。
2. 删除一个文章,观察是否有自动刷新列表。
3. 切换路由,检查自动刷新是否停止。
#### Does this PR introduce a user-facing change?
```release-note
优化部分数据列表的逻辑,支持在检测出有正在删除的数据时,自动定时刷新列表。
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
修正关于 Attachment 组件和编辑器组件的参数错别字。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind documentation
#### What this PR does / why we need it:
更新 [Repobeats analytics](https://repobeats.axiom.co/) 的图片源,之前因为修改仓库名,导致 Repobeats analytics 的统计失效。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.0
#### What this PR does / why we need it:
当删除文章或自定义页面时级联删除内容快照和评论及计数器
see also #2602
#### Which issue(s) this PR fixes:
Fixes#2599
#### Special notes for your reviewer:
how to test it?
1. 新建一篇文章并创建一些评论(需要安装评论插件 [plugin-comment-widget](https://github.com/halo-sigs/plugin-comment-widget))
2. 逻辑删除文章时评论不会被删除,真实删除则会
3. 新建一个文章,再删除它,然后查询 snaphost 模型看关联文章的数据有没有被删除
4. 自定义页面同上
5. 删除文章或自定义页面时会删除对应的 Counter 记录(`GET /apis/metrics.halo.run/v1alpha1/counters`)
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
修复删除文章或自定义页面时没有级联删除内容快照和评论的问题
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
移除在 Git Commit 之前运行单元测试和类型检查的步骤。因为目前 main 分支处于保护分支,无法直接推送代码。所以仅在 PR 中的 Action 来运行这两个步骤即可。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
插件和主题管理的 Logo 改为使用 `Avatar` 组件。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
测试方式:检查主题和插件相关的管理页面是否正常加载 Logo。
#### Does this PR introduce a user-facing change?
```release-note
插件和主题管理的 Logo 改为使用 `Avatar` 组件。
```
#### What type of PR is this?
/kind feature
/milestone 2.0
#### What this PR does / why we need it:
为部分功能数据列表添加刷新按钮。
#### Screenshots:
<img width="1664" alt="image" src="https://user-images.githubusercontent.com/21301288/197397277-353befe4-8c43-4326-9ad5-64d2888dc4a3.png">
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
测试方式:
1. 需要 `pnpm build:packages`
2. 测试点击刷新按钮是否可以正常请求接口。
#### Does this PR introduce a user-facing change?
```release-note
为部分功能数据列表添加刷新按钮。
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
发布 `@halo-dev/components` `@halo-dev/console-shared` 版本。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.0
#### What this PR does / why we need it:
Use CopyOnWriteArrayList on SchemeManager to prevent concurrent modification when link plugin is installed.
#### How to test?
1. Install link plugin
2. Restart Halo
3. Delete any extensions
4. Check the result
#### Does this PR introduce a user-facing change?
```release-note
修复数据一直处于删除中的错误
```
#### 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 #
#### Special notes for your reviewer:
how to test it?
在任意主题页面使用如下语法
```
<p th:text="${siteStatsFinder.getStats()}"></p>
```
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
提供主题端站点统计信息查询器
```
#### What type of PR is this?
/kind api-change
/kind bug
#### What this PR does / why we need it:
更新 `@halo-dev/api-client` 以修复文章访问数据不正确的问题。
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo-console
#### Does this PR introduce a user-facing change?
```release-note
更新 `@halo-dev/api-client` 以修复文章访问数据不正确的问题。
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0
#### What this PR does / why we need it:
修改仪表盘统计返回类型的名称避类名相同时 swagger api 的 schema 被覆盖
#### Which issue(s) this PR fixes:
Fixes #
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
Remove custom schema validation and make field metadata.name of extension required. So that the API client generated by `openapi-gen` will be more consistent than before.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.0
#### What this PR does / why we need it:
修复分类树查询
#### Which issue(s) this PR fixes:
Fixes#2532
#### Special notes for your reviewer:
how to test it?
1. 新建分类并,并拖动构建一个树形
2. 在主题端通过 `categoryFinder.listAsTree()` 查看结果是否正确
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
修复分类树状数据查询
```
#### What type of PR is this?
/kind bug
/area core
/milestone 2.0
#### What this PR does / why we need it:
修复主题列表数据类型转换问题
#### Which issue(s) this PR fixes:
Fixes #
#### Special notes for your reviewer:
how to test it?
访问如下 API 不报错即可
```
curl http://localhost:8090/apis/api.console.halo.run/v1alpha1/themes?uninstalled=false
```
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind feature
/area core
/milestone 2.0
#### What this PR does / why we need it:
See https://github.com/halo-dev/halo/issues/2309 for more.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2309
#### Special notes for your reviewer:
#### Does this PR introduce a user-facing change?
```release-note
新增 generateName 字段用于自动生成自定义模型名称
```
#### What type of PR is this?
/kind feature
/milestone 2.0
/area core
/kind api-change
#### What this PR does / why we need it:
新增 API 用于查询未安装的主题
#### Which issue(s) this PR fixes:
Fixes#2554
#### Special notes for your reviewer:
how to test it?
1. 安装几个主题
2. 直接解压几个主题到 work dir 的 themes 目录
3. 使用以下 endpoint 查询未安装的主题,期望获得所有未安装主题的 themes.yaml 信息
```
/apis/api.console.halo.run/v1alpha1/themes?uninstalled=true
```
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
支持扫描主题目录下未安装的主题
```