feat: migration docs to vuepress

This commit is contained in:
vran 2022-05-26 18:39:46 +08:00
parent 8bebc3f3ac
commit 6987567b1c
126 changed files with 0 additions and 1665 deletions

1
CNAME
View File

@ -1 +0,0 @@
doc.databasir.com

View File

View File

@ -1 +0,0 @@
doc.databasir.com

View File

@ -1,7 +0,0 @@
# Databasir <small>1.0.2</small>
> "致力于提供一个简单易用的数据库文档管理平台!"
[GitHub](https://github.com/vran-dev/databasir)
[快速开始](/guid/index.md)

View File

@ -1,7 +0,0 @@
* 入门指南
* [快速开始](/guid/index.md)
* [常见问题](/faq/index.md)
* [更新日志](/changelog/index.md)
* [参与开发](/develop/index.md)
* [捐赠](/donate/index.md)

View File

@ -1 +0,0 @@
* [变更记录](/changelog/index.md)

View File

@ -1,77 +0,0 @@
# changelog
## v1.0.4
feature
- feature表文档中”可空”采用 YES/NO 展示
- feature表文档中”默认值”为 null 时采用红色 tag 展示
- feature支持上传本地驱动
- feature文档侧边栏支持按颜色显示版本差异
- feature点击分组卡片即可跳转到项目列表页
- feature登录应用采用卡片替代表格展示
- featureUI 细节优化,采用响应式布局
bug fix
- bug-fixhive 同步表结构时出现异常导致失败
- bug-fixoracle 同步表时数据为空
- bug-fix自定义驱动配置连接属性未生效
ref
- refactor重构版本差异接口逻辑
Full Changelog: [v1.0.3...v1.0.4](https://github.com/vran-dev/databasir/compare/v1.0.3...v1.0.4)
## v1.0.3
feature
- feature重新设计同步任务列表
- feature支持取消同步中的任务
- feature文档页面添加【回到顶部】按钮
- feature内置 mysql、oracle、sqlserver、postgresql、mariaDB 数据库模板
- feature支持通过 JSON 导入数据库模板
- feature创建分组、项目时的【描述】字段由必填改为可选
- feature优化页面 UI 多个细节
bug fix
- bug-fix并发同步任务时概率出现版本冲突
- bug-fixmarkdown 文档导出时出现 NPE
- bug-fix部分数据库oracle、达梦同步文档失败
- bug-fix同步表超过 1000+ 时出现 cursor limit
Full Changelog: [v1.0.2...v1.0.3](https://github.com/vran-dev/databasir/compare/v1.0.2...v1.0.3)
## v1.0.2
feature
- featureUML 图片导出支持 svg 格式
- feature表目录列表支持按表名、注释名搜索
- feature表文档页面新增注释展示
- feature数据库扩展支持自动获取驱动类名
- feature数据库元数据同步采用异步任务设计解决大数据量同步超时问题
- feature文档内容采用分组加载解决大数据量加载超时问题
- feature文档默认模板统一改为中文
security
- security对上传的驱动 jar 包新增规则校验
- security采用可配置默认随机的 jwt token secret
Full Changelog: [v1.0.1...v1.0.2](https://github.com/vran-dev/databasir/compare/v1.0.1...v1.0.2)
## v1.0.1
feature
- feature重新设计文档模板编辑功能
- feature优化文档页面样式
bug fix
- bug fix邮件线程池配置导致系统启动失败
- bug fixDiff 引擎异常导致文档同步失败
- bug fix部分浏览器复制 Insert SQL 会出现不兼容情况
Full Changelog: [v1.0.0...v1.0.1](https://github.com/vran-dev/databasir/compare/v1.0.0...v1.0.1)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.8 KiB

View File

@ -1,11 +0,0 @@
* 构建指南
* [项目构建](/develop/build/index.md)
* 系统扩展
* [如何扩展文件导出类型?](/develop/how-to-add-export-type/index.md)
* 系统架构
* [模块和包](/develop/module-and-package/index.md)
* 系统原理
* [用户名密码登录流程](/develop/login-and-auth/username-and-password/index.md)

View File

@ -1,132 +0,0 @@
# 如何扩展导出文件类型?
> Note: 本节内容默认读者有 Java 开发能力
## 实现步骤
### 一、扩展文件类型
`com.databasir.core.domain.document.generator.DocumentFileType` 中新增文件类型
```java
@AllArgsConstructor
@Getter
public enum DocumentFileType {
MARKDOWN("md", "Markdown"),
PLANT_UML_ER_SVG("svg", "UML SVG"),
PLANT_UML_ER_PNG("png", "UML PNG"),
;
private String fileExtension;
private String name;
}
```
`DocumentFilType` 是一个枚举类型,构造器需要传入两个参数
| 名称 | 说明 | |
| ------------- | ------------------------------------------------------------ | ---- |
| fileExtension | 代表导出文件的后缀,用户导出项目文件时系统会使用 `项目名 + "." + {{fileExtension}}` 去命名文件 | |
| name | 展示给用户的标签 | |
比如我现在要新增一个 excel 格式的导出类型,那么新增一个枚举值 `EXCEL`
```java
@AllArgsConstructor
@Getter
public enum DocumentFileType {
MARKDOWN("md", "Markdown"),
PLANT_UML_ER_SVG("svg", "UML SVG"),
PLANT_UML_ER_PNG("png", "UML PNG"),
EXCEL("xlsx", "Excel")
;
private String fileExtension;
private String name;
}
```
### 二、实现文件生成逻辑
接下来就是定义一个类,该类需要实现接口 `com.databasir.core.domain.document.generator.DocumentFileGenerator`
```java
public interface DocumentFileGenerator {
boolean support(DocumentFileType type);
void generate(DocumentFileGenerateContext context, OutputStream outputStream);
@Getter
@Builder
class DocumentFileGenerateContext {
@NonNull
private DocumentFileType documentFileType;
@NonNull
private DatabaseDocumentResponse databaseDocument;
}
}
```
其中
- support 方法标识该类支持生成的文件类型
- generate 是具体的生成逻辑
继续完善的 excel 导出的扩展记住实现类一定要加上spring 的 `@Component` 注解,不然 [Databasir](https://github.com/vran-dev/databasir) 无法找到该实现类
```java
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Component;
@Component
@Slf4j
@RequiredArgsConstructor
public class MarkdownDocumentFileGenerator implements DocumentFileGenerator {
@Override
public boolean support(DocumentFileType type) {
// 这里表示该实现类是支持 EXCEL 格式导出的
return type == DocumentFileType.EXCEL;
}
@Override
public void generate(DocumentFileGenerateContext context, OutputStream outputStream) {
Path path = .... // excel path
byte[] bytes = Files.readAllBytes(path);
// 将文件的字节流通过 stream 写出即可
outputStream.write(bytes)
}
}
```
## 示例
[Databasir](https://github.com/vran-dev/databasir) 目前已经提供了 markdown、png、svg 三种格式的文件导出,其中 png 和 svg 文件是基于 plantuml 导出的实体关系图。
对应的源码如下,读者可以参考
- SVG`com.databasir.core.domain.document.generator.plantuml.PlantUmlErSvgFileGenerator`
- PNG`com.databasir.core.domain.document.generator.plantuml.PlantUmlPngFileGenerator`
- Markdown`com.databasir.core.domain.document.generator.MarkdownDocumentFileGenerator`

View File

@ -1,3 +0,0 @@
# 参与开发
// TODO 系统设计文档正在逐步完善中...

View File

@ -1,9 +0,0 @@
# Databasir 登录授权流程
### [一、用户名密码登录认证流程](README/develop/login-and-auth/username-and-password/index.md)
### [二、OAuth2 登录认证流程](README/develop/login-and-auth/oauth2/index.md)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 21 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 80 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

View File

@ -1,161 +0,0 @@
# 用户名密码登录解析
## 相关代码位置
相关代码都位于 `API` 模块下的
- 【package】com.databasir.api.config.security.*
- 【class】com.databasir.api.config.SecurityConfig.java
## 登录认证过滤器
Databasir 的登录认证都是在 Filter 中实现的,目前有两个自定义的 Filter
- `DatabasirOauth2LoginFilter`:负责处理 OAuth2 登录的请求
- `DatabasirJwtTokenFilter`:负责验证登录凭证的有效性
用户名和密码的登录采用 Spring Security 自带的 Filter
- `UsernamePasswordAuthenticationFilter`:负责处理用户名密码登录的请求
用户登录请求都会经过这三个过滤器
![](img/1-filter.png)
由于本篇主要说明用户明密码登录这一流程,所以会重点专注于 `UsernamePasswordFilter` 这一过滤器。
## 登录认证相关类
用户名密码登录是基于 Spring Security 提供的 `UsernamePasswordAuthenticationFilter` 实现。
Databasir 根据该过滤器的扩展点自定义了以下类
- DatabasirAuthenticationFailureHandler登录失败回调
- DatabasirAuthenticationSuccessHandler登录成功回调
- DatabasirUserDetailService获取用户登录信息的 service
- DatabasirUserDetails用户的登录信息扩展了角色信息
这些类的装配都在 `com.databasir.api.config.SecurityConfig.java` 中,下面展示了一部分源码,重点关注 `configure(HttpSecurity)` 方法
```java
@Configuration
@RequiredArgsConstructor
@EnableGlobalMethodSecurity(prePostEnabled = true)
public class SecurityConfig extends WebSecurityConfigurerAdapter {
private final DatabasirUserDetailService databasirUserDetailService;
private final DatabasirAuthenticationEntryPoint databasirAuthenticationEntryPoint;
private final DatabasirJwtTokenFilter databasirJwtTokenFilter;
private final DatabasirAuthenticationFailureHandler databasirAuthenticationFailureHandler;
private final DatabasirAuthenticationSuccessHandler databasirAuthenticationSuccessHandler;
@Override
protected void configure(HttpSecurity http) throws Exception {
http.headers().frameOptions().disable();
http.csrf().disable();
http.cors();
http.sessionManagement().sessionCreationPolicy(SessionCreationPolicy.STATELESS)
.and()
// 启用 form 表单登录方式,配置登录地址为 /login并制定成功和失败的回调处理类
.formLogin()
.loginProcessingUrl("/login")
.failureHandler(databasirAuthenticationFailureHandler)
.successHandler(databasirAuthenticationSuccessHandler)
.and()
.authorizeRequests()
// 登录和 Token 刷新无需授权
.antMatchers("/login", Routes.Login.REFRESH_ACCESS_TOKEN)
.permitAll()
// oauth 回调地址无需鉴权
.antMatchers("/oauth2/apps", "/oauth2/authorization/*", "/oauth2/login/*")
.permitAll()
// 静态资源无需鉴权
.antMatchers("/", "/*.html", "/js/**", "/css/**", "/img/**", "/*.ico")
.permitAll()
// api 请求需要授权
.antMatchers("/api/**").authenticated()
.and()
.exceptionHandling()
.authenticationEntryPoint(databasirAuthenticationEntryPoint);
http.addFilterBefore(
databasirJwtTokenFilter,
UsernamePasswordAuthenticationFilter.class
);
}
@Override
protected void configure(AuthenticationManagerBuilder auth) throws Exception {
// 这里指定了 userDetailService 为自定义的 DatabasirUserDetailService
auth.userDetailsService(databasirUserDetailService)
.passwordEncoder(bCryptPasswordEncoder());
}
}
```
## 登录认证过滤器处理流程
当请求经过 `UsernamePasswordAuthenticationFilter` 时,该过滤器会校验请求的路径是否是 `/login` ,如果不是的话就直接放行。
然后在从请求参数里面获取用户名和密码
- username
- password
再之后使用 `DatabasirUserDetailsService` 根据用户名获取实际的用户信息,将实际的密码和登录时传的参数做比较
- 如果不一致就登录失败,调用 `DatabasirAuthenticationFailureHandler`
- 如果一致就说明登录成功,调用 `DatabasirAuthenticationSuccessHandler`
下图展示了一个简化的代码调用时序
![](img/2-username-and-password-filter.png)
## 登录成功回调
当用户名密码认证通过以后就会触发**登录成功回调**(代码实现在`DatabasirAuthenticationSuccessHandler`),这里主要做一件事情
- 生成登录凭证access_token、refresh_token
access_token 是请求接口的凭证,证明你是合法的登录用户,时效性是以分钟为单位,格式为 JWT。
refresh_token 是用于在 access_token 过期时,用于获取新的 access_token时效性是以天为单位。
这些信息都存储在 login 表里login 表与 user 表是一对一的关系
![](img/3-token.png)
access_token 和 refresh_token 最终都会返回给前端,前端拿到 token 以后调用业务接口都需在请求中加入 名为 Authorization 的 Header值为 access_token
```http
POST /api/v1.0/groups
Authorization: {{ access_token }}
```
如果 access_token 过期,前端会拿 refresh_token 获取一个新的 access_token然后再调用业务接口这些过程对用户是透明的。
## 登录失败回调
当用户名密码认证没通过的时候机会触发登录失败回调,源码位于 `DatabasirAuthenticationFailureHandler` 中。
失败的回调会判断异常类型做出不同的响应
- BadCredentialsException响应 200用户名或密码错误
- DisabledException响应 200用户已禁用
- DatabasirAuthenticationException响应 200自定义登录异常
- 其他:响应 401

Binary file not shown.

Before

Width:  |  Height:  |  Size: 22 KiB

View File

@ -1,67 +0,0 @@
## 后端模块概览
Databasir 基于 Gradle 进行模块管理,当前共有 5 个模块
| 模块名称 | 职责 |
|---------------| ------------------------------------------------------------ |
| api | 所有的接口和定时任务均在该模块定义 |
| common | 定义了项目通用的类,比如加解密工具、业务异常、标准 HTTP 返回类型等 |
| core | 核心业务模块,包含了所有的业务逻辑 |
| dao | 数据访问层,包含了数据库的实体、数据访问对象以及项目模型的 SQL 文件 |
| meta原plugin | jdbc 封装模块,将从 jdbc 获取的数据库元信息转换成 Databasir 的 Java 对象,文档信息的 DIFF 功能也是在该模块内实现 |
模块的依赖关系是一个简单的单向依赖
![](img/module-relation.png)
## API 模块介绍
- 代码目录
```java
api
└── src/main/java
└── com/databasir
├── api
│ ├── advice
│ │ ├── DatabasirExceptionAdvice.java /* 业务异常切面 */
│ │ └── OperationLogAspect.java /* 审计日志切面 */
│ ├── common
│ │ └── LoginUserContext.java 用户信息工具类
│ ├── config
│ │ ├── oauth2
│ │ │ ├── DatabasirOAuth2Authentication.java /* oauth2 登录信息实体 */
│ │ │ ├── DatabasirOauth2LoginFilter.java /* oauth2 登录过滤器 */
│ │ │ └── OAuth2AuthenticationSuccessHandler.java /* oauth2 登录成功回调类 */
│ │ ├── security
│ │ │ ├── DatabasirAuthenticationEntryPoint.java /* 授权失败回调类 */
│ │ │ ├── DatabasirAuthenticationFailureHandler.java /* 登录失败回调类 */
│ │ │ ├── DatabasirAuthenticationSuccessHandler.java /* 登录成功回调类 */
│ │ │ ├── DatabasirJwtTokenFilter.java /* jwt token 校验过滤器 */
│ │ │ ├── DatabasirUserDetails.java /* 已登录用户实体信息 */
│ │ │ └── DatabasirUserDetailService.java /* 加载 DatabasirUserDetails 的 service */
│ │ ├── SecurityConfig.java /* spring security 配置类 */
│ │ └── WebConfig.java /* web 配置类 */
│ ├── validator
│ │ └── XXXXXValidator.java /* 业务规则前置校验器 */
│ ├── XXXXXController.java /* 业务 HTTP 接口 */
│ └── Routes.java /* 业务 HTTP 接口路径常量 */
└── job
├── ProjectDocumentAutoSyncJob.java /* 文档自动同步任务 */
└── ProjectDocumentAutoSyncTriggerJob.java /* 文档自动同步任务启用任务 */
```
- 配置目录
```java
api
└── src/main/resources
├── static /* 静态资源目录 */
├── application.properties /* 生产环境配置文件 */
└── application-local.properties /* 本地开发配置文件 */
```

View File

@ -1 +0,0 @@
* [捐赠](/donate/index.md)

View File

@ -1,9 +0,0 @@
## 捐赠方式
开源不易,扶我起来吧!再写两行
<img src="https://s2.loli.net/2022/05/23/phDIKagHwjZl3kA.jpg" width="280">
## 扫码加群
<img src="https://s2.loli.net/2022/05/23/w3nDImdk9KAjr4L.jpg" width="250px" />

View File

@ -1 +0,0 @@
* [常见问题](/faq/index.md)

View File

@ -1,25 +0,0 @@
## Mysql
- 如何填写 database 和 schema
在 Mysql 中两者概念其实是一样的,都是数据库名称,填一样的就可以了
- 文档同步完成以后没有注释信息
这是 MYSQL 官方 JDBC 驱动的限制,需要在项目编辑页面的连接属性中添加 `useInformationSchema=true`
## Oracle
- 文档同步完成以后没有注释信息
这是 Oracle 官方 JDBC 驱动的限制,需要在项目编辑页面的连接属性中添加 `remarksReporting = true`
## Postgresql
- Postgresql 的 schema 该怎么填写?
如果项目没有做特殊的设置,那么 postgresql 的默认 schema 名称是 `public`
## SQL Server
- Sql Server 的 database 该怎么填写?
如果项目没有做特殊的设置,那么 Sql Server 的默认 database 名称是 `master`

View File

@ -1,24 +0,0 @@
* 项目说明
* [](/guid/index.md)
* 系统部署
* [Jar 包部署](/guid/deploy/jar-deploy.md)
* [Docker 部署](/guid/deploy/docker-deploy.md)
* 基本概念
* [角色与权限](/guid/concept-user-role/user-role.md)
* [分组与项目](/guid/concept-group-project/index.md)
* 基础操作
* [分组管理](/guid/management-group/index.md)
* [项目管理](/guid/management-project/index.md)
* [文档管理](/guid/management-document/index.md)
* [用户管理](/guid/management-user/index.md)
* [邮箱设置](/guid/management-email/index.md)
* 进阶操作
* [启用 Github 第三方认证登录](/guid/advance-github-oauth2/github-oauth2.md)
* [启用 Gitlab 第三方认证登录](/guid/advance-gitlab-oauth2/gitlab-oauth2.md)
* [扩展更多数据库类型](/guid/advance-database-extension/database-extension.md)
* [数据库模板列表](/guid/advance-database-type-list/index.md)
* [Mock Insert SQL 生成](/guid/advance-mock-sql/index.md)

View File

@ -1,80 +0,0 @@
# 扩展更多数据库类型
## 说明
[Databasir](https://github.com/vran-dev/databasir) 理论上是支持所有**拥有 JDBC 驱动的数据库**,系统已为 Mysql、Postgresql 提供了内置的支持,这两种数据库可以开箱即用。
默认配置
| 数据库类型 | 驱动版本 | 驱动类名 |
| ---------- | -------- | ------------------------ |
| mysql | 8.0.27 | com.mysql.cj.jdbc.Driver |
| postgresql | 42.3.1 | org.postgresql.Driver |
对于其它数据库(有 JDBC 驱动),用户可以通过导入的方式实现扩展。
## 内置模板导入
在数据库的扩展中已将以下数据库模板实行了内置,用户可以按需添加
- mysql
- postgresql
- sqlserver
- oracle
- mariaDB
![img.png](img/inner-template.png)
当然这并不是说 Databasir 只支持这几款数据库,而是这些数据库经过了测试是可以使用的。
随着测试的扩展,内置模板的数量将会越来越多。
## 第三方模板 JSON 导入
有很多社区的模板没有被内置到 Databasir 中,用户可以通过分享 JSON 的形式进行导入
[点击查看](/guid/advance-database-type-list/index) JSON 模板示例
![img.png](img/json-import.png)
## 自定义配置
如果用户有一定的 Java 技术背景,则可以通过填写表单的形式进行扩展。
数据库类型是全平台可用的,所以限制了只有【系统管理员】权限才能新增数据库类型。
通过菜单我们进入【数据库类型】配置页面
![](img/1-menu.png)
在该页面我们可以看到既有的数据库类型信息,点击左上角的 + 号就可以进入新增页面
![](img/2-database-types.png)
这个表单中我们需要填入一些必要的信息,我们以扩展一个 mariadb 为例
![](img/3-add.png)
| 属性 | 说明 | 示例数据 |
| ----------------- | ------------------------------------------------------------ | ------------------------------------------------------------ |
| 数据库类型 | 这是你自己定义的名称,最好是能见名知意,改名字在整个系统内不能重复。创建项目时的数据库类型会展示该名称。 | mariadb |
| 图标地址 | 用于展示图标 | |
| 描述 | 对该数据库类型的一些说明 | maria database |
| JDBC 驱动下载地址 | 系统会从改地址去下载对应的驱动,如果填入的时 maven 仓库,建议选择国内的镜像仓库,如阿里云、公司私服等。 | https://maven.aliyun.com/repository/central/org/mariadb/jdbc/mariadb-java-client/3.0.3/mariadb-java-client-3.0.3.jar |
| 驱动类名 | 比如 mysql 老版本的类名就是 `com.mysql.jdbc.Driver` | org.mariadb.jdbc.Driver |
| 协议头 | 创建连接时的协议头,比如 mysql 就是 `jdbc:mysql` | jdbc:mariadb |
| URL 生成表达式 | 大部分数据库连接的格式是规范的,但也有少部分我们需要自定义连接 URL而该表达式就定义了连接的模板系统会基于该模板生成最终的连接。通常情况下我们不需要去修改默认表达式 | 默认 |
表达式内置变量
- {{jdbc.protocol}} 对应表单中填写的协议头
- {{db.name}} 对应创建项目时填写的数据库名称
- {{db.schema}} 对应创建项目时填写的 schema名称
- {{db.url}} 对应创建项目时填写的 url
## 验证
保存完成以后我们就可以在项目创建页面找到我们自定义的数据库示例了
![](img/4-result.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 104 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 89 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 51 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

View File

@ -1,125 +0,0 @@
# 数据库模板
## MYSQL
<!-- tabs:start -->
#### **mysql-8**
```json
{
"author": {
},
"template": {
"databaseType": "mysql-8.0.28",
"jdbcDriverFileUrl": "https://maven.aliyun.com/repository/central/mysql/mysql-connector-java/8.0.28/mysql-connector-java-8.0.28.jar",
"icon": "",
"description": "mysql-8.0.28",
"jdbcDriverClassName": "com.mysql.cj.jdbc.Driver",
"jdbcProtocol": "jdbc:mysql",
"urlPattern": "{{jdbc.protocol}}://{{db.url}}/{{db.name}}"
}
}
```
#### **mysql-5**
```json
{
"author": {
},
"template": {
"databaseType": "mysql-5.1.49",
"jdbcDriverFileUrl": "https://maven.aliyun.com/repository/central/mysql/mysql-connector-java/5.1.49/mysql-connector-java-5.1.49.jar",
"icon": "",
"description": "mysql-5.1.49",
"jdbcDriverClassName": "com.mysql.jdbc.Driver",
"jdbcProtocol": "jdbc:mysql",
"urlPattern": "{{jdbc.protocol}}://{{db.url}}/{{db.name}}"
}
}
```
<!-- tabs:end -->
## PostgreSQL
```json
{
"author": {
},
"template": {
"databaseType": "postgresql-42.3.4",
"jdbcDriverFileUrl": "https://maven.aliyun.com/repository/central/org/postgresql/postgresql/42.3.4/postgresql-42.3.4.jar",
"icon": "",
"description": "postgresql jdbc version 42.3.4",
"jdbcDriverClassName": "org.postgresql.Driver",
"jdbcProtocol": "jdbc:postgresql",
"urlPattern": "{{jdbc.protocol}}://{{db.url}}/{{db.name}}"
}
}
```
## MariaDB
```json
{
"author": {
},
"template": {
"databaseType": "mariadb-3.0.3",
"jdbcDriverFileUrl": "https://maven.aliyun.com/repository/central/org/mariadb/jdbc/mariadb-java-client/3.0.3/mariadb-java-client-3.0.3.jar",
"icon": "",
"description": "mariadb-3.0.3",
"jdbcDriverClassName": "org.mariadb.jdbc.Driver",
"jdbcProtocol": "jdbc:mariadb",
"urlPattern": "{{jdbc.protocol}}://{{db.url}}/{{db.name}}"
}
}
```
## Oracle
<!-- tabs:start -->
#### **thin**
```json
{
"author": {
},
"template": {
"databaseType": "oracle-thin-12.2.0.1",
"jdbcDriverFileUrl": "https://maven.aliyun.com/repository/central/com/oracle/database/jdbc/ojdbc8/12.2.0.1/ojdbc8-12.2.0.1.jar",
"icon": "",
"description": "oracle-thin-12.2.0.1",
"jdbcDriverClassName": "oracle.jdbc.OracleDriver",
"jdbcProtocol": "jdbc:oracle:thin",
"urlPattern": "{{jdbc.protocol}}:@{{db.url}}:{{db.name}}"
}
}
```
<!-- tabs:end -->
## SqlServer
```json
{
"author": {
},
"template": {
"databaseType": "sqlServer-10.2.0.jre8",
"jdbcDriverFileUrl": "https://maven.aliyun.com/repository/central/com/microsoft/sqlserver/mssql-jdbc/10.2.0.jre8/mssql-jdbc-10.2.0.jre8.jar",
"icon": "",
"description": "sqlServer-10.2.0.jre8",
"jdbcDriverClassName": "com.microsoft.sqlserver.jdbc.SQLServerDriver",
"jdbcProtocol": "jdbc:sqlserver",
"urlPattern": "{{jdbc.protocol}}://{{db.url}};databaseName={{db.name}}"
}
}
```
## 达梦
```json
// TODO
```

View File

@ -1,57 +0,0 @@
# 启用 Github 第三方认证登录
## 一、创建 Github OAuth 应用
前往 Github 的配置页面创建 Github OAuth Application
![github-app-create](img/1-github-oauth2-app-create.png)
点击 `New OAuth App` 就会进入应用创建页面
![github-oauth2](img/2-github-oauth2-create.png)
Homepage URL 填写你部署 databasir 后,可访问的公网域名。
Authorization callback URL 你可以先填写 {{ databasir 域名 }}/login/oauth2/{{ registrationId }}。
这里的 registrationId 你可以任意填写,只需要稍后在 Databasir 中配置时保持一致即可,我这里填写了 `vran_github`
填好信息以后点击 `Register application` 就能成功创建一个 OAuth Application 了并跳入下图所示页面
![oauth2-github](img/3-github-oauth2-create.png)
在点击 `Generate a new client secret`,生成秘钥以后记得复制暂存一下,以后是看不见原始秘钥的了
记得保存 Client Id 和刚刚生成的 Client Secret。
![oauth2-github](img/4-github-oauth2-create.png)
## 二、Databasir 登录设置
进入 Databasir 系统管理 -> 登录设置
![databasir](img/5-github-oauth-create.png)
进入到应用创建页面,填写表单信息。
![](img/6-github-oauth-create.png)
还记得前面提到的 `registrationId` 吗?那个就对应 databasir 中的 `应用 ID` ,只要两者保持一致就可以成功接受 github 的回调。
要是前面配错了也没关系,可以在当前页面复制自动生成的 URL 去 github 重新填写 Authorization callback URL 就可以了。
注意授权地址和资源地址
- 授权地址:获取 access_token 的请求地址
- 资源地址:获取用户信息的请求地址
这里填写不一样是因为 github 官方将授权和资源地址分开的,**如果你使用的时 github enterprise 版本,授权地址和资源地址其实是一样的**。
## 三、登录验证
配置完成以后,注销登录后再次进入登录页面就会发现多了一个 github 的小图标,点击就可以使用 github 进行登录
![](img/7-github-oauth-create.png)
点击就会进入授权页面,授权完成就会创建一个新的 databasir 用户,并直接登录成功
![](img/8-github-oauth-create.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 69 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 78 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

View File

@ -1,41 +0,0 @@
# 启用 Gitlab 第三方认证登录
## 一、申请 Gitlab 应用
前往 Gitlab 配置页面创建 Gitlab 应用,填写应用名称、回调地址等信息,注意下面授权一定记得勾选上 **read_user**
回调地址填写你访问 databasir 的公网地址 {{ databasir 地址 }}/login/oauth2/{{ 应用ID }}
这里我的应用 id 为 vran-gitlab后面在 databasir 配置的时候需要用上
![](img/1-gitlab-oauth2.png)
保存好应用以后,就可以看见 Application Id 和 Secret保存下来这两个值
![](img/2-gitlab-oauth2.png)
## 二、Databasir 登录设置
进入 Databasir 系统管理 -> 登录设置页面
![](img/3-gitlab-oauth2.png)
创建并保存应用信息
- client Id 就对应申请到的 Application Id
- client secret 就对应申请到的 Application secret
- 应用 id 记得和我们第一步填写 redirect uri 时的应用 id 保持一致
![image-20220303225811673](img/4-gitlab-oauth2.png)
## 三、登录验证
保存完成以后注销登录,进入登录页面就可以看见多了一个 gitlab 的登录图标,点击就可以使用 gitlab 来登录了
![](img/5-gitlab-oauth2.png)
注意:如果登录出现 The redirect URI included is not valid. 这样的错误,请检查回调地址是否与 databasir 的地址一致,以及协议是否一致(比如 http 和 https
点击登录以后就会进入授权页面,授权完成以后就会新建一个 databasir 用户并自动完成登录
![](img/6-gitlab-oauth2.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 146 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 34 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 72 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 119 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 101 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 110 KiB

View File

@ -1,50 +0,0 @@
# Mock Insert SQL 生成
## 功能入口
每一张表的文档都包含了完整的列信息,基于这些信息 Databasir 可以生成 Insert SQL从而降低开发过程中**造数据**的复杂度。
该功能位于文档信息的表名称旁边,一个以 M 标识的按钮
![a](img/a.png)
点击按钮就会弹出对话框,该对话框有两部分
- Mock 数据:展示了生成的 sql 语句,可以直接复制
- 生成规则:该 Tab 页面可以配置每个字段的生成规则
![](img/b.png)
![](img/c.png)
## 生成规则
目前 Databasir 提供了 8 种生成规则
| 类型 | 说明 | 类型 |
| ------ | ------------------------------------------------------------ | ------ |
| 自动 | Databasir 会根据列类型生成数据,比如数字就默认是 1字符串就默认是 '' | - |
| 关联 | 该字段可以关联其他表的其他列Databasir 会根据依赖关系生成所有的关联 SQL并且会自动检测是否出现了循环依赖 | - |
| 脚本 | Databasir 支持使用 Spel 表达式来定义字段值,比如表达式 "true" 就代表为 true表达式 "'hello'" 就是 'hello',目前还处于 Beta 状态 | * |
| 手机号 | 手机号 | 字符串 |
| 头像 | 头像 URL | 字符串 |
| UUID | UUID | 字符串 |
| 邮箱 | 随机邮箱 | 字符串 |
| 姓名 | 全英文随机姓名 | 字符串 |
## SpEl 表达式Beta示例
Note目前脚本模式还处于 Beta 状态,后期有可能会有大的调整。
一、自定义常量值
如果想生成自定义的常量值,可以使用双引号包括起来,比如
- 布尔值 "true" -> true
- 字符串 "'hello world'" -> 'hello world'
- 数字 "1" -> 1
- 函数 "now()" -> now()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 23 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 31 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 36 KiB

View File

@ -1,41 +0,0 @@
# 分组与项目
分组Group和项目Project是 Databasir 中最基础的概念,它们之间的关系如下图所示
![group-and-project](img/group.png)
## 分组Group)
![group-and-project](img/group-sample.png)
分组是由项目和成员共同组成,它们之间有着非常明确对应关系
- 一个分组下有多个成员(用户)
- 一个分组下有多个项目
每个成员(用户)在所属分组可以承担两种角色,分别是
- 组长:拥有该分组下的所有读写权限
- 组员:拥有该分组下的部分写权限,全部读权限
对于每个用户来说,他可以加入多个分组,在不同的分组承担不同的角色。
Databasir 并没有将分组和企业中的组织或开发中的环境做强行的绑定,你可以灵活的使用它,推荐的做法是
- 如果你的项目数不多,可以使用分组作为环境管理,比如创建 dev、qa、prod 三个分组
- 如果你所在团队很大,可以将分组对应到不同的业务线,比如公共设施组、电商平台组、物流平台组等
## 项目Project)
![img.png](img/project-sample.png)
`Database per Project` 是 Databasir 中的基本概念,见名知意,也就是一个项目其实对应一个数据库。
项目必须建立在某个指定的分组下面,不能独立存在,它是 Databasir 管理的最小单位,主要维护了以下信息
- 对应数据库的连接信息
- 文档同步规则,比如:字段过滤条件、定时同步时间等
- 数据库模型文档所有历史版本数据
- 数据库模型文档的讨论
项目支持手动和自动同步,每次同步时 Databasir 会与项目当前最新版本文档做对比,如果没有结构变更,则不会生成新的版本。

View File

@ -1,65 +0,0 @@
# 用户角色与权限
## 角色说明
Databasir 将用户分为了 4 种角色,它们分别是
- 系统管理员
- 组长
- 组员
- 游客
每个角色的说明以及可配置数量见下面表格
| 角色 | 说明 | 数量 |
| ---------- | ------------------------------------------------ | ------------------ |
| 系统管理员 | 拥有平台所有权限 | 任意 |
| 组长 | 拥有对应分组下所有读写权限 | 一个分组最多 20 个 |
| 组员 | 拥有对应分组下部分写权限,所有读权限 | 任意 |
| 游客 | 登入用户的默认角色,能够看见所有分组以及项目文档 | 任意 |
## 默认权限
由于创建分组、数据库扩展等功能只有系统管理员才有,建议为平台设置多位系统管理员。
- 分组模块各角色权限详情
| 功能 | 组员 | 组长 | 游客 | 系统管理员 |
|----------| ---- | ---- | ---- | ---------- |
| **分组模块** | 部分 | 全部 | 只读 | 全部 |
| 查看分组 | √ | √ | √ | √ |
| 编辑分组 | x | √ | x | √ |
| 删除分组 | x | √ | x | √ |
| 查看组员 | √ | √ | √ | √ |
| 添加组员 | x | √ | x | √ |
| 删除组员 | x | √ | x | √ |
- 项目模块各角色权限详情
| 功能 | 组员 | 组长 | 游客 | 系统管理员 |
|----------| ---- | ---- | ---- | ---------- |
| **项目模块** | 部分 | 全部 | 只读 | 全部 |
| 查看项目 | √ | √ | √ | √ |
| 创建项目 | √ | √ | x | √ |
| 删除项目 | √ | √ | x | √ |
| 编辑项目 | √ | √ | x | √ |
| 查看讨论 | √ | √ | √ | √ |
| 新增讨论 | √ | √ | x | √ |
| 删除讨论 | x | √ | x | √ |
| 编辑描述 | √ | √ | x | √ |
- 其余模块只有系统管理员才有
| 功能 | 组员 | 组长 | 游客 | 系统管理员 |
|----------| ---- | ---- | ---- | ---------- |
| **用户模块** | x | x | x | √ |
| **数据库管理** | x | x | x | √ |
| **系统邮箱管理** | x | x | x | √ |
| **登录设置** | x | x | x | √ |
| **系统日志** | x | x | x | √ |

View File

@ -1,57 +0,0 @@
# Docker 部署
[Databasir](https://github.com/vran-dev/databasir) 已经准备好了开箱即用的 Docker Image你只需要简单三步就可以完成一个 Databasir 应用的部署
## 环境要求
1. Docker
2. Mysql 5.7+
## 测活接口
```shell
GET /live
```
返回 200 即表示启动成功
## 部署流程
1. 拉取镜像(更多版本[点击这里](https://registry.hub.docker.com/r/vrantt/databasir)查看)
```shell
docker pull vrantt/databasir:latest
```
2. 在 Mysql 中创建数据库 databasir
```sql
create database databasir;
```
3. 启动镜像,需要指定可用的 Mysql 的连接信息
```shell
docker run -p 8888:8080 --name my-databasir -e DATABASIR_DB_URL=127.0.0.1:3306 -e DATABASIR_DB_USERNAME=root -e DATABASIR_DB_PASSWORD=123456 vrantt/databasir:latest
```
**docker 启动命令参数说明**
| 参数 | 说明 | 必填 |
| ---------------------------------- | ------------------------------------------------------------ | ---- |
| --name my-databasir | 启动的镜像名称 | |
| -e DATABASIR_DB_URL=127.0.0.1:3306 | 数据库连接地址 | 是 |
| -e DATABASIR_DB_USERNAME=root | 数据库连接用户名 | 是 |
| -e DATABASIR_DB_PASSWORD=123456 | 数据库连接密码 | 是 |
| -e DATABASIR_JWT_SECRET=databasir | 生成用户登录 Token 的秘钥,如果部署了多个实例,那多个实例之间的秘钥要保持一致。默认为 UUID | 否 |
| -p 8888:8080 | 将 databasir 的 8080 端口映射到宿主机的 8888 端口 | |
## 登录验证
启动后Databasir 会默认创建一个超级管理员账户
- 用户名:`databasir`
- 密码:`databasir`
这时候访问 http://localhost:8888 进入登录页,输入上面的账号和密码即可成功登入,到此就算部署完成

View File

@ -1,74 +0,0 @@
# Jar 包部署
## 环境要求
1. Java 11+
2. Mysql 5.7+
## 部署流程
1. 在 [Github RELEASE](https://github.com/vran-dev/databasir/releases) 页面下载最新版应用 Databasir.jar (你也可以选择克隆项目后自行构建)
2. 将 Databasir.jar 上传到服务器
3. 执行启动命令
```java
java -jar databasir.jar --databasir.db.url=127.0.0.1:3306 --databasir.db.username=root --databasir.db.password=123456
```
目前支持以下参数
| 参数名 | 说明 | 是否必传 | 默认值 |
| ----------------------------- | --------------------- | -------- | ------------------------------ |
| databasir.db.url | 数据库地址 | 是 | |
| databasir.db.username | 数据库用户名 | 是 | |
| databasir.db.password | 数据库密码 | 是 | |
| databasir.jwt.secret | 生成登录 Token 的秘钥 | 否 | uuid |
| databasir.db.driver-directory | 自定义驱动的上传目录 | 否 | 项目所在位置的 `drivers/` 目录 |
**注意:**如果部署了多个 databasir 实例,一定要定义 `databasir.jwt.secret` 的值,从而使得多个实例之间的 `databasir.jwt.secret` 保持一致
## 登录验证
应用启动完成后会默认创建 Databasir 管理员用户
- 用户名databasir
- 密码databasir
通过该账号登录应用既可以进行管理
## 配置文件
除了在命令行指定参数启动外,还可以通过配置文件来保存
在 Databasir.jar 所在目录创建 config 目录,并在目录下创建 `application.properties` 配置,配置中配置 MYSQL 的用户名、密码和连接
```properties
# 端口号,默认 8080
server.port=8080
# 数据库用户名
databasir.db.username=root
# 数据库密码
databasir.db.password=123456
# 数据库地址
databasir.db.url=127.0.0.1:3306
# 登录 token 生成秘钥,可选
databasir.jwt.secret=${random.uuid}
```
通过 `java -jar Databasir.jar` 启动应用即可

View File

@ -1,81 +0,0 @@
## 项目概览
![](../../databasir.png) 是面向团队的**关系型数据库模型文档管理平台**,旨在通过自动化的方式解决模型文档管理过程中维护成本高、内容更新不及时以及团队协作复杂等问题。
问题反馈https://github.com/vran-dev/databasir/issues
## 在线演示
在线演示:[http://demo.databasir.com](http://demo.databasir.com)
| 账号 | 密码 | 角色 |
| ---- | ------- | ---------- |
| demo | demo123 | 系统管理员 |
| dev | dev123 | 普通 |
<!-- tabs:start -->
#### **微信群**
扫码加入微信群,随时获取第一手更新内容
<img src="https://s2.loli.net/2022/05/23/phDIKagHwjZl3kA.jpg" width="280">
#### **公众号**
![qrcode.jpg](https://s2.loli.net/2022/04/22/mZjlG5u4vrXW1SL.jpg)
#### **邮箱**
vran_dev@foxmail.com
<!-- tabs:end -->
## 支持平台
理论上支持拥有 JDBC 驱动的任何数据库,以下是社区内已验证过的数据库
- MySQL
- PostgreSQL
- Oracle
- SqlServer
- 达梦
- TIDB
- Hive
- Clickhouse
- MariaDB
- .....
注意:以上列表是目前社区已经验证过的,并不代表 [Databasir](https://github.com/vran-dev/databasir) 只支持这些。
## 多图展示
<!-- tabs:start -->
#### **文档同步**
![sync.gif](https://s2.loli.net/2022/04/22/aoiSR1V3MuN67m8.gif)
#### **版本对比**
![](index/diff.gif)
#### **文档导出**
- UML 图片导出
![](index/uml-export.gif)
- 导出 Markdown 格式展示
![](index/markdown-exported.gif)
<!-- tabs:end -->
## 捐赠
开源不易,扶我起来,再写两行!
<img src="img/sponsor.jpg" width="280">

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.7 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 MiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 846 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 446 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 102 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 120 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 108 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 123 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 86 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 90 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 56 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 100 KiB

View File

@ -1,77 +0,0 @@
## 文档导出
Databasir 支持多种类型的文档格式导出该功能位于文档详情页面to通过项目列表中点击指定项目的**查看文档**进入
![](img/project-export1.png)
进入文档页面以后,鼠标指向**导出**按钮即可显示出目前支持的文档导出格式
![](img/project-export2.png)
## 版本差异对比
如果成功同步了多个版本的文档,你可以随意的选择版本进行差异对比。
在文档页面,点击**显示版本差异**按钮
![](img/doc-diff1.png)
启用以后会出现一个对比版本的下拉框,选择我们要对比的版本,默认情况下基础版本是最新的,也就是在对比新版本比老版本有什么变化
![](img/doc-diff2.png)
选中版本以后就自动出现了差异标记
- 绿色:标识新增
- 红色:标识删除
- 黄色:标识修改
- 灰色:标识无变化
![](img/doc-diff3.png)
比如下图
- 删除了 document_remark 表
- 修改了 table_column_document、table_document 表
- 新增了 table_foreign_key_document 表
![](img/doc-diff4.png)
切换到修改表的地方,可以查看具体的修改内容,比如下图就展示了
- type 字段的类型由 text 改为了 varchar
- comment 字段的类型由 text 改为了 varchar
![](img/doc-diff5.png)
## 自定义文档模板(即将废弃)
目前 Databasir 的文档主要是以表格形式进行内容展示,包括了以下内容
- 表信息
- 列信息
- 索引信息
- 外键信息
- 触发器信息
这其中除了表信息以外,其他的表格内容都支持自定义表头(默认表头为英文)。
该操作需要拥有系统管理员权限,操作之前需要注意表格头名称的更改是全局的,即所有的项目都会生效。
页面入口位于侧边菜单栏的**文档模板**
![](img/template-edit1.png)
点击就会跳转编辑页面,就能跳转入模板的编辑页。
注意我用红框框起来的表头,这些都是可以编辑的
![](img/template-edit2.png)
比如我们将 Columns 的 `名称` 改为 `列名称` ,只需要点击表头输入新的名称,按下回车即可保存
![](img/template-edit3.png)
回到项目文档页面就可以看见我们做的变更生效了(没生效的话记得重新登陆试一下)
![](img/template-edit4.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 39 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 24 KiB

View File

@ -1,28 +0,0 @@
# 邮箱设置
Databasir 很多通知会通过邮件的形式进行发送,比如
- 项目版本变更
- 项目新增讨论
- 重置密码
这些通知只有在管理员为系统设置了默认邮箱时才能正常使用。
## 新增邮箱
邮箱的设置入口如下图所示
![img.png](img/email-menu.png)
点击就可以进入邮箱配置页面,目前支持使用 SMTP 协议进行配置。
![img.png](img/email-setting.png)
验证邮箱配置是否成功可以在用户管理列表页中点击**重置密码**,如果邮箱配置正常,那么对应用户的邮箱会收到重置后的新密码
## 重置邮箱
如果想关闭系统的推送,可以**重置邮箱**,这样系统的邮箱配置就会回到初始状态。
重置功能位于邮箱配置页面,点击**重置按钮**即可完成
![img.png](img/email-setting.png)

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 52 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 64 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 65 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 46 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 83 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 58 KiB

View File

@ -1,95 +0,0 @@
# 分组管理
如果你还不清楚 Databasir 中分组的概念,可以先阅读[分组与项目](/README/group-and-project/index.md)一节
## 创建分组
Note**只有系统管理员才可以创建分组**
在成功登入 Databasir 后就会默认进入**分组列表页**,该页面将会以卡片的形式展示平台中已创建的所有分组。
![](img/group-add1.png)
点击左上角蓝色的 + 号就可以弹窗分组创建页,需要填写三个信息
- 名称:即列表页展示的组名
- 描述:简要描述分组信息
- 组长:该分组的负责人,支持通过名称、邮箱搜索
![](img/group-add2.png)
信息填写完成以后点击确定即可创建成功
![](img/group-add3.png)
## 删除分组
Note只有系统管理员和组长可以删除分组
在分组列表页,将鼠标移到想要删除的分组上面就会在名称左边显现出一个编辑图标
![](img/group-delete1.png)
点击该按钮进入分组编辑页
![](img/group-delete2.png)
点击**确认删除分组**后再次弹出一个警告框,最终确认以后就成功删除该分组了
![](img/group-delete3.png)
## 添加移除成员
Note只有系统管理员和组长可以添加移除成员
成员的管理有两种方式
**一、在分组编辑页管理**
在分组的编辑页面上可以添加或删除组长(仅可增删组长)
添加的过程和前面创建分组时一样,在搜索框搜索用户然后点击即可添加,完成以后记得保存方可生效。
删除分组的话只需要点击组长标签右侧的 x 按钮即可,同样,完成以后记得保存方可生效。
![](img/group-member1.png)
**二、在成员管理页管理**
通过点击分组列表页中的组名可以跳转到分组详情页中,该页面有两个 Tab
- 项目列表
- 分组成员
![](img/group-member2.png)
点击分组成员即可进入成员管理 Tab 页,在该页面我们可以通过点击**移除**按钮将用户移出该分组
![](img/group-member3.png)
通过点击左上角的**添加成员**按钮就可以进入成员选择页面进行添加,可以作为组员添加,也可以作为组长添加,按需选择。
在该页面我们可以通过点击**移除**按钮将用户移出该分组。
![](img/group-member4.png)
## 修改成员角色
Note只有系统管理员和组长可以修改成员角色
如果我们想修改一个用户在分组内的角色,只需要在分组成员 Tab 页进行切换就可以
- 如果该用户是组员,则会出现**升为组长**的按钮
- 如果该用户是组长,则会出现**设为组员**的按钮
![](img/group-role1.png)
组长拥有所属分组的所有读写权限,包括修改其他组长的角色,但是组长无法修改自己的角色

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 77 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 71 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 49 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 81 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 79 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 48 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 82 KiB

Some files were not shown because too many files have changed in this diff Show More