Commit Graph

23 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 baba8b9d24
chore: bump @halo-dev/richtext-editor version to alpha 24 (#4146) 2023-06-29 00:10:58 +08: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 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 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 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
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
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
Ryan Wang 48863addba
refactor: remove the codemirror of the component package and change it to built-in (#3926)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.6.x

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

从 `@halo-dev/components` 包中移除 VCodemirror 组件,改为由 Console 内置。因为观察到 VCodemirror 暂时无法支持 Tree Shaking,即代表如果在其他地方引入了 `@halo-dev/components`,就算没有使用 VCodemirror 组件,也会构建到生产产物。

此外,内置到 Console 之后,改为了异步加载此组件,即进入到使用了 VCodemirror 的组件的页面才会加载相应资源。

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

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

#### Special notes for your reviewer:

测试方式:

1. Console 需要 `pnpm build:packages`
2. 测试系统设置中的代码注入部分,观察输入框是否加载正常即可。

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

```release-note
None
```
2023-05-11 04:12:21 +00:00
Ryan Wang 61f4729d87
chore: bump tanstack query version and disable refetchOnWindowFocus option by default (#3771)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x

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

升级 @tanstack/vue-query 的版本至 [v4.29.1](https://github.com/TanStack/query/releases/tag/v4.29.1),并默认将 `refetchOnWindowFocus` 选项设置为 false。此选项的作用是当窗口重新聚焦时,刷新当前页面请求的状态(重新请求接口),目前暂时不需要使用它。

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

```release-note
升级 Console 端 `@tanstack/vue-query` 依赖的版本至 [v4.29.1](https://github.com/TanStack/query/releases/tag/v4.29.1)
```
2023-04-23 03:37:56 +00:00
Ryan Wang a2516dbef4
chore: bump @halo-dev/richtext-editor version to resolve i18n issue (#3682)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.5.x
/cherry-pick release-2.4

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

升级 `@halo-dev/richtext-editor` 的版本以解决编辑器翻译不完整的问题。

see https://github.com/halo-sigs/richtext-editor/pull/7

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

```release-note
升级 `@halo-dev/richtext-editor` 的版本以解决编辑器部分文本翻译不完整的问题。
```
2023-04-03 04:38:12 +00:00
Ryan Wang 04cda52379
chore: add FloatingDropdown to solve compatibility issues (#3622)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.4.x

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

重新在全局注册 FloatingDropdown 组件,因为在 https://github.com/halo-dev/halo/pull/3576 中移除之后,会导致插件无法正常加载 FloatingDropdown 组件,从而带来破坏更新。

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

Fixes #3621 

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

```release-note
None
```
2023-03-30 04:10:13 +00:00
Ryan Wang 8d9be88b94
chore: bump the patch version of all console dependencies (#3617)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.4.x

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

升级 Console 依赖的所有 patch 版本,由于升级了 prettier 的版本,可能发生了规则改变,所以同时包含重新格式化后的文件。

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

```release-note
None
```
2023-03-29 13:44:14 +00:00
Ryan Wang c9a5a01bf1
chore: bump @halo-dev/richtext-editor version to support i18n (#3613)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.4.x

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

升级 `@halo-dev/richtext-editor` 以支持 i18n。 https://github.com/halo-sigs/richtext-editor/pull/6

<img width="1406" alt="image" src="https://user-images.githubusercontent.com/21301288/228414222-e5014957-1d30-4fdc-9db6-0f79e07a73b5.png">
<img width="1432" alt="image" src="https://user-images.githubusercontent.com/21301288/228414283-a2d401cd-a215-4398-9d8d-b33e7373ee49.png">

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

Ref #3574 

#### Special notes for your reviewer:

在不同语言的浏览器中测试编辑器的语言是否显示正确即可。

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

```release-note
None
```
2023-03-29 06:16:12 +00:00
Ryan Wang 403702021c
perf: improve the style of the scrollbar (#3587)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.4.x

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

优化页面滚动条的样式,引入 [OverlayScrollbars](https://github.com/KingSora/OverlayScrollbars) 实现类似于 macOS 下的仅滚动时显示滚动条的特性,并保证在各个浏览器的表现一致。

![2023-03-26 13 44 04](https://user-images.githubusercontent.com/21301288/227757677-ca2709be-03bc-4bdd-a74c-2e42a452417a.gif)

#### Special notes for your reviewer:

测试方式:使用不同的浏览器测试滚动条是否可以自动隐藏以及样式是否一致即可。

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

```release-note
优化 Console 端页面滚动条的样式。
```
2023-03-27 09:20:22 +00:00
Ryan Wang 9a00a74f06
feat: add dropdown component to refactor the action buttons (#3576)
#### What type of PR is this?

/kind improvement
/area console
/milestone 2.4.x

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

在 `@halo-dev/components` 添加 Dropdown 组件用于统一 Console 端所有下拉框的样式和表现,同时方便插件使用。

<img width="1408" alt="image" src="https://user-images.githubusercontent.com/21301288/227758168-ed6f40ef-8627-4d5a-8a4a-476badf5196d.png">
<img width="992" alt="image" src="https://user-images.githubusercontent.com/21301288/227758184-01bf61a0-f778-4ba8-aaea-f6b99715b577.png">

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

Fixes #2987 

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

```release-note
Console 端添加 Dropdown 组件以统一所有下拉框的样式和表现。
```
2023-03-27 08:06:13 +00:00
Ryan Wang b63d2b882c
feat: add i18n supports for console (#3506)
#### What type of PR is this?

/kind feature

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

为 Console 端添加多语言的支持,并默认提供简体中文和英文的语言包。

todolist:

- [x] 完善 Console 的文字语言包翻译。
- [ ] ~~为后端提供的部分数据支持翻译,比如系统设置的表单定义。(实现方式待讨论,这个 PR 先不支持)~~
- [x] 提供语言设置。

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

Fixes #3346 

#### Special notes for your reviewer:

测试方式:

1. 检查各个页面的文字显示是否正常。
2. 测试中英文环境中是否使用了对应的语言包。

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

```release-note
Console 端支持多语言界面
```
2023-03-23 08:54:33 +00:00
Ryan Wang 69f7b18aad
chore: bump formkit version to 0.16.2 (#3527)
#### What type of PR is this?

/kind improvement
/area console

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

升级 FormKit 的版本到 0.16.2。

- https://formkit.com/changelog#0160-beta-16

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

```release-note
升级 Console 端的 FormKit 的版本到 0.16.2。
```
2023-03-18 02:38:33 +00:00
John Niang d192b8c956
Support logging in with encrypted password (#3480)
#### What type of PR is this?

/kind feature
/kind api-change
/area core
/area console
#### What this PR does / why we need it:

This PR creates AuthenticationWebFilter by ourselves instead of using FormLoginSpec directly. Because we have no chance to customize `org.springframework.security.web.server.authentication.ServerAuthenticationConverter` currently.

Meanwhile, we provide CryptoService(RSA) to generate key pair, get public key and decrypt message encrypted by public key.

There is a new endpoint to get public key which is used by console:

```bash
❯ curl localhost:8090/login/public-key -s | jq .
{
  "base64Format": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAouDtdDS751U8NcWfAAQ53ijEtkLnIHh1Thqkq5QHGslq2hBmWnNsIZFnc/bwVp00ImKLV2NtLgOuv5RRNS5iO+oqRvfOGdXLdW2nzqU2towtaMkYTEMJrsNMZp5BUNCGI7Z2xpPBZzvys0d1BvcpNFobX/LkOtcTyfB1DRp9ZAhxRYOZkTkCzaKo+6X11lnMexTsB3exzaXk9rRZ8XoJ+dWT5G0URs/PF2cDkgxuMdOFJzqDsb9HQYGI/etajdCcKs7mZsjmDgse9Cw9/3mgoTNnEGx9Wl89S0P+FJ7T5DALGt3/nSAlzmKdXJNBLf6Q44ogFpTWdq27JpJD3SKicQIDAQAB"
}
```

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

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

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

```release-note
支持登录时密码加密传输
```
2023-03-08 09:52:12 +00:00
Ryan Wang 80a3fa803f
chore: bump uppy version to fix crash on chrome browser (#3481)
#### What type of PR is this?

/kind bug

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

修复在非安全情况下(非 HTTPS 环境或本地环境),在 [Chromium](https://www.chromium.org/) 内核的浏览器下拖拽文件上传出现浏览器崩溃的问题。

修复来源:

- https://github.com/transloadit/uppy/releases/tag/uppy%403.6.0
- https://github.com/transloadit/uppy/pull/4310

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

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

#### Screenshots:

before:

![2023-03-08 10 59 02](https://user-images.githubusercontent.com/21301288/223609341-222f62d2-630a-4ee8-ba8f-2fb3c78fcca7.gif)

after:

![2023-03-08 11 00 06](https://user-images.githubusercontent.com/21301288/223609353-857f6559-cc9c-482f-9b46-713430621bb6.gif)

#### Special notes for your reviewer:

测试方式:

1. 需要先执行 `make -C console install` 以更新 Console 的依赖。
2. 使用非 localhost 或者 127.0.0.1 访问 Halo 后台,本地环境可以使用 192.168.x.x 访问。
3. 在 Console 的附件管理测试拖拽文件上传,观察浏览器是否崩溃。

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

```release-note
修复非 HTTPS 环境下,在 Chromium 内核浏览器拖拽上传文件时出现浏览器崩溃的问题。
```
2023-03-08 09:30:13 +00:00
Ryan Wang bc186a4225
chore: solving the issue of generating API client causing unnecessary diffs (#3465)
#### What type of PR is this?

/kind improvement

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

为 springdoc 添加 `writer-with-order-by-keys` 参数以固定 OpenAPI 中接口的参数顺序,防止重新生成 `api-client` 时因为参数顺序不同而造成不必要的 diff。

#### Special notes for your reviewer:

测试方式:

1. 反复执行 `make -C console api-client-gen`
2. 观察是否有产生 diff

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

```release-note
None
```
2023-03-07 14:14:14 +00:00
johnniang 64919f9a1b Move root to console
Signed-off-by: johnniang <johnniang@fastmail.com>
2023-03-02 15:49:22 +08:00