Commit Graph

299 Commits (16641e3331e92b080150d9b39dfc4af406e297cc)

Author SHA1 Message Date
Ryan Wang b673e4a24f
chore: regenerate API client (#6229)
#### What type of PR is this?

/area ui
/kind cleanup

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

重新生成 api client,移除无用的文件。并且此 PR 改进了生成的脚本,会在生成前删除旧的 api client 文件,保证不会遗留旧文件。


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

```release-note
None
```
2024-07-01 07:01:17 +00:00
Ryan Wang d92bb4398e
refactor: refine extension settings page (#6231)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.17.x

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

完善插件扩展设置页面:

1. 完善 i18n。
2. 将入口移动至插件页面右上角的操作按钮区域。

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

```release-note
None 
```
2024-07-01 06:43:17 +00:00
Ryan Wang f3f48e2753
feat: refine 2fa-related i18n (#6228)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.17.x

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

补充 2FA 相关的 i18n 定义。

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

```release-note
None
```
2024-07-01 06:41:16 +00:00
longjuan 2c454ccb28
feat: add disabled state styling to checkboxes (#6220)
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/main/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/main/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?

<!--
添加其中一个类别:
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
-->
/area ui
/kind improvement
#### What this PR does / why we need it:
当前多选框disabled与非disabled样式上无区别,不好分辨。
#### 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/5974

#### Special notes for your reviewer:
![image](https://github.com/halo-dev/halo/assets/28662535/f3a3b683-4964-4701-a14e-3b12b0af26c1)

#### 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
增加多选框disabled样式
```
2024-07-01 03:19:17 +00:00
Ryan Wang ceb97458d4
fix: correct the kind definition in the Device extension (#6222)
#### What type of PR is this?

/area core
/kind bug
/milestone 2.17.x

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

修复 Device 模型中,Kind 定义错误的问题。

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

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

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

```release-note
None 
```
2024-07-01 03:05:16 +00:00
Ryan Wang c1ca8d14b7
feat: add slug generation rules to post saving feature in the post editing page (#6205)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.17.x

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

支持在文章编辑页面创建文章时,也应用别名生成规则

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

Fixes https://github.com/halo-dev/halo/issues/5118
Fixes https://github.com/halo-dev/halo/issues/6155

#### Special notes for your reviewer:

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

```release-note
支持在文章编辑页面创建文章时,也应用别名生成规则
```
2024-06-29 16:37:20 +00:00
Ryan Wang bae53f59ea
fix: resolve issue with secret input saving additional data (#6196)
#### What type of PR is this?

/kind bug
/area ui
/milestone 2.17.x

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

修复 Secret Input 保存之后会多出 Secret Form 中数据的问题。

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

Fixes #6193 

#### Special notes for your reviewer:

测试方式:

1. 在保存 Secret 的表单选项前,打开一次编辑 Secret 的对话框。
2. 保存数据,检查内容是否多出了其他数据。

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

```release-note
None
```
2024-06-29 16:35:21 +00:00
BugKing 2fe1b54f9d
Make front-end scripts compatible with Windows environment (#6202)
#### What type of PR is this?

/kind improvement

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

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


#### Special notes for your reviewer:

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

```release-note
None
```
2024-06-28 13:49:00 +00:00
Ryan Wang f0445f4e51
refactor: remove page cache feature (#6108)
#### What type of PR is this?

/area core
/kind api-change
/milestone 2.17.x

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

移除内置的页面静态缓存功能,后续将由 https://github.com/halo-sigs/plugin-page-cache 插件提供。

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

Fixes #5639 

#### Special notes for your reviewer:

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

```release-note
移除内置的页面静态缓存功能,后续由 https://github.com/halo-sigs/plugin-page-cache 插件提供。
```
2024-06-28 10:08:59 +00:00
Ryan Wang 80e1110da2
feat: restrict deletion of the primary menu (#6203)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.17.x

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

添加对菜单的限制,不能删除已经设置为主菜单的菜单。

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

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

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

```release-note
None
```
2024-06-28 08:18:59 +00:00
Ryan Wang fc35e69766
chore: add types path to ui-plugin-bunlder-kit package.json (#6169) 2024-06-27 18:13:57 +08:00
Ryan Wang bb0a3bc467
feat: add support for setting an owner for posts (#6178)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.17.x

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

支持手动为文章设置作者。

<img width="734" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/b91b1754-4f50-4333-8478-6735d5846847">


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

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

#### Special notes for your reviewer:

需要测试:

1. 打开任意文章的设置,在高级中设置作者并保存,观察是否成功。
2. 选择一批文章,点击批量设置,设置一个作者,观察是否设置成功。

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

```release-note
支持手动为文章设置作者。
```
2024-06-27 10:10:55 +00:00
Ryan Wang 9d478eecf9
feat: add secret select input (#6140)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.17.x

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

为 FormKit 添加 Secret 选择组件。

<img width="749" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/5100d7c0-89c0-48d3-9db5-7de67504686e">

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

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

#### Special notes for your reviewer:

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

```release-note
为 FormKit 添加 Secret 选择组件。
```
2024-06-27 10:08:55 +00:00
Takagi 0f6722a37e
pref: add the option to open a new window to the picture jump link (#6170)
#### What type of PR is this?

/kind improvement
/area editor
/milestone 2.17.x

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

为图片跳转链接增加在新窗口打开的选项。

#### How to test it?

测试新窗口打开是否正常可用。

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

Fixes #6109 

#### Does this PR introduce a user-facing change?
```release-note
默认编辑器图片跳转链接支持配置新窗口打开
```
2024-06-27 10:04:54 +00:00
Ryan Wang fc57978aa2
fix: text style in extension point definition page (#6179)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.17.0

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

修复插件扩展点设置页面标题的颜色问题。

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

```release-note
None
```
2024-06-27 09:48:55 +00:00
Ryan Wang 4d22bc3bbb
refactor: improve the content area width of the editor for low-resolution screens (#6175)
#### What type of PR is this?

/area ui
/area editor
/kind improvement
/milestone 2.17.x

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

优化文章编辑器内容区域在低分屏下的表现。

默认:

<img width="1898" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/bfca69e5-29cf-45d9-8757-0952fd2a129c">


小屏幕:

<img width="1043" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/88efbeed-fe0c-4b78-b435-f6352dbd8d27">


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

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

#### Special notes for your reviewer:

建议测试在各个屏幕下的表现。

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

```release-note
优化文章编辑器内容区域在低分屏下的表现。
```
2024-06-27 09:46:54 +00:00
Takagi ab14157def
pref: add folding function to code blocks (#6177)
#### What type of PR is this?

/kind improvement
/area editor
/milestone 2.17.x

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

为默认编辑器代码块增加折叠功能。

<img width="892" alt="image" src="https://github.com/halo-dev/halo/assets/31335418/8325cba9-08ce-4bd7-98b6-6bc28fe52daf">

#### How to test it?

测试折叠功能是否可用。
测试重新打开文章之后代码块是否仍旧处于折叠状态。

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

Fixes #6166

#### Does this PR introduce a user-facing change?
```release-note
为默认编辑器代码块增加折叠功能
```
2024-06-27 09:42:54 +00:00
Ryan Wang c59c61b251
fix: vue injection warn (#6168)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.17.x

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

Fix the vue injection warn in browser console

<img width="559" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/4160cbe4-fe8b-4b30-a1db-57d35d78e4f9">

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

```release-note
None 
```
2024-06-27 08:08:56 +00:00
Ryan Wang f277655e11
docs: update readme for api client package (#6167)
#### What type of PR is this?

/area ui
/kind documentation
/milestone 2.17.x

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

更新 `@halo-dev/api-client` 包的 readme。

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

```release-note
None
```
2024-06-27 07:16:54 +00:00
Takagi cc36ddaec5
pref: block-level content actively sets fakeSelection (#6162)
#### What type of PR is this?

/kind improvement
/area editor
/milestone 2.17.x

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

由于 RangeSelection 可能将一些并不想展示为模拟选中效果的节点进行了转换,因此将 RangeSelection 中模拟选中的效果,由默认的自动设置为 true,变为 false。

之后需要由节点自行设置 `fakeSelection: true` 后才会展示为模拟选中的效果,否则保持原本的选择样式。

#### How to test it?

测试使用 Mod-a 全选后,listItem 等节点是否会展示为模拟选中的效果。

#### Does this PR introduce a user-facing change?
```release-note
None
```
2024-06-27 07:14:55 +00:00
Ryan Wang 28e4ef0756
fix: clear extension definition options after switching extension points (#6165)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.17.x

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

修复在扩展点设置页面切换扩展点定义后,扩展定义的选项被清空的问题。

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

Fixes #6164 

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

```release-note
修复在扩展点设置页面切换扩展点定义后,扩展定义的选项被清空的问题。
```
2024-06-27 07:12:53 +00:00
John Niang 632bb69dfe
Refactor search engine and improve document extensibility (#6082)
#### What type of PR is this?

/kind improvement
/kind api-change
/area core

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

See https://github.com/JohnNiang/halo/blob/refactor/search/docs/extension-points/search-engine.md for more

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

Fixes https://github.com/halo-dev/halo/issues/5202
Fixes https://github.com/halo-dev/halo/issues/5339
Fixes https://github.com/halo-dev/halo/issues/5613
Fixes https://github.com/halo-dev/halo/issues/5172
Fixes https://github.com/halo-dev/halo/issues/4796
Fixes https://github.com/halo-dev/halo/issues/5625
Fixes https://github.com/halo-dev/halo/issues/5805

#### Special notes for your reviewer:

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

```release-note
重构搜索引擎并提高可扩展性。
```
2024-06-26 15:22:51 +00:00
Ryan Wang 5eabce7544
feat: add management and view pages for extension points (#6137)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.17.x

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

添加扩展点的查看和设置页面。

<img width="1414" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/4dd4660f-540f-46b5-8250-b4f011ebaae6">

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

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

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

```release-note
添加系统扩展点的查看和设置页面。
```
2024-06-26 13:58:51 +00:00
Ryan Wang 49c4a917e1
fix: resolve style issues caused by changing the order of CSS imports (#6153)
#### What type of PR is this?

/area ui
/kind bug

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

修复 https://github.com/halo-dev/halo/pull/6152 中因为改动了 css 文件的导入顺序带来的样式问题。

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

```release-note
None
```
2024-06-26 11:36:50 +00:00
Ryan Wang bc1033611e Refine UI for categories hiden 2024-06-26 19:25:10 +08:00
John Niang 59edade8bb
Merge pull request #6100 from guqing/feature/6023 2024-06-26 19:19:46 +08:00
Takagi 73798e86c6
feat: add gap cursor for top-level block nodes in default editor (#6103)
#### What type of PR is this?

/kind feature
/area editor
/milestone 2.17.x

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

目前想对块级节点进行换行是一件比较困难的事情,尤其是两个相邻的块级节点之间的想插入额外的一行时更加困难。间隙光标可以解决这一问题。

为默认编辑器的顶级块节点(pos.depth = 1)增加间隙光标的功能。当 NodeType 属性 `allowGapCursor` 为 true 时,将会在目标节点上启用间隙光标的功能。间隙光标将可能出现在目标节点的左上方与右下方。

<img width="909" alt="image" src="https://github.com/halo-dev/halo/assets/31335418/fbbdc8fe-59c9-4ae3-a7c8-97a90607c785">

已知问题:
1. 对于 inlineContent 的节点,点击生成间隙光标时,光标会先出现在对应的内容上,会出现闪动的问题。
2. 在间隙光标上使用组合输入(例如中文输入)时,首个字母会被新增至新的一行。
3. CodeBlock 无法使用间隙光标(CodeBlock 自身问题,待适配)
~~4. 首行空文本无法被删除(与 Gap Cursor 问题无关,待适配  Paragraph)~~
~~5. 删除文本上方有可以添加间隙光标的块级节点时,无法触发间隙光标的 Backspace 事件(同 4,属于 Paragraph 适配问题)~~

目前已经启用此功能的节点:

- 表格
- 分栏卡片
- CodeBlock (无法生效)

#### How to test it?

测试间隙光标是否能够在表格与分栏卡片上出现。
测试间隙光标出现后,输入文本、使用快捷键等操作是否符合逻辑。
测试使用方向键调整间隙光标位置。

#### Does this PR introduce a user-facing change?
```release-note
为默认编辑器的块级节点增加间隙光标的功能。
```
2024-06-26 11:18:50 +00:00
Ryan Wang 2c9d94f034 Refine UI for device managment 2024-06-26 18:53:24 +08:00
Ryan Wang a93479dc34
chore: organize and fix imports (#6152)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.17.x

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

重新组织和固定 UI 部分代码的 imports 导入,防止后续因为 imports 的顺序造成不必要的 diff。

基于:https://github.com/halo-dev/halo/pull/6151

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

```release-note
None
```
2024-06-26 10:42:50 +00:00
Takagi 5aacd8a252
pref: editor iframe risk with src tag (#6150)
#### What type of PR is this?

/kind improvement
/area editor
/milestone 2.17.x

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

在用户设置 iframe 相关的 src 时,检测设置的链接是否符合白名单。如果不符合则不允许设置。

see https://github.com/ueberdosis/tiptap/pull/5160

#### How to test it?

测试在 iframe 中的 src 输入 `javascript: alert("1")` 时是否会触发 javascript

#### Does this PR introduce a user-facing change?
```release-note
处理默认编辑器中 iframe 标签的 src 属性可能存在的风险
```
2024-06-26 10:24:50 +00:00
Ryan Wang ed6a5e3898
chore: add vscode settings.json (#6151)
Signed-off-by: Ryan Wang <i@ryanc.cc>
2024-06-26 18:07:53 +08:00
Ryan Wang 2ae5d222d9
feat: add batch setting for partial post fields (#6142)
#### What type of PR is this?

/kind feature
/area ui
/milestone 2.17.x

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

支持批量为文章设置部分属性。

![image](https://github.com/halo-dev/halo/assets/21301288/cc4aa912-20ba-4b50-869b-705702f56d7d)

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

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

#### Special notes for your reviewer:

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

```release-note
支持批量为文章设置部分属性。
```
2024-06-26 09:58:50 +00:00
Takagi 5d5df7c7a9
feat: add dynamic list input (#6146)
#### What type of PR is this?

/kind feature
/area ui
/milestone 2.17.x

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

为 formkit 增加动态列表的 input。

使用方式:

```
- $formkit: list
  name: users
  label: Users
  addLabel: Add User
  min: 1
  max: 3
  itemType: string
  children:
    - $formkit: text
      index: "$index"
      validation: required
```

> [!NOTE]
> `list` 组件有且只有一个子节点,并且必须为子节点传递 `index` 属性。若想提供多个字段,则建议使用 `group` 组件包裹。

#### How to test it?

测试动态数组是否正常可用。保存的结果是否为 `{users: ["", ""]}`

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

Fixes #6098

#### Does this PR introduce a user-facing change?
```release-note
为 Formkit 增加动态列表的 input 组件 list
```
2024-06-26 09:48:49 +00:00
guqing ae6724a2b6
feat: implement persistent token based remember me mechanism (#6131)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.17.x

#### What this PR does / why we need it:
新增基于持久化 Token 的 RememberMe 机制

本次更新引入了一种新的 RememberMe 机制,该机制基于持久化 Token,以增强安全性和管理灵活性。在此之前,RememberMe 功能通过以下方式生成 Token,并将其作为 cookie 发送回客户端:
```
 username + ":" + expiryTime + ":" + algorithmName + ":"
   + algorithmHex(username + ":" + expiryTime + ":" + password + ":" + key)
```
此方法的优点在于无需存储 Token 就可以进行验证,并且用户密码的更改会自动使 Token 失效。然而,它的主要缺点是缺乏管理能力,例如无法手动撤销 Token。

鉴于最新的设备管理需求(见 PR #6100),我们需要一种支持设备撤销(revoke)的机制。因此,我们采用了持久化 Token 的方式,并通过随机生成的方法来提高安全性,而不将用户名和密码直接签名在 Token 中。新的 Token 格式如下:
```
base64(tokenValue:series)
```
此更改将为系统带来更高的安全保障和更灵活的管理选项,特别是在需要高度控制和监管设备访问时。

#### Does this PR introduce a user-facing change?
```release-note
引入基于持久化 Token 的新 RememberMe 机制以增强安全性和管理灵活性,升级后需要重新登录
```
2024-06-26 08:40:49 +00:00
Takagi ba2987b585
feat: range selection feature to default editor (#6117)
#### What type of PR is this?

/kind feature
/area editor
/milestone 2.17.x

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

为默认编辑器添加 `RangeSelection` 选择器。

<img width="989" alt="image" src="https://github.com/halo-dev/halo/assets/31335418/c976cf99-0d6e-4346-9b05-8b9b0dc95183">


它的功能基本与 TextSelection 相反,例如:

1. TextSelection 支持光标展示,RangeSelection 不允许空内容,即它并不支持光标。
2. TextSelection 会抛弃被选择的 Node 节点部分偏移量,而 RangeSelection 会扩展偏移量至 Node 节点结束。
3. TextSelection 支持 Text 而 RangeSelection 支持 Node 节点。

`RangeSelection` 可以用于范围选中块节点并进行操作,可用于全选内容并进行删除操作。

#### How to test it?

测试使用点击,拖拽,释放鼠标的操作,能否选中某些节点。
测试删除选中的节点。

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

Fixes #5194

#### Does this PR introduce a user-facing change?
```release-note
为默认编辑器添加 RangeSelection 选择器
```
2024-06-26 06:14:50 +00:00
Takagi c1ba566e08
fix: autosave content feature not working (#6147)
#### What type of PR is this?

/kind bug
/area ui
/milestone 2.17.x

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

解决自动保存失效的问题

#### How to test it?

测试文章、页面输入内容后,点击其他页面是否能够自动保存。

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

Fixes #6129 

#### Does this PR introduce a user-facing change?
```release-note
解决文章自动保存失效的问题
```
2024-06-26 06:10:49 +00:00
Ryan Wang 88db1976c8
refactor: hide move group button when no attachment groups are present (#6138)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.17.x

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

选择附件时,如果当前没有分组,改为不显示移动按钮。

<img width="385" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/2d805f29-ecea-4469-b305-e217bd17db8b">

<img width="497" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/34800eb1-8fae-42fa-b875-929a3d912967">


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

Fixes #6124 

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

```release-note
None
```
2024-06-26 04:26:49 +00:00
Ryan Wang f09b685d28
refactor: remove phone field for user form (#6139)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.17.x

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

移除用户创建/编辑表单的手机号字段,当前手机号在系统中没有任何使用。

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

```release-note
None
```
2024-06-26 03:56:48 +00:00
Ryan Wang aee39906a4
refactor: preserve post title when opening settings (#6122)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.17.x

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

在文章编辑页面,打开文章设置时,支持保存标题,防止已修改的标题恢复为之前的值。

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

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

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

```release-note
优化文章编辑页面自动保存标题的功能
```
2024-06-26 03:52:48 +00:00
Ryan Wang c0d38a99ed
feat: support batch publish/unpublish posts (#6123)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.17.x

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

支持批量发布/取消发布文章。

<img width="475" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/5b79123b-5917-4b5e-9eaa-41c0cf5c8cdb">

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

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

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

```release-note
支持批量发布/取消发布文章。
```
2024-06-26 03:38:48 +00:00
Ryan Wang 8302c21bb6
feat: add avatar group component (#6128)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.17.x

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

添加 AvatarGroup 组件,用于堆叠多个 Avatar 组件。

<img width="243" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/2d202e95-e735-4635-b16e-cdcf1f94f69a">
<img width="352" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/da4a293d-eb3f-40b4-94b2-10dcf54d3305">

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

Fixes #6079 

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

```release-note
添加 AvatarGroup 组件,用于堆叠多个头像。
```
2024-06-26 02:24:48 +00:00
Ryan Wang 705bd235c3
fix: incorrect root path in API client requests (#6136)
#### What type of PR is this?

/area ui
/kind bug

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

修复 api client 默认请求根地址不正确的问题。

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

```release-note
None
```
2024-06-25 06:42:45 +00:00
Ryan Wang c74187c066 feat: add requests library as a global shared dependency 2024-06-25 12:31:44 +08:00
JohnNiang ecc0a70249 Refactor api client using separated OpenAPI groups 2024-06-25 12:31:25 +08:00
Ryan Wang af73a69e69
fix: resolve phantom dependency issue for iconify (#6120)
#### What type of PR is this?

/kind bug
/area ui
/milestone 2.17.x

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

修复关于 iconify 图标包的幽灵依赖问题,某些情况下,可能导致无法正常导入模块。

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

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

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

```release-note
None
```
2024-06-25 04:24:44 +00:00
Ryan Wang 9604262378
Refactor attachment moving using the patch api (#6111)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.17.x

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

使用新的 [patch](https://github.com/halo-dev/halo/pull/6031) 接口重构附件的移动功能。

#### Special notes for your reviewer:

1. 测试附件移动至其他分组的功能是否正常。
2. 测试删除附件分组,选择 **删除并将附件移动至未分组** 选项,观察删除分组之后,其中的附件是否已经移动到未分组。

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

```release-note
None
```
2024-06-24 04:12:42 +00:00
Ryan Wang 6a1ade375d
refactor: simplify the plugin startup logic (#6113)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.17.x

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

简化插件启动的接口,改为之前单独提供的修改插件状态的接口,而不是修改 `spec.enabled`。

#### Special notes for your reviewer:

需要测试:

1. 手动安装插件之后,启动插件。

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

```release-note
None
```
2024-06-24 03:58:43 +00:00
Ryan Wang f45ffdeca1
Refactor comment data update using the patch api (#6112)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.17.x

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

使用新的 patch 接口重构评论相关的逻辑。

#### Special notes for your reviewer:

需要测试:

1. 审核评论和回复功能。
2. 批量审核评论和回复功能。

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

```release-note
None
```
2024-06-23 16:16:33 +00:00
Ryan Wang ae7dcbb317
fix: not remembering the selected attachment policy in upload modal (#6115)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.17.x

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

修复首次上传附件时,没有默认选择第一个存储策略的问题。

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

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

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

```release-note
修复首次上传附件时,没有默认选择第一个存储策略的问题。
```
2024-06-23 03:48:29 +00:00
Ryan Wang 373229e9de
fix: not remembering the selected editor (#6114)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.17.x

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

修复新建文章时,没有自动选择之前所选编辑器的问题。

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

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

#### Special notes for your reviewer:

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

```release-note
修复新建文章时,没有自动选择之前所选编辑器的问题。
```
2024-06-23 03:46:29 +00:00
guqing 8bdde317e5
feat: add preventParentPostCascadeQuery option to control visibility of child category posts (#6083)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.17.x

#### What this PR does / why we need it:
此次变更为文章分类引入了一个新的 `preventParentPostCascadeQuery` 布尔属性,用于控制分类及其子分类下的文章显示方式。具体变更包括:

- 在分类结构中增加了 `preventParentPostCascadeQuery` 属性。
- 当分类的 `preventParentPostCascadeQuery` 属性设置为 `true` 时,该分类的文章数量不会汇总到父分类中。
- 更新了树结构遍历逻辑,以支持对 `preventParentPostCascadeQuery` 属性的处理。
- 确保独立分类中的文章显示受控,不向上级分类进行聚合。
- 增加了相应的测试用例,以验证在不同树结构中 `preventParentPostCascadeQuery` 属性的功能性。

#### Which issue(s) this PR fixes:
Fixes #5663 
Fixes #4923
Fixes https://github.com/halo-dev/halo/issues/3418

#### Does this PR introduce a user-facing change?
```release-note
新增独立分类选项用于控制关联的子分类下的文章显示以提供更灵活的内容管理方式
```
2024-06-21 04:08:10 +00:00
John Niang c0ac2f37d7
Add support for patching extensions (#6031)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.17.x

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

This PR adds patch method for all extensions API.

Patch example:

```bash
http -a admin:admin PATCH http://localhost:8090/apis/plugin.halo.run/v1alpha1/plugins/app-store-integration \
  Content-Type:application/json-patch+json \
  --raw='[{"op": "replace", "path": "/spec/enabled", "value": false}]'
```

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

Fixes #2311 

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

```release-note
None
```
2024-06-20 09:32:06 +00:00
guqing b5f9010e60
feat: support setting rendering templates for related posts on category (#6106)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.17.x

#### What this PR does / why we need it:
支持在分类上为关联的文章统一设置渲染模板

现在文章的模板生效顺序为:
1. 文章关联的分类上设置的文章模板,如果有多个则选择第一个
2. 文章上设置的自定义模板
3. 文章的默认模板

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

#### Does this PR introduce a user-facing change?
```release-note
支持在分类上为关联的文章统一设置渲染模板
```
2024-06-20 08:12:07 +00:00
Takagi b445b505be
feat: add import and export theme configuration (#6071)
#### What type of PR is this?

/kind feature
/area ui
/milestone 2.17.x

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

为主题增加导入及导出配置的功能。

<img width="1666" alt="image" src="https://github.com/halo-dev/halo/assets/31335418/3574b33e-0293-427c-9036-5d82948aa7f2">

#### How to test it?

测试主题导入及导出功能是否正常可用。
测试当前主题下的不同版本导入导出后数据是否正常。
测试在当前主题下使用其他主题导出的配置是否会报错。

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

Fixes #1073 

#### Does this PR introduce a user-facing change?
```release-note
为单个主题配置增加导入与导出的功能。
```
2024-06-19 10:55:00 +00:00
Takagi c956533160
pref: default code block indentation from Tab to 2 Spaces in editor (#6090)
#### What type of PR is this?

/kind improvement
/area editor
/milestone 2.17.x

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

将默认编辑器中代码块的缩进由一个制表符(\t),更改为两个空格` {2}`。

#### How to test it?

测试使用 `Tab` 即 `Shift + Tab` 缩进时,是否每次缩进两个空格而不是一个制表符。

#### Does this PR introduce a user-facing change?
```release-note
优化默认编辑器代码块缩进为两个空格。
```
2024-06-18 06:02:53 +00:00
Takagi 1e37768b35
pref: improve code block styling in editor (#6089)
#### What type of PR is this?

/kind improvement
/area editor

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

优化编辑器代码块样式。

before:

<img width="907" alt="image" src="https://github.com/halo-dev/halo/assets/31335418/11ad91a9-75ce-42ec-a947-effca7b42f30">

after:

<img width="932" alt="image" src="https://github.com/halo-dev/halo/assets/31335418/d0b3275b-a269-4104-aea8-0d8726ce32e7">

#### How to test it?

测试复制功能是否正常。

#### Does this PR introduce a user-facing change?
```release-note
优化默认编辑器代码块样式
```
2024-06-18 06:00:52 +00:00
Takagi 10f3157258
fix: ensure pasted content auto-generates title id (#6059)
#### What type of PR is this?

/kind bug
/area editor
/milestone 2.17.x

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

当前在编辑器中粘贴内容后,如果不修改任意标题或新增标题,则无法为当前标题自动生成标题 ID,进而导致锚点失效。

本 PR 将在编辑器触发内容更改后,如果是粘贴的内容,则直接触发生成标题 ID。

#### How to test it?

新建一篇文章并粘贴一段带标题的内容后直接发布。

查看发布后的文章是否可以在主题端使用锚点跳转。

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

Fixes #6056 

#### Does this PR introduce a user-facing change?
```release-note
解决在默认编辑器中粘贴的内容无法生成标题 ID 的问题
```
2024-06-17 13:48:50 +00:00
Takagi 3076838f36
fix: default editor focus setting failure (#6062)
#### What type of PR is this?

/kind bug
/area editor
/area ui

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

当前为默认编辑器设置焦点的时机放在 `onMounted` 时,但此时默认编辑器可能还未加载成功且标题也为能成功加载,因此无法保证正确设置标题焦点。

当前 PR 将此时机放置在默认编辑器创建完成之后的 `onCreate` ,此时将能够保证焦点设置成功。

#### How to test it?

测试默认编辑器能否正常设置标题或内容的焦点。

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

Fixes #6060 

#### Does this PR introduce a user-facing change?
```release-note
解决使用默认编辑器时无法正确设置焦点的问题
```
2024-06-14 08:08:39 +00:00
mashirot f2a0c502e3
fix: content offset caused by empty slot (#6040)
#### What type of PR is this?

/area ui
/kind improvement

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

Fixes #5877 

```release-note
修复Tag Icon为空时,后台文章的Tag内容不居中
```
2024-06-06 06:43:21 +00:00
John Niang 1821829f99
Prepare for developing 2.17.0 (#6032)
#### What type of PR is this?

/kind cleanup
/area core

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

This is a regular update after a release.

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

```release-note
None
```
2024-06-03 09:53:44 +00:00
Ryan Wang a26b73e258
chore: remove unnecessary env (#6022)
#### What type of PR is this?

/area ui
/kind cleanup
/milestone 2.16.x

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

移除 UI 项目中不必要的环境变量配置。

1. VITE_API_URL:当前 Console 不会考虑独立部署,并且在开发环境是后端 Proxy 的 Console 请求,所以此变量没有任何意义。
2. VITE_BASE_URL:无意义,当前不考虑修改。

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

```release-note
None
```
2024-05-30 08:31:16 +00:00
Ryan Wang 296d8c5833
fix: dropdown component auto-destruction issue (#6021)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.16.x

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

修复 Dropdown 组件自动销毁的问题,这可能导致部分插件在 Dropdown 中的组件无法正常渲染。

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

```release-note
None 
```
2024-05-30 08:29:15 +00:00
Ryan Wang 4c6abdcaa1
feat: enable asynchronous resolving for UI extension points (#6018)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.16.x

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

优化 UI 部分的扩展点获取实现,让部分扩展点支持异步获取,之前的实现与文档不符。

比如:

```ts
import { definePlugin } from "@halo-dev/console-shared";
import axios from "axios";

export default definePlugin({
  components: {},
  routes: [],
  extensionPoints: {
    "attachment:selector:create": async () => {
      const { data } = await axios.get(
        "/apis/v1alpha1/fake.halo.run/attachments/selectors"
      );

      return data;
    },
  },
});
```

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

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

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

```release-note
优化 UI 部分的扩展点获取实现,让部分扩展点支持异步获取。
```
2024-05-30 07:01:15 +00:00
Ryan Wang bf75a36df7
chore: revert @uppy/xhr-upload version to 3.6.0 (#6019)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.16.x

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

回退 `@uppy/xhr-upload` 的版本至 3.6.0,因为最新版本的 `@uppy/xhr-upload` 添加了重试机制和修改了错误异常的结构,并且当前重试参数并没有体现在文档和 API 中,所以暂时先回退至 3.6.0 以解决 https://github.com/halo-dev/halo/issues/6014

31cc47f3fb/packages/%40uppy/utils/src/fetcher.ts (L26)

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

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

#### Special notes for your reviewer:

需要测试:

1. 附件上传功能
2. 上传已安装的插件或者主题,观察是否有提示升级。

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

```release-note
None
```
2024-05-30 06:55:15 +00:00
Ryan Wang f87e78904c
feat: add version for themes and plugins when copying overview information (#6012)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.16.x

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

在概览页面复制信息时,为主题和插件添加版本号。

示例:

```
- 外部访问地址: 
- 启动时间: 2024-05-29 15:51
- 版本: 2.16.0-SNAPSHOT
- 构建时间: 2024-05-29 15:51
- Git Commit: 6204472
- Java: OpenJDK Runtime Environment / 17.0.11+0
- 数据库: PostgreSQL / 15.2 (Debian 15.2-1.pgdg110+1)
- 操作系统: Mac OS X / 14.5
- 已激活主题: [Earth 1.8.0](https://github.com/halo-dev/theme-earth.git)
- 已启动插件:
  - [静态网页服务 1.0.0-alpha.2](https://github.com/ruibaby/plugin-static-pages)
  - [评论组件 2.10.0-SNAPSHOT](https://github.com/halo-dev/plugin-comment-widget)
  - [OAuth2 认证 1.1.1](https://github.com/halo-sigs/plugin-oauth2)
  - [增强备份(Backup IMproved) 1.0.0-SNAPSHOT](https://www.halo.run/store/apps/app-dHakX)
  - [图库管理 1.3.0](https://github.com/halo-sigs/plugin-photos)
  - [Markdown / HTML 内容块 1.2.0](https://github.com/halo-dev/plugin-hybrid-edit-block)
  - AI 助手 1.0.0-alpha.2
  - [对象存储(Amazon S3 协议) 1.9.1](https://github.com/halo-dev/plugin-s3)
  - [链接管理 1.3.3](https://github.com/halo-sigs/plugin-links)
  - [Docsme 1.0.0-alpha.5](https://github.com/f2ccloud/plugin-docsme)
  - [ByteMD 1.4.0](https://github.com/ruibaby/plugin-bytemd)
  - [StackEdit 1.1.1](https://github.com/halo-sigs/plugin-stackedit)
  - [应用市场 1.3.0](https://www.halo.run/store/apps/app-VYJbF)
```

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

```release-note
在概览页面复制信息时,为主题和插件添加版本号。
```
2024-05-29 08:53:11 +00:00
Ryan Wang afabffc546
refactor: typing component template refs for VModal (#5994)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

为 VModal 组件的引用添加类型。

See https://vuejs.org/guide/typescript/composition-api.html#typing-component-template-refs

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

```release-note
None
```
2024-05-27 08:56:57 +00:00
Ryan Wang 22ce60b0e9
chore: bump uppy version (#5997)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

更新上传库 Uppy 的包依赖。

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

```release-note
更新上传库 Uppy 的包依赖。
```
2024-05-27 08:34:56 +00:00
Ryan Wang 94826d44c0
refactor: improve ui/ux of attachment group and policy selector (#5996)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

优化附件分组、存储策略选择组件的 UI。

<img width="1649" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/194d6334-e600-4235-85f7-affb1d44c003">
<img width="953" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/d8cb2470-2500-4b2c-a251-5fdf45a9cccb">

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

```release-note
优化附件分组、存储策略选择组件的 UI。
```
2024-05-27 08:30:57 +00:00
Ryan Wang 19fb1c2311
feat: record the plugin query conditions in the route query parameters (#5995)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.16.x

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

在插件数据管理列表页面路由中记录查询条件,可以保证在刷新页面或者切换路由返回时保留之前的查询状态。

<img width="1663" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/2638dfc9-793b-48c6-81dd-f460a6c9214d">

#### Special notes for your reviewer:

需要测试:

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

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

```release-note
Console 端的插件管理列表支持在地址栏记录筛选条件。
```
2024-05-27 08:28:57 +00:00
Ryan Wang 54e088741e
refactor: logic of publishing post (#5987)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

重构文章的发布逻辑,以下是主要改动:

1. 如果文章未发布,点击文章设置的发布按钮时,会先保存文章。
2. 在文章列表的操作菜单中添加发布 / 取消发布的选项。
3. 重构文章设置中,发布 / 取消发布按钮的显示条件。
4. 优化文章设置对话框的显示条件,减少不必要的渲染开销和请求。

#### Special notes for your reviewer:

需要测试:

1. 文章正常新建和发布的逻辑。
2. 文章设置未来时间的发布逻辑。
3. 取消定时发布和已发布文章的逻辑。

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

```release-note
优化 Console 文章管理中的文章发布逻辑。
```
2024-05-27 08:26:58 +00:00
Ryan Wang 6124ab9831
feat: add retry feature for update last read time of comment (#5985)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

为更新评论的最后读取时间添加重试机制。Ref https://github.com/halo-dev/halo/pull/5903#issuecomment-2106855779

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

```release-note
None 
```
2024-05-27 08:24:59 +00:00
Ryan Wang d675c4a8b1
fix: update initial values when form data changes (#5993)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.16.x

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

修复部分表单数据更新时,引用的初始值对象被跟着更新的问题。

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

```release-note
None
```
2024-05-27 08:22:57 +00:00
John Niang 5df51bb715
Refactor plugin reconciliation for dependency mechanism (#5900)
#### What type of PR is this?

/kind improvement
/area core
/area plugin

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

This PR wholly refactors plugin reconciliation to implement dependency mechanism.

Currently,
- If we disable plugin which has dependents, the plugin must wait for dependents to be disabled.
- If we enable plugin which has dependencies , the plugin must wait for dependencies to be enabled.
- If we upgrade plugin which has dependents, the plugin must request dependents to be unloaded. After the plugin is unloaded, the plugin must cancel unload request for dependents.

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

Fixes #5872 

#### Special notes for your reviewer:

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

```release-note
优化被依赖的插件的升级,启用和禁用
```
2024-05-27 08:16:56 +00:00
Ryan Wang 769b19c23c
refactor: improve code base of role-related (#5984)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

优化和角色相关的对话框显示逻辑,减少不必要的渲染开销和请求。

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

```release-note
优化和角色相关的对话框显示逻辑,减少不必要的渲染开销和请求。
```
2024-05-24 07:18:51 +00:00
guqing 9ec608be3b
feat: add remember-me mechanism to enhance user login experience (#5929)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.16.x

#### What this PR does / why we need it:
为登录增加记住我机制以优化登录体验

how to test it?
1. 勾选记住密码选项后登录
2. 退出浏览器后打开 console 期望依然可以访问而不需要登录
3. 测试修改密码功能,期望修改密码后所有会话需要重新登录包括当前设备和其他设备

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

#### Does this PR introduce a user-facing change?
```release-note
为登录增加记住我机制以优化登录体验
```
2024-05-24 06:20:50 +00:00
Ryan Wang 69c3a63618
fix: color style issue of code block in post content snapshot page (#5982)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.16.x

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

修复在文章版本历史内容预览中代码块颜色显示异常的问题。

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

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

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

```release-note
修复在文章版本历史内容预览中代码块颜色显示异常的问题。
```
2024-05-24 05:02:50 +00:00
guqing c1e8bdb568
feat: add scheduled post publishing feature (#5940)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.16.x

#### What this PR does / why we need it:
新增文章定时发布功能

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

#### Does this PR introduce a user-facing change?
```release-note
新增文章定时发布功能
```
2024-05-24 04:58:51 +00:00
Ryan Wang f3c3c91ca4
refactor: improve method name of api client (#5980)
#### What type of PR is this?

/area ui
/kind cleanup
/milestone 2.16.x

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

规范 api client 的方法名,之前生成的 api client 的方法名没有完全遵循驼峰命名。

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

Close https://github.com/halo-dev/halo/issues/5716

#### Special notes for your reviewer:

CI 通过即可。

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

```release-note
None
```
2024-05-24 04:04:50 +00:00
Ryan Wang 34981f95ba
refactor: improve visible condition of global search component (#5976)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

优化 Console 的全局搜索对话框显示逻辑,改为未开启时不渲染组件。

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

```release-note
None
```
2024-05-23 06:34:50 +00:00
Ryan Wang 4d289c0a45
refactor: improve code base of user-related (#5975)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

优化和用户管理相关的所有对话框显示逻辑,减少不必要的渲染开销和请求。

#### Special notes for your reviewer:

改动范围如下:

1. 用户密码修改
2. 用户资料修改
3. 用户创建
4. 重新登录

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

```release-note
优化和用户管理相关的所有对话框显示逻辑,减少不必要的渲染开销和请求。
```
2024-05-23 06:32:49 +00:00
Ryan Wang c51f2f4d4f
refactor: logic of singlePage setting modal (#5968)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

优化页面设置弹窗的显示逻辑,改为在未打开弹窗组件的时候不渲染组件,减少不必要的请求。

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

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

```release-note
优化页面设置弹窗的显示逻辑,减少不必要的请求。
```
2024-05-23 03:02:49 +00:00
Ryan Wang 5a3c9f0601
refactor: logic of theme management modal (#5966)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

优化主题管理弹窗的显示逻辑,改为在未打开弹窗组件的时候不渲染组件,减少不必要的请求。

before:

<img width="1656" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/96cfe2f0-4fef-4140-a014-1a96efb0e2c0">

after:

<img width="1660" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/9624561f-ae94-43c9-8e05-32134ebb4091">

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

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

```release-note
优化主题管理弹窗的显示逻辑,减少不必要的请求。
```
2024-05-23 03:00:49 +00:00
Ryan Wang a8fb28a105
refactor: layout of reset password page (#5960)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

让 UC 端的重置密码页面使用和登录相关页面一样的 GatewayLayout 布局组件。

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

```release-note
None
```
2024-05-23 02:58:50 +00:00
Ryan Wang 99eae2f31b
refactor: simplify the code of reply creation modal (#5972)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

简化评论回复组件的代码。

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

```release-note
None 
```
2024-05-23 02:56:50 +00:00
Ryan Wang 89b20bf5a3
refactor: improve code base of attachment-related (#5967)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

优化附件管理的相关代码。

1. 优化附件管理相关的对话框组件,减少重复和不必要的请求。
2. 简化附件存储策略编辑组件的逻辑。

#### Special notes for your reviewer:

需要测试:

1. 附件上传的相关功能。
2. 附件存储策略的编辑和新建。
3. 附件筛选条件功能。

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

```release-note
优化附件管理相关代码,减少重复和不必要的请求。
```
2024-05-23 02:54:49 +00:00
Ryan Wang ce5757ae10
chore: bump up vue-related version (#5965)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

升级 Vue 生态的相关依赖,以及修复编译 packages 时的异常日志问题。

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

```release-note
升级 Vue 生态的相关依赖至最新版本。
```
2024-05-22 12:42:47 +00:00
Ryan Wang ea98ae5add
refactor: improve code base of post tag-related (#5959)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

优化文章标签的表单组件代码。

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

```release-note
None
```
2024-05-22 09:34:46 +00:00
Ryan Wang 9bfe3a66d5
refactor: improve code base of post category-related (#5958)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

优化文章分类管理相关的 UI 代码。

1. 使用 vue-draggable-plus 库代替 vuedraggable 库实现拖拽排序。vue-draggable-plus 是在 https://github.com/halo-dev/halo/pull/5914 中引入,替换的原因是 vuedraggable 库已经不再积极维护。
2. 改进分类编辑表单的逻辑,清理无用代码。

#### Special notes for your reviewer:

需要测试:

1. 测试文章分类拖拽排序功能是否表现正常。
2. 测试新增/编辑文章分类功能是否表现正常。

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

```release-note
None
```
2024-05-22 02:52:46 +00:00
Takagi d29da319e7
fix: deleting selected text in a list with the backspace key causes the list to revert (#5938)
#### What type of PR is this?

/kind bug
/area editor
/milestone 2.16.x

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

移除使用 `Backspace` 进行缩进的功能。此功能会导致选中无序列表文本至起始位置时,按 `Backspace` 快捷键会导致无序列表解除当前层级。

#### How to test it?

测试从后往前选中无序列表文本至文本起始位置,然后按下 `Backspace` 快捷键。此时应当只删除文本而不会调整无序列表层级。

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

Fixes #5925 

#### Does this PR introduce a user-facing change?
```release-note
修复默认编辑器中列表使用 Backspace 快捷键删除选中文本的错误行为
```
2024-05-22 02:12:45 +00:00
Takagi b762a9dac7
pref: optimize code block backspace shortcut key logic (#5936)
#### What type of PR is this?

/kind improvement
/area editor
/milestone 2.16.x

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

优化默认编辑器代码块 `Backspace` 快捷键逻辑。如下所示:

1. 选中内容时进行删除,保证光标仍处于代码块内。
2. 光标处于代码块首位或者代码块没有内容时,不再删除代码块。

#### How to test it?

测试默认编辑器代码块功能。查看是否符合上述逻辑

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

Fixes #5927 

#### Does this PR introduce a user-facing change?
```release-note
优化默认编辑器代码块 Backspace 快捷键逻辑
```
2024-05-21 09:46:45 +00:00
Ryan Wang d29a377bbd
refactor: improve code base of menu-related (#5957)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

优化菜单管理相关的 UI 代码。

1. 使用 vue-draggable-plus 库代替 vuedraggable 库实现拖拽排序。vue-draggable-plus 是在 https://github.com/halo-dev/halo/pull/5914 中引入,替换的原因是 vuedraggable 库已经不再积极维护。
2. 改进菜单和菜单项编辑表单的逻辑,清理无用代码。

#### Special notes for your reviewer:

需要测试:

1. 测试菜单项拖拽排序功能是否表现正常。
2. 测试新增菜单、菜单项和修改菜单、菜单项功能是否表现正常。

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

```release-note
None
```
2024-05-21 07:10:44 +00:00
Ryan Wang 248d075481
chore: bump pnpm version to 9 (#5953)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

升级 pnpm 的版本至 9,以及 GitHub Actions 的 Node 版本改为了 20。

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

```release-note
升级 pnpm 的版本至 9
```
2024-05-21 03:24:45 +00:00
Takagi c5d63b1a8f
fix: toolbar menu being obscured after overflowing (#5930)
#### What type of PR is this?

/kind bug
/area editor
/milestone 2.16.x

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

当工具栏菜单出现溢出时,由于 `justify-content` 会始终保持居中状态,因此会导致溢出的内容被遮挡。

考虑到 [justify-content:safe](https://developer.mozilla.org/zh-CN/docs/Web/CSS/justify-content#safe) 在 safari 上具有兼容性问题,因此修改 HTML 结构,使用 `text-align` 来使菜单居中。

#### How to test it?

测试在菜单栏溢出时,溢出的内容是否被遮挡。

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

Fixes #5926 

#### Does this PR introduce a user-facing change?
```release-note
解决默认编辑器中顶部工具栏菜单溢出后被遮挡的问题
```
2024-05-20 08:54:42 +00:00
guqing c22b4e9ef4
refactor: optimize auth provider sorting with drag-and-drop support (#5914)
#### What type of PR is this?
/kind feature
/area core
/area ui
/milestone 2.16.x

#### What this PR does / why we need it:
优化认证方式的排序并支持拖动

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

#### Does this PR introduce a user-facing change?
```release-note
优化认证方式的排序并支持拖动
```
2024-05-20 08:30:42 +00:00
Ryan Wang fc10ffaeb2
chore: bump tiptap version to 2.4.0 (#5951)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

升级 Tiptap 依赖至 2.4.0,https://github.com/ueberdosis/tiptap/releases/tag/v2.4.0

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

```release-note
升级 Tiptap 依赖至 [2.4.0](https://github.com/ueberdosis/tiptap/releases/tag/v2.4.0)
```
2024-05-20 04:54:41 +00:00
Takagi 607898b172
fix: incorrect column width calculation after merging cells in the table (#5803)
#### What type of PR is this?

/kind bug
/area editor
/milestone 2.16.x

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

默认编辑器中的表格**首行被合并单元格**之后,将会出现当前表在刷新之后宽度被重置为默认。此 PR 改正了计算宽度,使其首次刷新时,也能返回正确的数组。

#### How to test it?

1. 将表格首行使用合并单元格之后,改变表格宽度。
2. 刷新表格,查看表格宽度是否不再变为默认宽度。

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

Fixes #5767 

#### Does this PR introduce a user-facing change?
```release-note
解决默认编辑器中的表格首行合并单元格后会出现宽度重置的问题
```
2024-05-16 07:06:37 +00:00
Takagi 33e6c9e38d
fix: cursor misalignment when scrolling through the table (#5928)
#### What type of PR is this?

/kind bug
/area editor
/milestone 2.16.x

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

目前表格在监听到滚动时,会重新设置 `TextSelection` 用于阴影的显示。
本 PR 将设置 `TextSelection` 更改为重新执行一次 `Transaction` 。这样可以解决在滚动时光标错位的问题。

#### How to test it?

编写表格时,测试当编写内容出现滚动条时,是否会导致文本错位。
测试滚动表格时,光标位置是否会发生改变。

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

Fixes #5924 

#### Does this PR introduce a user-facing change?
```release-note
解决默认编辑器中滚动表格时会导致光标变换的问题
```
2024-05-16 07:02:35 +00:00
Ryan Wang b47015a36d
chore: bump vite to 5.x (#5920)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.16.x

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

升级 Vite 至 5.x。

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

```release-note
升级 UI 部分的 Vite 版本至 5.x。
```
2024-05-16 06:18:36 +00:00
guqing f24b08c7db
feat: add an API to invalidate theme template cache (#5906)
#### What type of PR is this?
/kind feature
/area core
/area theme
/milestone 2.16.x

#### What this PR does / why we need it:
为主题管理增加在线清理缓存功能

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

#### Does this PR introduce a user-facing change?
```release-note
为主题管理增加在线清理缓存功能
```
2024-05-16 02:36:36 +00:00
Takagi e5bc699fb2
feat: support filtering attachments in the library by file media type (#5893)
#### What type of PR is this?

/kind feature
/area core
/area ui

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

为 `/apis/api.console.halo.run/v1alpha1/attachments` 接口增加了 `accepts` 可选参数,用于根据附件的 `MediaType` 进行筛选。

为附件库增加通过文件的 MediaType 类型进行筛选的筛选项。

同时支持使用了 `CoreSelectorProvider` 组件的文件选择框的筛选。现在只会显示 `accepts` 所支持的文件。

#### How to test it?

测试 ui 端文件选择框的类型筛选是否正确有效。
测试使用了 `CoreSelectorProvider` 组件的 `accepts` 是否有效。

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

Fixes #5054

#### Does this PR introduce a user-facing change?
```release-note
附件库支持按文件类型进行过滤
```
2024-05-16 02:32:35 +00:00
lan-yonghui 587dafa66c
fix: remove close button for reserved alert in role detail page (#5909)
#### What type of PR is this?

/kind bug
/area core
/area ui

#### What this PR does / why we need it:
用户角色详情页面,权限设置提示框关闭按钮不能关闭,增加对应关闭事件!
![image](https://github.com/halo-dev/halo/assets/81747598/2aa93550-8f97-413d-8b88-0d6731587ca7)

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


```release-note
用户-角色设置-权限设置提示框关闭按钮
```
2024-05-14 07:02:33 +00:00
lan-yonghui d7b655267e
feat: Add title slot to alert component (#5911)
#### What type of PR is this?

/kind feature
/area core
/area ui

#### What this PR does / why we need it:
alert 组件增加标题插槽,可以更好的自定义标题内容!

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

```release-note
为 VAlert 组件增加标题插槽
```
2024-05-14 02:06:33 +00:00
lan-yonghui 0d524e1ba2
fix: style issue of dialog component icon (#5910)
#### What type of PR is this?

/kind bug
/area core
/area ui

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

dialog 组件在标题内容过多的时候,icon 会很小,样式出现错位!

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

```release-note
修复当 Dialog 标题过长时,提示图标的样式问题。
```
2024-05-14 02:04:32 +00:00
John Niang fa286f74ee
Support excluding node_modules for idea IDE (#5857)
#### What type of PR is this?

/kind cleanup
/area core

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

There are too many unrelated results from node_modules folders when we try to search in files using IDEA IDE. This PR adapts the IDEA IDE using Gradle plugin `idea` to reduce search results.

Before:

<img width="700" alt="image" src="https://github.com/halo-dev/halo/assets/16865714/0e730896-6327-445c-b30e-0b0773f1743d">

After:

<img width="686" alt="image" src="https://github.com/halo-dev/halo/assets/16865714/2fc080cd-939c-4658-9309-e066e143bc30">

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

```release-note
None
```
2024-05-05 06:51:34 +00:00
John Niang 7ea414dd6d
Prepare for developing 2.16.0 (#5856)
#### What type of PR is this?

/kind cleanup
/area core

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

This is a regular action after releasing a minor version.

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

```release-note
None
```
2024-05-05 01:37:33 +00:00
Ryan Wang 2178bd8b80
fix: show plugin error message (#5838)
#### What type of PR is this?

/area ui
/kind bug
/milestone 2.15.0

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

修复插件异常启动时,指示器显示不正确的问题。

Fixes https://github.com/halo-dev/halo/pull/5520

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

```release-note
None
```
2024-04-30 06:40:24 +00:00
Ryan Wang 966558d1ce
feat: add cleanup feature for post snapshots (#5822)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.15.x

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

支持清理所有无用的文章历史快照,仅保留已发布、基础版本、正在编辑的版本。

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

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

#### Special notes for your reviewer:

需要在历史版本页面测试清理功能是否符合预期。

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

```release-note
None
```
2024-04-29 08:41:08 +00:00
Ryan Wang d1d4705705
refactor: improve editor ui (#5828)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.15.x

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

优化编辑器的部分 UI。

1. 优化顶部工具栏的样式。
2. 统一格式刷和清除格式的图标。

before:

<img width="1001" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/4d3f2e9a-a79d-429e-aaa4-70313f61da6c">

after:

<img width="1021" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/676ce83b-da87-4c5b-bc63-1405106827f8">

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

```release-note
优化编辑器的部分 UI。
```
2024-04-29 07:59:34 +00:00
Takagi 8abae05be7
fix: excel tables copied into editor become images (#5793)
#### What type of PR is this?

/kind bug
/area ui
/area editor

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

在进行图片上传的前置处理中,将剪切板属性中的 `text/plain` 类型与 `text/html` 类型进行过滤,用于解决将 Excel 表格粘贴至默认编辑器时,会导致其变为了图片而不是表格。

#### How to test it?

从 Excel 中复制一个表格,在默认编辑器中使用粘贴,查看其是否成功粘贴为表格而不是图片。

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

Fixes #5761 

#### Does this PR introduce a user-facing change?
```release-note
解决 Excel 表格粘贴至默认编辑器后会变为图片的问题。
```
2024-04-26 10:32:40 +00:00
guqing 0e17d53ede
feat: subscription support for expression-based subscribing (#5705)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.15.x

#### What this PR does / why we need it:
通知订阅支持基于表达式订阅

see #5632 for more details

how to test it?
1. 测试系统通知功能的文章、页面有新评论通知和评论有新回复通知的功能是否正常
2. 测试 2.14 创建的文章、评论和回复升级到此版本后是否能继续收到相应通知,如文章有新评论

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

#### Does this PR introduce a user-facing change?
```release-note
通知订阅支持基于表达式订阅避免订阅随数据量增长同时自动优化之前的订阅数据
```
2024-04-26 10:26:41 +00:00
Ryan Wang 58f82d2cc2
feat: add features for view post history snapshots (#5787)
* Add snapshots related api

* feat: add features for view post history snapshots

---------

Co-authored-by: guqing <i@guqing.email>
2024-04-26 18:10:06 +08:00
guqing 1ade8493da
feat: require password verification for email updates (#5780)
#### What type of PR is this?
/kind feature
/milestone 2.15.x
/area core

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

增加了在用户尝试更新邮箱地址时进行密码验证的步骤。此举提高了安全性,确保邮箱修改操作由经过身份验证的用户执行。

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

#### Does this PR introduce a user-facing change?
```release-note
更新邮箱地址时需进行密码验证
```
2024-04-26 10:06:32 +00:00
Takagi cb6836aa8c
feat: add tab shortcut function to the default editor table (#5784)
#### What type of PR is this?

/kind feature
/area editor

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

为默认编辑器表格增加 `Tab` 与 `Shift-Tab` 切换至上一个单元格或下一个单元格。具体功能如下:

1. 使用 Tab 快捷键从左向右切换至下一个单元格,当光标在最后一个单元格时,使用 Tab 键新建一行并跳转至新一行的第一个单元格。
2. 使用 Shift + Tab 快捷键从右向左来切换至上一个单元格。

#### How to test it?

测试在默认编辑器中 `Tab` 快捷键切换单元格是否生效。
测试在合并单元格等各种表格操作下,切换单元格是否生效。

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

Fixes #5771 

#### Does this PR introduce a user-facing change?
```release-note
为默认编辑器表格增加 Tab 快捷键切换单元格的功能
```
2024-04-26 10:00:10 +00:00
Ryan Wang ee76f19572
feat: add issues field for plugin and theme manifest (#5755)
#### What type of PR is this?

/area core
/area ui
/kind feature
/kind api-change

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

为主题和插件的定义文件添加 issues 字段,用于填写问题反馈地址。方便使用者可以清楚的知道可以在哪里反馈问题。

<img width="767" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/b7dfce3f-8362-4964-82b8-cc018b85bb82">


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

Fixes #5715 

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

```release-note
为主题和插件的定义文件添加问题反馈(issues)字段
```
2024-04-26 07:20:31 +00:00
Ryan Wang f2b883f2e9
feat: add verified badge for email field in profile detail page (#5783)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.15.x

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

在个人中心的个人资料页面添加邮箱已验证的标识,方便用户知晓。

<img width="596" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/77cd83e1-cefe-453c-ad12-689ee893c8ee">

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

```release-note
在个人中心的个人资料页面添加邮箱已验证的标识。
```
2024-04-26 04:36:59 +00:00
Ryan Wang 5a0f735efb
feat: show the startup status of the plugin (#5520)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.14.x

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

Show the startup status of the plugin

<img width="444" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/0f5d47c2-9d81-4cb7-b114-6b2eebe753c5">


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

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

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

```release-note
插件支持显示启动中的状态。
```
2024-04-25 08:21:13 +00:00
Ryan Wang 924aad1304
feat: toast the http request error (#5796)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.15.x

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

优化 Console 的请求异常提示,如果异常不满足原有的判断逻辑,最终将提示 status + statusText,不再显示未知错误,方便使用者根据异常提示进行排查。

<img width="246" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/86111068-69a1-4ac1-b405-eea69a95e141">

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

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

#### Special notes for your reviewer:

我的测试方式:

使用 Caddy 模拟请求异常:

```
:9000

encode gzip

@blocked {
   path /apis/content.halo.run/v1alpha1/posts/**
}

respond @blocked 413

reverse_proxy 127.0.0.1:8090
```

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

```release-note
优化 Console 的请求异常提示,方便异常排查。
```
2024-04-25 08:13:12 +00:00
Ryan Wang a644c40cfd
refactor: implementation of browser tab title (#5794)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.15.x

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

重构 Console 和 UC 的浏览器标题切换。

1. 将代码逻辑封装为统一的 Hook。
2. 移除 index.html 默认的标题,防止加载中的时候显示不正确。

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

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

#### Special notes for your reviewer:

测试各个页面的标题显示正常即可。

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

```release-note
重构 Console 和 UC 的浏览器标题切换。
```
2024-04-25 03:43:10 +00:00
Ryan Wang fbf2b06432
feat: add extension points for user detail tab (#5763)
#### What type of PR is this?

/area ui
/kind feature
/milestone 2.15.x

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

为 Console 的用户详情页面的选项卡和个人中心的个人资料页面选项卡添加扩展点,支持通过插件扩展选项卡。

todo:

- [x] 完善 docs.halo.run 的开发文档 https://github.com/halo-dev/docs/pull/340

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

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

#### Special notes for your reviewer:

可以使用 [plugin-starter-1.3.2-SNAPSHOT.jar.zip](https://github.com/halo-dev/halo/files/15059291/plugin-starter-1.3.2-SNAPSHOT.jar.zip) 进行测试。

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

```release-note
为 Console 的用户详情页面的选项卡和个人中心的个人资料页面选项卡添加扩展点
```
2024-04-25 00:33:09 +00:00
Takagi a692c622c9
feat: add search and filtering functions to post tags (#5710) 2024-04-23 17:26:29 +08:00
guqing 06e0b63b5b
feat: invalidate all sessions of a user after password changed (#5757)
* feat: invalidate all sessions of a user after password changed

* fix: unit test case

* refactor: use spring session 3.3 to adapt

* refactor: compatible with session timeout configuration

* refactor: indexed session repository

* Reload page after changed the password

Signed-off-by: Ryan Wang <i@ryanc.cc>

* chore: update session repository

---------

Signed-off-by: Ryan Wang <i@ryanc.cc>
Co-authored-by: Ryan Wang <i@ryanc.cc>
2024-04-23 15:21:24 +08:00
Takagi 944a244186
feat: add the order of the posts according to last modify time (#5727)
* feat: add the order of the posts according to last modify time

* replace es change
2024-04-23 11:28:53 +08:00
guqing f07c09b243
feat: add original password verification for password change (#5748)
* feat: add original password verification for password change

* chore: update properties file

* Refine ui

Signed-off-by: Ryan Wang <i@ryanc.cc>

* chore: update properties file

* fix: confirm assword

* fix: unit test case

* feat: add new api for change own password

* chore: regenerate api client

* chore: adapt to UI

* chore: enusre old password not blank

---------

Signed-off-by: Ryan Wang <i@ryanc.cc>
Co-authored-by: Ryan Wang <i@ryanc.cc>
2024-04-21 15:07:46 +08:00
Ryan Wang 571df5f865
feat: refine fields in plugin detail page (#5724)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.15.x

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

优化插件详情页面的字段显示,适配 https://github.com/halo-dev/halo/pull/4061

1. 显示 metadata.name。
2. 显示源码仓库地址(spec.repo)。
3. 显示网站地址(spec.homepage)。

<img width="663" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/a1b2a561-4351-4c18-b959-6b398532a9af">

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

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

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

```release-note
优化插件详情页面的字段显示
```
2024-04-19 02:40:08 +00:00
Ryan Wang 1ed54a1c20
feat: refine fields in theme detail page (#5723)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.15.x

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

优化主题详情页面的字段显示,适配 https://github.com/halo-dev/halo/pull/4061

1. 将 spec.website 字段改为 spec.homepage,并兼容 website。
2. 显示 spec.license 字段。
3. 显示 spec.description 字段。

<img width="794" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/13bf6ef8-4111-4889-bd10-8a8865e247e8">

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

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

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

```release-note
优化主题详情页面的字段显示
```
2024-04-19 02:38:09 +00:00
John Niang 3c20ce3c55
Generate API docs and regenerate API client (#5742)
#### What type of PR is this?

/kind cleanup
/area core

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

This PR adds support for generating API docs into project and generate API client according the API docs.

To generate/update latest API docs, execute the following command:

```bash
./gradlew clean generateOpenApiDocs
```

To generate/update latest API client, execute the following command:

```bash
make -C ui api-client-gen
```

Meanwhile, I also remove the lint on API client due to unnecessary.

Supersedes of https://github.com/halo-dev/halo/pull/5637

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

```release-note
None
```
2024-04-19 02:34:07 +00:00
Ryan Wang 90e3c2c017
refactor: username validation rules for signup form (#5740)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.15.x

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

优化注册表单的用户名校验规则,改为最低要求 4 个字符,并完善规则提示。

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

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

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

```release-note
优化注册表单的用户名校验规则
```
2024-04-18 09:44:06 +00:00
Ryan Wang b05ed5814c
chore: bump tiptap version to 2.3.0 (#5655)
#### What type of PR is this?

/area ui
/kind improvement

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

升级 Tiptap 的版本为 2.3.0。

- https://github.com/ueberdosis/tiptap/releases/tag/v2.3.0
- https://github.com/ueberdosis/tiptap/releases/tag/v2.2.6
- https://github.com/ueberdosis/tiptap/releases/tag/v2.2.5
- https://github.com/ueberdosis/tiptap/releases/tag/v2.2.4

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

```release-note
升级 Tiptap 的版本为 2.3.0。
```
2024-04-18 09:40:07 +00:00
Takagi ac6896d0f3
pref: optimize the toolbar space and fold the same type of function (#5683)
#### What type of PR is this?

/kind improvement
/area editor
/milestone 2.15.x

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

本 PR 对富文本编辑器中工具栏和冒泡菜单进行精简。

- 对默认富文本冒泡菜单及顶部工具栏相同类型的功能进行了折叠。
- 删除在 text 的冒泡菜单中,不属于当前选中文本的功能,例如转换为代码块等,这些实际上是段落的功能,并非是文本的功能。而 textAlign 目前也仅仅用在标题和行上,因此也移除。

#### How to test it?

查看默认富文本编辑器工具栏中,折叠的功能是否正常。选中文本,查看文本中是否不包含段落相关的功能。

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

Fixes #5669 

#### Does this PR introduce a user-facing change?
```release-note
对默认富文本编辑器中的工具栏进行折叠及精简优化。
```
2024-04-18 09:30:06 +00:00
Takagi fdc2453cc8
fix: code block content insertion location error (#5737)
#### What type of PR is this?

/kind bug
/area editor
/milestone 2.15.x

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

在编写多行文本后,粘贴代码块时,会出现粘贴的内容插入错误,其与代码块分割开。

[例如 #5736 中的示例所示](https://github.com/halo-dev/halo/assets/44745967/4b1ef8dc-60bf-47fd-b64d-23b0d6537d9e)

在本 PR 中,在创建 CodeBlock 时,将 Text 转为 `TextNode` 后,一同传入作为 `CodeBlock` 的 content。
另外为了保证插入代码块之后,光标处于代码块中,将会从插入位置的 from 开始往文档顶部搜索。

#### How to test it?

测试示例中的场景下,代码块插入是否正常。

测试在代码块前后放入其他代码块或者其他块,插入代码块后光标是否在代码块中。

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

Fixes #5736 

#### Does this PR introduce a user-facing change?
```release-note
修复默认编辑器中粘贴代码块会出现错行的问题
```
2024-04-18 04:42:06 +00:00
Takagi 410a7557f9
feat: add the format brush extension to the default rich text editor (#5603)
#### What type of PR is this?

/kind feature
/area editor
/area ui

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

为默认富文本编辑器添加格式刷扩展。用以给 text node 复制格式。

使用方式:

1. 选中一串具有格式的文本
2. 点击格式刷或者使用 `Shift + Mod + c` 快捷键复制格式。
3. 选中需要进行格式处理的文本
4. 松开鼠标,格式刷生效。

#### How to test it?

测试格式刷功能是否正常可用。需要测试 text node 以及 block node 内部的 text 格式功能。

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

Fixes #5591 

#### Does this PR introduce a user-facing change?
```release-note
为默认富文本编辑器添加格式刷扩展。
```
2024-04-18 04:26:07 +00:00
Takagi 0ba50b806e
pref: optimize the pop-up mode of toolbar submenu (#5682)
#### What type of PR is this?

/kind improvement
/area editor

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

优化默认富文本编辑器中,顶部工具栏子菜单的弹出方式,将原有的鼠标移入弹出改为点击左键弹出。并且为了显示效果,将会在具有子菜单的工具栏后方显示额外的下拉图标。

#### How to test it?

查看顶部工具栏子菜单弹出方式是否已改变。(插入组件未进行更改,仍旧保持原有鼠标移入弹出方式)

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

Fixes #5668 

#### Does this PR introduce a user-facing change?
```release-note
优化默认富文本编辑器中顶部工具栏的子菜单弹出方式
```
2024-04-18 04:24:06 +00:00
Aero ab7c598f7b
fix: layout height triggers page background color not fully filling scroll area (#5698)
<!--  Thanks for sending a pull request!  Here are some tips for you:
1. 如果这是你的第一次,请阅读我们的贡献指南:<https://github.com/halo-dev/halo/blob/main/CONTRIBUTING.md>。
1. If this is your first time, please read our contributor guidelines: <https://github.com/halo-dev/halo/blob/main/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
/area ui
<!--
添加其中一个类别:
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:
布局高度引发页面背景色未完全填充滚动区域的问题;

另外,为了不影响全局 `footer` 置于页面底部,对 `BasicLayout.vue` 容器也添加了最小高度 `100vh`
#### 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 #5678

#### Special notes for your reviewer:
当 Console 出现滚动条时,如:https://demo.halo.run/console/attachments?page=1&group= 

注意观察对布局设置最小高度 `100vh` 后与设置之前的背景色变化;

注意是否会对其它布局高度造成影响

#### 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
布局高度引发页面背景色未完全填充滚动区域的问题
```
2024-04-16 09:32:07 +00:00
mashirot d4f38dc6c6
feat: set selectedRole as required when creating a new user (#5697)
#### What type of PR is this?

/kind improvement
/area ui

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

Fixes #5677 

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

```release-note
将新建用户的表单中的角色设置设为必填
```
2024-04-15 04:30:10 +00:00
Takagi 505f38a145
pref: optimize the rich text editor link paste logic (#5680)
#### What type of PR is this?

/kind improvement
/area editor
/area ui
/milestone 2.15.x

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

优化默认富文本编辑器中自动创建链接的逻辑。

- 移除了粘贴文本时,如果文本为链接则会自动转为链接的问题。
- 移除输入链接文本之后回车,会自动转化为链接的问题。
- 新增当选中的文本内容为链接时,点击链接按钮,将会自动转化选中的文本为链接。

#### How to test it?

在富文本编辑器中,测试如下场景:

1. 在浏览器地址栏复制一个链接,粘贴后不会再转为链接,而是一个普通文本。
2. 输入一段链接文本,按回车后是否不会再被转为链接。
3. 选中一段可以被解析为链接的地址,选中此地址,点击链接按钮,此地址是否会被默认转为链接。

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

Fixes #5653 

#### Does this PR introduce a user-facing change?
```release-note
优化默认富文本编辑器中文本自动转为链接的相关逻辑
```
2024-04-13 00:50:08 +00:00
Takagi 37f530b619
pref: limit the datetime year of the post or page to four digits (#5666)
#### What type of PR is this?

/kind improvement
/area ui

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

限定文章或页面中的发布日期中的年份为四位数,方便用户输入四位年份之后自定跳转至月份。

#### How to test it?

测试在 `chrome` 上输入四位年份之后,是否会自动跳转至月份。

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

Fixes #5630 

#### Does this PR introduce a user-facing change?
```release-note
限定文章或页面中的发布日期中的年份为四位数
```
2024-04-12 11:28:09 +00:00
Takagi a317ec9563
feat: add the clear format function to the default rich text editor (#5685)
#### What type of PR is this?

/kind feature
/area editor
/milestone 2.15.x

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

为默认富文本编辑器添加清除格式的功能。快捷键为 `Mod + \`。

#### How to test it?

输入文本,使用加粗、链接、斜体等 mark 相关功能,之后使用清除格式,查看格式是否被清除。

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

Fixes #5684 

#### Does this PR introduce a user-facing change?
```release-note
为默认富文本编辑器添加清除格式的功能。
```
2024-04-12 11:26:09 +00:00
Takagi 60f113110b
feat: change the tab title to the site title of the website (#5696)
#### What type of PR is this?

/kind feature
/area ui
/area core
/milestone 2.15.x

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

将 Console 与 UC 页面的标签页标题改为网站实际标题

#### How to test it?

查看 Console 页面与 UC 页面的标题页标题是否变为网站实际标题

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

Fixes #5679 

#### Does this PR introduce a user-facing change?
```release-note
将 Console 与 UC 的标签页标题改为网站实际标题
```
2024-04-12 09:48:08 +00:00
Takagi 6ed8cdf5bc
fix: the details of the attachment may be empty (#5695)
#### What type of PR is this?

/kind bug
/area ui
/milestone 2.15.x

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

修复由于 modal 延迟 200ms 所导致的数据可能为空的问题。

See #5078 

#### How to test it?

反复点击并关闭附件库详情弹窗,查看是否会有空数据的问题

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

Fixes #5689 

#### Does this PR introduce a user-facing change?
```release-note
修复附件详情弹窗可能无法显示数据的问题
```
2024-04-12 09:46:07 +00:00
ZhengHaoYu 817963c15e
feat: support sorting posts by views and comment count (#5614)
#### What type of PR is this?
/kind feature

#### What this PR does / why we need it:
文章支持根据访问量和评论量排序

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

Fixes #3216 

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

```release-note
文章支持根据访问量和评论量排序
```
2024-04-11 10:10:11 +00:00
Takagi fc79de70fd
feat: add line-height setting feature for the default editor (#5681)
#### What type of PR is this?

/kind feature
/area editor
/milestone 2.15.x

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

此 PR 为默认富文本编辑器中的 P 标签设置了 `line-height` 属性,因此可以支持为某一行设置行高。

#### How to test it?

测试行高功能是否正常。测试在不同组件下功能是否正常。

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

Fixes #5660 

#### Does this PR introduce a user-facing change?
```release-note
为默认富文本编辑器增加行高设置
```
2024-04-11 08:02:10 +00:00
Takagi 26db6036a7
refactor: post tag management page (#5593)
#### What type of PR is this?

/kind improvement
/area ui

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

使用分页列表的形式重新展示文章标签页,移除原有的 grid 形式。

#### How to test it?

查看文章标签页面的分页列表功能显示是否正常。
完成增、删、改之后是否能够正常回显。

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

Fixes #5415 

#### Does this PR introduce a user-facing change?
```release-note
使用分页列表的形式重构文章标签页 UI
```
2024-04-11 07:50:10 +00:00
John Niang aab367a1f7
Prepare for developing 2.15.0 (#5635)
#### What type of PR is this?

/kind cleanup
/area core

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

Upgrade version to `2.15.0-SNAPSHOT`.

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

```release-note
None
```
2024-04-02 02:20:07 +00:00
Ryan Wang ae274db893
refactor: hide the custom annotations form by defaults (#5595)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.14.x

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

默认隐藏自定义元数据表单,通常这不会让用户自行修改,默认显示反而会给使用者造成心智负担。

<img width="807" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/f80813e2-00c8-483e-bb16-fe4671c5450e">

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

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

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

```release-note
默认隐藏文章设置等界面的自定义元数据表单。
```
2024-03-31 14:20:06 +00:00
Ryan Wang 35cc323585
refactor: simplify the dialogs title (#5601)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.14.x

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

简化部分确认框的标题。

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

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

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

```release-note
简化部分确认框的标题。
```
2024-03-27 14:20:07 +00:00
Takagi ec4c390e1f
fix: wrong router navigation when redirect to /uc (#5609)
#### What type of PR is this?

/kind bug
/area ui

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

修复当角色勾选禁止访问 Console 后,redirect_uri 参数无效的问题

#### How to test it?

测试角色禁止访问 console 时,当链接中携带 redirect_uri 参数,能否正常跳转

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

Fixes #5417 

#### Does this PR introduce a user-facing change?
```release-note
修复当角色禁止访问 Console 后,redirect_uri 参数无效的问题
```
2024-03-27 13:14:06 +00:00
Ryan Wang c2a71545aa
refactor: ignore case when matching editor raw types (#5602)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.14.x

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

编辑文章匹配编辑器类型时,忽略大小写。

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

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

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

```release-note
None
```
2024-03-27 05:00:07 +00:00
Takagi 1a19bdcb54
fix: resolving the issue of the draggable extension not working in the editor (#5570)
#### What type of PR is this?

/kind bug
/area editor
/milestone 2.14.x

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

解决在默认编辑器中,插件扩展 getDraggable 方法可能无效的问题。向 handleDrop 中添加属性 `selection`,方便插件对当前拖拽元素进行处理。

部分插件拖拽之后可能无效果,此时需要插件自行实现 `handleDrop` 方法来处理拖拽后的情况。

#### How to test it?

测试 getDraggable 方法是否正常。插件中使用此方法是否显示拖拽图标。

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

Fixes #5208 

#### Does this PR introduce a user-facing change?
```release-note
解决默认编辑器 getDraggable 在部分插件中失效的问题。
```
2024-03-27 04:26:06 +00:00
Takagi b8293faafd
fix: error occurs when opening attachment library in the uc (#5590)
#### What type of PR is this?

/kind bug
/area ui

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

在个人中心,使用默认富文本编辑器上传附件库时,由于在 UC 中不存在附件库列表,因此会出现错误。

本 PR 通过对默认富文本编辑器上传组件进行调整,调整如下:

1. 当不具有 uc 和 system 的附件权限时,用户仅能通过链接插入图片、音频等,且不允许拖拽和粘贴上传。
2. 当用户具有 uc 但没有 system 的附件权限时,用户可以通过拖拽和粘贴的方式上传,但不允许通过附件库上传。
3. 当用户具有 system 附件权限时,允许通过所有方式(上传、附件库、链接、拖拽和粘贴)进行上传。

#### How to test it?

测试默认富文本编辑器中,用户在不同附件库权限下上传图片是否能够按照逻辑正常处理。

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

Fixes #5581

#### Does this PR introduce a user-facing change?
```release-note
修复在个人中心中使用默认富文本编辑器的附件库而导致的报错问题
```
2024-03-26 14:44:07 +00:00
Ryan Wang 78b60a0a29
refactor: rendering conditions for plugin installation components (#5577)
#### What type of PR is this?

/area ui
/kind improvement
/milestone 2.14.x

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

优化插件安装弹框组件的渲染时机,改为在未打开时不进行渲染,可以避免一些不必要的请求,尤其是在安装了应用市场插件之后。

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

Fixes #5573 

#### Special notes for your reviewer:

测试插件安装和升级功能是否正常即可。

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

```release-note
优化插件安装弹框组件的渲染时机,避免不必要的请求。
```
2024-03-26 10:48:07 +00:00