feat(docs): update doc

This commit is contained in:
chenos 2021-11-19 15:40:29 +08:00
parent e6fa6f9a8e
commit 372a0c372c
20 changed files with 169 additions and 148 deletions

View File

@ -0,0 +1 @@
# action-logs

View File

@ -0,0 +1 @@
# automations

View File

@ -0,0 +1,2 @@
# china-region

1
docs/plugins/client.md Normal file
View File

@ -0,0 +1 @@
# client

View File

@ -1,4 +1,4 @@
# @nocobase/plugin-collections
# collections
提供 HTTP API 的方式管理数据表和字段

1
docs/plugins/export.md Normal file
View File

@ -0,0 +1 @@
# export

View File

@ -0,0 +1 @@
# file-manager

View File

@ -1,6 +1,5 @@
---
title: Plugins
toc: menu
title: Overview
nav:
title: Plugins
order: 4
@ -8,12 +7,16 @@ nav:
# Plugins
## Plugin Manager
## Plugin Manager <Badge>Not Available</Badge>
<Alert title="Note">
It is not yet possible to manage plugins via the CLI, this part is still under design and development.
</Alert>
Development can download, activate, disable, and remove plugins via the command line, which corresponds to
```bash
## Download plugins, which can be activated quickly with the --enable parameter
# Download plugins, which can be activated quickly with the --enable argument
yarn nocobase pm:download <plugin-name> --enable
# Activate the plugin
yarn nocobase pm:enable <plugin-name>
@ -25,66 +28,36 @@ yarn nocobase pm:remove <plugin-name>
## List of existing plugins
### @nocobase/plugin-collections datasheet configuration
Core plugins
Provides an HTTP API for managing data tables and fields
- [@nocobase/plugin-collections](plugins/collections)
Provides an HTTP API for managing data tables and fields
- [@nocobase/plugin-permissions](plugins/permissions)
Permissions module (server-side)
- [@nocobase/plugin-users](plugins/users)
User module (server-side)
- [@nocobase/plugin-client](plugins/client)
Client-side plugin that provides a GUI for the server and connects @nocobase/server to @nocobase/client
- [@nocobase/plugin-ui-schema](plugins/ui-schema)
Store the Schema of the client SchemaComponent on the server side for on-demand dynamic output
- [@nocobase/plugin-ui-router](plugins/ui-router)
Client-side routing table, storing client-side route config on the server side for on-demand dynamic output
### @nocobase/plugin-permissions
Other plugins
Permissions module
### @nocobase/plugin-users
User module
### @nocobase/plugin-system-settings
Site information configuration
### @nocobase/plugin-china-region
Field extension, China region
### @nocobase/plugin-file-manager
Field extension, attachment field
### @nocobase/plugin-action-logs
Action logs
### @nocobase/plugin-multi-apps
Dynamic multi-apps, a simple SaaS
### @nocobase/plugin-export
Operation extensions, export
### @nocobase/plugin-notifications
Notifications module (half-baked), only supports emailing for now, no visual interface
### @nocobase/plugin-automations
Automation (not available at the moment)
### @nocobase/plugin-client
Client-side plugin that provides visual configuration support for nocobase. Dependent plugins are.
- @nocobase/plugin-collections (required)
- @nocobase/plugin-permissions (required)
- @nocobase/plugin-users (required)
- @nocobase/plugin-system-settings (required)
- @nocobase/plugin-file-manager (required)
- @nocobase/plugin-china-region (optional)
- @nocobase/plugin-action-logs (optional)
Several components are included.
- Store client ui-schema on the server side for on-demand dynamic output
- Store client-side ui-router on the server side for on-demand dynamic output
- Provide static server support for app dist, allowing configuration of app dist paths
- Provide initial demo data import support for nocobase installation, configurable via importData
- Provide visualization support for collections
- [@nocobase/plugin-action-logs](plugins/action-logs)
Action logs
- [@nocobase/plugin-file-manager](plugins/file-manager)
File Manager
- [@nocobase/plugin-china-region](plugins/china-region)
China region, field extensions
- [@nocobase/plugin-export](plugins/export)
Export plugin
- [@nocobase/plugin-system-settings](plugins/system-settings)
System information configuration
- [@nocobase/plugin-multi-apps](plugins/multi-apps)
Dynamic multi-apps, easy SaaS plugin
- [@nocobase/plugin-notifications](plugins/notifications)
Notifications module (half-finished), only supports emailing for now, no visual interface
- [@nocobase/plugin-automations](plugins/automations)
Automation module (temporarily unavailable)

View File

@ -1,6 +1,5 @@
---
title: 插件
toc: menu
title: 概述
nav:
title: 插件
order: 4
@ -8,7 +7,11 @@ nav:
# 插件
## 插件管理器
## 插件管理器 <Badge>待完善</Badge>
<Alert title="注意">
暂时还不能通过 CLI 的方式管理插件,这部分还在设计开发中。
</Alert>
开发可以通过命令行下载、激活、禁用、移除插件,对应的命令行有:
@ -25,66 +28,36 @@ yarn nocobase pm:remove <plugin-name>
## 已有的插件列表
### @nocobase/plugin-collections 数据表配置
核心插件
提供 HTTP API 的方式管理数据表和字段
- [@nocobase/plugin-collections](plugins/collections)
提供 HTTP API 的方式管理数据表和字段
- [@nocobase/plugin-permissions](plugins/permissions)
权限模块(服务端)
- [@nocobase/plugin-users](plugins/users)
用户模块(服务端)
- [@nocobase/plugin-client](plugins/client)
客户端插件,为 server 提供 GUI@nocobase/server@nocobase/client 连接起来
- [@nocobase/plugin-ui-schema](plugins/ui-schema)
将客户端 SchemaComponent 的 Schema 存储在服务端,以实现按需动态输出
- [@nocobase/plugin-ui-router](plugins/ui-router)
客户端路由表,将客户端 route config 存储在服务端,以实现按需动态输出
### @nocobase/plugin-permissions
其他插件
权限模块
### @nocobase/plugin-users
用户模块
### @nocobase/plugin-system-settings
站点信息配置
### @nocobase/plugin-china-region
字段扩展,中国行政区
### @nocobase/plugin-file-manager
字段扩展,附件字段
### @nocobase/plugin-action-logs
操作日志
### @nocobase/plugin-multi-apps
动态多应用,一个简易的 SaaS
### @nocobase/plugin-export
操作扩展,导出
### @nocobase/plugin-notifications
通知模块(半成品),暂时只支持邮件发送,没有可视化界面
### @nocobase/plugin-automations
自动化(暂不可用)
### @nocobase/plugin-client
客户端插件,为 nocobase 提供可视化配置的支持。依赖的插件有:
- @nocobase/plugin-collections必须
- @nocobase/plugin-permissions必须
- @nocobase/plugin-users必须
- @nocobase/plugin-system-settings必须
- @nocobase/plugin-file-manager必须
- @nocobase/plugin-china-region可选
- @nocobase/plugin-action-logs可选
包括几部分内容:
- 将客户端 ui-schema 存储在服务端,以实现按需动态输出
- 将客户端 ui-router 存储在服务端,以实现按需动态输出
- 提供 app dist 的 static server 支持,可以配置 app 的 dist 路径
- 为 nocobase 安装提供初始化 demo 数据导入的支持,可通过 importData 配置
- 提供 collections 可视化支持
- [@nocobase/plugin-action-logs](plugins/action-logs)
操作日志
- [@nocobase/plugin-file-manager](plugins/file-manager)
文件管理器
- [@nocobase/plugin-china-region](plugins/china-region)
中国行政区,字段扩展
- [@nocobase/plugin-export](plugins/export)
导出插件
- [@nocobase/plugin-system-settings](plugins/system-settings)
系统信息配置
- [@nocobase/plugin-multi-apps](plugins/multi-apps)
动态多应用,简易的 SaaS 插件
- [@nocobase/plugin-notifications](plugins/notifications)
通知模块(半成品),暂时只支持邮件发送,没有可视化界面
- [@nocobase/plugin-automations](plugins/automations)
自动化模块(暂不可用)

View File

@ -0,0 +1 @@
# multi-apps

View File

@ -0,0 +1 @@
# notifications

View File

@ -1,3 +1,3 @@
# @nocobase/plugin-permissions
# permissions

View File

@ -0,0 +1 @@
# system-settings

View File

@ -0,0 +1 @@
# ui-router

View File

@ -0,0 +1 @@
# ui-schema

1
docs/plugins/users.md Normal file
View File

@ -0,0 +1 @@
# users

View File

@ -1,10 +1,3 @@
---
nav:
title: API
order: 3
toc: menu
---
# Application
## `app.db`

View File

@ -0,0 +1,37 @@
---
nav:
title: API
order: 3
order: 0
---
# Overview
核心 API 总共可以分为四部分:
## Database
- [Database](database.md)
- [Repository](repository.md)
- [Collection](collection.md)
- [Model](model.md)
- [Field Types](field-types.md)
- [Operators](operators.md)
## Application
- [Application](application.md)
- [Context](context.md)
- [Resourcer](resourcer.md)
- [CLI](cli.md)
## PluginManager
- [PluginManager](plugin-manager.md)
- [Plugin](plugin.md)
## Client
- [Client](client.md)
- [JavaScript SDKAPI Client](client.md)
- [REST API](rest-api.md)

View File

@ -713,6 +713,8 @@ interface destroy {
interface DestroyOptions {
filter?: any;
filterByPk?: number | string | number[] | string[];
transaction?: Sequelize.Transaction;
}
```
@ -778,9 +780,9 @@ interface IHasOneRepository<M extends Sequelize.Model> {
// 删除
destroy(): Promise<Boolean>;
// 建立关联
set(primaryKey: any): Promise<void>;
set(options: PrimaryKey | AssociatedOptions): Promise<void>;
// 移除关联
remove(): Promise<void>;
remove(options?: AssociatedOptions): Promise<void>;
}
interface HasOneFindOptions {
@ -820,9 +822,15 @@ interface IBelongsToRepository<M extends Sequelize.Model> {
// 删除
destroy(): Promise<Boolean>;
// 建立关联
set(primaryKey: any): Promise<void>;
set(options: PrimaryKey | AssociatedOptions): Promise<void>;
// 移除关联
remove(): Promise<void>;
remove(options?: AssociatedOptions): Promise<void>;
}
type PrimaryKey = string | number;
interface AssociatedOptions {
transaction?: Sequelize.Transaction;
}
interface HasOneFindOptions {
@ -863,11 +871,18 @@ interface IHasManyRepository<M extends Sequelize.Model> {
// 删除
destroy(options?: number | string | number[] | string[] | DestroyOptions): Promise<Boolean>;
// 建立关联
set(primaryKey: any | primaryKeys: any[]): Promise<void>;
set(options: PrimaryKey | PrimaryKey[] | AssociatedOptions): Promise<void>;
// 附加关联
add(primaryKey: any | primaryKeys: any[]): Promise<void>;
add(options: PrimaryKey | PrimaryKey[] | AssociatedOptions): Promise<void>;
// 移除关联
remove(primaryKey: any | primaryKeys: any[]): Promise<void>;
remove(options: PrimaryKey | PrimaryKey[] | AssociatedOptions): Promise<void>;
}
type PrimaryKey = string | number;
interface AssociatedOptions {
pk?: PrimaryKey | PrimaryKey[];
transaction?: Sequelize.Transaction;
}
```
@ -903,12 +918,19 @@ interface IBelongsToManyRepository<M extends Sequelize.Model> {
// 删除
destroy(options?: number | string | number[] | string[] | DestroyOptions): Promise<Boolean>;
// 建立关联
set(primaryKey: any | primaryKeys: any[]): Promise<void>;
set(options: PrimaryKey | PrimaryKey[] | ThroughValues | ThroughValues[] | AssociatedOptions): Promise<void>;
// 附加关联,存在中间表数据
add(primaryKey: any | primaryKeys: any[]): Promise<void>;
add(options: PrimaryKey | PrimaryKey[] | ThroughValues | ThroughValues[] | AssociatedOptions): Promise<void>;
// 移除关联
remove(primaryKey: any | primaryKeys: any[]): Promise<void>;
toggle(primaryKey: any): Promise<void>;
remove(options: PrimaryKey | PrimaryKey[] | AssociatedOptions): Promise<void>;
toggle(options: PrimaryKey | AssociatedOptions): Promise<void>;
}
type PrimaryKey = string | number;
interface AssociatedOptions {
pk?: PrimaryKey | PrimaryKey[];
transaction?: Sequelize.Transaction;
}
```
@ -917,7 +939,17 @@ interface IBelongsToManyRepository<M extends Sequelize.Model> {
多对多关系多了中间表的处理
```ts
repository.add(1);
repository.add([1, {/* 中间表数据 */}]);
repository.add([1,2,3]);
repository.add([
[1, {/* 中间表数据 */}],
[2, {/* 中间表数据 */}],
[3, {/* 中间表数据 */}],
]);
repository.set(1);
repository.set([1, {/* 中间表数据 */}]);
repository.set([1,2,3]);
repository.set([
[1, {/* 中间表数据 */}],

View File

@ -170,7 +170,7 @@ export default {
'Edit tab': '编辑标签页',
'Relationship blocks': '关系数据区块',
'Select record': '选择数据',
'Display name': 'Display name',
'Display name': '显示名称',
'Select icon': '选择图标',
'Custom column name': '自定义列名称',
'Edit description': '编辑描述',