#### What type of PR is this?
/kind bug
/area core
#### What this PR does / why we need it:
修复插件开发模式下后续增加的 fixedPluginPath 项无法被加载的问题
- 目前启动时会加载 pluginRepository 的所有 path,fixedPluginPath 被 DefaultDevelopmentPluginRepository 管理,所以在遍历 fixedPluginPath 加载时可能已经被加载过,需要判断是否被加载过,但即使被加载过也不能跳过而要继续执行创建/更新 plugin.yaml 资源的逻辑
- 创建/更新 plugin.yaml 时需要使用重试机制防止因为乐观锁冲突导致 Halo 无法启动
see #2939 for more detail
#### Which issue(s) this PR fixes:
Fixes#2939
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
修复插件开发模式下后续增加的 fixedPluginPath 项无法被加载的问题
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
将 http 请求体的最大字节数改为 10m。
Ref https://github.com/halo-dev/halo/issues/2861#issuecomment-1339526589
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2861
#### Special notes for your reviewer:
测试方式:
1. 在 Console 端新建文章,保存大量文本内容(最快方式是截图或者复制图片到编辑器,这时候因为会转为 base64,所以内容会很大)
2. 保存文章,检查是否成功。
#### Does this PR introduce a user-facing change?
```release-note
修改 HTTP 请求体最大字节数的限制,修复保存大内容文章异常的问题。
```
#### 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
```
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
重构访问量统计逻辑
1. 去掉了访问量总数存储在 Meter Counter 中的逻辑,因为迁移时是直接像 Counter 自定义模型创建数据,而文章被访问时是存储在 Meter Counter 后定时同步到数据库,这就存在双向同步问题且都有新数据无法知道该如何合并数据。
2. 目前访问时会发送一个事件,当得到事件后会缓存在队列中,每隔一分钟将增量更新到数据库中
3. 评论统计也去掉了 Meter Counter 改为事件队列处理
4. 如果后续要暴露 Metrics 应该使用 Gauge 监控 Counter 自定义模型
5. Counter 自定义模型的查询优化后续可以使用 Indexer 或者加缓存来实现而非将 Meter Counter 当作缓存
#### Which issue(s) this PR fixes:
Fixes#2820
#### Special notes for your reviewer:
1. 测试迁移导入看文章访问量是否正确
2. 创建评论及回复观察未读回复数量、评论回复数、最新回复时间是否正确
3. 多创建一些回复然后删除评论,看是否正确删除
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
重构访问量统计逻辑,修复文章visits无法迁移的问题
```
#### What type of PR is this?
/kind improvement
/milestone 2.1.x
#### What this PR does / why we need it:
移除与表单相关的组件,比如 `VInput`、`VSelect` 等,以后均使用 FormKit 提供的表单元素
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2905
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/area core
#### What this PR does / why we need it:
Shutdown AsyncLogWriter on VM exit.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2901
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### 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/2906
#### Special notes for your reviewer:
测试方式:
1. 进入新建文章页面。
2. 点击右上角发布按钮,填写必要的标题和别名,然后点击保存。
3. 点击右上角设置按钮,切换到高级设置,再次点击保存。
4. 观察是否正常保存。
#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端文章设置中的发布时间为空字符串时,无法保存的问题。
```
#### What type of PR is this?
/kind bug
/area core
#### What this PR does / why we need it:
修复自定义页面没有统计访问量的问题
#### Which issue(s) this PR fixes:
Fixes#2912
#### Special notes for your reviewer:
how to test it?
创建自定义页面并到主题端访问,可以看到访问量增加
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
修复自定义页面没有统计访问量的问题
```
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
在插件开发模式下加载插件失败时不抛出异常改为静默提示
#### Which issue(s) this PR fixes:
A part of #2901
#### Special notes for your reviewer:
how to test it?
1. 配置 `halo.plugin.fixed-plugin-path` 为一些不合法的插件项目路径不影响 Halo 正常启动,且有错误提示
2. 配置合法路径,插件能正确启动
#### 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:
更新 Readme 中快速开始的命令,提供初始管理员账号和外部访问链接的环境变量设置。
```release-note
None
```
#### What type of PR is this?
/kind documentation
#### What this PR does / why we need it:
为 Halo 2.0 正式版更新 Readme。
#### 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:
Bump halo version to 2.1.0-SNAPSHOT for next release.
#### Which issue(s) this PR fixes:
```release-note
None
```
#### What type of PR is this?
/kind bug
/milestone 2.0.1
#### What this PR does / why we need it:
修复插件停止时,仍然获取设置选项导致提示失败的问题。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2866
#### Special notes for your reviewer:
测试方式:
1. 安装一个插件,将其停止之后检查是否有获取 setting 的请求以及页面上是否有提示。
#### Does this PR introduce a user-facing change?
```release-note
修复在 Console 端停止插件时,仍然获取设置选项导致显示失败提示的问题。
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
优化主题和插件详情页面切换 tab 时的页面闪动问题。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2856
#### Special notes for your reviewer:
测试方式:检查在主题和插件详情页面是否还存在 https://github.com/halo-dev/halo/issues/2856 中提到的问题。
#### Does this PR introduce a user-facing change?
```release-note
优化 Console 端的主题和插件详情页面切换选项卡时的页面闪动问题。
```
#### What type of PR is this?
/kind bug
/milestone 2.0.1
#### What this PR does / why we need it:
修复在生产环境,激活主题之后,界面数据没有更新的问题。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2850
#### Special notes for your reviewer:
测试方式:
1. 使用 `pnpm build` 构建此 PR。
2. 在 Halo 配置 `halo.console.location` 为 Console 项目的 dist 目录,比如:`file:/Users/ryanwang/Workspace/github/ruibaby/halo-console/dist/`
3. 安装若干主题,激活其中一个,检查页面 UI 元素是否更新。
#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端激活主题之后页面没有更新数据的问题。
```
#### What type of PR is this?
/kind bug
/area core
#### What this PR does / why we need it:
Add forgotten label `rbac.authorization.halo.run/system-reserved` for system-reserved roles. See the screenshot below:

#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2844
#### Special notes for your reviewer:
For @halo-dev/sig-halo-console : We have to determine whether the role is system-reserved by checking if label `rbac.authorization.halo.run/system-reserved` is equal to `true`.
#### 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
修复每个角色都显示系统保留标签的问题
```
#### 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/2857
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bugfix
/area core
#### What this PR does / why we need it:
修复文章列表查询时的类型转换错误
文章列表查询将 collectList 错写为 collectSortedList 导致此 `Contributor cannot be cast to class java.lang.Comparable`,
collectSortedList 会使用 `Arrays.sort(a, (Comparator) c)`,这需要目标类实现 Comparable 才行,而此处并不需要自然排序。
#### Which issue(s) this PR fixes:
Fixes#2830
#### Special notes for your reviewer:
此 bug 的复现方式为:
编辑一篇文章保存后,在使用另一个用户账户编辑此文章并发布就会出现,而使用此 PR 后问题消失,此问题只对 Contributor 这个类型有效它不是自定义模型类,而 Tag 和 Category 都是自定义模型 继承了 AbstractExtension 而它 实现了 Comparable 接口。
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
修复文章列表查询时的类型转换错误
```
#### What type of PR is this?
/kind improvement
/area core
#### What this PR does / why we need it:
Bump Halo version in gradle.properties for next release.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind bug
/milestone 2.0.1
#### What this PR does / why we need it:
修复创建菜单项的时候,自定义链接类型的菜单项无法正常保存名称和链接的问题。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2816
#### Special notes for your reviewer:
测试方式:
1. 创建若干自定义类型的菜单项。
2. 检查是否成功保存了名称和连接。
#### Does this PR introduce a user-facing change?
```release-note
修复 Console 端无法正常创建自定义链接类型菜单项的问题。
```
#### What type of PR is this?
/kind improvement
/milestone 2.0.1
#### What this PR does / why we need it:
使用 api-client 进行网络请求时,支持添加 `mute` 参数以隐藏异常提示。
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2836
#### Special notes for your reviewer:
None
#### 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:
鉴于目前已不在 Release 中提供 Jar 包下载,Releases 下载数量的展示已经没有太大意思,所以去掉了 README 中的 Releases 下载数量徽章。
#### 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:
为 Halo 2.0 正式版本更新 README。
#### Special notes for your reviewer:
/hold
等待创建 2.0 的 release。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
#### What this PR does / why we need it:
修改版本号以发布 Console 2.0.0 正式版。
#### 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:
重构 Console 端插件扩展点的定义方式。现在需要如下定义:
```ts
extensionPoints: {
"page:functional:create": () => {
return [
{
name: "链接",
url: "/links",
path: "/pages/functional/links",
permissions: ["plugin:links:view"],
},
];
},
},
```
#### Special notes for your reviewer:
可以用以下插件进行测试:
- https://github.com/halo-sigs/plugin-links
- https://github.com/halo-sigs/plugin-unsplash
#### 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:
更新系统初始化数据的资源,主要为了适配 https://github.com/halo-dev/console/pull/730 的修改。
#### Special notes for your reviewer:
测试方式:
1. 准备全新的环境。
2. 启动之后初始化,检查初始数据是否正常。
#### 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:
在首次初始化页面隐藏 `资源不存在` 的提示,这是由 https://github.com/halo-dev/console/pull/732 带来的问题。
#### Special notes for your reviewer:
测试方式:
1. 准备全新的环境。
2. 进入初始化页面,检查是否存在 `资源不存在` 的提示。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0.0
#### What this PR does / why we need it:
This PR provides an ability to migrate attachments from other places, like Halo 1.x or Wordpress.
We could simply configure resource mappings to support attachments migration:
```yaml
halo:
attachment:
resource-mappings:
- pathPattern: /upload/**
locations:
- upload
- migrate-from-1.x
- pathPattern: /wp-content/uploads/**
locations:
- migrate-from-wp
```
Meanwhile, I refactored LocalAttachmentUploadHandler for managing attachments from migration in the future.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2585
#### Special notes for your reviewer:
**Steps to test:**
1. Try to configure the resource mappings
2. Put some static resources into the corresponding location
3. Access it from Browser
At last, please make sure the functionalities of attachment are ok as before.
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/kind api-change
#### What this PR does / why we need it:
将 Plugin 的 author 改为 Author 对象与主题保持一致。
移除了测试类中使用的 jar 文件,改为使用时压缩
⚠️ 此为破坏性更新,需要修改 Console 插件列表的展示,以及所有官方插件的 plugin.yaml
#### Special notes for your reviewer:
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
Require-user-change:将 Plugin 的 author 类型从 String 为 Author
```
#### What type of PR is this?
/kind improvement
/milestone 2.0
#### What this PR does / why we need it:
修改插件的 author 字段为对象形式。适配 https://github.com/halo-dev/halo/pull/2806
#### Special notes for your reviewer:
None
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/kind api-change
/area core
/milestone 2.0.x
#### What this PR does / why we need it:
Two things this PR does:
1. **Simplify MenuItem with targetRef instead of multi refs**
2. Organize extensions with group `content.halo.run` into content folder
> **Warning** The first thing has some break changes about structure of MenuItem, please @halo-dev/sig-halo-console be aware of that.
Before:
```java
@Schema(description = "Category reference.")
private Ref categoryRef;
@Schema(description = "Tag reference.")
private Ref tagRef;
@Schema(description = "Post reference.")
private Ref postRef;
@Schema(description = "SinglePage reference.")
private Ref singlePageRef;
```
After:
```java
@Schema(description = "Target reference. Like Category, Tag, Post or SinglePage")
private Ref targetRef;
```
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2739
#### Special notes for your reviewer:
Because this PR contains break changes, we cannot test it in console directly.
#### 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:
更新默认主题的安装包。 https://github.com/halo-dev/theme-earth/releases/tag/v1.0.0
#### Special notes for your reviewer:
测试方式:
1. 使用全新的环境启动此 PR。
2. 插件默认主题是否正确初始化。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/kind api-change
#### What this PR does / why we need it:
- 暂时关闭 JWT 认证功能,`POST /api/auth/token` API 将失效。
- 移除 `halo.security.oauth2.jwt` 配置,公私钥放在 classpath 只是之前还没有 halo work dir 时的临时方案
- Disable JWT 相关的单元测试
后续会 Revert 此 PR。
#### Special notes for your reviewer:
how to test it?
1. 期望 `/api/auth/token` 失效
2. 期望 Console 登录功能没问题
/cc @halo-dev/sig-halo
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### 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/2773
#### Does this PR introduce a user-facing change?
```release-note
Console 端支持实时保存内容到浏览器,防止意外操作丢失内容。
```
#### What type of PR is this?
/kind feature
/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/2370
#### 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:
移除文章设置中内部成员可访问的选项,目前后端没有支持。
#### Does this PR introduce a user-facing change?
```release-note
None
```
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0.x
#### What this PR does / why we need it:
This PR only do one improvement for reconciling Role. I always fetch the latest data and compare the difference between the latest and current, and then decide whether to update based on the result.
#### Which issue(s) this PR fixes:
Fixes https://github.com/halo-dev/halo/issues/2784
#### Special notes for your reviewer:
Steps to test:
1. Restart Halo multiple times and see the log
#### Does this PR introduce a user-facing change?
```release-note
None
```