Commit Graph

4528 Commits (767aa53a22a4f0d23bb76fcb16a9944f01388548)

Author SHA1 Message Date
Ryan Wang cf9a9e8a6d
feat: refine restore completed tips i18n (#4301)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.8.x

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

完善备份恢复界面的 i18n。

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

```release-note
None
```
2023-07-26 08:00:19 +00:00
Ryan Wang a617ea164c
feat: require confirmation before restoring backup (#4300)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.8.x

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

在恢复备份的界面,改为需要先点击开始恢复按钮再显示上传区域。

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

Fixes #4295 

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

```release-note
None 
```
2023-07-26 06:44:23 +00:00
Ryan Wang 25725e520e
feat: add showCancel prop for dialog component (#4302)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.8.x

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

为 Dialog 组件添加 showCancel 属性用于控制是否显示取消按钮,某些场景下 Dialog 只是用于提示切必须点击确定。

此外,还对以下位置做了对应修改:

1. 进入文章编辑时检查编辑器是否存在的弹框,只允许点击确定并返回。
2. 备份恢复完成之后点击确定关闭 Halo。

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

```release-note
Console 端的 Dialog 组件添加 showCancel 属性用于控制是否显示取消按钮。
```
2023-07-26 06:42:19 +00:00
Ryan Wang cfe77c5ded
chore: release 2.8.0-rc.1 (#4290)
#### What this PR does / why we need it:

修改版本号,发布 2.8.0-rc.1

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

```release-note
None
```
2023-07-24 12:48:15 +00:00
Ryan Wang f56de041b4
chore: bump default editor version to 27 (#4288)
#### What type of PR is this?

/area console
/area editor
/milestone 2.8.x
/kind feature

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

升级默认编辑器以支持:

1. 重构 Block 操作区域逻辑,防止误操作。 Fixes https://github.com/halo-dev/halo/issues/4164
2. 支持设置文字背景颜色和字体颜色。
3. iframe block 支持主动刷新页面。 https://github.com/halo-dev/halo/issues/4227
4. 在顶部工具栏的区域添加工具箱。
5. 支持设置字体大小。

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

```release-note
升级默认编辑器版本,支持设置字体颜色、大小等功能,优化使用体验。
```
2023-07-24 12:46:14 +00:00
Ryan Wang 6fa442de98
chore: bump default theme version to 1.5.0 (#4289)
#### What type of PR is this?

/area theme
/milestone 2.8.x

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

升级默认主题版本至 1.5.0

https://github.com/halo-dev/theme-earth/releases/tag/v1.5.0

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

```release-note
None
```
2023-07-24 10:18:15 +00:00
guqing bf1be64959
refactor: conditionally render comment for theme (#4271)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.8.x
/area theme

#### What this PR does / why we need it:
按条件渲染评论组件以简化主题端对评论组件是否显示的条件控制

使用了评论标签的模板页面都能直接使用 `${haloCommentEnabled}` 取值能得到评论组件是否可见的结果为`true/false` 用于在需要级联条件渲染的组件上使用,如:

```html
<!-- 评论组件不可见时不渲染标题 -->
<p th:if="${haloCommentEnabled}">评论</p>
<halo:comment />
```

how to test it?
在主题端未加渲染条件时:
1. 测试全局评论组件是否开启的设置是否有效
2. 测试文章和自定义页面是否开启评论的设置是否有效
3. 测试评论组件启用和停止时评论组件的渲染是否正确
4. 测试 `${haloCommentEnabled}` 结果是否正确

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

#### Does this PR introduce a user-facing change?
```release-note
按条件渲染评论组件以简化主题端对评论组件是否显示的条件控制
```
2023-07-24 09:38:14 +00:00
John Niang 4505fcfd16
Support extending username password authentication (#4265)
#### What type of PR is this?

/kind feature
/area core
/area plugin

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

Plugin developers are able to define own UsernamePasswordAuthenticationManager to take charge of username password authentication. 

1. If the manager fails to handle, the default authentication manager will be used.
2. If the manager returns `Mono.empty()`, the default authentication manager will be used.

For example:

```java
@Component
public class LdapAuthenticationManager
    extends UserDetailsRepositoryReactiveAuthenticationManager
    implements UsernamePasswordAuthenticationManager {

    public LdapAuthenticationManager(ReactiveUserDetailsService userDetailsService) {
        super(userDetailsService);
    }

    @Override
    protected Mono<UserDetails> retrieveUser(String username) {
        return super.retrieveUser(username);
    }
}
```

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

See https://github.com/halo-dev/halo/issues/4207#issuecomment-1643042348 for more.

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

```release-note
提供用户名密码认证扩展
```
2023-07-24 09:26:14 +00:00
John Niang 0d19ccdb8a
Delete file already wrote partially into attachment folder when content is terminated with an error (#4286)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.8.x

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

If content is terminated with an error, the file already wrote partially into attachment folder won't be cleaned.

Imagine a scenario where we check that the content size is not larger than 2MB when we write content to the attachments folder. Once the limit is reached, files that have been partially written should be cleaned instead of being kept.

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

```release-note
None
```
2023-07-24 09:22:15 +00:00
John Niang 15dd7826dc
Bump plugin preset (#4287)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.8.x

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

Bump plugin preset. See https://github.com/halo-sigs/plugin-comment-widget/releases/tag/v1.7.0 for more.

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

```release-note
None
```
2023-07-24 09:08:14 +00:00
John Niang bd912c36b9
Support backup and restore (#4206)
#### What type of PR is this?

/kind feature
/area core

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

See 9921deb076/docs/backup-and-restore.md for more.

<img width="1906" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/41531186-d305-44fd-8bdc-30df9b71af43">
<img width="1909" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/3d7af1b9-37ad-4a40-9b81-f15ed0f1f6e8">


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

Fixes https://github.com/halo-dev/halo/issues/4059
Fixes https://github.com/halo-dev/halo/issues/3274

#### Special notes for your reviewer:

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

```release-note
支持备份和恢复功能。
```
2023-07-24 08:26:16 +00:00
John Niang 5ce47190fa
Support resolving static resources at halo work directory (#4285)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.8.x

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

Support resolving static resources at halo work directory `${halo.work-dir}/static/`.

Please note that we only support adding static resources at hand by logging in the server.

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

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

#### Special notes for your reviewer:

1. Create a file `index.html` at `${halo.work-dir}/static`
2. Edit the file with any content
3. Browse with `http://localhost:8090/index.html`

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

```release-note
支持静态资源映射
```
2023-07-24 08:24:34 +00:00
guqing 9bea5ef1c9
fix: inconsistency status occurred during plugin startup due to optimistic locking conflict (#4275)
#### What type of PR is this?
/kind improvement
/area core
/area plugin
/milestone 2.7.x

#### What this PR does / why we need it:
修复插件启动成功但更新数据失败而导致插件状态不符合预期的问题

how to test it?
1. 安装一个带 console 页面的插件并停用它
2. 使用 IDEA 在 doStart 方法最后更新数据的地方也就是 834e37cf13/application/src/main/java/run/halo/app/core/extension/reconciler/PluginReconciler.java (L447) 处打断点,suspend 勾选为 Thread
	<img width="404" alt="image" src="https://github.com/halo-dev/halo/assets/38999863/ead0ad2c-65a9-41aa-b2b1-f4fdbc2d2edf">
3. 启用插件,会执行到断点处
4. 使用如下命令更新数据将 status 删除以模拟乐观锁冲突并清除 status 状态排除干扰
```shell
curl -u admin:admin -X PUT http://localhost:8090/apis/plugin.halo.run/v1alpha1/plugins/{name} --data '替换为 plugin 的 json '
```
5. 放行端点

根据上述步骤先在 main 分支浮现然后在切换到此 PR 对比结果,期望插件的状态为启动成功且 status 数据示例如下:
conditions 有两条会因为乐观锁更新失败一次且entry和stylesheet都有值
```json
{
        "phase": "STARTED",
        "conditions": [
            {
                "type": "STARTED",
                "status": "TRUE",
                "lastTransitionTime": "2023-07-21T07:46:01.274211Z",
                "message": "Started successfully",
                "reason": "STARTED"
            },
            {
                "type": "FAILED",
                "status": "FALSE",
                "lastTransitionTime": "2023-07-21T07:46:01.248001Z",
                "message": "Failed to update table [extensions]; Version does not match for row with Id [/registry/plugin.halo.run/plugins/PluginBytemd]",
                "reason": "UnexpectedState"
            }
        ],
        "lastStartTime": "2023-07-21T07:46:01.273625Z",
        "entry": "/plugins/PluginBytemd/assets/console/main.js?version=1.1.0-SNAPSHOT",
        "stylesheet": "/plugins/PluginBytemd/assets/console/style.css?version=1.1.0-SNAPSHOT",
        "logo": "/plugins/PluginBytemd/assets/logo.png?version=1.1.0-SNAPSHOT",
        "loadLocation": "file:///Users/guqing/Development/halo-sigs/plugin-bytemd/"
    }
```

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

#### Does this PR introduce a user-facing change?
```release-note
修复插件启动成功但更新数据失败而导致插件状态不符合预期的问题
```
2023-07-24 08:22:42 +00:00
Takagi 84093d8db0
feat: add support for user avatar upload (#4253)
#### What type of PR is this?

/kind improvement
/area console
/area core

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

此 PR 对用户头像上传的方式进行了重构,移除了原有的头像链接及上传至附件库的方案。允许具有用户管理权限的用户对其他用户的头像进行修改和移除。

Core: 
新增了 `/apis/api.console.halo.run/v1alpha1/users/-/avatar` 的 `POST` 以及 `DELETE` 接口,用来上传用户的头像及删除当前用户的头像。

Console:
新增对用户头像进行裁剪的功能,并调用上传接口保存用户头像。

需等待 #4247 合并

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

Fixes #2688 

See #4251 
See #4247 

#### Special notes for your reviewer:

1. 测试上传、删除头像接口是否能够正常执行。
2. 查看当前用户的头像是否能够设置成功。
3. 查看附件库中,当前用户的头像文件是否为 0 或 1 个。

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

```release-note
支持裁剪、上传和删除用户头像。
```
2023-07-24 08:08:04 +00:00
John Niang fdfaa53614
Support sort parameter when listing extensions (#4274)
#### What type of PR is this?

/kind feature
/area core

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

Currently, we cannot pass a sort parameter into extensions' list API, so the result of the API is unsortable.

This PR add the support for that API. e.g.:

```bash
curl -X 'GET' \
  'http://localhost:8090/api/v1alpha1/annotationsettings?sort=metadata.name,desc' \
  -H 'accept: */*'
```

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

```release-note
Extension 查询接口支持排序参数。
```
2023-07-24 07:02:23 +00:00
John Niang e98aec32ca
Upgrade Spring Boot 3.1.2 (#4284)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.8.x

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

Upgrade Spring Boot 3.1.2. See https://github.com/spring-projects/spring-boot/releases/tag/v3.1.2 for more.

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

```release-note
升级 Spring Boot 至 3.1.2。
```
2023-07-24 03:20:14 +00:00
Ryan Wang 617d05f3bc
refactor: remove username input validation rule in user editing form (#4276)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.8.x

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

移除用户编辑表单中用户名的校验规则,在这个表单中,用户名本身就是不能修改的,所以不需要验证。移除之后还能够解决旧版本 Halo 升级之后无法修改资料的问题。(旧版本没有用户名校验)

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

Fixes #4269 

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

```release-note
移除 Console 端用户编辑表单中用户名的校验规则,防止旧版本 Halo 升级之后无法修改资料。
```
2023-07-21 09:04:14 +00:00
Ryan Wang 834e37cf13
feat: record the attachment query conditions in the route query parameters (#4210)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.8.x

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

在附件数据管理列表页面路由中记录查询条件,包括分页信息、筛选信息等。可以保证在刷新浏览器窗口或者从编辑页面返回时保留之前的查询状态。

<img width="1714" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/cd3ab1da-ac5c-48c7-a8f2-83f2f86a47bc">

#### Special notes for your reviewer:

需要测试:

1. 附件管理列表的所有筛选项是否可以正常工作。
2. 尝试设置部分筛选,然后刷新页面,观察筛选条件是否正常保留。

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

```release-note
Console 端的附件管理列表支持在地址栏记录筛选条件。
```
2023-07-21 03:50:14 +00:00
guqing 3b03ed9570
refactor: add read-write lock to ExtensionContextRegistry (#4245)
#### What type of PR is this?
/kind improvement
/area core
/area plugin
/milestone 2.8.x

#### What this PR does / why we need it:
修复由于多线程环境下导致的插件卸载时的路由异常问题

改动描述:
为了确保在多线程环境下访问 ExtensionContextRegistry 类的注册表时的线程安全。通过添加读写锁,可以保证在读取和写入PluginApplicationContext 时只有一个线程可以访问,从而避免了多个线程同时访问注册表时可能出现的竞态条件和数据不一致的问题。同时,更新了 register、remove、getByPluginId、containsContext 和 getPluginApplicationContexts 方法,以在访问注册表时获取和释放适当的锁,从而确保了线程安全。

问题原因:
当插件卸载时,卸载动作在 Reconciler 线程中执行而路由访问是在 reactor 的 NonBlockingThread 线程执行,当 PluginCompositeRouterFunction 的 routerFunctions() 方法从 ExtensionContextRegistry 中获取所有 PluginApplicationContext 并持有还未处理完成时由于 PluginReconciler 中执行了卸载插件逻辑而将某个 PluginApplicationContext 关闭从而让 PluginCompositeRouterFunction 中持有到的对象引用发生变化出现数据不一致问题导致出现 `PluginApplicationContext@14971c8e has been closed already` 异常。

解决方案:
所以此修改让读取和写入PluginApplicationContext 时只有一个线程可以访问来解决此问题

how to test it?
测试开发模式下卸载插件时是否会出现如 #4242 中所描述的异常信息
#### Which issue(s) this PR fixes:
Fixes #4242

#### Does this PR introduce a user-facing change?
```release-note
修复由于多线程环境下导致的插件卸载时的路由异常问题
```
2023-07-21 03:38:14 +00:00
guqing 832c86071a
fix: plugin delete lifecycle method will not be triggered when the plugin is uninstalled (#4241)
#### What type of PR is this?
/kind bug
/kind improvement
/area core
/milestone 2.8.x

#### What this PR does / why we need it:
修复插件被卸载时 delete 生命周期方法不会被触发的问题

how to test it?
1. 测试开发模式下卸载插件,delete 生命周期方法被触发且不会误删项目目录
2. 测试生产模式下插件卸载,文件正确被删除且触发 delete 生命生命周期方法

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

#### Does this PR introduce a user-facing change?
```release-note
修复插件被卸载时 delete 生命周期方法不会被触发的问题
```
2023-07-21 03:36:14 +00:00
dependabot[bot] dc18d287e7
chore(deps-dev): bump word-wrap from 1.2.3 to 1.2.4 in /console (#4270)
Bumps [word-wrap](https://github.com/jonschlinkert/word-wrap) from 1.2.3 to 1.2.4.
- [Release notes](https://github.com/jonschlinkert/word-wrap/releases)
- [Commits](https://github.com/jonschlinkert/word-wrap/compare/1.2.3...1.2.4)

---
updated-dependencies:
- dependency-name: word-wrap
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-07-21 11:22:28 +08:00
Ryan Wang 51848d8563
fix: search input component cannot be rendered normally under a non-secure domain name (#4260)
#### What type of PR is this?

/area console
/kind bug
/milestone 2.8.x

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

修复在非安全域名下,SearchInput 组件无法正常渲染的问题,因为使用了 crypto 接口来随机生成表单的 id。但 crypto 在非安全域名下无法被调用,参考:https://developer.mozilla.org/en-US/docs/Web/API/Crypto

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

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

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

```release-note
None
```
2023-07-21 02:34:17 +00:00
Ryan Wang 7ee6e050a2
feat: record the comment query conditions in the route query parameters (#4209)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.8.x

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

在评论数据管理列表页面路由中记录查询条件,包括分页信息、筛选信息等。可以保证在刷新浏览器窗口或者从其他页面返回的时候不丢失筛选条件。

<img width="1544" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/39573c8d-f664-40d1-8248-90443179ac73">

#### Special notes for your reviewer:

需要测试:

1. 评论管理列表的所有筛选项是否可以正常工作。
2. 尝试设置部分筛选,然后刷新页面,观察筛选条件是否正常保留。

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

```release-note
Console 端的评论管理列表支持在地址栏记录筛选条件。
```
2023-07-21 02:28:13 +00:00
guqing 133e54106d
refactor: optimize the usage of comment widget extension point (#4249)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.8.x

#### What this PR does / why we need it:
优化评论扩展点的使用方式

how to test it?
测试评论插件是否正常可用

#### Does this PR introduce a user-facing change?
```release-note
优化评论扩展点的使用方式
```
2023-07-20 08:59:56 +00:00
guqing 5eb9b68209
refactor: optimizing regex pettern for html meta matching (#4235)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.8.x

#### What this PR does / why we need it:
优化去除 Html Meta 重复标签的正则表达式

see #4234 for more details.

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

Fixes #4234

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

```release-note
优化去除 Html Meta 重复标签的正则表达式
```
2023-07-20 08:55:56 +00:00
Ryan Wang 6b70296956
refactor: code structure of the post data list (#4219)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.8.x

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

重构 Console 端文章管理列表的代码结构,封装列表项为单个组件。

#### Special notes for your reviewer:

需要测试文章管理的功能是否正常。

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

```release-note
None
```
2023-07-20 08:10:18 +00:00
Ryan Wang ea792f511b
refactor: code structure of the single page data list (#4220)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.8.x

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

重构 Console 端页面管理列表的代码结构,封装列表项为单个组件。

#### Special notes for your reviewer:

需要测试页面管理的功能是否正常。

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

```release-note
None
```
2023-07-20 07:40:18 +00:00
Ryan Wang ad1ec3641c
chore: bump @halo-dev/richtext-editor to fix image size was abnormally modified (#4264)
#### What type of PR is this?

/area console
/kind bug
/milestone 2.8.x

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

升级编辑器以修复图片被自动修改尺寸的问题,see https://github.com/halo-sigs/richtext-editor/pull/22

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

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

#### Special notes for your reviewer:

测试方法可以参考:https://github.com/halo-sigs/richtext-editor/pull/22

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

```release-note
修复编辑文章时,原来的图片尺寸被自动修改的问题。
```
2023-07-20 07:30:18 +00:00
Takagi 5a7e794fea
feat: allow attachment library to filter certain groups and their attachments (#4255)
#### What type of PR is this?

/kind feature
/area core

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

为附件库增加过滤条件,过滤 labels 中包含 `halo.run/hidden` 的分组及其附件。

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

Fixes #4251 

#### Special notes for your reviewer:

保证默认情况下附件能够正常访问即可。
或者为分组增加 `halo.run/hidden` label,之后查看接口中是否不包含具有目标分组及其附件。

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

```release-note
None
```
2023-07-20 07:28:17 +00:00
Ryan Wang d21472dc0f
fix: post status filter item cannot be displayed when the page is refreshed (#4263)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.8.x

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

修复文章状态筛选在刷新页面之后无法回显的问题。

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

see https://github.com/halo-dev/halo/pull/4219#issuecomment-1641310000

#### Special notes for your reviewer:

需要测试:

1. 在文章管理页面选择某个状态筛序项,观察数据是否正常。
2. 刷新页面,观察筛选项是否回显。

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

```release-note
None
```
2023-07-20 07:24:18 +00:00
Ryan Wang ec2ab632fc
feat: refine validation for password field (#4257)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.8.x

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

在 Console 端关于用户密码输入的部分添加基本的验证,目前的规则是:

1. 必填,且不能全为空格符
2. 长度为 5-100
3. 字符串前后不能有空格

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

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

#### Special notes for your reviewer:

按照以上规则测试即可。

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

```release-note
Console 端关于用户密码输入的部分添加基本的验证
```
2023-07-19 11:48:12 +00:00
Ryan Wang 2ade57184c
feat: record the single page query conditions in the route query parameters (#4208)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.8.x

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

在页面数据管理列表页面路由中记录查询条件,包括分页信息、筛选信息等。可以保证在刷新浏览器窗口或者从编辑页面返回时保留之前的查询状态。

<img width="1597" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/5e14019b-9751-4a3f-b5c4-ec28b8ba4380">

#### Special notes for your reviewer:

需要测试:

1. 页面管理列表的所有筛选项是否可以正常工作。
2. 尝试设置部分筛选,然后刷新页面,观察筛选条件是否正常保留。
3. 尝试设置部分筛选,然后选择任意一个页面进行编辑,观察发布之后是否正常返回到管理列表,并正确设置了查询参数。

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

```release-note
Console 端的页面管理列表支持在地址栏记录筛选条件。
```
2023-07-19 11:46:17 +00:00
Takagi 01b81f1afc
feat: add attachment policy and group selection component to formkit (#4258)
#### What type of PR is this?

/kind feature
/area console

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

为 formkit 添加一个 `attachmentPolicySelect` 类型的下拉选择框组件,用来供用户选择附件策略。
同时也添加了一个 `attachmentGroupSelect` 类型的下拉选择框组件,用来供用户选择附件分组。

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

Fixes #4247 

#### Special notes for your reviewer:

使用 formkit 组件时将 type 修改为 `attachmentPolicySelect` 或 `attachmentGroupSelect`,查看是否能够展示一个可以选择附件策略或附件分组的组件,

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

```release-note
None
```
2023-07-19 11:06:13 +00:00
Ryan Wang 022526386a
perf: improve polling interval for api requests (#4246)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.8.x

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

优化 Console 端对异步数据轮询的间隔时间

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

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

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

```release-note
优化 Console 端对异步数据轮询的间隔时间
```
2023-07-19 03:44:12 +00:00
Ryan Wang 53b8ccb7c9
fix: delay issue in the theme settings tab switch (#4240)
#### What type of PR is this?

/area console
/kind bug
/milestone 2.8.x

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

修复主题设置选项卡切换的延迟问题。

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

Fixes #4239 

#### Special notes for your reviewer:

需要测试:

1. 进入主题设置,尝试对设置选项卡进行切换,观察选项卡和实际的设置表单是否一致。

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

```release-note
None
```
2023-07-19 03:26:13 +00:00
guqing 1dc2f6f4ea
refactor: plugin path in annotations when plugin installation (#4179)
#### What type of PR is this?
/kind improvement
/area core
/area plugin
/milestone 2.7.x

#### What this PR does / why we need it:
修复生产模式下插件安装时的位置信息为绝对路径会影响迁移的问题

how to test it?
1. 生产模式下安装插件看 annotation 中 `plugin.halo.run/plugin-path` 的值是否为相对于 pluginsRoot 的相对路径
2. 在生产模式下在 main 分支启动后安装的插件切换到此 PR 后 `plugin.halo.run/plugin-path` 是否变为相对路径

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

#### Does this PR introduce a user-facing change?
```release-note
修复生产模式下插件安装时的位置信息为绝对路径会影响迁移的问题
```
2023-07-19 02:34:11 +00:00
Ryan Wang e6f31759a0
feat: allow switching editors while editing a post (#4180)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.8.x

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

支持在编辑文章时切换编辑器,不再限制仅新建时允许切换。但需要注意的是,目前只支持同类型的编辑器切换(rawType)。

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

Fixes #4176 

#### Special notes for your reviewer:

测试方式:

1. 安装多个编辑器插件,可以在 https://github.com/halo-sigs/awesome-halo 中查找。
2. 测试在新建文章时是否能够正常切换编辑器。
3. 测试在修改文章时能够正常切换同类型的编辑器。

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

```release-note
Console 端编辑文章时允许同类型的编辑器切换。
```
2023-07-18 08:16:02 +00:00
Ryan Wang 5a0e202847
chore: add sponsorship entry and sponsor image (#4233)
#### What type of PR is this?

/kind improvement

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

添加[爱发电](https://afdian.net/a/halo-dev)的赞助入口,以及在 README 上添加 Sponsors 图像,此图像会在 https://github.com/halo-sigs/sponsor-images 仓库中自动更新。

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

```release-note
None
```
2023-07-16 16:14:19 +00:00
Ryan Wang ad9b0dfb21
fix: system settings and plugin settings panels cannot be displayed (#4222)
#### What type of PR is this?

/area console
/kind bug
/milestone 2.8.x

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

修复系统设置面板和插件设置面板无法正常显示的问题,此问题由 https://github.com/halo-dev/halo/pull/4102 中升级了 `@vueuse/router` 导致。

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

Fixes #4221 

#### Special notes for your reviewer:

需要测试:

1. 测试系统设置能否正常工作。
2. 测试插件的设置能否正常工作。

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

```release-note
None
```
2023-07-16 15:34:17 +00:00
Ryan Wang b1a6fe3446
feat: register the AnnotationsForm component globally (#4212)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.8.x

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

全局注册 AnnotationsForm 组件,以暴露给插件使用,让插件可以实现为模型设置 annotations 数据的功能。

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

Fixes #4183 

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

```release-note
Console 端全局注册 AnnotationsForm 组件,以暴露给插件使用
```
2023-07-14 04:18:10 +00:00
Ryan Wang efcf526f1b
refactor: logic of attachment data filtering (#4194)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.8.x

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

重构附件数据管理的筛选条件逻辑以及 UI。

<img width="1645" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/6b13045e-ab6b-4306-a1bb-f19d97115191">


Ref https://github.com/halo-dev/halo/pull/4182
Ref https://github.com/halo-dev/halo/issues/4181

#### Special notes for your reviewer:

需要测试:

1. 测试附件的筛选条件包括关键词筛选功能是否正常。

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

```release-note
重构 Console 端附件数据列表的筛选项 UI 和逻辑。
```
2023-07-13 03:31:17 +00:00
Ryan Wang 6bba5073fa
refactor: simplify the logic of the system settings tab (#4196)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.8.x

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

简化系统设置页面,选项卡的状态管理逻辑,放弃动态路由的模式,改为使用路由查询参数代替。

原由:https://github.com/halo-dev/halo/pull/4041#issuecomment-1622921084

#### Special notes for your reviewer:

需要测试:

1. 测试系统设置页面能否正常工作即可。

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

```release-note
重构 Console 端系统设置页面的路由结构
```
2023-07-12 06:19:15 +00:00
Ryan Wang bb0a5f114a
feat: record the post query conditions in the route query parameters (#4102)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.8.x

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

在文章数据管理列表页面路由中记录查询条件,包括分页信息、筛选信息等。可以保证在刷新页面或者从文章编辑页面返回时保留之前的查询状态。

<img width="1758" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/270948d6-d585-4b36-ad3a-93064cf47548">

TODO:

- [x] 记录筛选条件,因为路由参数只能使用基本类型,但是原来的筛选条件的变量都是完整对象。

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

Fixes #4098 

#### Special notes for your reviewer:

需要测试:

1. 文章管理列表的所有筛选项是否可以正常工作。
2. 尝试设置部分筛选,然后刷新页面,观察筛选条件是否正常保留。

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

```release-note
Console 端的文章管理列表支持在地址栏记录筛选条件。
```
2023-07-12 06:17:20 +00:00
Ryan Wang 197096305b
refactor: logic of comment data filtering (#4195)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.8.x

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

重构评论数据管理的筛选条件逻辑以及 UI。

<img width="1650" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/d89769bb-b8af-427e-a1ec-6ac8674131d3">

Ref https://github.com/halo-dev/halo/pull/4182
Ref https://github.com/halo-dev/halo/issues/4181

#### Special notes for your reviewer:

需要测试:

1. 测试评论的筛选条件包括关键词筛选功能是否正常。

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

```release-note
重构 Console 端评论数据列表的筛选项 UI 和逻辑。
```
2023-07-12 01:53:12 +00:00
Ryan Wang 119f352145
refactor: logic of post and singlepage data filtering (#4193)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.8.x

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

重构文章和页面数据管理的筛选条件逻辑以及 UI。

<img width="1646" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/154c5588-91c0-448d-aa39-d75e90bce6ca">


Ref https://github.com/halo-dev/halo/pull/4182
Ref https://github.com/halo-dev/halo/issues/4181

#### Special notes for your reviewer:

需要测试:

1. 测试文章的筛选条件包括关键词筛选功能是否正常。
2. 测试页面的筛选条件包括关键词筛选功能是否正常。

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

```release-note
重构 Console 端文章数据列表的筛选项 UI 和逻辑。
```
2023-07-11 07:15:10 +00:00
Ryan Wang f622b1787c
refactor: data list filter components (#4182)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.8.x

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

重构 Console 端数据列表的筛选项 UI,并提供全局的筛选列表组件和搜索输入框组件。

> 在此 PR 同时重构了插件列表和用户列表用于验证,其他页面后续提 PR 修改。

<img width="1657" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/ffa42184-46e6-4cb0-b39f-bd7b18869697">

重构之后可以获得:

1. 更好的代码组织。
2. 更好的使用体验。
3. UI 更加容易适配移动端。

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

Fixes #4181 

#### Special notes for your reviewer:

需要测试:

1. 测试插件管理和用户管理的数据列表筛选和关键词搜索功能是否正常。

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

```release-note
重构 Console 端数据列表的筛选项 UI,并提供全局的筛选列表组件和搜索输入框组件。
```
2023-07-07 08:23:06 +00:00
Ryan Wang c0aae3a63c
feat: make plugin tabs extensible (#4041)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.7.x

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

插件自身的详情页面中的 Tabs 选项卡支持拓展,允许开发者自行为插件编写设置界面、一些不常用的操作页面等。

示例:

<img width="1358" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/1e414e4e-688d-47de-907f-5f2a0afa9350">

扩展方式:

参考文档:https://github.com/ruibaby/halo/blob/feat/plugin-tabs-extend/console/docs/extension-points/plugin-self-tabs.md

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

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

#### Special notes for your reviewer:

需要测试:

1. 测试任意插件的详情页面是否能够正常使用。
2. 测试任意插件的设置表单能否正常使用。
3. 可以尝试根据文档为某个插件添加自定义的选项卡,测试是否能够正常工作。

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

```release-note
Console 端插件详情选项卡支持通过插件扩展。
```
2023-07-07 04:38:11 +00:00
John Niang bf2b92e77c
Prepare for next release 2.8.0 (#4168)
#### What type of PR is this?

/kind cleanup
/area core

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

- Update README
- Bump version to 2.8.0-SNAPSHOT

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

```release-note
None
```
2023-06-30 07:44:13 +00:00
Ryan Wang dcafee7e1f
chore: release 2.7.0 (#4158)
#### What this PR does / why we need it:

修改版本号,准备发布 2.7.0。

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

```release-note
None
```
2023-06-30 03:16:12 +00:00
guqing 529740a238
fix: creating a draft cannot be displayed in the post list (#4155)
#### What this PR does / why we need it:
此改动为还原 AbstractContentService 的 getContent 逻辑

当将 AbstractContentService 的 getContent 的查询改为 client.get 时会影响到文章 reconciler 的调用导致出错后一直requeue 所以无法完成文章逻辑处理。
<img width="633" alt="image" src="https://github.com/halo-dev/halo/assets/38999863/93743cac-f3db-4ff7-837c-bd42dfcf1280">
reconciler 这里获取 releaseSnapshot 时可能文章还是草稿,所以会导致调用 getContent 时多一次查询,所以最好是后续判断一下,当然这里已经在 getContent 判断了

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

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

```release-note
None
```
2023-06-30 03:04:16 +00:00