Commit Graph

4597 Commits (f37fcb18fa893d23f35b0f8b39a0a12960e92a29)

Author SHA1 Message Date
Ryan Wang f37fcb18fa
chore: bump formkit version to 1.3.0 (#4913)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.11.x

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

升级 FormKit 的版本至 1.3.0

see https://formkit.com/changelog#_130

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

```release-note
升级 FormKit 的版本至 1.3.0
```
2023-11-27 09:50:10 +00:00
Ryan Wang 8657854d87
chore: update issue template (#4915)
#### What type of PR is this?

/kind cleanup

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

更新 issue 模板,支持粘贴系统概览中提供的信息。


<img width="971" alt="图片" src="https://github.com/halo-dev/halo/assets/21301288/22799613-2c05-4621-99cd-f12293a3e837">


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

```release-note
None
```
2023-11-27 09:40:09 +00:00
Ryan Wang 925f8d0ea4
feat: add sticky block component (#4919)
#### What type of PR is this?

/kind feature
/area console
/milestone 2.11.x

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

添加 `<StickyBlock />` 组件,用于将元素固定在顶部或者底部。

此外,此 PR 针对主题设置、插件设置、系统设置等表单可能较长的页面使用了此组件。

<img width="1214" alt="图片" src="https://github.com/halo-dev/halo/assets/21301288/abc849eb-a9a9-4d0a-b81c-d7430815660d">


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

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

#### Special notes for your reviewer:

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

```release-note
添加 `<StickyBlock />` 组件,用于将元素固定在顶部或者底部,并为主题 / 插件 / 系统设置的底部保存按钮区域做了适配。
```
2023-11-27 09:38:08 +00:00
Ryan Wang 0102f7a227
fix: overflow issue of card component (#4922)
#### What type of PR is this?

/area console
/kind bug
/milestone 2.11.x

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

修复在 Card 组件中使用下拉组件无法完整显示的问题。

before:

<img width="898" alt="图片" src="https://github.com/halo-dev/halo/assets/21301288/8381ab18-fe48-4e14-9ac2-2c7da5b22556">

after:

<img width="900" alt="图片" src="https://github.com/halo-dev/halo/assets/21301288/517622e8-f507-4ce8-89be-1e47380be3a3">


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

Fixes #4921 

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

```release-note
修复在 Card 组件中使用下拉组件无法完整显示的问题。
```
2023-11-27 09:04:08 +00:00
John Niang c02911ce01
Merge pull request #4875 from ruibaby/perf/asynchronously-load-uppy-upload
perf: asynchronously load the uppy upload component
2023-11-27 16:57:06 +08:00
John Niang 64fed0cacc
Reset base Docker image of builder to eclipse-temurin (#4910)
#### What type of PR is this?

/kind bug
/area core

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

Reset base Docker image of builder to eclipse-temurin to fix the problem of OOM while building multi-platform Docker image. See https://github.com/halo-dev/halo/actions/runs/6976331252/job/18984676251 for more.

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

```release-note
None
```
2023-11-24 08:04:06 +00:00
guqing 57a1f2ec18
Fix the issue with repeatedly building plugin RouterFunction for CustomEndpoints (#4890)
* fix: OOM occured when using ab to test custom endpoints provided by plugin

* refactor: custom endpoints to rotuer function register for plugin

* refactor: bean post processor register

* Register AggregatedRouterFunction bean instead of adding bean factory post processor

* Remove debug lines

---------

Co-authored-by: John Niang <johnniang@foxmail.com>
2023-11-24 14:31:35 +08:00
John Niang 4ee4a8fd36
Merge pull request #4896 from ruibaby/chore/use-ibm-semeru-runtimes
chore: use ibm-semeru-runtimes to replace eclipse-temurin as the base image
2023-11-24 10:54:08 +08:00
John Niang 2800ba46c2
Merge pull request #4903 from LinuxSuRen/fix/wrong-image-tag
fix: the image tag might be wrong when it is not a pr
2023-11-24 10:42:51 +08:00
John Niang 1277349221
Merge pull request #4904 from JohnNiang/chore/upgrade-to-springboot-3.2.0
Upgrade to Spring Boot 3.2.0
2023-11-24 10:38:15 +08:00
John Niang 3bb2d8fbae Upgrade to Spring Boot 3.2.0 2023-11-24 00:09:45 +08:00
John Niang a56f7e89f5
Merge pull request #4900 from ruibaby/refactor/signup-event
refactor: redirect to user center by default after registration
2023-11-23 23:56:33 +08:00
John Niang e5dc116279 Add CARGO_NET_GIT_FETCH_WITH_CLI env into Dockerfile to prevent OOM error during building multi-platforms Docker image 2023-11-23 23:33:36 +08:00
John Niang dec7a7f222
Merge branch 'main' into chore/use-ibm-semeru-runtimes 2023-11-23 23:29:40 +08:00
rick 6bde0c8848 fix: the image tag might be wrong when it is not a pr
Signed-off-by: Rick <LinuxSuRen@users.noreply.github.com>
2023-11-23 10:49:14 +00:00
John Niang e97f3135e9
Merge pull request #4892 from LinuxSuRen/e2e
test: add e2e testing for the backend
2023-11-23 17:58:06 +08:00
Ryan Wang 1f1f3cb724
feat: add tailwindcss/forms plugin to standardize the style of form elements (#4893)
#### What type of PR is this?

/area console
/kind improvement

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

Use [@tailwindcss/forms](https://github.com/tailwindlabs/tailwindcss-forms) plugin to standardize the style of form elements, and resolve some style issues.

before:

<img width="294" alt="图片" src="https://github.com/halo-dev/halo/assets/21301288/eeb6792f-a278-4fd0-a99c-7d7e50dd550d">

after:

<img width="291" alt="图片" src="https://github.com/halo-dev/halo/assets/21301288/652b07d8-7410-4c62-9b4f-1b3228d68883">

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

Fixes #4734 

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

```release-note
优化 Console 端表单元素样式
```
2023-11-23 09:32:09 +00:00
Ryan Wang 0bfa1709ce
feat: add email field for signup (#4899)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.11.x

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

Add email field for signup

<img width="832" alt="图片" src="https://github.com/halo-dev/halo/assets/21301288/dabc7411-a18d-4a8b-a0be-f875b16ba58f">

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

```release-note
用户注册新增电子邮箱字段。
```
2023-11-23 09:18:08 +00:00
Ryan Wang ec7dbf0a9b refactor: redirect to user center by default after registration
Signed-off-by: Ryan Wang <i@ryanc.cc>
2023-11-23 17:04:06 +08:00
Ryan Wang 6cecca25d2 Add platforms input for docker build step
Signed-off-by: Ryan Wang <i@ryanc.cc>
2023-11-23 16:06:26 +08:00
Ryan Wang 8f3ed637ad chore: use ibm-semeru-runtimes to replace eclipse-temurin as the base image
Signed-off-by: Ryan Wang <i@ryanc.cc>
2023-11-23 14:29:29 +08:00
rick 2e77ff9c64 test: add e2e testing for the backend
Signed-off-by: Rick <LinuxSuRen@users.noreply.github.com>
2023-11-23 03:32:11 +00:00
John Niang 457e05913e
Respond HTTP status CREATED for system initialization API (#4887)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.11.x

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

Respond HTTP status CREATED for system initialization API instead of string `true`.

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

Fixes #4885 

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

```release-note
None
```
2023-11-22 08:14:07 +00:00
AirboZH aa9f84ea6f
Prevent private posts from being indexed when rebuilding index. (#4882)
<!--  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:

在加入索引前判断文章的可见性。只将PUBLIC文章加入索引,修复手动刷新搜索索引会将私有文章加入索引的问题

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

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

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

null

#### 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
修复手动刷新搜索索引会将私有文章加入索引的问题
```
2023-11-21 06:28:07 +00:00
Ryan Wang fbc9045908
fix: unable to compile console and uc on Windows platform (#4877)
#### What type of PR is this?

/kind bug
/area console
/milestone 2.11.x

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

修复在 Windows 平台下无法正常启动 Console 服务以及无法正常编译的问题。

<img width="1124" alt="图片" src="https://github.com/halo-dev/halo/assets/21301288/55edd00a-8e71-437e-8889-0fe4a43bb40b">

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

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

#### Special notes for your reviewer:

在 Windows 平台下测试 `pnpm dev` 和 `pnpm build`,检查是否能够正常运行。

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

```release-note
None
```
2023-11-20 06:26:09 +00:00
Ryan Wang 6f1d86de6d perf: asynchronously load the uppy upload component
Signed-off-by: Ryan Wang <i@ryanc.cc>
2023-11-18 16:08:19 +08:00
随心 747cab3aa1
fix: vue warning issue in BackupListItem component (#4870)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.11.x

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

修复代码错误导致的控制台警告。异常现象:备份列表页面,有多少备份文件就会有多少个警告日志。
![image](https://github.com/halo-dev/halo/assets/44720422/2dc64621-9731-4647-b23e-c3a5aa115c37)

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

Fixes #4871

#### Special notes for your reviewer:

None

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

```release-note
修复备份页面中的浏览器控制台警告日志
```
2023-11-17 16:08:08 +00:00
John Niang 4216d95cd6
Fix the problem of unable to start application through Docker image (#4859)
#### What type of PR is this?

/kind bug
/area core

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

See https://github.com/halo-dev/halo/pull/4850#issuecomment-1812068735 for more.

Test steps:

```bash
make -C console build
./gradlew clean build -x check
docker build -t halo:not-find-main-class .
docker run -it --rm -p 8090:8090 -v ~/.halo2:/root/.halo2 halo:not-find-main-class
```

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

```release-note
None
```
2023-11-16 11:36:07 +00:00
John Niang 796ffac55f
Merge pull request #4864 from halo-dev/feature-user-center
Support user center project
2023-11-16 16:51:15 +08:00
John Niang c7a94a8211
Merge branch 'main' into feature-user-center 2023-11-16 16:36:30 +08:00
John Niang a0ea21175c
Revert "ci: push image to GHCR for pull_request event" (#4865)
Reverts halo-dev/halo#4588

According to https://docs.github.com/en/actions/security-guides/using-secrets-in-github-actions#using-secrets-in-a-workflow, we cannot obtain secrets in pull requests, so that we are not able to push docker image for every pull request.

```release-note
None
```
2023-11-16 08:36:07 +00:00
Ryan Wang a951a34a1b
feat: refine user center feature (#4857)
Signed-off-by: Ryan Wang <i@ryanc.cc>
2023-11-16 15:51:19 +08:00
John Niang 96a01cccc7
Merge branch 'main' into feature-user-center 2023-11-16 15:41:27 +08:00
John Niang c5dd569aa7
Disable code scanning for pull requests (#4863) 2023-11-16 15:37:59 +08:00
John Niang 206fdfa1ae
Merge pull request #4856 from JohnNiang/chore/integrate-with-sonarcloud
Integrate with SonarCloud
2023-11-15 15:55:22 +08:00
John Niang 08898bf100 Integrate with SonarCloud 2023-11-15 15:14:55 +08:00
Ryan Wang d356b65671 Merge branch 'main' into feature-user-center 2023-11-15 13:47:25 +08:00
John Niang b04496e4f3
Upgrade to SpringDoc 2.2.1-SNAPSHOT (#4854)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.11.x

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

This PR upgrades to SpringDoc 2.2.1-SNAPSHOT to resolve the problem of Swagger API doc display errors.

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

```release-note
升级 SpringDoc 至 2.2.1-SNAPSHOT 以解决部分 API 文档无法正常使用的问题
```
2023-11-15 03:04:09 +00:00
John Niang 65a7e970cd
Upgrade to Spring Boot 3.2.0-RC2 (#4850)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.11.x

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

- Upgrade to Spring Boot 3.2.0-RC2.
- Fix unit test errors due to upgrading.

See https://github.com/spring-projects/spring-boot/releases/tag/v3.2.0-RC2 for more.

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

Anyone who is using H2 database and wants to upgrade this version has to backup and restore Halo or upgrade old h2 database file manually.

```release-note
[Action Required] 升级 Spring Boot 至 3.2.0-RC2
```
2023-11-13 09:28:08 +00:00
Ryan Wang b0aec48c7c
feat: basic implementation of personal center (#4851)
#### What type of PR is this?

/area console
/milestone 2.11.x
/kind feature

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

个人中心的基础实现,此 PR 已完成:

1. 个人中心基础布局。
2. 将个人相关的功能移动到个人中心,包括个人资料修改、密码修改、PAT、通知配置、通知中心等。
3. 个人中心和管理控制台的切换入口。

<img width="1920" alt="图片" src="https://github.com/halo-dev/halo/assets/21301288/2db810dc-c467-4b6d-86ad-dd7473fa8ef6">

注意:此 PR 仅包含基础实现,其他的 UI 更改和 i18n 完善会放在后面的 PR。

#### Special notes for your reviewer:

测试方式:

1. 使用开发模式启动 Halo 后端。
2. 在 Console 目录运行 `pnpm dev`。
3. 测试 /console 的功能。
4. 测试 /uc 的功能。

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

```release-note
None
```
2023-11-13 08:56:08 +00:00
John Niang 70402994fa
Fix unit test errors on Windows environment (#4842)
#### What type of PR is this?

/kind cleanup
/area core

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

This PR fixes the unit test errors on Windows environment, mainly caused by different file systems.

```bash
PS C:\Users\johnniang\IdeaProjects\halo> ./gradlew check

> Task :application:checkstyleTest
Checkstyle rule violations were found. See the report at: file:///C:/Users/johnniang/IdeaProjects/halo/application/build/reports/checkstyle/test.html
Checkstyle files with violations: 16
Checkstyle violations by severity: [warning:43]


> Task :application:checkstyleMain
Checkstyle rule violations were found. See the report at: file:///C:/Users/johnniang/IdeaProjects/halo/application/build/reports/checkstyle/main.html
Checkstyle files with violations: 135
Checkstyle violations by severity: [warning:218]


> Task :application:test


BUILD SUCCESSFUL in 1m 39s
25 actionable tasks: 5 executed, 20 up-to-date
```

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

```release-note
None
```
2023-11-13 05:32:08 +00:00
inkslab 4a6ce88b7f
feat: add devices mock preview for post and single page (#4846)
#### What type of PR is this?
/kind feature
/area console


#### What this PR does / why we need it:
为文章以及页面预览增加终端切换功能,类似于预览主题的终端切换

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

Fixes #4789

#### Special notes for your reviewer:
测试方式:
本地运行halo,预览文章和页面,切换不同终端,各个界面正常显示且功能正常。


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

```release-note
文章预览支持模拟不同设备尺寸。
```
2023-11-13 04:06:08 +00:00
John Niang 841aa96e59
Upgrade to Lombok gradle plugin 8.4 (#4849)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.11.x

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

Upgrade to Lombok gradle plugin 8.4.

See https://docs.freefair.io/gradle-plugins/8.4/reference/#_installation and https://docs.freefair.io/gradle-plugins/8.4/reference/#_system_requirements for more.

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

```release-note
升级 Lombok Gradle 插件至 8.4
```
2023-11-13 03:08:09 +00:00
John Niang 9963ad359c
Upgrade to Gradle 8.4 (#4848)
#### What type of PR is this?

/kind cleanup
/area core
/milestone 2.11.x

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

Upgrade to Gradle 8.4 by executing command `./gradlew wrapper --gradle-version 8.4 --distribution-type all`.

See https://docs.gradle.org/8.4/release-notes.html for more.

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

```release-note
升级 Gradle 至 8.4
```
2023-11-13 03:06:08 +00:00
John Niang ee52adf24c
Fix the problem where some Windows developers are unable to build project (#4844)
#### What type of PR is this?

/kind bug
/area core

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

Currently, some Windows developers using GBK as character encoding are unable to build project, please see https://github.com/halo-dev/halo/issues/4771 for more. 

Because the source code are using UTF-8 character encoding, the `javadoc`, `compileJava`, `compileTestJava` and `delombok` tasks will use the default character encoding GBK to handle the sources, which prevents the `:api:javadoc` task from running properly.

At the same time, we thank to @DaiYuANg for his first proposed solution in https://github.com/halo-dev/halo/pull/4517.

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

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

#### Special notes for your reviewer:

Validate the result by executing command `./gradlew clean build -x check` on Windows environment.

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

```release-note
修复在部分 Windows 开发者无法正常构建 Halo 的问题
```
2023-11-12 04:30:08 +00:00
Ryan Wang 52d064381f
refactor: improve project structure for user center feature (#4839)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.11.x

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

重构前端的目录结构,以便在后续让个人中心的代码支持复用部分代码。

https://github.com/ruibaby/halo/tree/refactor/file-structure/console/docs/project-structure

#### Special notes for your reviewer:

测试方式:

1. 启动最新的 Halo 后端。
2. 在 Console 目录运行 `pnpm dev`,可以观察到同时监听了 3000 和 4000 端口,分别代理原本的 /console 和新加的 /uc
3. 访问 /console 和 /uc。
4. 测试 `pnpm build`,完成之后检查主项目的 `src/main/resources` 目录是否包含 console 和 uc 目录。
5. 使用生产环境运行 Halo,访问 /console 和 /uc

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

```release-note
None
```
2023-11-09 06:56:06 +00:00
John Niang 4ea20142f5
Add generator meta into head (#4821)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.11.x

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

Please see https://html.spec.whatwg.org/multipage/semantics.html#meta-generator for more.

This PR add the generator meta into head, so that we can know what sites are using Halo.

```bash
http localhost:8090/ | grep generator

<meta name="generator" content="Halo 2.11.0-SNAPSHOT"/>
```

If someone want to disable the generator meta, they can configure the property `halo.theme.generator-meta-disabled` to `true`.

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

```release-note
添加 Generator 元数据标识
```
2023-11-06 02:52:48 +00:00
John Niang caa4d44907
Upgrade to SnakeYAML 2.2 (#4819)
#### What type of PR is this?

/kind cleanup

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

Upgrade to SnakeYAML 2.2.

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

This PR fixes CVE-2022-1471(High-severity vulnerabilities).

<img width="643" alt="image" src="https://github.com/halo-dev/halo/assets/16865714/65a3c2e3-09bb-4592-a9f1-07f72ae05263">

See https://hub.docker.com/layers/halohub/halo/sha-2ccf811/images/sha256-e11fe7550a6b7eef42166b53373b6fe889538db54921fbd83623558286d9270c?context=explore for more.

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

```release-note
升级 SnakeYAML 至 2.2
```
2023-11-04 04:48:42 +00:00
guqing b8755ff3b4
chore: update the waiting time for publishing post (#4814)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.11.x

#### What this PR does / why we need it:
修改发布文章的等待时间以防止因数据库执行延迟较高导致的错误提示

最大等待时间为:`100ms * 2 ^ (retryNum - 1)` = `25600ms`
总共需等待时间为:`100ms * (2 ^ retryNum - 1)` = `31900ms` = `31.9 s`

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

```release-note
None
```
2023-11-02 09:16:05 +00:00
Ryan Wang 8c56093ee2
feat: build infrastructure for user center feature (#4806)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.11.x

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

添加前端部分的个人中心的基础设施,将通过改造 Console 项目的结构实现对个人中心页面的隔离。意味着 Console 项目的意义将转变为 frontend,其中包含 Console 和 UC。

#### Special notes for your reviewer:

测试方式:

1. 启动最新的 Halo 后端。
2. 在 Console 目录运行 `pnpm dev`,可以观察到同时监听了 3000 和 4000 端口,分别代理原本的 /console 和新加的 /uc
3. 访问 /console 和 /uc。
4. 测试 `pnpm build`,完成之后检查主项目的 `src/main/resources` 目录是否包含 console 和 uc 目录。
5. 使用生产环境运行 Halo,访问 /console 和 /uc

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

```release-note
None
```
2023-11-02 09:00:28 +00:00