Commit Graph

16 Commits (694ad26c3f1f076c0f5621ae11f1f69f5df2fd87)

Author SHA1 Message Date
Ryan Wang da021658c8
feat: make attachment list item operations extendable (#4689)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.10.x

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

附件管理列表项的操作按钮支持被插件扩展。


<img width="1669" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/be938c07-2976-4e22-9bf3-cdfaf53896e5">


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

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

#### Special notes for your reviewer:

需要测试附件的关于列表的已有功能是否正常。

如果需要测试扩展点是否有效,可以使用此插件测试:[plugin-s3-1.5.0-SNAPSHOT.jar.zip](https://github.com/halo-dev/halo/files/12839986/plugin-s3-1.5.0-SNAPSHOT.jar.zip)

```diff
export default definePlugin({
  components: {},
  routes: [],
  extensionPoints: {
    "plugin:self:tabs:create": (): PluginTab[] => {
      return [
        {
          id: "s3-link",
          label: "关联S3文件",
          component: markRaw(HomeView),
          permissions: [],
        },
      ];
    },
+    "attachment:list-item:operation:create": (attachment: Ref<Attachment>) => {
+      return [
+        {
+          priority: 21,
+          component: markRaw(VDropdownDivider),
+        },
+        {
+          priority: 22,
+          component: markRaw(VDropdownItem),
+          props: {
+            type: "danger",
+          },
+          label: "解除 S3 关联",
+          permissions: ["system:attachments:manage"],
+          action: () => {
+            console.log(attachment);
+          },
+        },
+      ];
+    },
  },
});

```

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

```release-note
Console 附件管理列表项的操作按钮支持被插件扩展。
```
2023-10-08 09:58:37 +00:00
Ryan Wang 272e279891
feat: make field items of post data list extendable (#4528)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.9.x

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

文章数据列表的显示字段支持通过插件扩展。

<img width="717" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/3b3b7e1f-4626-4878-a234-48915dd34e8d">

#### Special notes for your reviewer:

需要测试文章管理功能是否正常。

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

```release-note
Console 端文章数据列表的显示字段支持通过插件扩展。
```
2023-09-01 03:02:12 +00:00
Ryan Wang 1892dce64b
refactor: operation and entity field extension points (#4530)
#### What type of PR is this?

/area console
/kind improvement
/milestone 2.9.x

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

重构数据列表操作项和显示字段扩展点的类型定义和条件判断:

1. `EntityDropdownItem` 改为 `OperationItem` 以适配不同的场景,最开始仅仅是为了提供给 Entity 组件,但后面发现如主题管理列表并没有使用 Entity 组件,所以定义统一改为 Operation 。
2. 修改 `OperationItem` 和 `EntityFieldItem` 的 `visible` 字段为 `hidden`,方便渲染的时候判断,并方便调用方默认不设置值。

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

```release-note
None
```
2023-08-31 10:36:12 +00:00
Ryan Wang 8eaedd6ee8
feat: make theme list item operations extendable (#4523)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.9.x

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

主题管理列表项的操作按钮支持被插件扩展。

![image](https://github.com/halo-dev/halo/assets/21301288/fd605aa5-91a9-49dc-9f8d-14eeabd4fb93)

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

Fixes #4522 

#### Special notes for your reviewer:

测试已有的操作按钮功能正常即可。

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

```release-note
Console 主题管理列表项的操作按钮支持被插件扩展。
```
2023-08-31 07:02:12 +00:00
Ryan Wang 329b389d60
feat: add entity param for list item operation extension point (#4515)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.9.x

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

Halo 在 https://github.com/halo-dev/halo/pull/4452 中为数据列表的操作选项添加了拓展点,用于通过插件扩展操作选项。但忽略了操作选项的组件需要自定义并且自行处理点击事件,这个时候组件应该比较难拿到数据列表项的数据。

此 PR 对此进行优化,在扩展点方法传入了需要的数据。

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

```release-note
None
```
2023-08-31 03:36:13 +00:00
Ryan Wang aa95bbbf4e
feat: add extension point for extend field items of data list (#4514)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.9.x

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

添加扩展数据列表中字段的基础能力,并为插件管理列表的字段添加扩展点以测试此扩展能力。

<img width="1650" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/0b43d7fe-c1d3-4df5-913b-77cc6dc899eb">

文档:https://github.com/halo-dev/halo/pull/4514/files#diff-3fa20be5b2061cc7b68fb5581f1f9ba64daac5831c6ccfdc9ff99f1b4b77a0a4


todo:

- [x] 场景测试
- [x] 文档 

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

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


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

```release-note
Console 端的插件列表的显示字段支持扩展。
```
2023-08-31 03:32:22 +00:00
Ryan Wang a819296945
Refactor theme list modal to support extend (#4505)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.9.x

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

重构主题管理的界面,支持扩展选项卡,同时做了一些 UI 的变更。

https://github.com/halo-dev/halo/pull/4505/files#diff-e8824d75ad964eebf685ad33b915b77d3146cd04587ec53328bbb5b5602ff094

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

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

#### Special notes for your reviewer:

需要测试主题的本地上传和远程下载的安装的更新。

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

```release-note
重构 Console 端主题管理界面,支持通过插件扩展选项卡。
```
2023-08-30 04:54:15 +00:00
Ryan Wang 8afd50f84f
feat: make backup list item operations extendable (#4508)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.9.x

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

备份列表的操作列表支持被插件扩展。

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

```release-note
Console 端的备份列表的操作按钮列表支持扩展。
```
2023-08-29 03:36:16 +00:00
Ryan Wang 63bbd4fa81
Refactor plugin installation modal to support extend (#4461)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.9.x

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

重构插件安装的界面,以支持扩展。

文档:https://github.com/halo-dev/halo/pull/4461/files?short_path=fe4adc6#diff-fe4adc66005d24150478d0919c5f330ee695c2b5657ee7baed56929830c7eb90

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

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

#### Special notes for your reviewer:

需要测试插件的本地上传和远程下载的安装的更新。

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

```release-note
重构 Console 端插件安装界面,支持通过插件扩展选项卡。
```
2023-08-25 15:28:12 +00:00
Ryan Wang 70eb039468
feat: add extension point for extend data list operation items (#4452)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.9.x

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

添加扩展数据列表中操作按钮列表的基础能力,并为文章和插件管理列表的操作按钮列表添加扩展点以测试此扩展能力。

todo:

- [x] 场景测试
- [x] 文档 

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

Ref https://github.com/halo-dev/halo/issues/4177

#### Special notes for your reviewer:

可以使用以下插件进行测试:

- 源码:[plugin-export-md.zip](https://github.com/halo-dev/halo/files/12436956/plugin-export-md.zip)
- 可安装的 JAR 包:[plugin-export-md-1.0.0-SNAPSHOT.jar.zip](https://github.com/halo-dev/halo/files/12436950/plugin-export-md-1.0.0-SNAPSHOT.jar.zip)

安装之后可以在文章列表的操作按钮列表中新增一个 `导出为 Markdown 文档` 的按钮,点击之后会导出一个 Markdown 文档。

<img width="374" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/eb0b7c61-f5c8-4af3-bf13-579681d36097">


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

```release-note
Console 端的文章和插件列表的操作按钮列表支持扩展。
```
2023-08-25 09:02:12 +00:00
guqing 5c115563e0
feat: add API to obtain the bundled js file for all enabled plugins (#3444)
#### What type of PR is this?
/kind feature
/milestone 2.3.x
/area core
#### What this PR does / why we need it:
提供 `/apis/api.console.halo.run/v1alpha1/plugins/bundle.js` 来获取已启用插件的捆绑后的 main.js 和 style.css 文件

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

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

```release-note
优化已启用插件 jsbundle 文件的加载方式
```
2023-08-25 07:28:11 +00:00
John Niang bd912c36b9
Support backup and restore (#4206)
#### What type of PR is this?

/kind feature
/area core

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

See 9921deb076/docs/backup-and-restore.md for more.

<img width="1906" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/41531186-d305-44fd-8bdc-30df9b71af43">
<img width="1909" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/3d7af1b9-37ad-4a40-9b81-f15ed0f1f6e8">


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

Fixes https://github.com/halo-dev/halo/issues/4059
Fixes https://github.com/halo-dev/halo/issues/3274

#### Special notes for your reviewer:

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

```release-note
支持备份和恢复功能。
```
2023-07-24 08:26:16 +00:00
Ryan Wang c0aae3a63c
feat: make plugin tabs extensible (#4041)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.7.x

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

插件自身的详情页面中的 Tabs 选项卡支持拓展,允许开发者自行为插件编写设置界面、一些不常用的操作页面等。

示例:

<img width="1358" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/1e414e4e-688d-47de-907f-5f2a0afa9350">

扩展方式:

参考文档:https://github.com/ruibaby/halo/blob/feat/plugin-tabs-extend/console/docs/extension-points/plugin-self-tabs.md

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

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

#### Special notes for your reviewer:

需要测试:

1. 测试任意插件的详情页面是否能够正常使用。
2. 测试任意插件的设置表单能否正常使用。
3. 可以尝试根据文档为某个插件添加自定义的选项卡,测试是否能够正常工作。

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

```release-note
Console 端插件详情选项卡支持通过插件扩展。
```
2023-07-07 04:38:11 +00:00
Ryan Wang c39691d6fe
feat: make default editor extensible (#4090)
#### What type of PR is this?

/area console
/kind feature
/milestone 2.7.x

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

默认编辑器支持扩展,包括输入类型、工具栏、Slash Command 等。

Ref https://github.com/halo-sigs/richtext-editor/pull/16

## 定义方式

```ts
import ExtensionFoo from "./tiptap/extension-foo.ts"

export default definePlugin({
  extensionPoints: {
    "default:editor:extension:create": () => {
      return [ExtensionFoo];
    },
  },
});
```

其中,`ExtensionFoo` 是一个 Tiptap Extension,可以参考 [Tiptap 文档](https://tiptap.dev/) 和 [https://github.com/halo-sigs/richtext-editor/blob/main/docs/extension.md](https://github.com/halo-sigs/richtext-editor/blob/main/docs/extension.md)。

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

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

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

```release-note
Console 端的默认编辑器支持被扩展
```
2023-06-26 13:33:59 +00:00
Ryan Wang 8c05a6d30e
feat: make comment subject ref provider extensible (#4039)
#### What type of PR is this?

/area console
/kind feature

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

让评论来源的显示支持通过插件扩展,目前如 [瞬间](https://github.com/halo-sigs/plugin-moments) 这类的插件如果使用了评论模块,那么在评论管理是无法显示具体来源的:

<img width="627" alt="image" src="https://github.com/halo-dev/halo/assets/21301288/0df354dc-ed42-4217-abbd-5bce67329e0d">

此 PR 为 Console 端提供了拓展方法,使用方式如下:

```ts
import { definePlugin } from "@halo-dev/console-shared";
import type { CommentSubjectRefResult } from "@halo-dev/console-shared";
import type { Extension } from "@halo-dev/api-client";
import type { Moment } from "./types";

export default definePlugin({
  components: {},
  extensionPoints: {
    "comment:subject-ref:create": () => {
      return [
        {
          kind: "Moment",
          group: "moment.halo.run",
          resolve: (subject: Extension): CommentSubjectRefResult => {
            const moment = subject as Moment;
            return {
              label: "瞬间",
              title: determineMomentTitle(moment),
              externalUrl: `/moments/${moment.metadata.name}`,
              route: {
                name: "Moments",
              },
            };
          },
        },
      ];
    },
  },
});

```

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

Fixes #3554 

#### Special notes for your reviewer:

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

```release-note
Console 端的评论来源显示支持通过插件扩展
```
2023-06-26 04:20:18 +00:00
johnniang 64919f9a1b Move root to console
Signed-off-by: johnniang <johnniang@fastmail.com>
2023-03-02 15:49:22 +08:00