Commit Graph

4094 Commits (ce9c33c8163a3078aca12f3efaee41401970f7fa)

Author SHA1 Message Date
Ryan Wang 3b5b41eb1d refactor: improve login-related logic (halo-dev/console#617)
#### 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/2453

1. 将生产构建的 base url 更改为 console
2. 优化登录之后跳转的逻辑。

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

#### Special notes for your reviewer:

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

测试方式:

1. 在本地根据此 PR 构建生产版本(pnpm build)
2. 根据 https://github.com/halo-dev/halo/pull/2453#issue-1381947867 中的描述修改配置文件。
3. 访问 http://localhost:8090/console

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

```release-note
None
```
2022-09-22 12:46:12 +00:00
Ryan Wang 9e38c43b84 refactor: move api-client to core
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-22 16:46:32 +08:00
guqing 95b7a273f8
feat: create a configmap based on the setting definition when installing a theme (#2440)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0
#### What this PR does / why we need it:
- 安装主题后通过读取主题 Setting 模型中的默认值初始化一个 ConfigMap
- 修改了 Setting 模型的 spec  结构(多了一层 forms 嵌套),配置示例如下:
```yaml
apiVersion: v1alpha1
kind: Setting
metadata:
  name: theme-anatole-setting
spec:
  forms:
    - group: basic
      label: 基本设置
      formSchema:
        - $formkit: select
          name: sidebar_width
          label: 侧边栏宽度
          options:
            "20%": 20%
            "30%": 30%
            "40%": 40%
            "50%": 50%
          value: "40%"
```

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

Fixes #2414

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

```release-note
None
```
2022-09-22 08:26:13 +00:00
Ryan Wang 934850cbbc refactor: structure of the setting extension (halo-dev/console#616)
#### What type of PR is this?

/kind improvement
/milestone 2.0
/kind api-change

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

重构 Setting 模型的结构,适配 https://github.com/halo-dev/halo/pull/2440

todo list:

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

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

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

#### Special notes for your reviewer:

测试方式:

1. 本地 admin 仓库切换到当前 PR 的分支,halo 仓库切换到 https://github.com/halo-dev/halo/pull/2440 PR 的分支。
2. 测试后台各个表单功能是否正常。
3. 主题设置表单可使用 https://github.com/halo-sigs/theme-anatole/pull/2 PR 的分支进行测试。

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

```release-note
None
```
2022-09-22 08:26:13 +00:00
guqing cda6402780
feat: any user who accesses the system has the anonymous role (#2443)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
- 未认证用户在系统中被定义为匿名用户(username=anonymousUser),它在授权系统中具有 principle=anonymousUser 且 role=anonymous,key=[secure randomly generated key]
- 未认证用户和已认证用户都将被赋予一个匿名用户角色

参考:
- [Spring security#ServerHttpSecurity.AnonymousSpec](70460ca009/config/src/main/java/org/springframework/security/config/web/server/ServerHttpSecurity.java (L4387))
- [Spring security reactive AnonymousAuthenticationWebFilter](70460ca009/web/src/main/java/org/springframework/security/web/server/authentication/AnonymousAuthenticationWebFilter.java (L46))


#### 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-22 06:58:12 +00:00
guqing bfbc4ec70a
feat: add more query predicates for post list (#2436)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
文章列表新增更过的查询条件
- publishPhase 状态
- visible 可见性
- keyword 关键词
新增排序(sort)(可逆序 sortOrder)
- 创建时间(默认创建时间逆序)
- 发布时间

关键词过滤暂不管文章内容,否则需要查询所有文章内容判断是否包含字符串
排序暂无法支持评论数量和阅读量,这两个属性属于文章统计需要 #2430 的支撑
#### Which issue(s) this PR fixes:

Fixes #2424

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

```release-note
None
```
2022-09-22 06:14:12 +00:00
Ryan Wang 9e273e14aa feat: update page title when route change
Close https://github.com/halo-dev/halo/issues/2431
2022-09-22 12:16:11 +08:00
guqing eee81e78f1
fix: category and tag query parameters in post query (#2441)
#### What type of PR is this?
/kind api-change
/kind improvement
/area core
/milestone 2.0
#### What this PR does / why we need it:
修复文章列表的分类、标签查询参数方法名和取值不一致导致无效问题
#### Which issue(s) this PR fixes:

Fixes #2439

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

```release-note
None
```
2022-09-21 13:58:12 +00:00
guqing ac8dd74211
feat: the ConfigMap named system to store user-defined configurations (#2415)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
将原来系统默认的系统配置 system 改名为 system-default, 并使用名为 system 的 ConfigMap 来存储用户自定义的系统配置。系统最终配置为用户自定义系统配置 Merge Patch 系统默认配置的结果。
see also #2304
#### Which issue(s) this PR fixes:

Fixes #2304

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

```release-note
None
```
2022-09-21 04:06:10 +00:00
Ryan Wang eedf682974 feat: support for deleting user
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-20 17:56:15 +08:00
John Niang 1714f8edb2
Refactor CustomEndpoint for customizing GroupVersion (#2429)
#### What type of PR is this?

/kind improvement
/area core
/milestone 2.0.0

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

Refactor CustomEndpoint for customizing GroupVersion.

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

```release-note
None
```
2022-09-20 06:38:09 +00:00
Ryan Wang 4fcaa2a5e2 chore: bump dependencies
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-20 11:33:03 +08:00
Ryan Wang 69c309ea11 refactor: rename api group for custom api (halo-dev/console#613)
#### 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/2419

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

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

#### Screenshots:

#### Special notes for your reviewer:

具体变更请查阅:https://github.com/halo-dev/halo/pull/2419

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

```release-note
None
```
2022-09-20 02:44:08 +00:00
guqing a39cf2645e
refactor: rename api group for custom api (#2419)
#### What type of PR is this?
/kind improvement
/kind api-change
/area core
/milestone 2.0

#### What this PR does / why we need it:
- 修改管理后台使用的自定义 API 的 group 为 `api.console.halo.run`
- 面向三方应用的自定义 API 的 group 为 `api.halo.run`
- 插件的自定义 API 的 group 为 `api.plugin.halo.run`

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

Fixes #2418

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

```release-note
None
```
2022-09-19 16:24:35 +00:00
Ryan Wang e2db8005b7 feat: support for deleting post
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-19 20:36:15 +08:00
Ryan Wang dea60b0ebc feat: add comment management support (halo-dev/console#612)
#### 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/2412

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

Fixes halo-dev/halo#2409

#### Screenshots:

#### Special notes for your reviewer:

测试方式:

1. 本地的 halo-admin 仓库需要 checkout 到当前分支。
2. 后端需要 checkout 到 <https://github.com/halo-dev/halo/pull/2412>。
3. 使用最新的主题:<https://github.com/halo-sigs/theme-anatole>。
4. 更新 halo-admin 的依赖和构建 packages:`pnpm install` `pnpm build:packages`
5. 启用主题之后在文章详情页面即可看到评论框。
6. 测试主题端的评论和后台评论的管理。

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

```release-note
None
```
2022-09-19 09:26:50 +00:00
guqing 9fdc9c1bb7
feat: add comment custom endpoint for list view (#2412)
#### What type of PR is this?
/kind feature
/milestone 2.0
/area core
/kind api-change

#### What this PR does / why we need it:
- 新增评论列表自定义 API,支持过滤和排序条件
- 新增评论 Reconciler 以支持:
  -  是否有新回复
  - 最新回复时间
  - 上次查看回复时间
  - 未读回复数量
- 新增评论主体信息获取扩展点 `CommentSubject` 用于获取评论的 subject 信息 ,默认实现 `Post` 模型和 `SinglePage`
#### Which issue(s) this PR fixes:
Fixes #2409

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?
```release-note
新增评论列表自定义 API (包括回复)并支持过滤和排序条件
新增发表评论和回复的自定义 API
支持是否有新回复及未读回复数量
```
2022-09-19 08:38:13 +00:00
guqing 510f155e05
feat: count the number of posts under categories and tags (#2402)
#### What type of PR is this?
/kind feature
/milestone 2.0
/area core

#### What this PR does / why we need it:
统计分类和标签下的文章
#### Which issue(s) this PR fixes:
Fixes #2401

#### Special notes for your reviewer:
how to test it?
1. 创建一个多层级的分类及若干文章,查看分类的 status.posts 是否包含当前及其子分类下的文章
2. 创建标签,并将其分配给若干文章,查看标签的 status.posts 是否正确
3. 在主题端查看分类和标签包含的文章数量是否正确,需要注意的是主题端显示的文章数量只包含已发布且 visiable 为 public 且未删除的

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

```release-note
None
```
2022-09-19 02:22:12 +00:00
Ryan Wang 17759ee9a5 feat: editor support to open attachment selector
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-18 15:59:19 +08:00
guqing a0d55c58f6
feat: theme side provides variables for theme and some system settings (#2406)
#### What type of PR is this?
/kind feature
/milestone 2.0
/area core

#### What this PR does / why we need it:
提供当前使用主题(预览或激活)的 configMap 变量和部分系统设置等变量。

提供了以下变量:
- `${theme}` 当前主题的信息,theme.yaml 
- `${theme.config}` 获取当前主题的设置项
- ~`${siteSetting}`~ `${site}` 提供必要系统变量

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

#### Special notes for your reviewer:
how to test it?
再任意主题模板上使用表达式获取例如:`${theme}`,`${theme.config.sns?.email}`

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

```release-note
None
```
2022-09-15 06:52:13 +00:00
Ryan Wang e5389379c6 refactor: move entity component to @halo-dev/components package
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-14 11:17:15 +08:00
Ryan Wang 69c37e5b4f Merge branch 'next' of github.com:halo-dev/halo-admin into next 2022-09-14 10:32:05 +08:00
Ryan Wang 297dbfb962 feat: add status dot component (halo-dev/console#611)
#### 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:


#### Screenshots:

#### Special notes for your reviewer:

https://halo-admin-ui-git-fork-ruibaby-feat-status-dot-ec0d53-halo-dev.vercel.app/story/src-components-status-statusdot-story-vue?variantId=src-components-status-statusdot-story-vue-1

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

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

```release-note
None
```
2022-09-13 13:30:11 +00:00
Ryan Wang 2788261001 fix: display styles of pagination component
Signed-off-by: Ryan Wang <i@ryanc.cc>
2022-09-13 16:25:45 +08:00
Ryan Wang bcfe7a52ee feat: add the entity component as a list item (halo-dev/console#609)
#### What type of PR is this?

/kind feature
/milestone 2.0

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

添加 Entity 和 EntityField 组件,作为列表项使用。

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

#### Screenshots:

#### Special notes for your reviewer:

测试方式:检查后台各个页面的列表样式和功能是否正常。

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

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

```release-note
None
```
2022-09-13 04:08:12 +00:00
guqing 069ff04c84
refactor: theme route pattern and permalink indexer (#2397)
#### What type of PR is this?
/kind improvement
/milestone 2.0
/area core

#### What this PR does / why we need it:
使用正则细化主题端路由并优化

如何测试:
1. 在 admin 系统设置中修改文章文章详情页访问规则
2. 根据规则访问文章详情页,如规则为:`/{year:\d{4}}/{month:\d{2}}/{slug}` 而存在文章 slug 为 fake-slug 且发布日期为 2022-09-08 则 /2022/09/fake-slug 能访问, /2022/9/fake-slug 则不能访问
使用规则 `/{year:\d{4}}/{month:\d{2}}/{day:\d{2}}/{slug}`时 /2022/09/08/fake-slug 能访问 /2022/09/8/fake-slug ,则不能访问
#### Which issue(s) this PR fixes:
Fixes #2396

#### Special notes for your reviewer:
/cc @halo-dev/sig-halo 
#### Does this PR introduce a user-facing change?
```release-note
None
```
2022-09-13 03:58:10 +00:00
Ryan Wang 0a4d31fa33 perf: improve modal component style 2022-09-11 17:10:25 +08:00
Ryan Wang 780cb20def feat: add avatar component 2022-09-11 01:26:26 +08:00
Ryan Wang cccb7d07ae perf: improve functional page ui 2022-09-11 00:18:53 +08:00
Ryan Wang 24a6b9baec feat: display post count under category and tag 2022-09-10 23:35:21 +08:00
Ryan Wang 9668c429f1 perf: improve system settings page 2022-09-10 23:24:58 +08:00
Ryan Wang c278e85d6c perf: improve theme detail and settings page 2022-09-10 23:11:15 +08:00
Ryan Wang 088196e6ae perf: improve plugin detail and settings page 2022-09-10 17:23:51 +08:00
Ryan Wang bcd997231a feat: refine post filtering 2022-09-10 00:32:46 +08:00
Ryan Wang ea10523dd5 perf: auto focus when opening editing forms 2022-09-09 21:48:07 +08:00
Ryan Wang c26741e383 chore: update gitpod config 2022-09-09 19:17:22 +08:00
Ryan Wang 58c4b78067 chore: bump dependencies 2022-09-09 19:04:04 +08:00
Ryan Wang b014510036 perf: clean up theme visual component code 2022-09-09 18:46:14 +08:00
Ryan Wang 4462ceceb4 perf: improve tabbar component styles 2022-09-09 18:24:14 +08:00
guqing 9dc7bc1729
refactor: the structure of finders vo (#2400)
#### What type of PR is this?
/kind improvement
/area core
/milestone 2.0

#### What this PR does / why we need it:
统一主题端 VO 的结构 
#### Which issue(s) this PR fixes:
Fixes #2394

#### Special notes for your reviewer:
how to test it?
通过主题端调用 finder 方法来验证

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

```release-note
None
```
2022-09-09 09:44:11 +00:00
guqing 1d73228b1f
feat: theme template route filling necessary data to request model (#2393)
* feat: add archives data

* refactor: route strategy to populate necessary data

* refactor: next page url does not exceed the total number of pages
2022-09-09 14:43:02 +08:00
Ryan Wang 96b7d101d8 perf: update the api client of singlePage 2022-09-09 11:10:20 +08:00
John Niang 9331f31d58
Fix stackoverflow error when installing big theme (#2399)
#### What type of PR is this?

/kind bug
/area core
/milestone 2.0

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

We will encounter a stackoverflow error when installing theme with large size. Please see the following screenshot:

![a8a3fadd7b06a071e80d4dd1899a244](https://user-images.githubusercontent.com/16865714/189171274-1940634e-a984-4ca6-857f-f8232f6a6ad3.jpg)

#### Special notes for your reviewer:

How to test?

1. Create a big theme installation package
2. Install it and see the result

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

```release-note
None
```
2022-09-08 17:04:11 +00:00
Ryan Wang d49bcf1bde feat: menu items support setting singlePage ref relations (halo-dev/console#608)
#### 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/2395

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

#### Screenshots:

#### Special notes for your reviewer:

功能测试步骤:

1. 本地仓库 Checkout 到当前 PR。
2. Halo 后端需要 Checkout 到 https://github.com/halo-dev/halo/pull/2395/files PR。
3. 更新依赖:pnpm install
4. 构建依赖包:pnpm build:packages
5. 进入后台的自定义页面并新建页面。
6. 进入菜单管理,添加类型为自定义页面的菜单项。
7. 检查最终菜单项提供的显示名称和 permalink 是否正确。
8. 修改页面标题或者 slug,再检查最终菜单项的显示名称和 permalink 是否有自动修改。

/hold until https://github.com/halo-dev/halo-admin/pull/606 merge

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

```release-note
None
```
2022-09-08 10:32:09 +00:00
John Niang d1902ef50f
Reconcile SinglePage reference of MenuItem (#2395)
#### What type of PR is this?

/kind feature

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

Synchronize premalink and display name from SinglePage every 1 minute if only `spec.pageRef` is set.

#### Special notes for your reviewer:

See https://github.com/halo-dev/halo/pull/2380 for more.

How to test?

1. Checkout https://github.com/halo-dev/halo-admin/pull/608 and run it.
2. Create a custom page
3. Select the custom page you created just now when creating menu item
4. Check the permalink of the menu item
5. Change slug name of the custom page and check the permalink of it
6. Wait for 1 minute and check the permalink of of the menu item

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

```release-note
支持绑定自定义页面至菜单项
```
2022-09-08 10:12:10 +00:00
Ryan Wang 0e9d3c86a1 feat: single page management (halo-dev/console#606) 2022-09-08 16:49:42 +08:00
John Niang 5b66860504 Support pushing to Docker Hub (halo-dev/console#607) 2022-09-08 15:13:37 +08:00
Ryan Wang dcf42767be fix: failed to upload theme and plugin 2022-09-08 11:40:30 +08:00
John Niang a2ee2e492e
Support pushing to Docker Hub (#2392)
Signed-off-by: johnniang <johnniang@fastmail.com>

Signed-off-by: johnniang <johnniang@fastmail.com>
2022-09-07 22:39:04 +08:00
guqing e25a3d2232
fix: permalink update when slug changed (#2382)
<!--  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
/area core
/milestone 2.0
<!--
添加其中一个类别:
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:
修复文章 分类 标签的 slug 改变时,没有重新生成 permalink 的问题
#### 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 #

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

<!--
如果当前 Pull Request 的修改不会造成用户侧的任何变更,在 `release-note` 代码块儿中填写 `NONE`。
否则请填写用户侧能够理解的 Release Note。如果当前 Pull Request 包含破坏性更新(Break Change),
Release Note 需要以 `action required` 开头。
If no, just write "NONE" in the release-note block below.
If yes, a release note is required:
Enter your extended release note in the block below. If the PR requires additional action from users switching to the new release, include the string "action required".
-->

```release-note
None
```
2022-09-07 08:28:11 +00:00