Commit Graph

146 Commits (bb0a5f114a59ffa0354ce4689026f7efa6344b74)

Author SHA1 Message Date
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
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
John Niang 4685bf4052
Add role template for managing cache (#4153)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.7.x

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

Add role template for managing cache. Anyone with role `role-template-manage-cache` can see the `Refresh Page Cache` button.

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

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

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

```release-note
None
```
2023-06-29 07:48:12 +00:00
John Niang 0d387eddf3
Enable configuration caching with separate names (#4151)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.7.x

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

Refactor configuration properties to configure caching with separate names, so that we can enable / disable cache with name.

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

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

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

```release-note
None
```
2023-06-29 07:02:11 +00:00
Ryan Wang baba8b9d24
chore: bump @halo-dev/richtext-editor version to alpha 24 (#4146) 2023-06-29 00:10:58 +08:00
Ryan Wang 8db4cec91e
feat: add support for inserting external media resources to the default editor (#4126)
#### What type of PR is this?

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

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

默认编辑器支持直接插入图片、视频、音频,提供除了附件库的媒体插入入口。

<img width="1011" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/4c9be243-882f-4d21-9fa8-ce3033744746">

通过链接插入图片需要 https://github.com/halo-sigs/richtext-editor/pull/17 的支持。

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

Fixes https://github.com/halo-dev/halo/issues/3882
Fixes https://github.com/halo-dev/halo/issues/3994

#### Special notes for your reviewer:

测试编辑器通过链接插入图片、视频、音频的功能是否正常。

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

```release-note
默认编辑器支持不通过附件库直接插入图片、视频、音频。
```
2023-06-28 09:54:11 +00:00
Ryan Wang 02e7068ee0
refactor: simplify request exception handling (#4129)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.7.x

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

简化请求异常提示的逻辑。

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

```release-note
None
```
2023-06-28 06:44:12 +00:00
John Niang d0526ec592
Add support for caching template rendering result (#4091)
#### What type of PR is this?

/kind feature
/area core

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

This PR adds dependency [spring-boot-starter-cache](https://docs.spring.io/spring-boot/docs/current/reference/html/io.html#io.caching) as cache framework and [caffeine](https://github.com/ben-manes/caffeine/wiki) as cache implementation to cache template rendering result.

By default, we disable the cache feature. If you want to enable it, please try to configure properties like this:

```yaml
halo:
  cache:
    disabled: false
```

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

Fixes #2827 

#### Special notes for your reviewer:

1. Start Halo
2. Browse any page twice
3. See the difference in request times

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

```release-note
支持模板渲染结果缓存
```
2023-06-26 14:38:00 +00:00
guqing 2791d2f0e5
refactor: uinify some properties of plugins and themes (#4061)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.7.x
/kind api-change

#### What this PR does / why we need it:
统一主题和插件描述文件的部分字段
1. 统一网站字段为 homepage,将主题的 website 标记为过时并兼容为 homepage
2. 主题添加 license 字段
3. 插件添加 repo

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

#### Does this PR introduce a user-facing change?
```release-note
统一主题和插件描述文件的部分字段
```
2023-06-26 14:33:58 +00:00
Ryan Wang e13beb4cd1
feat: add redirect support for social auth provider (#4063)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.7.x

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

三方登录时支持传入 `login_redirect_uri` 参数,以让三方登录提供方支持适配登录后重定向到具体页面的功能。

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

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

#### Special notes for your reviewer:

测试方式:

1. 可以使用 https://github.com/halo-sigs/plugin-oauth2/pull/33 进行测试。
2. 手动在登录页面构造如 https://127.0.0.1:8090/console/login?redirect_uri=/ 的地址,观察使用三方登录之后是否会跳转到指定页面。

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

```release-note
Console 端三方登录支持重定向参数。
```
2023-06-26 13:35:58 +00:00
Ryan Wang c39691d6fe
feat: make default editor extensible (#4090)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.7.x

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

默认编辑器支持扩展,包括输入类型、工具栏、Slash Command 等。

Ref https://github.com/halo-sigs/richtext-editor/pull/16

## 定义方式

```ts
import ExtensionFoo from "./tiptap/extension-foo.ts"

export default definePlugin({
  extensionPoints: {
    "default:editor:extension:create": () => {
      return [ExtensionFoo];
    },
  },
});
```

其中,`ExtensionFoo` 是一个 Tiptap Extension,可以参考 [Tiptap 文档](https://tiptap.dev/) 和 [https://github.com/halo-sigs/richtext-editor/blob/main/docs/extension.md](https://github.com/halo-sigs/richtext-editor/blob/main/docs/extension.md)。

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

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

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

```release-note
Console 端的默认编辑器支持被扩展
```
2023-06-26 13:33:59 +00:00
Ryan Wang 34d0f9369b
refactor: add legacy option for useClipboard hook to solve compatibility issues (#4114)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.7.x

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

Console 端部分使用了复制功能的页面,所使用的 useClipboard hook 添加 legacy 参数以解决部分浏览器的兼容问题。

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

Fixes #4113 

#### Special notes for your reviewer:

1. 使用路由地址(192.168.x.x)访问 Halo。
2. 测试附件详情弹框的链接复制和概览页面中的复制功能是否正常。

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

```release-note
优化 Console 端部分页面复制功能的兼容性问题。
```
2023-06-26 13:28:08 +00:00
Ryan Wang 27ef8d3bab
fix: dropdown options cannot be clicked in some mobile devices (#4116)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.7.x

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

修复在部分移动端浏览器(比如 iOS Safari)中,下拉框组件(VDropdown)的选项点击无效的问题,即没有触发 click 事件。此问题的原因可能是因为我们用的 floating-vue 组件提供的 `v-close-popper` 指令的兼容问题,最小复现:https://stackblitz.com/edit/vitejs-vite-ncpzhj?file=src%2FApp.vue

此 PR 改写了关闭下拉框的方式,不再使用 v-close-popper 指令,而且对其他使用此组件的地方没有破坏性更新。

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

Fixes https://github.com/halo-dev/halo/issues/3689
Ref https://github.com/halo-dev/halo/issues/2699

#### Special notes for your reviewer:

如果有条件可以在移动端测试一下,尤其是 iOS Safari,目前在桌面端 Chrome 的设备模拟中测试正常。

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

```release-note
修复 Console 端的下拉框组件选项在移动端无法正常点击的问题。
```
2023-06-26 13:21:57 +00:00
Ryan Wang 8c05a6d30e
feat: make comment subject ref provider extensible (#4039)
#### What type of PR is this?

/area console
/kind feature

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

让评论来源的显示支持通过插件扩展,目前如 [瞬间](https://github.com/halo-sigs/plugin-moments) 这类的插件如果使用了评论模块,那么在评论管理是无法显示具体来源的:

<img width="627" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/0df354dc-ed42-4217-abbd-5bce67329e0d">

此 PR 为 Console 端提供了拓展方法,使用方式如下:

```ts
import { definePlugin } from "@halo-dev/console-shared";
import type { CommentSubjectRefResult } from "@halo-dev/console-shared";
import type { Extension } from "@halo-dev/api-client";
import type { Moment } from "./types";

export default definePlugin({
  components: {},
  extensionPoints: {
    "comment:subject-ref:create": () => {
      return [
        {
          kind: "Moment",
          group: "moment.halo.run",
          resolve: (subject: Extension): CommentSubjectRefResult => {
            const moment = subject as Moment;
            return {
              label: "瞬间",
              title: determineMomentTitle(moment),
              externalUrl: `/moments/${moment.metadata.name}`,
              route: {
                name: "Moments",
              },
            };
          },
        },
      ];
    },
  },
});

```

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

Fixes #3554 

#### Special notes for your reviewer:

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

```release-note
Console 端的评论来源显示支持通过插件扩展
```
2023-06-26 04:20:18 +00:00
Ryan Wang ac47942a04
feat: add permission settings to dashboard widgets (#4112)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.7.x

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

为仪表板内置的小组件添加权限设置,解决部分没有权限的用户访问仪表盘提示异常的问题。

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

Fixes #4111 

#### Special notes for your reviewer:

测试方式:

1. 创建一个访客角色的用户。
2. 访问仪表盘,观察是否有异常提示,以及是否出现没有权限的小组件。

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

```release-note
Console 端仪表盘的内置小组件添加权限设置。
```
2023-06-26 04:12:16 +00:00
Ryan Wang 96225e4040
chore: improve the console project infrastructure (#4105)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.7.x

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

维护 Console 端的开发基础设施。

- 升级 TypeScript 以及 Vue 对于 TS 支持的相关包。
- 优化 packages 下所有包的配置,解决构建时生成 d.ts 文件的异常。
- 解决 TS 异常。

#### Special notes for your reviewer:

尝试执行:

1. pnpm build:packages
2. pnpm typecheck

观察是否正常即可。

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

```release-note
维护 Console 端的开发基础设施。
```
2023-06-26 03:54:17 +00:00
Ryan Wang f37085f5a6
perf: improve the text length style of the comment subject ref title (#4115)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.7.x

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

Fix style issue of the comment subject ref title.

before:

<img width="1386" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/d6c845d4-039b-42bb-855a-01c9ddf113ee">

after:

<img width="1390" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/0f53f3fb-ab59-4b12-9352-49623b121347">


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

Fixes #4068 

#### Special notes for your reviewer:

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

```release-note
None
```
2023-06-25 06:34:17 +00:00
Ryan Wang 1b6d081750
feat: add mouse hover style to the default type of button (#4108)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.7.x

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

为默认类型的按钮添加鼠标悬浮的样式。

<img width="333" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/922dd681-a2f1-4875-adef-9d1c5a075467">

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

Fixes #4067 

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

```release-note
Console 端默认类型的按钮添加鼠标悬浮的样式。
```
2023-06-25 06:28:14 +00:00
Ryan Wang e658097b99
fix: modal height issue in ios devices (#4106)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.7.x

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

优化 VModal 组件在 iOS 设备上底部和顶部被遮挡的问题,解决方案来自于:https://github.com/Faisal-Manzer/postcss-viewport-height-correction

| before                                                       | After                                                        |
| ------------------------------------------------------------ | ------------------------------------------------------------ |
| ![IMG_0319](https://github.com/halo-dev/halo/assets/21301288/71d15e51-5cf9-402e-b6ce-fff4e1014f72) | ![IMG_0315](https://github.com/halo-dev/halo/assets/21301288/6c3b4b75-2029-4b32-8dcc-eead3e479ab1) |
| ![IMG_0318](https://github.com/halo-dev/halo/assets/21301288/b4f586b4-34e1-48ea-97ed-7f1f70184346) | ![IMG_0316](https://github.com/halo-dev/halo/assets/21301288/7dee64bb-2328-44ef-a9f6-534ea4c005fe) |

<!--fuck apple, fuck safari-->

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

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


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

```release-note
优化 Console 端弹框组件(VModal)在 iOS 设备的高度问题。
```
2023-06-25 02:06:14 +00:00
Ryan Wang f6a6b25dd6
chore: bump formkit version to 0.17.3 (#4103)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.7.x

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

升级 FormKit 的版本至 0.17.3

- https://formkit.com/changelog
- https://github.com/formkit/formkit/releases/tag/0.17.0
- https://github.com/formkit/formkit/releases/tag/0.17.3

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

Fixes #3951 

#### Special notes for your reviewer:

测试 Console 端各个表单功能是否正常即可。

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

```release-note
升级 Console 端 FormKit 的依赖版本至 0.17.3
```
2023-06-21 08:28:13 +00:00
Ryan Wang 2fd9cbde33
feat: add support for selecting the parent category when creating a new category (#4056)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.7.x

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

支持在创建分类的时候选择上级分类。

<img width="805" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/02912f70-4de4-4b8e-bbbe-f973fbd3e684">

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

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

#### Special notes for your reviewer:

测试方式:

1. 测试新建的时候指定上级分类的功能是否正常。
2. 点击某个分类的操作按钮,选择添加子分类的菜单项,检查在新建分类的表单中上级分类是否选中了此分类。

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

```release-note
Console 端的文章分类支持在新建时指定上级分类。
```
2023-06-19 02:54:11 +00:00
Ryan Wang 4a1fe8dd1e
perf: disallow repeated clicks when third-party login (#4066)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.7.x

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

在使用某个三方登录的时候,禁用其他三方登录,防止重复点击。

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

Fixes #4064 

#### Special notes for your reviewer:

测试方式:

1. 可安装 https://github.com/halo-sigs/plugin-oauth2 进行测试,可以不用配置各个登录方式,只需开启即可。
2. 在登录页面点击某个三方登录方式,观察所有三方登录方式的按钮是否被禁用。

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

```release-note
优化 Console 端登录页面的三方登录方式按钮,禁用重复点击。
```
2023-06-19 02:36:10 +00:00
longjuan 1b581d5d6f
perf: remove html lang attribute in console (#4085)
#### What type of PR is this?
/kind improvement
/area console

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

去除`index.html`的`lang`属性以避免console端出现翻译提示

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

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

#### Special notes for your reviewer:

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


```release-note
避免 Console 端出现翻译提示
```
2023-06-19 01:30:10 +00:00
John Niang 02369fbd3c
Add rate limiter for login endpoint (#4062)
#### What type of PR is this?

/kind feature
/area core

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

This PR introduces https://github.com/resilience4j/resilience4j to archive the feature. The login endpoint has limited login failures at a rate of 3 per minute.

See https://github.com/halo-dev/halo/issues/4044 for more.

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

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

#### Special notes for your reviewer:

1. Start Halo.
2. Try to login with incorrect credential 4 times
3. Check the response.

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

```release-note
增加登录失败次数限制功能
```
2023-06-16 04:50:12 +00:00
Ryan Wang 65b27eed6c
chore: release 2.6.0 (#4021)
#### What type of PR is this?

/area core

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

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

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

```release-note
None
```
2023-06-01 03:08:12 +00:00
Ryan Wang b37ec04c87
perf: improve the experience of redirection after login (#4014)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.6.x

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

优化 Console 端登录之后重定向的体验,解决在重定向时会重新显示登录页面的问题。

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

Fixes #4010 

#### Special notes for your reviewer:

测试方式与 https://github.com/halo-dev/halo/pull/3989 相同。

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

```release-note
None
```
2023-05-31 06:55:01 +00:00
Ryan Wang ee1ea06171
fix: text content overflowing the container in the dialog component (#4007)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.6.x

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

修复 Console 端 Dialog 对话框组件中的文字内容可能会溢出容器的问题。

before:

<img width="623" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/ca9817c6-66e4-41f0-8112-4308913efcf2">

after:

<img width="666" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/9d64ee23-124c-434a-b8da-669cfd727dd0">


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

Fixes #4006 

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

```release-note
修复 Console 端 Dialog 对话框组件中的文字内容可能会溢出容器的问题。
```
2023-05-29 11:38:56 +00:00
Ryan Wang e95caa2c21
refactor: use createWebHistory instead of createWebHashHistory (#4005)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.6.x

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

将 Console 的 Router 模式从 Hash History 改为 Web History。可以让路由看起来更加简洁,也方便在后端或者页面上构建路由。

文档:https://router.vuejs.org/zh/guide/essentials/history-mode.html

#### Special notes for your reviewer:

测试 Console 的各个页面是否正常访问即可。

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

```release-note
修改 Console 的路由模式为 HTML5 模式。
```
2023-05-29 08:48:55 +00:00
Ryan Wang 67e13546ae
chore: bump up version to 2.6.0-rc.1 (#3998)
#### What this PR does / why we need it:

修改版本号,准备发布 2.6.0-rc.1。

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

```release-note
None
```
2023-05-26 15:06:13 +00:00
guqing 710261b035
feat: add the ability to install plugins remotely via URI (#3963)
#### What type of PR is this?
/kind feature
/area core
/area console
/milestone 2.6.x
/kind api-change

#### What this PR does / why we need it:
支持通过 URI 远程安装和升级插件

how to test it?
1. 测试插件安装
```shell
curl -u admin:admin -X POST http://localhost:8090/apis/api.console.halo.run/v1alpha1/plugins/-/install-from-uri --data '{
  "uri": "https://halo.run/apis/api.store.halo.run/v1alpha1/applications/app-KhIVw/releases/app-release-canxF/download/app-release-canxF-znFre"
}'
```
2. 测试插件升级
```shell
curl -u admin:admin -X POST http://localhost:8090/apis/api.console.halo.run/v1alpha1/plugins/PluginFeed/upgrade-from-uri --data '{
  "uri": "https://halo.run/apis/api.store.halo.run/v1alpha1/applications/app-KhIVw/releases/app-release-canxF/download/app-release-canxF-znFre"
}'
```
#### Which issue(s) this PR fixes:
Fixes #2292

#### Does this PR introduce a user-facing change?
```release-note
支持通过 URI 远程安装和升级插件
```
2023-05-26 14:54:16 +00:00
guqing da5fb1a252
feat: implement a feature for previewing posts and single pages (#3983)
#### What type of PR is this?
/kind feature
/area core
/area console
/milestone 2.6.x

#### What this PR does / why we need it:
新增文章和自定义页面预览功能

提供了以下两个路由用于预览,必须登录且是对应文章或自定义页面的 contributors 才能访问,如果不是 contributor 则先得到没有权限访问异常,如果有权限访问但预览文章不存在则得到 404
- 文章预览 `GET /preview/posts/{name}`
- 自定义页面预览 `GET /preview/singlepages/{name}`

两个路由都可以通过查询参数 snapshotName 来指定需要预览的内容快照,它是可选的,默认为当前正在编辑的内容

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

Fixes #2349

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

```release-note
新增文章和自定义页面预览功能
```
2023-05-25 14:54:18 +00:00
Ryan Wang 533f0cfa66
feat: prompt to upgrade theme when installing existing theme (#3970)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.6.x

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

支持在安装已存在主题时提示是否升级主题。

<img width="611" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/2e99c781-96b6-4900-9a37-2d472ad65411">
<img width="604" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/a7bfa9d8-1522-417f-91b4-6ea3f75f693e">


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

Fixes #3969 

#### Special notes for your reviewer:

测试方式:

1. 通过本地上传和远程下载的方式重复安装某个主题,观察是否可以正常提示升级以及测试升级是否正常。

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

```release-note
Console 端支持安装已存在主题时提示升级主题。
```
2023-05-25 14:40:18 +00:00
Ryan Wang 6dd98d2c0c
feat: add min and max props for repeater input (#3965)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.6.x

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

Console 端的 FormKit Repeater 输入框支持 min 和 max 参数用于限制项目数量。

<img width="630" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/541da770-0439-4731-a796-a58277c33e05">

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

Fixes #3449 

#### Special notes for your reviewer:

定义方式:

```yaml
- $formkit: repeater
  name: test_repeater
  label: 测试 Repeater
  min: 2
  max: 3
  children:
    - $formkit: text
      name: test_text
      label: 测试 Text
    - $formkit: select
      name: test_select
      label: 测试 Select
      options:
        - value: prose-gray
          label: prose-gray
        - value: prose-slate
          label: prose-slate
        - value: prose-zinc
          label: prose-zinc
        - value: prose-neutral
          label: prose-neutral
        - value: prose-stone
          label: prose-stone
```

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

```release-note
Console 端的 FormKit Repeater 输入框支持 min 和 max 参数用于限制项目数量。
```
2023-05-25 14:38:19 +00:00
Ryan Wang 537d511cc0
feat: login page supports redirect_uri parameter (#3989)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.6.x

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

Console 端的登录页面支持登录之后重定向到某个链接(通过 redirect_uri 参数)。

支持一下链接形式:

1. 相对地址,比如 `/console#/plugins`、`/apps/app-links`
2. 绝对地址,仅限于同源地址,不支持非同源地址的重定向。

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

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

#### Special notes for your reviewer:

测试方式:

1. 在未登录的情况下访问如 `http://127.0.0.1:8090/console#/theme` 地址,观察登录之后是否会返回到这个页面。
2. 手动在登录页面构造如 `https://127.0.0.1:8090/console#/login?redirect_uri=/` 的地址,观察登录之后是否会跳转。

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

```release-note
Console 端的登录页面支持登录之后重定向到某个站内链接。
```
2023-05-25 14:30:18 +00:00
Ryan Wang 846138fe8c
chore: bump uppy packages (#3980)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.6.x

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

升级 Uppy 的所有 packages。

#### Special notes for your reviewer:

测试所有上传弹框是否可以正常使用即可。

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

```release-note
None
```
2023-05-25 13:38:18 +00:00
guqing d5f6dc2207
refactor: sorting parameters to maintain a unified API style (#3956)
#### What type of PR is this?
/kind improvement
/area core
/area console
/kind api-change
/milestone 2.6.x

#### What this PR does / why we need it:
重构排序参数以统一自定义 APIs 的风格
- 文章的排序参数字段名改为 `creationTimestamp`、`publishTime` 查询参数示例为 sort=creationTimestamp,desc
- 自定义页面排序参数字段名同文章
- 评论排序参数字段名为 `creationTimestamp`,`replyCount`,`lastReplyTime` 查询参数示例为 sort=creationTimestamp,desc

需要 Console 适配
#### Which issue(s) this PR fixes:

Fixes #3464

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

```release-note
重构排序参数以统一自定义 APIs 的风格
```
2023-05-25 12:42:17 +00:00
Ryan Wang a6c923d83d
chore: bump eslint and prettier related packages version (#3981)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.6.x

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

升级 ESLint 和 Prettier 相关的包。

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

```release-note
None
```
2023-05-22 08:56:05 +00:00
翟佳宇 c22f158fa3
fix: fix plugin detail page protocol name duplication issue (#3977)
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->

#### What type of PR is this?
/kind bug
<!--
添加其中一个类别:
Add one of the following kinds:

/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement

适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:

/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

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

修复插件详情页面协议名字重复出现的问题

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

<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes https://github.com/halo-dev/halo/issues/3971

#### Special notes for your reviewer:

#### 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
NONE
```
2023-05-22 03:01:47 +00:00
翟佳宇 c3d01dd7c4
perf: improve the logic of input selection for category and tag (#3978)
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/master/CONTRIBUTING.md>.
2. 请根据你解决问题的类型为 Pull Request 添加合适的标签。
2. Please label this pull request according to what type of issue you are addressing, especially if this is a release targeted pull request.
3. 请确保你已经添加并运行了适当的测试。
3. Ensure you have added or ran the appropriate tests for your PR.
-->

#### What type of PR is this?
/kind improvement
<!--
添加其中一个类别:
Add one of the following kinds:
/kind improvement
/kind bug
/kind cleanup
/kind documentation
/kind feature
/kind improvement

适当添加其中一个或多个类别(可选):
Optionally add one or more of the following kinds if applicable:

/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

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

改善分类和标签选择性输入框的输入逻辑

![Kapture 2023-05-22 at 01 20 41](https://github.com/halo-dev/halo/assets/106857035/cf2d60f5-9ec5-4e5c-99e2-e3cd7a97d692)


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

<!--
PR 合并时自动关闭 issue。
Automatically closes linked issue when PR is merged.

用法:`Fixes #<issue 号>`,或者 `Fixes (粘贴 issue 完整链接)`
Usage: `Fixes #<issue number>`, or `Fixes (paste link of issue)`.
-->
Fixes #3959

#### Special notes for your reviewer:

#### 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
NONE
```
2023-05-22 02:46:45 +00:00
b1d95fe06d
fix: add keyword search functionality to AuthProvider list (#3974)
#### What type of PR is this?

/kind bug

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

添加关键字搜索功能到认证方式列表

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

Fixes #3948

#### Special notes for your reviewer:

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


```release-note
修复 Console 端认证方式列表无法使用搜索的问题。
```
2023-05-19 16:29:50 +00:00
guqing 170cf4e412
feat: add the ability to install themes remotely via URI (#3939)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.6.x
/kind api-change

#### What this PR does / why we need it:
支持通过 URI 远程安装和升级主题

how to test it?
1. 测试主题安装
```shell
curl -u admin:admin -X POST http://localhost:8090/apis/api.console.halo.run/v1alpha1/themes/-/install-from-uri --data '{
  "uri": "https://halo.run/apis/api.store.halo.run/v1alpha1/applications/app-eiTyL/releases/app-release-QSyjc/download/app-release-QSyjc-JOSOB"
}'
```
2. 测试主题升级
```shell
curl -u admin:admin -X POST http://localhost:8090/apis/api.console.halo.run/v1alpha1/themes/guqing-higan/upgrade-from-uri --data '{
  "uri": "https://halo.run/apis/api.store.halo.run/v1alpha1/applications/app-eiTyL/releases/app-release-QSyjc/download/app-release-QSyjc-JOSOB"
}'
```
#### Which issue(s) this PR fixes:

Fixes #2291

#### Does this PR introduce a user-facing change?
```release-note
支持通过 URI 远程安装和升级主题
```

---------
Co-authored-by: Ryan Wang <i@ryanc.cc>
2023-05-19 02:10:24 +00:00
Ryan Wang 8deea08231
refactor: abnormal status display of plugin management (#3945)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.6.x

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

重构 Console 端插件异常状态的判断和显示,改动如下:

1. 移除插件名称旁边的启用状态。
2. 切换按钮的状态是期望值,意思就是不与插件实际状态一致。
3. 小红点出现的时机为:插件的实际状态与期望状态不一致以及插件本身出了异常。
4. 插件详情页面支持横幅显示插件异常状态。

<img width="1358" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/42408d1f-7975-4aef-9373-d828994501b3">
<img width="1383" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/033efdef-470b-4570-94c1-da64d9ea0db9">

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

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

#### Special notes for your reviewer:

测试方式:

1. 想办法将插件状态变成异常,比如在开发环境将 runtime-mode 改为 deployment。
2. 检查 Console 端插件管理中的 UI 表现是否和上面的描述一致。

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

```release-note
重构 Console 插件管理的异常状态显示。
```
2023-05-17 03:54:15 +00:00
Ryan Wang 017d5b8d8f
chore: async api client (#3941)
#### What type of PR is this?

/kind improvement
/area console

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

同步 api client。

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

```release-note
None
```
2023-05-16 10:18:51 +00:00
Ryan Wang 0ff11db111
refactor: improve the accessibility of action items in some data list (#3919)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.6.x

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

1. 移除 Entity 组件最外层容器的手型样式,避免出现可点击性的误导。
2. 为部分数据列表项操作提供更多的访问选项。
    1. 文章 / 页面列表添加编辑按钮。
    2. 插件列表项添加详情按钮。
    3. 附件列表项添加详情按钮。

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

Fixes #3914 

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

```release-note
优化 Console 端部分数据列表的可访问性
```
2023-05-16 10:16:55 +00:00
Li 136bd4e91f
fix: theme page displays error without management permissions. (#3938)
#### What type of PR is this?
/kind bug
/area console
/milestone 2.6.x

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

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

Fixes #3933 

#### Special notes for your reviewer:

1. 创建一个拥有主题查看而没有主题管理权限的角色,并为某个用户分配这个角色。
2. 使用该用户登录 console,点击主题选项卡查看控制台是否报错。

#### Does this PR introduce a user-facing change?
```release-note
修复没有主题管理权限时,进入主题功能页面报错的问题。
```
2023-05-15 06:43:55 +00:00
Ryan Wang 017bb55521
chore: bump pnpm version to 8 (#3935)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.6.x

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

升级 pnpm 的版本为 pnpm 8,更新 pnpm-lock.yaml 文件。

GitHub Actions 的改动将在 https://github.com/halo-sigs/actions

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

Fixes #3934 

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

```release-note
None 
```
2023-05-11 08:50:21 +00:00