Commit Graph

4419 Commits (58679b28117b1d6271dbb8ab995d24061d4ae5ec)

Author SHA1 Message Date
Ryan Wang 541fd5cea6 feat: refine ui permissions (halo-dev/console#628)
#### What type of PR is this?

/kind feature
/kind improvement
/milestone 2.0

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

完善 UI 权限控制。适配 https://github.com/halo-dev/halo/pull/2488

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

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

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. Halo 需要使用 https://github.com/halo-dev/halo/issues/2342 PR 的分支。
2. 创建新的角色,并勾选需要测试的权限。
3. 创建新的用户并赋予新的角色。
4. 测试操作权限。


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

```release-note
完善 UI 权限控制
```
2022-09-30 09:48:19 +00:00
Ryan Wang 0e81366754 feat: add system setup support (halo-dev/console#632)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

支持初始化默认数据。

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

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

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. 清空数据库。
2. 启动之后登录即可跳转到初始化界面。
3. 测试初始化的功能是否正常。

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

```release-note
None
```
2022-09-30 09:46:19 +00:00
guqing 708cd12d25
fix: total comment count for page and singlepage (#2498)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
修复文章和自定义页面的总评论数量统计取值错误
#### Which issue(s) this PR fixes:

Fixes #

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-09-30 09:44:19 +00:00
Ryan Wang 3b4703533e
docs: update readme for Halo 2.0 (#2492)
#### What type of PR is this?

/kind documentation
/milestone 2.0

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

更新 README。

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

#### Special notes for your reviewer:

/hold

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

```release-note
None
```
2022-09-30 09:42:24 +00:00
guqing 470696fff1
feat: add retry operation for post and single page when publish and update (#2497)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
发布和更新文章及自定义页面时如果遇到乐观锁错误自动重试
#### Which issue(s) this PR fixes:

Fixes #

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-09-30 09:40:23 +00:00
guqing 3995adba32
feat: add more role templates (#2488)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
补充角色模板
#### Which issue(s) this PR fixes:

Fixes #2342 https://github.com/halo-dev/halo/issues/2391

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-09-30 09:38:23 +00:00
guqing 7de944f61d
chore: degrade springboot version from 3.0.0-M5 to 3.0.0-M4 (#2496)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
将 spring boot 的版本从 3.0.0-M5 降级到 3.0.0-M5 以解决 swragger 无法使用的问题
#### Which issue(s) this PR fixes:

Fixes #

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?


```release-note
None
```
2022-09-30 08:52:19 +00:00
Ryan Wang 4b6096ce20 Merge remote-tracking branch 'origin/next' into next 2022-09-30 16:39:39 +08:00
Ryan Wang 737e65067a fix: failed to load side menus
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-30 16:38:13 +08:00
Ryan Wang bb62ebc89e perf: hide upload cover button of user detail page
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-30 16:36:35 +08:00
Ryan Wang 9c6bda84d3 feat: support for displaying site content statistics (halo-dev/console#624)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

- 支持在文章和自定义页面的管理列表显示访问数和评论数。
- 仪表盘支持显示整站的访问数。

适配 https://github.com/halo-dev/halo/pull/2476

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

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

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. Halo 需要 https://github.com/halo-dev/halo/pull/2476 PR 中的分支。
2. 需要执行 `pnpm install && pnpm build:packages`
3. 随机访问前台文章或者自定义页面,以及添加评论。
4. 查看后台是否正确统计文章浏览数和评论数。

TODO list:

- [ ] 更新 `@halo-dev/api-client`

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

```release-note
支持在文章和自定义页面的管理列表显示访问数和评论数
```
2022-09-30 08:06:18 +00:00
John Niang ba41c481bb
Fix the problem of granting role not taking effect (#2495)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.0

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

Fix the problem of granting role not taking effect.

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

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

#### Special notes for your reviewer:

Steps to test:

1. Create an user
2. Grant a role for the user
3. Check the user list

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

```release-note
None
```
2022-09-30 08:04:20 +00:00
guqing eaa18573f0
feat: add post and single page statistics (#2476)
#### What type of PR is this?
/kind feature
/area core
/milestone 2.0
/kind api-change

#### What this PR does / why we need it:
新增文章和自定义页面统计功能:
1. 浏览量统计,通过在指定模板页面插入 tracker js 上报浏览量数据并写日志到文件同时通过 Metrics 暴露数据
2. 浏览量日志异步写文件
3. 文章列表和自定义页面列表数据增加 stats 属性
4. 主题文章列表及详情、自定义页面详情增加 stats 属性
5. 新增仪表盘统计数据展示, endpoint: `/apis/api.console.halo.run/v1alpha1/stats`
```java
private Integer visits;
private Integer comments;
private Integer approvedComments;
private Integer upvotes;
private Integer users;
```

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

Fixes #2430

#### Special notes for your reviewer:
how to test it?
1. 使用一个主题,创建几篇文章和一些自定义页面,访问他们,并在详情页面的 head 总看到一个 `halo-tracker.js` 的 script 标签
![telegram-cloud-document-5-6167924618783885123](https://user-images.githubusercontent.com/38999863/192552428-b5635607-9810-4be3-b1fe-8a54ed3407c5.jpg)
2. 访问10次以上可以看到 halo work下有一个 `logs/visits.log`,里面有访问记录,它是10条为一批异步刷新到磁盘
3. 主题端文章列表及详情和自定义页面的详情可以取到一个stats字段
4.  `/apis/api.console.halo.run/v1alpha1/stats` 此 endpoint 可以得到总的访问量和评论量,这些数据也是异步的会有一分钟延迟

/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-09-30 07:58:19 +00:00
Ryan Wang 5d4613dd42 perf: improve attachment upload modal
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-30 13:03:31 +08:00
Ryan Wang 010288ec10 feat: add plugin filters support (halo-dev/console#629)
#### What type of PR is this?

/kind feature
/kind improvement
/milestone 2.0

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

添加插件管理筛选的支持。适配 https://github.com/halo-dev/halo/pull/2489

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

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

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo 
/cc @halo-dev/sig-halo-console 

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2489 PR 的分支。
2. Console 需要 `pnpm install`
3. 安装若干插件,测试筛选和排序。

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

```release-note
插件管理支持筛选
```
2022-09-30 03:12:18 +00:00
guqing a3aba94102
refactor: comment hidden default is false (#2482)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
创建评论时 hidden 字段默认为 false
#### Which issue(s) this PR fixes:

Fixes #

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-09-30 02:22:19 +00:00
John Niang 79bd55424d
Fix the problem of changing password not exist before (#2493)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.0

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

Fix the problem of changing password not exist before.

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

Partial Fixes https://github.com/halo-dev/halo/issues/2427

#### Special notes for your reviewer:

Steps to test:

1. Create an user and change his/her password
2. Login with the user and the password

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

```release-note
None
```
2022-09-30 02:18:20 +00:00
John Niang e8d00e56f4
Support filtering and sorting plugins (#2489)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.0

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

Support filtering and sorting plugins. e.g.:

```bash
http://localhost:8090/api/api.console.halo.run/v1alpha1/plugins?keyword=xyz&enabled=true&sort=creationTimestamp,desc
```

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

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

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

```release-note
None
```
2022-09-30 01:30:19 +00:00
Ryan Wang d330bb691d fix: typo of allowComment label
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-29 22:43:57 +08:00
Ryan Wang 3dcca48ef9 fix: failed to create menu item with ref
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-29 22:39:56 +08:00
Ryan Wang 5bf8a96f5e perf: improve post tag styles
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-29 14:16:11 +08:00
Ryan Wang 75694d8599 perf: refine validation config of user editing form
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-29 14:06:19 +08:00
Ryan Wang ef58d40251 refactor: pagination component
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-29 12:47:03 +08:00
Ryan Wang a853ea912a Merge remote-tracking branch 'origin/next' into next 2022-09-29 11:22:33 +08:00
Ryan Wang 54aa41d900 perf: optimize the display of numbers
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-29 11:10:31 +08:00
Ryan Wang 8df4d07fd7 feat: add display theme location support (halo-dev/console#626)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

添加显示主题存储位置的支持。适配 https://github.com/halo-dev/halo/pull/2484

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

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

#### Screenshots:

<img width="760" alt="image" src="https://user-images.githubusercontent.com/21301288/192721460-b39bfcf0-b6b7-49fe-979c-adad7bba0670.png">


#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2484 PR 的分支。
2. Console 需要 `pnpm install`
3. 上传新的主题,查看主题详情是否包含存储位置

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

```release-note
添加显示主题存储位置的支持
```
2022-09-29 02:56:17 +00:00
Ryan Wang ccdb7954f7 refactor: update the field for the number of post under categories and tags (halo-dev/console#627)
#### What type of PR is this?

/kind improvement
/milestone 2.0

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

修改标签/分类显示文章数量的字段。 适配 https://github.com/halo-dev/halo/pull/2483

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

Fixes #

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2483 PR 中的分支。
2. Console 需要 `pnpm install`
3. 发布多篇带分类和标签的文章后,检查分类和标签的文章数量是否正确。

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

```release-note
None
```
2022-09-29 02:40:17 +00:00
Ryan Wang 49d970c7cf feat: singlePage management adds filtering support (halo-dev/console#625)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

自定义页面管理支持筛选,适配 https://github.com/halo-dev/halo/pull/2481

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

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

#### Special notes for your reviewer:

测试方式:

1. Halo 需要切换到 https://github.com/halo-dev/halo/pull/2481 PR 的分支。
2. Console 需要 `pnpm install`
3. 创建多个自定义页面。
4. 测试筛选功能是否符合预期

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

```release-note
自定义页面管理支持筛选
```
2022-09-28 15:50:18 +00:00
guqing 98829f0a3e
feat: add more query params and sorter for single page (#2481)
#### What type of PR is this?
/kind feature
/milestone 2.0
/area core
/kind api-change

#### What this PR does / why we need it:
自定义页面增加排序和筛选:
筛选:
关键词
状态
可见性
作者

排序:
发布时间
创建时间
#### Which issue(s) this PR fixes:

Fixes #2469

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-09-28 15:50:17 +00:00
guqing 27e151a574
feat: add location for theme (#2484)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
主题支持展示绝对路径位置
#### Which issue(s) this PR fixes:

Fixes #2461

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-09-28 15:46:17 +00:00
guqing fe3860a8b2
refactor: reload theme.yaml when theme reload (#2486)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
主题 reload endpoint 增加对 theme.yaml 的 reload 操作
#### Which issue(s) this PR fixes:

Fixes #

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-09-28 15:28:18 +00:00
guqing 2d87a95193
refactor: do not serialize compact post for tag and category (#2483)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
标签和分类的 status 中的 posts 字段不序列化,只提供文章 postCount 代替
#### Which issue(s) this PR fixes:

Fixes #

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?

```release-note
None
```
2022-09-28 14:10:17 +00:00
Ryan Wang d05b7babe7 feat: add role search support
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-28 18:37:01 +08:00
Ryan Wang a71a04cbf3 feat: add user search support
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-28 18:27:21 +08:00
John Niang 565c8340e9
Fix the problem of not being able to request SinglePage with slug name containing special characters (#2479)
#### What type of PR is this?

/kind bug
/kind api-change
/area core
/milestone 2.0

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

Support setting special characters on slug name of SinglePage.

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

Partial Fixes https://github.com/halo-dev/halo/issues/2473

#### Special notes for your reviewer:

Steps to test:

1. Create single pags with slug name `中文`, `/a/b/c/d` or `a / b`
2. Request it with permalink generated by Halo

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

```release-note
None
```
2022-09-28 07:48:21 +00:00
Ryan Wang fe72b5ee28 perf: post and singlePage setting modal position
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-28 15:02:44 +08:00
Ryan Wang e954af88ec
perf: change the default sort order of articles (#2480)
#### What type of PR is this?

/kind improvement
/milestone 2.0
/area core

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

修改文章列表的默认排序规则,之前是按照创建时间(createTime)升序,现在改为降序。即最新创建的文章在前面。

#### Special notes for your reviewer:

测试方式:

连续创建多篇文章,检查前后台的文章排序是否是最新的在最前面。

/cc @halo-dev/sig-halo 

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

```release-note
None
```
2022-09-28 06:52:16 +00:00
Ryan Wang bd09cb3815 feat: add global search support (halo-dev/console#623)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

添加全局搜索框支持。

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

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

#### Screenshots:

<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/192448624-fbef4e58-7c0e-4c24-b29e-4dd6eba9fa4f.png">
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/192448660-369e19a4-747d-45ad-9056-162f5c8e01be.png">
<img width="1920" alt="image" src="https://user-images.githubusercontent.com/21301288/192449009-6b856d82-e7a6-4e93-b2fa-d0d0c7a58ebf.png">


#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-console 

测试方式:

1. 本地 Console 切换到当前 PR 的分支,需要 `pnpm install && pnpm build:packages`
2. 使用 Ctrl + K(Windows/Linux) 或者 Command + K(macOS)调起搜索框
3. 可以使用键盘上/下键(或者 Ctrl + J / Ctrl + K)选择搜索条目,回车键确认选择。

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

```release-note
后台添加全局搜索的支持
```
2022-09-28 06:50:16 +00:00
Ryan Wang 91793a7e03
perf: refine the extension definition for system setting (#2477)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0

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

完善系统设置表单的资源定义。

- 副标题的验证改为取消必填
- 优化主题路由规则显示名称
- 移除暂未实现的用户注册相关设置
- 代码注入设置的文案

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

Fixes #

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo 

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

```release-note
完善系统设置表单的资源定义
```
2022-09-28 03:34:16 +00:00
Ryan Wang d68f1481db fix: post editor generates toc causing cursor movement error
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-28 11:12:55 +08:00
Ryan Wang 19bb0ec1df chore: bump packages version
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-27 22:01:44 +08:00
Ryan Wang 29a5557f69 perf: disable transition of dashboard widgets
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-27 21:58:33 +08:00
John Niang 11d91712f6
Fix empty listing of single page (#2474)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.0

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

Fix empty listing of single page while using PostgreSQL.

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

```release-note
None
```
2022-09-27 09:46:15 +00:00
Ryan Wang fb501a064c feat: change favicon to halo logo
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-27 17:30:14 +08:00
Ryan Wang 0e2f0599fd refactor: grant permissions to user
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-27 17:13:20 +08:00
Ryan Wang a77fc3b2a5 perf: refine user detail page
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-27 16:47:13 +08:00
Ryan Wang f73f3e9ebf refactor: hide some features
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-27 16:23:45 +08:00
Ryan Wang 9c77b77023 feat: add deleting theme setting and configMap support (halo-dev/console#621)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

支持删除主题的时候删除对应的 Setting 和 ConfigMap 资源。

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

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

#### Screenshots:

<img width="1004" alt="image" src="https://user-images.githubusercontent.com/21301288/191994812-0ad32b23-e461-4286-9bd7-ce12b413f580.png">

#### Special notes for your reviewer:

测试方式:

1. 安装一个带有设置项的主题并做一定的配置。
2. 选择**卸载并删除配置**的选项。
3. 重新安装主题,检查设置项是否已经恢复为默认。

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

```release-note
支持卸载主题时,删除对应的 Setting 和 ConfigMap 资源。
```
2022-09-27 07:46:15 +00:00
Ryan Wang d55cbe8656 feat: add reload theme setting support (halo-dev/console#620)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

支持重载主题设置,以便开发主题的时候重载配置。适配 https://github.com/halo-dev/halo/pull/2456

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

Fixes halo-dev/halo#2426

#### Screenshots:

<img width="1664" alt="image" src="https://user-images.githubusercontent.com/21301288/191891908-64e25ec9-968f-4b56-95f8-d1479db0f31b.png">

#### Special notes for your reviewer:

/cc @halo-dev/sig-halo-admin 

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

```release-note
None
```
2022-09-27 07:44:17 +00:00
John Niang 1fc37673f7
Support running Halo with PostgreSQL (#2472)
#### What type of PR is this?

/kind feature
/area core
/milestone 2.0

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

Add PostgreSQL script to support running Halo with PostgreSQL database. BTW, there was a weird issue (emty posts even if there are some posts created) while listing Post, and I fixed it in this PR.

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

Partial Fixes https://github.com/halo-dev/halo/issues/2464

#### Special notes for reviewers

Steps to test:

1. Start up PostgreSQL. e.g.:

    ```yaml
    version: '3.1'
    
    services:
    
      db:
        image: postgres
        restart: always
        environment:
          POSTGRES_PASSWORD: openpostgresql
        ports:
          - 5432:5432
    
      adminer:
        image: adminer
        restart: always
        ports:
          - 8080:8080
    ```
    
    ```bash
    docker-compose -f postgresql.yaml up
    ```

2. Start Halo with `postgresql` profile. e.g.:

    ```bash
    ./gradlew bootRun --args="--spring.profiles.active=postgresql"
    ```

3. Validate the functionality of Halo

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

```release-note
None
```
2022-09-27 02:24:15 +00:00