vincent 3 years ago
parent
commit
e133ca309b
100 changed files with 6728 additions and 0 deletions
  1. 3 0
      .gitattributes
  2. 36 0
      .gitignore
  3. 21 0
      .travis.yml
  4. 213 0
      CONTRIBUTING-CH.md
  5. 201 0
      LICENSE
  6. 278 0
      LICENSE-3RD-PARTY
  7. 43 0
      MAINTAINING-CH.md
  8. 187 0
      NOTICE
  9. 87 0
      README-CH.md
  10. 85 0
      assembly/pom.xml
  11. 103 0
      assembly/src/main/assembly/assembly.xml
  12. 101 0
      assembly/src/main/assembly/release.xml
  13. 9 0
      bin/build.sh
  14. 707 0
      bin/davinci.sql
  15. 22 0
      bin/initdb.bat
  16. 2 0
      bin/initdb.sh
  17. 14 0
      bin/migration/beta5/README.md
  18. BIN
      bin/migration/beta5/upgrade.exe
  19. BIN
      bin/migration/beta5/upgrade_darwin
  20. BIN
      bin/migration/beta5/upgrade_linux
  21. 13 0
      bin/migration/beta8/README.md
  22. BIN
      bin/migration/beta8/upgrade.exe
  23. BIN
      bin/migration/beta8/upgrade_darwin
  24. BIN
      bin/migration/beta8/upgrade_linux
  25. 1191 0
      bin/patch/001_beta5.sql
  26. 74 0
      bin/patch/002_beta7.sql
  27. 10 0
      bin/patch/003_beta8.sql
  28. 20 0
      bin/patch/004_beta9.sql
  29. 20 0
      bin/patch/005_rc.sql
  30. 24 0
      bin/restart-server.sh
  31. 32 0
      bin/run.bat
  32. 51 0
      bin/start-server.sh
  33. 19 0
      bin/start.bat
  34. 25 0
      bin/stop-server.sh
  35. 19 0
      bin/stop.bat
  36. 211 0
      config/application.yml.example
  37. 65 0
      config/datasource_driver.yml.example
  38. 136 0
      config/logback.xml
  39. 4 0
      docs/.gitignore
  40. 24 0
      docs/404.html
  41. 34 0
      docs/Gemfile
  42. 20 0
      docs/_config.yml
  43. 67 0
      docs/_data/navigation.yml
  44. 414 0
      docs/_docs/zh/1.1-deployment.md
  45. 105 0
      docs/_docs/zh/1.2-quick_start.md
  46. 75 0
      docs/_docs/zh/2.1-source.md
  47. 139 0
      docs/_docs/zh/2.2-view.md
  48. 242 0
      docs/_docs/zh/2.3-widget.md
  49. 429 0
      docs/_docs/zh/2.4-dashboard.md
  50. 190 0
      docs/_docs/zh/2.5-display.md
  51. 72 0
      docs/_docs/zh/2.6-schedule.md
  52. 43 0
      docs/_docs/zh/3.1-organization.md
  53. 40 0
      docs/_docs/zh/3.2-member.md
  54. 29 0
      docs/_docs/zh/3.3-role.md
  55. 65 0
      docs/_docs/zh/3.4-project.md
  56. 20 0
      docs/_docs/zh/3.5-user_setting.md
  57. 37 0
      docs/_docs/zh/3.6-reset_password.md
  58. 89 0
      docs/_docs/zh/4.1-statistic.md
  59. 269 0
      docs/_docs/zh/5.1-chart_config.md
  60. 1 0
      docs/_includes/footer.html
  61. 46 0
      docs/_includes/zh_masthead.html
  62. 123 0
      docs/_layouts/global.html
  63. 42 0
      docs/_layouts/zh_base.html
  64. 65 0
      docs/_layouts/zh_single.html
  65. 22 0
      docs/_layouts/zh_splash.html
  66. BIN
      docs/assets/images/More_WeChat.jpg
  67. BIN
      docs/assets/images/chart_config/1.1.gif
  68. BIN
      docs/assets/images/chart_config/1.2.png
  69. BIN
      docs/assets/images/chart_config/1.3.gif
  70. BIN
      docs/assets/images/chart_config/10.png
  71. BIN
      docs/assets/images/chart_config/11.png
  72. BIN
      docs/assets/images/chart_config/12.1.png
  73. BIN
      docs/assets/images/chart_config/12.2.png
  74. BIN
      docs/assets/images/chart_config/12.3.png
  75. BIN
      docs/assets/images/chart_config/12.4.png
  76. BIN
      docs/assets/images/chart_config/13.png
  77. BIN
      docs/assets/images/chart_config/14.png
  78. BIN
      docs/assets/images/chart_config/15.png
  79. BIN
      docs/assets/images/chart_config/16.1.png
  80. BIN
      docs/assets/images/chart_config/16.2.png
  81. BIN
      docs/assets/images/chart_config/16.3.png
  82. BIN
      docs/assets/images/chart_config/16.4.png
  83. BIN
      docs/assets/images/chart_config/17.png
  84. BIN
      docs/assets/images/chart_config/18.png
  85. BIN
      docs/assets/images/chart_config/2.1.png
  86. BIN
      docs/assets/images/chart_config/3.png
  87. BIN
      docs/assets/images/chart_config/4.png
  88. BIN
      docs/assets/images/chart_config/5.png
  89. BIN
      docs/assets/images/chart_config/6.png
  90. BIN
      docs/assets/images/chart_config/7.png
  91. BIN
      docs/assets/images/chart_config/9.png
  92. BIN
      docs/assets/images/dashboard/1.1.png
  93. BIN
      docs/assets/images/dashboard/1.10.png
  94. BIN
      docs/assets/images/dashboard/1.2.png
  95. BIN
      docs/assets/images/dashboard/1.3.png
  96. BIN
      docs/assets/images/dashboard/1.4.png
  97. BIN
      docs/assets/images/dashboard/1.5.png
  98. BIN
      docs/assets/images/dashboard/1.6.png
  99. BIN
      docs/assets/images/dashboard/1.7.png
  100. BIN
      docs/assets/images/dashboard/1.8.png

+ 3 - 0
.gitattributes

@@ -0,0 +1,3 @@
+*.bat text eol=crlf
+*.cmd text eol=crlf
+*.zip filter=lfs diff=lfs merge=lfs -text

+ 36 - 0
.gitignore

@@ -0,0 +1,36 @@
+logs/
+project/target/
+project/project/
+target/
+build/
+*.iml
+*.ipr
+*.iws
+.idea/
+.out
+out
+output
+.gradle
+.project
+.cache
+.classpath
+.settings/
+*.dot
+.DS_Store
+*part-*
+derby.log
+metastore_db
+spark-warehouse
+*.bak
+*.log
+*.conf
+config/application.yml
+config/datasource_driver.yml
+swagger-ui/
+tempFiles/
+userfiles/
+.vscode
+*yarn.lock
+bin/upgrade.go
+bin/upgrade
+.history/

+ 21 - 0
.travis.yml

@@ -0,0 +1,21 @@
+sudo: required
+dist: trusty
+
+language: java
+jdk:
+  - oraclejdk8
+
+cache:
+  directories:
+  - $HOME/.sbt
+  - $HOME/.m2
+
+notification:
+  email:
+    recipients:
+      - edp_support@groups.163.com
+    on_failure: always
+
+branches:
+  only:
+    - master

+ 213 - 0
CONTRIBUTING-CH.md

@@ -0,0 +1,213 @@
+# Contributing
+
+非常感谢贡献 Davinci!在参与贡献之前,请仔细阅读以下指引。
+
+## 贡献范畴
+
+### Bug 反馈与修复
+我们建议无论是 Bug 反馈还是修复,都先创建一个 Issue 来仔细描述 Bug 的状况,以助于社区可以通过 Issue 记录来找到和回顾问题以及代码。Bug 反馈 Issue 通常需要包含**完整描述 Bug 的信息**以及**可复现的场景**,这样社区才能快速定位导致 Bug 的原因并修复它。包含 `#bug` 标签的打开的 Issue 都是需要被修复的。
+
+### 功能交流、实现、重构
+在交流过程中,详细描述新功能(或重构)的细节、机制和使用场景,能够促使它更好更快地被实现。**如果计划实现一个重大的功能(或重构),请务必通过 Issue 或其他方式与核心开发团队进行沟通**,这样大家能以最效率的方式来推进它。包含 `#feature` 标签的打开的 Issue 都是需要被实现的新功能,包含 `#enhancement` 标签的打开的 Issue 都是需要改进重构的功能。
+
+### Issue 答疑
+帮助回答 Issue 中的使用问题是为 Davinci 社区做贡献的一个非常有价值的方式;社区中总会有新用户不断进来,在帮助新用户的同时,也可以展现你的专业知识。
+
+### 文档改进
+Davinci 用户手册文档在 docs/ 目录下,我们使用了 [jekyll](https://jekyllrb.com/) 作为 Davinci 的文档服务,可以编辑目录里的 Markdown 文件来对文档做改进。
+
+### 国际化
+非常抱歉,Davinci 目前仅支持中文语言;但项目前端依赖包含 [react-intl](https://github.com/formatjs/react-intl),代码结构上也支持国际化,欢迎对其他语言进行贡献。
+
+## 贡献流程
+
+### 分支结构
+Davinci 源码可能会产生一些临时分支,但真正有明确意义的只有以下三个分支:
+
+- dev-0.3: 默认分支,主要开发分支,**需要注意,dev-0.3分支代码不保证可用性,请谨慎使用到生产**;
+- master: 最近一次稳定 release 的源码,偶尔会多几次 hotfix 提交;
+- dev-0.2: 0.2 版本源码,目前 0.2 版本已经停止更新,如有 0.2 版本使用者或是需要进行二次开发的用户可以参考此分支。
+
+### 开发指引
+Davinci 前后端代码共用同一个代码库,但在开发上是分离的。在着手开发之前,请先将 Davinci 项目 fork 一份到自己的 Github Repositories 中, 开发时请基于自己 Github Repositories 中的 Davinci 代码库进行开发。
+
+如果你计划给 Davinci 贡献代码,我们建议克隆 dev-0.3 分支来开发,这样在向 Davinci 主项目提交 PR 时合并冲突的可能性会小很多。
+```bash
+git clone https://github.com/yourname/davinci.git
+```
+
+如果你只是基于稳定功能做一些定制化满足使用需要,我们建议克隆 master 分支来开发。
+```bash
+git clone https://github.com/yourname/davinci.git --branch master
+```
+
+
+#### 前端
+前端源代码在 webapp/ 目录中;davinci-ui/ 目录为编译后的前端文件
+
+##### 目录结构
+```
+├── app              # 主应用源码
+  ├── assets           # 资源文件
+  ├── components       # 通用组件
+  ├── containers       # 路由容器组件
+  ├── utils            # 通用实用方法
+  └── app.tsx          # 主应用入口
+├── internals        # 开发工程文件
+├── libs             # 改动后的项目依赖
+├── server           # 开发服务器
+├── share            # 分享页源码
+└── package.json
+```
+
+##### 开发
+```
+npm install
+npm start
+```
+
+##### Lint
+```
+npm run lint
+```
+
+##### Test
+```
+npm run test
+```
+
+##### 打包
+```
+npm run build
+```
+
+#### 后端
+用户配置在项目根目录 /config/ 下,项目启动脚本和升级补丁脚本在项目根目录 /bin/ 下, 后端代码及核心配置在 server/ 目录下, 日志在项目根目录 /log/ 下。注意:此处所指项目根目录都指环境变量 DAVINCI3_HOME 所配置的目录,在使用 IDE 开发过程中也需要配置环境变量,如 Idea 关于环境变量加载的优先级:`Run/Debug Configurations` 中配置的 `Environment variables` —>  IDE缓存的系统环境变量。
+
+##### 目录结构
+
+脚本
+```
+├── bin                   # 脚本目录
+  ├── migration             # 较大版本变动迁移脚本目录
+  ├── patch                 # 数据库补丁
+  	 ├── 001_beta5.sql        # 已发布补丁(命名规则:“序列_版本”)
+  	 └── beta.sql             # 当期未发布补丁(固定名称)
+  ├── build.sh
+  ├── davinci.sql           # 完整系统数据库脚本(包含所有补丁)
+  ├── initdb.bat            # 针对 Windows 环境的初始化数据库批处理脚本
+  ├── initdb.sh             # 针对 Linux、Mac 环境的初始化数据库 Shell 脚本
+  ├── restart-server.sh     # 针对 Linux、Mac 环境的重启服务脚本
+  ├── run.bat               # 针对	Windows 环境的服务启停核心脚本						
+  ├── start.bat             # 针对 Windows 环境的服务启动脚本
+  ├── start-server.sh       # 针对 Linux、Mac 环境的服务启动脚本
+  ├── stop.bat              # 针对 Windows 环境的服务停止脚本
+  └── stop-server.sh        # 针对 Linux、Mac 环境的服务停止脚本
+```
+
+用户配置
+```
+├── config                          # 用户配置目录
+  ├── application.yml.example         # 应用配置模板
+  ├── datasource_driver.yml.example   # 自定义数据源配置模板
+  └── logback.xml                     # 日志配置
+``` 
+
+代码目录结构
+```
+├── server                                  # Server 代码根目录
+   ├── src                                    # 源码
+  	  ├── main
+  	  	 ├── java
+  	  	 	└── edp
+  	  	 	   ├── core                             # 核心配置及通用代码
+  	  	 	   ├── davinci                          # Davinci 业务代码 
+  	  	 	   ├── DavinciServerApplication         # 系统启动类
+  	  	 	   └── SwaggerConfiguration             # Swagger 配置类
+  	  	 └── resources
+  	  	 	├── generator
+  	  	 	├── mybatis                           # mybatis mapping 目录
+  	  	 	├── templates                         # 邮件、Sql 模板目录 
+  	  	 	├── application.yml                   # 系统核心配置文件
+  	  	 	└── banner.txt
+  	  └── test                                # 测试代码目录
+   └── pom.xml                              # Davinci Server maven 配置文件,继承自项目根目录pom.xml
+```
+
+日志目录
+```
+├── logs        # 日志根目录
+  ├── sys         # 系统日志目录
+  └── user        # 用户日志目录
+  	 ├── opt        # 用户操作日志
+  	 └── sql        # 用户Sql日志
+``` 
+
+##### 环境变量
+配置系统环境变量或 IDE 环境变量 DAVINCI3_HOME,推荐优先使用 IDE 环境变量。
+
+##### 数据库
+1. 自行创建 Davinci 系统数据库;
+2. 修改 bin/initdb.sh 或 bin/initdb.bat 中的数据库相应信息并执行 或 直接在数据库客户端导入 bin/davinci.sql。
+
+##### 配置文件
+重命名 config/ 目录下 `application.yml.example` 文件为 `application.yml`,并配置相关属性。
+
+##### 打包
+1. 打完整 release 包需要修改根目录下 /assembly/src/main/assembly/assembly.xml 中相关版本信息,然后在根目录下执行: `mvn clean package` 即可;
+2. 打 server 包可直接在 server/ 目录下执行 `mvn clean package`。
+
+### Pull Request 指引
+- 如果你还不知道怎样向开源项目发起 PR,请参考[这篇说明](https://help.github.com/en/articles/about-pull-requests)
+- 无论是 Bug 修复,还是新功能开发,请将 PR 提交到 dev-0.3 分支。
+- PR 和提交名称遵循 `<type>(<scope>): <subject>` 原则,详情可以参考阮一峰的 [Commit message 和 Change log 编写指南](http://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html) 这篇文章。
+- 如果 PR 中包含新功能,理应将文档更新包含在本次 PR 中。
+- 如果本次 PR 尚未准备好合并,请在名称头部加上 [WIP] 前缀(WIP = work-in-progress)。
+- 所有提交到 dev-0.3 分支的提交至少需要经过一次 Review 才可以被合并
+
+### Review 标准
+
+在贡献代码之前,可以了解一下什么样的提交在 Review 中是受欢迎的。简单来说,如果一项提交能带来尽可能多增益和尽可能少的副作用或风险,那它被合并的几率就越高,Review 的速度也会越快。风险大、价值低的提交是几乎不可能被合并的,并且有可能会被拒绝连 Review 的机会都没有。
+
+#### 增益
+- 修复导致 Bug 的主要原因
+- 添加或修复一个大量用户亟需的功能或问题
+- 简单有效
+- 容易测试,有测试用例
+- 减少复杂度以及代码量
+- 经社区讨论过的、确定需要改进的问题
+#### 副作用和风险
+- 仅仅修复 Bug 的表面现象
+- 引入复杂度高的新功能
+- 为满足小众需求添加复杂度
+- 改动稳定的现有API或语义
+- 导致其他功能不能正常运行
+- 添加大量依赖
+- 随意改变依赖版本
+- 一次性提交大量代码或改动
+#### Reviewer 注意事项
+- 请使用建设性语气撰写评论
+- 如果需要提交者进行修改,请明确说明完成此次 Pull Request 所需要修改的所有内容
+- 如果某次 PR 在合并后发现带来了新问题,Reviewer 需要向 PR 作者联系并沟通解决问题;如果无法联系到 PR 作者,Reviewer 需要将此次 PR 进行还原
+
+## 贡献进阶
+
+### 关于 Committers(Collaborators)
+
+#### 如何成为 Committer
+如果你对 Davinci 代码有过颇具价值的 PR 并且被合并,你可以在这个 [Issue](https://github.com/edp963/davinci/issues/1194) 下评论,或是通过官方微信群联系核心开发团队申请成为 Davinci 项目的 Committer;核心开发团队和其他 Committers 将会一起投票决定是否允许你的加入,如果得到足够票数,你将成为 Davinci 项目的 Committer。
+
+#### Committer 的权利
+- 可以加入官方开发者微信群,参与讨论和制定开发计划
+- 可以对 Issue 进行管理,包括关闭、添加标签
+- 可以创建和管理项目分支,master、dev-0.3、dev-0.2 分支除外
+- 可以对提交到 dev-0.3 分支的 PR 进行 Review
+- 可以申请成为 Committee 成员
+
+### 关于 Committee
+
+#### 如何成为 Committee 成员
+如果你是 Davinci 项目的 Committer,并且你贡献的所有内容得到了其他 Committee 成员的认可,你可以申请成为 Davinci Committee 成员,其他 Committee 成员将会一起投票决定是否允许你的加入,如果全票通过,你将成为 Davinci Committee 成员。
+
+#### Committee 成员的权利
+- 可以合并其他 Committers 和贡献者提交到 dev-0.3 分支的 PR

+ 201 - 0
LICENSE

@@ -0,0 +1,201 @@
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.

+ 278 - 0
LICENSE-3RD-PARTY

@@ -0,0 +1,278 @@
+
+List of third-party dependencies grouped by their license type.
+
+    Apache 2:
+
+        * druid (com.alibaba:druid:1.1.11 - https://github.com/alibaba/druid)
+        * fastjson (com.alibaba:fastjson:1.2.28 - https://github.com/alibaba/fastjson)
+        * Joda-Time (joda-time:joda-time:2.9.9 - http://www.joda.org/joda-time/)
+        * Lucene Common Analyzers (org.apache.lucene:lucene-analyzers-common:6.3.0 - http://lucene.apache.org/lucene-parent/lucene-analyzers-common)
+        * Lucene Memory (org.apache.lucene:lucene-backward-codecs:6.3.0 - http://lucene.apache.org/lucene-parent/lucene-backward-codecs)
+        * Lucene Core (org.apache.lucene:lucene-core:6.3.0 - http://lucene.apache.org/lucene-parent/lucene-core)
+        * Lucene Grouping (org.apache.lucene:lucene-grouping:6.3.0 - http://lucene.apache.org/lucene-parent/lucene-grouping)
+        * Lucene Highlighter (org.apache.lucene:lucene-highlighter:6.3.0 - http://lucene.apache.org/lucene-parent/lucene-highlighter)
+        * Lucene Join (org.apache.lucene:lucene-join:6.3.0 - http://lucene.apache.org/lucene-parent/lucene-join)
+        * Lucene Memory (org.apache.lucene:lucene-memory:6.3.0 - http://lucene.apache.org/lucene-parent/lucene-memory)
+        * Lucene Miscellaneous (org.apache.lucene:lucene-misc:6.3.0 - http://lucene.apache.org/lucene-parent/lucene-misc)
+        * Lucene Queries (org.apache.lucene:lucene-queries:6.3.0 - http://lucene.apache.org/lucene-parent/lucene-queries)
+        * Lucene QueryParsers (org.apache.lucene:lucene-queryparser:6.3.0 - http://lucene.apache.org/lucene-parent/lucene-queryparser)
+        * Lucene Sandbox (org.apache.lucene:lucene-sandbox:6.3.0 - http://lucene.apache.org/lucene-parent/lucene-sandbox)
+        * Lucene Spatial (org.apache.lucene:lucene-spatial:6.3.0 - http://lucene.apache.org/lucene-parent/lucene-spatial)
+        * Lucene Spatial Extras (org.apache.lucene:lucene-spatial-extras:6.3.0 - http://lucene.apache.org/lucene-parent/lucene-spatial-extras)
+        * Lucene Spatial 3D (org.apache.lucene:lucene-spatial3d:6.3.0 - http://lucene.apache.org/lucene-parent/lucene-spatial3d)
+        * Lucene Suggest (org.apache.lucene:lucene-suggest:6.3.0 - http://lucene.apache.org/lucene-parent/lucene-suggest)
+        * Objenesis (org.objenesis:objenesis:2.6 - http://objenesis.org)
+
+    Apache 2.0:
+
+        * Caffeine cache (com.github.ben-manes.caffeine:caffeine:2.6.2 - https://github.com/ben-manes/caffeine)
+        * compiler (com.github.spullara.mustache.java:compiler:0.9.3 - http://github.com/spullara/mustache.java)
+        * JSON library from Android SDK (com.vaadin.external.google:android-json:0.0.20131108.vaadin1 - http://developer.android.com/sdk)
+        * Apache Commons Codec (commons-codec:commons-codec:1.11 - http://commons.apache.org/proper/commons-codec/)
+        * JSON Web Token support for the JVM (io.jsonwebtoken:jjwt:0.7.0 - http://nexus.sonatype.org/oss-repository-hosting.html/jjwt)
+        * Lettuce (io.lettuce:lettuce-core:5.0.4.RELEASE - http://github.com/lettuce-io/lettuce-core)
+        * Netty (io.netty:netty:3.10.6.Final - http://netty.io/)
+        * Netty/Buffer (io.netty:netty-buffer:4.1.27.Final - http://netty.io/netty-buffer/)
+        * Netty/Codec (io.netty:netty-codec:4.1.27.Final - http://netty.io/netty-codec/)
+        * Netty/Codec/HTTP (io.netty:netty-codec-http:4.1.27.Final - http://netty.io/netty-codec-http/)
+        * Netty/Common (io.netty:netty-common:4.1.27.Final - http://netty.io/netty-common/)
+        * Netty/Handler (io.netty:netty-handler:4.1.27.Final - http://netty.io/netty-handler/)
+        * Netty/Resolver (io.netty:netty-resolver:4.1.27.Final - http://netty.io/netty-resolver/)
+        * Netty/Transport (io.netty:netty-transport:4.1.27.Final - http://netty.io/netty-transport/)
+        * swagger-annotations (io.swagger:swagger-annotations:1.5.10 - https://github.com/swagger-api/swagger-core/modules/swagger-annotations)
+        * swagger-models (io.swagger:swagger-models:1.5.10 - https://github.com/swagger-api/swagger-core/modules/swagger-models)
+        * Bean Validation API (javax.validation:validation-api:2.0.1.Final - http://beanvalidation.org)
+        * Apache Commons CSV (org.apache.commons:commons-csv:1.4 - http://commons.apache.org/proper/commons-csv/)
+        * Apache HttpAsyncClient (org.apache.httpcomponents:httpasyncclient:4.1.3 - http://hc.apache.org/httpcomponents-asyncclient)
+        * Apache HttpClient (org.apache.httpcomponents:httpclient:4.5.7 - http://hc.apache.org/httpcomponents-client)
+        * Apache HttpCore (org.apache.httpcomponents:httpcore:4.4.10 - http://hc.apache.org/httpcomponents-core-ga)
+        * Apache HttpCore NIO (org.apache.httpcomponents:httpcore-nio:4.4.10 - http://hc.apache.org/httpcomponents-core-ga)
+        * Apache Log4j API (org.apache.logging.log4j:log4j-api:2.10.0 - https://logging.apache.org/log4j/2.x/log4j-api/)
+        * Apache Log4j to SLF4J Adapter (org.apache.logging.log4j:log4j-to-slf4j:2.10.0 - https://logging.apache.org/log4j/2.x/log4j-to-slf4j/)
+        * tomcat-embed-core (org.apache.tomcat.embed:tomcat-embed-core:8.5.32 - http://tomcat.apache.org/)
+        * tomcat-embed-el (org.apache.tomcat.embed:tomcat-embed-el:8.5.32 - http://tomcat.apache.org/)
+        * tomcat-embed-websocket (org.apache.tomcat.embed:tomcat-embed-websocket:8.5.32 - http://tomcat.apache.org/)
+        * AssertJ fluent assertions (org.assertj:assertj-core:3.9.1 - http://assertj.org/assertj-core)
+        * Hibernate Validator Engine (org.hibernate.validator:hibernate-validator:6.0.11.Final - http://hibernate.org/validator/hibernate-validator)
+        * Javassist (org.javassist:javassist:3.18.1-GA - http://www.javassist.org/)
+        * Spring AOP (org.springframework:spring-aop:5.0.8.RELEASE - https://github.com/spring-projects/spring-framework)
+        * Spring Beans (org.springframework:spring-beans:5.0.8.RELEASE - https://github.com/spring-projects/spring-framework)
+        * Spring Context (org.springframework:spring-context:5.0.8.RELEASE - https://github.com/spring-projects/spring-framework)
+        * Spring Context Support (org.springframework:spring-context-support:5.0.8.RELEASE - https://github.com/spring-projects/spring-framework)
+        * Spring Core (org.springframework:spring-core:5.0.8.RELEASE - https://github.com/spring-projects/spring-framework)
+        * Spring Expression Language (SpEL) (org.springframework:spring-expression:5.0.8.RELEASE - https://github.com/spring-projects/spring-framework)
+        * Spring Commons Logging Bridge (org.springframework:spring-jcl:5.0.8.RELEASE - https://github.com/spring-projects/spring-framework)
+        * Spring JDBC (org.springframework:spring-jdbc:5.0.8.RELEASE - https://github.com/spring-projects/spring-framework)
+        * Spring Object/XML Marshalling (org.springframework:spring-oxm:5.0.8.RELEASE - https://github.com/spring-projects/spring-framework)
+        * Spring TestContext Framework (org.springframework:spring-test:5.0.8.RELEASE - https://github.com/spring-projects/spring-framework)
+        * Spring Transaction (org.springframework:spring-tx:5.0.8.RELEASE - https://github.com/spring-projects/spring-framework)
+        * Spring Web (org.springframework:spring-web:5.0.8.RELEASE - https://github.com/spring-projects/spring-framework)
+        * Spring Web MVC (org.springframework:spring-webmvc:5.0.8.RELEASE - https://github.com/spring-projects/spring-framework)
+        * Spring Boot (org.springframework.boot:spring-boot:2.0.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot)
+        * Spring Boot AutoConfigure (org.springframework.boot:spring-boot-autoconfigure:2.0.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-autoconfigure)
+        * Spring Boot Starter (org.springframework.boot:spring-boot-starter:2.0.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter)
+        * Spring Boot Cache Starter (org.springframework.boot:spring-boot-starter-cache:2.0.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-cache)
+        * Spring Boot Data LDAP Starter (org.springframework.boot:spring-boot-starter-data-ldap:2.0.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-data-ldap)
+        * Spring Boot Data Redis Starter (org.springframework.boot:spring-boot-starter-data-redis:2.0.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-data-redis)
+        * Spring Boot JDBC Starter (org.springframework.boot:spring-boot-starter-jdbc:2.0.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-jdbc)
+        * Spring Boot Json Starter (org.springframework.boot:spring-boot-starter-json:2.0.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-json)
+        * Spring Boot Logging Starter (org.springframework.boot:spring-boot-starter-logging:2.0.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-logging)
+        * Spring Boot Mail Starter (org.springframework.boot:spring-boot-starter-mail:2.0.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-mail)
+        * Spring Boot Test Starter (org.springframework.boot:spring-boot-starter-test:2.0.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-test)
+        * Spring Boot Thymeleaf Starter (org.springframework.boot:spring-boot-starter-thymeleaf:2.0.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-thymeleaf)
+        * Spring Boot Tomcat Starter (org.springframework.boot:spring-boot-starter-tomcat:2.0.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-tomcat)
+        * Spring Boot Web Starter (org.springframework.boot:spring-boot-starter-web:2.0.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-starters/spring-boot-starter-web)
+        * Spring Boot Test (org.springframework.boot:spring-boot-test:2.0.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-test)
+        * Spring Boot Test Auto-Configure (org.springframework.boot:spring-boot-test-autoconfigure:2.0.4.RELEASE - https://projects.spring.io/spring-boot/#/spring-boot-parent/spring-boot-test-autoconfigure)
+        * Spring Data Core (org.springframework.data:spring-data-commons:2.0.9.RELEASE - http://www.spring.io/spring-data/spring-data-commons)
+        * Spring Data KeyValue (org.springframework.data:spring-data-keyvalue:2.0.9.RELEASE - http://www.spring.io/spring-data/spring-data-keyvalue)
+        * Spring Data LDAP (org.springframework.data:spring-data-ldap:2.0.9.RELEASE - https://github.com/spring-projects/spring-data-ldap)
+        * Spring Data Redis (org.springframework.data:spring-data-redis:2.0.9.RELEASE - http://www.spring.io/spring-data/spring-data-redis)
+        * Spring Plugin - Core (org.springframework.plugin:spring-plugin-core:1.2.0.RELEASE - https://github.com/spring-projects/spring-plugin/spring-plugin-core)
+        * Spring Plugin - Metadata Extension (org.springframework.plugin:spring-plugin-metadata:1.2.0.RELEASE - https://github.com/spring-projects/spring-plugin/spring-plugin-metadata)
+        * SnakeYAML (org.yaml:snakeyaml:1.19 - http://www.snakeyaml.org)
+
+    Apache License v2.0:
+
+        * Java Native Access (net.java.dev.jna:jna:4.5.2 - https://github.com/java-native-access/jna)
+
+    Apache License, version 2.0:
+
+        * JBoss Logging 3 (org.jboss.logging:jboss-logging:3.3.2.Final - http://www.jboss.org)
+
+    BSD:
+
+        * JLine (jline:jline:0.9.94 - http://jline.sourceforge.net)
+        * StringTemplate 4 (org.antlr:ST4:4.0.8 - http://www.stringtemplate.org)
+        * ANTLR 3 Runtime (org.antlr:antlr-runtime:3.5.2 - http://www.antlr.org)
+        * ASM Core (org.ow2.asm:asm:5.0.4 - http://asm.objectweb.org/asm/)
+
+    CC0:
+
+        * HdrHistogram (org.hdrhistogram:HdrHistogram:2.1.6 - http://hdrhistogram.github.io/HdrHistogram/)
+        * reactive-streams (org.reactivestreams:reactive-streams:1.0.2 - http://www.reactive-streams.org/)
+
+    CDDL:
+
+        * JavaBeans Activation Framework (JAF) (javax.activation:activation:1.1 - http://java.sun.com/products/javabeans/jaf/index.jsp)
+        * javax.annotation API (javax.annotation:javax.annotation-api:1.3.2 - http://jcp.org/en/jsr/detail?id=250)
+        * jaxb-api (javax.xml.bind:jaxb-api:2.3.0 - https://github.com/javaee/jaxb-spec/jaxb-api)
+
+    CDDL/GPLv2+CE:
+
+        * JavaMail API (com.sun.mail:javax.mail:1.6.1 - http://javaee.github.io/javamail/javax.mail)
+
+    Eclipse Public License - v 1.0:
+
+        * Logback Classic Module (ch.qos.logback:logback-classic:1.2.3 - http://logback.qos.ch/logback-classic)
+        * Logback Core Module (ch.qos.logback:logback-core:1.2.3 - http://logback.qos.ch/logback-core)
+
+    Eclipse Public License 1.0:
+
+        * JUnit (junit:junit:4.12 - http://junit.org)
+
+    Eclipse Public License, Version 1.0:
+
+        * mchange-commons-java (com.mchange:mchange-commons-java:0.2.11 - https://github.com/swaldman/mchange-commons-java)
+
+    GNU Lesser General Public License:
+
+        * Logback Classic Module (ch.qos.logback:logback-classic:1.2.3 - http://logback.qos.ch/logback-classic)
+        * Logback Core Module (ch.qos.logback:logback-core:1.2.3 - http://logback.qos.ch/logback-core)
+
+    GNU Lesser General Public License, Version 2.1:
+
+        * mchange-commons-java (com.mchange:mchange-commons-java:0.2.11 - https://github.com/swaldman/mchange-commons-java)
+
+    GNU Library or Lesser General Public License (LGPL) V2.1:
+
+        * JSQLParser library (com.github.jsqlparser:jsqlparser:1.2 - https://github.com/JSQLParser/JSqlParser)
+
+    GPL:
+
+        * jaxb-api (javax.xml.bind:jaxb-api:2.3.0 - https://github.com/javaee/jaxb-spec/jaxb-api)
+
+    ISC/BSD License:
+
+        * jbcrypt (org.mindrot:jbcrypt:0.3m - http://www.mindrot.org/)
+
+    LGPL:
+
+        * Java Native Access (net.java.dev.jna:jna:4.5.2 - https://github.com/java-native-access/jna)
+        * Javassist (org.javassist:javassist:3.18.1-GA - http://www.javassist.org/)
+
+    Lesser General Public License (LGPL):
+
+        * JTS Topology Suite (com.vividsolutions:jts:1.13 - http://sourceforge.net/projects/jts-topo-suite)
+
+    MIT:
+
+        * JOpt Simple (net.sf.jopt-simple:jopt-simple:5.0.2 - http://pholser.github.io/jopt-simple)
+        * mockito-core (org.mockito:mockito-core:2.15.0 - https://github.com/mockito/mockito)
+        * Project Lombok (org.projectlombok:lombok:1.16.22 - https://projectlombok.org)
+        * JUL to SLF4J bridge (org.slf4j:jul-to-slf4j:1.7.25 - http://www.slf4j.org)
+        * SLF4J API Module (org.slf4j:slf4j-api:1.7.25 - http://www.slf4j.org)
+        * jquery (org.webjars:jquery:1.11.3 - http://webjars.org)
+
+    MPL:
+
+        * Javassist (org.javassist:javassist:3.18.1-GA - http://www.javassist.org/)
+
+    New BSD License:
+
+        * Hamcrest Core (org.hamcrest:hamcrest-core:1.3 - https://github.com/hamcrest/JavaHamcrest/hamcrest-core)
+        * Hamcrest library (org.hamcrest:hamcrest-library:1.3 - https://github.com/hamcrest/JavaHamcrest/hamcrest-library)
+
+    The Apache Software License, Version 2.0:
+
+        * HPPC Collections (com.carrotsearch:hppc:0.7.1 - http://labs.carrotsearch.com/hppc.html/hppc)
+        * ClassMate (com.fasterxml:classmate:1.3.4 - http://github.com/FasterXML/java-classmate)
+        * Jackson-annotations (com.fasterxml.jackson.core:jackson-annotations:2.9.0 - http://github.com/FasterXML/jackson)
+        * Jackson-core (com.fasterxml.jackson.core:jackson-core:2.9.6 - https://github.com/FasterXML/jackson-core)
+        * jackson-databind (com.fasterxml.jackson.core:jackson-databind:2.9.6 - http://github.com/FasterXML/jackson)
+        * Jackson dataformat: CBOR (com.fasterxml.jackson.dataformat:jackson-dataformat-cbor:2.9.6 - http://github.com/FasterXML/jackson-dataformats-binary)
+        * Jackson dataformat: Smile (com.fasterxml.jackson.dataformat:jackson-dataformat-smile:2.9.6 - http://github.com/FasterXML/jackson-dataformats-binary)
+        * Jackson-dataformat-YAML (com.fasterxml.jackson.dataformat:jackson-dataformat-yaml:2.9.6 - https://github.com/FasterXML/jackson-dataformats-text)
+        * Jackson datatype: jdk8 (com.fasterxml.jackson.datatype:jackson-datatype-jdk8:2.9.6 - https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jdk8)
+        * Jackson datatype: JSR310 (com.fasterxml.jackson.datatype:jackson-datatype-jsr310:2.9.6 - https://github.com/FasterXML/jackson-modules-java8/jackson-datatype-jsr310)
+        * Jackson-module-parameter-names (com.fasterxml.jackson.module:jackson-module-parameter-names:2.9.6 - https://github.com/FasterXML/jackson-modules-java8/jackson-module-parameter-names)
+        * JSQLParser library (com.github.jsqlparser:jsqlparser:1.2 - https://github.com/JSQLParser/JSqlParser)
+        * Guava: Google Core Libraries for Java (com.google.guava:guava:18.0 - http://code.google.com/p/guava-libraries/guava)
+        * project ':json-path' (com.jayway.jsonpath:json-path:2.4.0 - https://github.com/jayway/JsonPath)
+        * T-Digest (com.tdunning:t-digest:3.0 - https://github.com/tdunning/t-digest)
+        * HikariCP (com.zaxxer:HikariCP:2.7.9 - https://github.com/brettwooldridge/HikariCP)
+        * Commons Lang (commons-lang:commons-lang:2.6 - http://commons.apache.org/lang/)
+        * Commons Logging (commons-logging:commons-logging:1.1.3 - http://commons.apache.org/proper/commons-logging/)
+        * Non-Blocking Reactive Foundation for the JVM (io.projectreactor:reactor-core:3.1.8.RELEASE - https://github.com/reactor/reactor-core)
+        * springfox-core (io.springfox:springfox-core:2.6.1 - https://github.com/springfox/springfox)
+        * springfox-schema (io.springfox:springfox-schema:2.6.1 - https://github.com/springfox/springfox)
+        * springfox-spi (io.springfox:springfox-spi:2.6.1 - https://github.com/springfox/springfox)
+        * springfox-spring-web (io.springfox:springfox-spring-web:2.6.1 - https://github.com/springfox/springfox)
+        * springfox-swagger-common (io.springfox:springfox-swagger-common:2.6.1 - https://github.com/springfox/springfox)
+        * springfox-swagger-ui (io.springfox:springfox-swagger-ui:2.6.1 - https://github.com/springfox/springfox)
+        * springfox-swagger2 (io.springfox:springfox-swagger2:2.6.1 - https://github.com/springfox/springfox)
+        * Apache Log4j (log4j:log4j:1.2.16 - http://logging.apache.org/log4j/1.2/)
+        * Byte Buddy (without dependencies) (net.bytebuddy:byte-buddy:1.7.11 - http://bytebuddy.net/byte-buddy)
+        * Byte Buddy Java agent (net.bytebuddy:byte-buddy-agent:1.7.11 - http://bytebuddy.net/byte-buddy-agent)
+        * LZ4 and xxHash (net.jpountz.lz4:lz4:1.3.0 - https://github.com/jpountz/lz4-java)
+        * ASM based accessors helper used by json-smart (net.minidev:accessors-smart:1.2 - http://www.minidev.net/)
+        * JSON Small and Fast Parser (net.minidev:json-smart:2.3 - http://www.minidev.net/)
+        * Curator Client (org.apache.curator:curator-client:2.12.0 - http://curator.apache.org/curator-client)
+        * Curator Framework (org.apache.curator:curator-framework:2.12.0 - http://curator.apache.org/curator-framework)
+        * Curator Testing (org.apache.curator:curator-test:2.12.0 - http://curator.apache.org/curator-test)
+        * Apache POI (org.apache.poi:poi:3.9 - http://poi.apache.org/)
+        * Apache POI (org.apache.poi:poi-ooxml:3.9 - http://poi.apache.org/)
+        * Apache POI (org.apache.poi:poi-ooxml-schemas:3.9 - http://poi.apache.org/)
+        * XmlBeans (org.apache.xmlbeans:xmlbeans:2.3.0 - http://xmlbeans.apache.org)
+        * attoparser (org.attoparser:attoparser:2.0.4.RELEASE - http://www.attoparser.org)
+        * core (org.elasticsearch:elasticsearch:5.1.2 - https://github.com/elastic/elasticsearch)
+        * Elasticsearch SecureSM (org.elasticsearch:securesm:1.1 - http://nexus.sonatype.org/oss-repository-hosting.html/securesm)
+        * rest (org.elasticsearch.client:rest:5.1.2 - https://github.com/elastic/elasticsearch)
+        * transport (org.elasticsearch.client:transport:5.1.2 - https://github.com/elastic/elasticsearch)
+        * lang-mustache (org.elasticsearch.plugin:lang-mustache-client:5.1.2 - https://github.com/elastic/elasticsearch)
+        * percolator (org.elasticsearch.plugin:percolator-client:5.1.2 - https://github.com/elastic/elasticsearch)
+        * reindex (org.elasticsearch.plugin:reindex-client:5.1.2 - https://github.com/elastic/elasticsearch)
+        * transport-netty3 (org.elasticsearch.plugin:transport-netty3-client:5.1.2 - https://github.com/elastic/elasticsearch)
+        * transport-netty4 (org.elasticsearch.plugin:transport-netty4-client:5.1.2 - https://github.com/elastic/elasticsearch)
+        * Spatial4J (org.locationtech.spatial4j:spatial4j:0.6 - http://www.locationtech.org/projects/locationtech.spatial4j)
+        * MapStruct Core (org.mapstruct:mapstruct:1.0.0.Final - http://mapstruct.org/mapstruct/)
+        * mybatis (org.mybatis:mybatis:3.4.6 - http://www.mybatis.org/mybatis-3)
+        * mybatis-spring (org.mybatis:mybatis-spring:1.3.2 - http://www.mybatis.org/spring/)
+        * mybatis-spring-boot-autoconfigure (org.mybatis.spring.boot:mybatis-spring-boot-autoconfigure:1.3.2 - http://www.mybatis.org/spring-boot-starter/mybatis-spring-boot-autoconfigure/)
+        * mybatis-spring-boot-starter (org.mybatis.spring.boot:mybatis-spring-boot-starter:1.3.2 - http://www.mybatis.org/spring-boot-starter/mybatis-spring-boot-starter/)
+        * elasticsearch-sql (org.nlpcn:elasticsearch-sql:5.1.2.0 - https://github.com/NLPchina/elasticsearch-sql/)
+        * quartz (org.quartz-scheduler:quartz:2.3.0 - http://www.quartz-scheduler.org/quartz)
+        * JSONassert (org.skyscreamer:jsonassert:1.5.0 - https://github.com/skyscreamer/JSONassert)
+        * spring-ldap-core (org.springframework.ldap:spring-ldap-core:2.3.2.RELEASE - http://www.springframework.org/ldap)
+        * thymeleaf (org.thymeleaf:thymeleaf:3.0.9.RELEASE - http://www.thymeleaf.org)
+        * thymeleaf-spring5 (org.thymeleaf:thymeleaf-spring5:3.0.9.RELEASE - http://www.thymeleaf.org)
+        * thymeleaf-extras-java8time (org.thymeleaf.extras:thymeleaf-extras-java8time:3.0.1.RELEASE - http://www.thymeleaf.org)
+        * unbescape (org.unbescape:unbescape:1.1.5.RELEASE - http://www.unbescape.org)
+        * org.xmlunit:xmlunit-core (org.xmlunit:xmlunit-core:2.5.1 - http://www.xmlunit.org/)
+        * StAX API (stax:stax-api:1.0.1 - http://stax.codehaus.org/)
+        * XML Commons External Components XML APIs (xml-apis:xml-apis:1.4.01 - http://xml.apache.org/commons/components/external/)
+
+    The GNU General Public License, Version 2:
+
+        * MySQL Connector/J (mysql:mysql-connector-java:5.1.44 - http://dev.mysql.com/doc/connector-j/en/)
+
+    The MIT License (MIT):
+
+        * pagehelper 5 (com.github.pagehelper:pagehelper:5.1.4 - https://github.com/pagehelper/Mybatis-PageHelper)
+
+    The SAX License:
+
+        * XML Commons External Components XML APIs (xml-apis:xml-apis:1.4.01 - http://xml.apache.org/commons/components/external/)
+
+    The W3C License:
+
+        * XML Commons External Components XML APIs (xml-apis:xml-apis:1.4.01 - http://xml.apache.org/commons/components/external/)
+
+    Unknown License:
+
+        * dom4j (dom4j:dom4j:1.6.1 - http://dom4j.org)
+        * zookeeper (org.apache.zookeeper:zookeeper:3.4.8 - no url defined)
+
+    license.txt:
+
+        * JPA 2.0 API (org.hibernate.javax.persistence:hibernate-jpa-2.0-api:1.0.1.Final - http://hibernate.org)

+ 43 - 0
MAINTAINING-CH.md

@@ -0,0 +1,43 @@
+# Maintaining
+
+## 项目管理
+
+Davinci 项目通过 [Project](https://github.com/edp963/davinci/projects) 来管理开发计划和维护清单。
+
+### 开发计划
+
+开发计划在 [Roadmap](https://github.com/edp963/davinci/projects/4) 中管理。Committers 可以在 `To do` 栏中自行添加功能卡片,当功能还在卡片阶段时,意味着此功能还在设计和讨论阶段,卡片中应当包含:
+- 功能描述标题
+- 功能设计明细及原理
+- 如果包含子功能项,请逐一列出
+
+当功能经过设计和讨论阶段之后,可以将功能卡片转成 Issue,并打上相应的 Tags。如果有 Committers 计划开发实现它,请将 Issue 拖到 `In progress` 栏中,并添加自己到 Issue 的 Assignees 列表中。**请确保功能经过充分设计和讨论之后再开始开发,未经社区讨论过的功能 PR 不会被合并。**
+
+### 维护清单
+
+维护清单在 [Maintenance](https://github.com/edp963/davinci/projects/5) 中管理。Committers 可以在 To do 栏中自行添加 bug 或亟待修复的缺陷类 Issue。同样的,如果有 Committers 计划开发修复它,请将 Issue 拖到 `In progress` 栏中,并添加自己到 Issue 的 Assignees 列表中。
+
+**为保证开发高效以及目标专注,建议每位 Committer 在所有 Project `In progress` 栏中的 Issue 不超过2个。**
+
+## 版本发布周期及流程
+
+当前阶段,如无特殊需求,每月发布一个 `minor` 版本,正式版本发布不遵循此规则
+
+版本发布之前需要确认
+- 所有功能可以正常运行
+- 与此版本相关的 Issue 和 PR 已经被正确处理
+
+编辑更新日志以及升级版本号
+- 新建一个 PR 将 dev-0.3 分支合并到 master,所有发布操作需要在 master 分支上进行。**注意!不要使用 squash merge!防止提交信息丢失!**
+- 从 master 新建一个 release 分支用来做发布的修改(例如:git checkout -b release-beta.7)
+- 在 CHANGELOG.md 里添加发布日志,可以用 compare 功能找到当前和之前版本的区别,将有价值的改动如实反馈给用户
+- 对用户使用上无感知的改动建议(文档修补、微小的样式优化、代码风格重构等等)不要提及,保持 changelog 的内容有效性
+- 用面向开发者的角度和叙述方式撰写 changelog,不描述修复细节,描述问题和对开发者的影响
+- 尽量给出原始的 PR 链接,社区提交的 PR 改动加上提交者的链接或 Issue 链接
+- 如果不确定改动的真实目的,可以向提交者进行咨询
+- push release 分支并发起 changelog 的 PR 请其他 Committee 成员进行 Review
+- PR 的内容里填上 changelog 内容,好处是版本 changelog 的 PR 会关联在各个 issue 中,很容易知道 Issue 在哪个版本被改了
+
+正式发布 release
+- 更新日志的修改合并后,删除 release-x 分支,给当前 master 分支打上版本号 tag
+- 上传 release 包,发布 release note

+ 187 - 0
NOTICE

@@ -0,0 +1,187 @@
+Licensed to Apereo under one or more contributor license
+agreements. See the NOTICE file distributed with this work
+for additional information regarding copyright ownership.
+Apereo licenses this file to you under the Apache License,
+Version 2.0 (the "License"); you may not use this file
+except in compliance with the License.  You may obtain a
+copy of the License at the following location:
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+
+This project includes:
+  ANTLR 3 Runtime under BSD licence
+  Apache Commons Codec under Apache License, Version 2.0
+  Apache Commons Collections under Apache License, Version 2.0
+  Apache Commons CSV under Apache License, Version 2.0
+  Apache HttpAsyncClient under Apache License, Version 2.0
+  Apache HttpClient under Apache License, Version 2.0
+  Apache HttpCore under Apache License, Version 2.0
+  Apache HttpCore NIO under Apache License, Version 2.0
+  Apache Log4j Core under Apache License, Version 2.0
+  Apache Log4j to SLF4J Adapter under Apache License, Version 2.0
+  Apache POI under The Apache Software License, Version 2.0
+  ASM based accessors helper used by json-smart under The Apache Software License, Version 2.0
+  ASM Core under BSD
+  AssertJ fluent assertions under Apache License, Version 2.0
+  attoparser under The Apache Software License, Version 2.0
+  Bean Validation API under Apache License 2.0
+  Byte Buddy (without dependencies) under The Apache Software License, Version 2.0
+  Byte Buddy Java agent under The Apache Software License, Version 2.0
+  Caffeine cache under Apache License, Version 2.0
+  ClassMate under The Apache Software License, Version 2.0
+  Commons Logging under The Apache Software License, Version 2.0
+  compiler under Apache License 2.0
+  core under The Apache Software License, Version 2.0
+  curvesapi under BSD License
+  davinci-server_3.01 under Apache License, Version 2.0
+  druid under Apache 2
+  Elasticsearch SecureSM under The Apache Software License, Version 2.0
+  elasticsearch-sql under The Apache Software License, Version 2.0
+  fastjson under Apache 2
+  Guava: Google Core Libraries for Java under The Apache Software License, Version 2.0
+  Hamcrest Core under New BSD License
+  Hamcrest library under New BSD License
+  HdrHistogram under Public Domain, per Creative Commons CC0
+  Hibernate Validator Engine under Apache License 2.0
+  HikariCP under The Apache Software License, Version 2.0
+  HPPC Collections under The Apache Software License, Version 2.0
+  Jackson dataformat: CBOR under The Apache Software License, Version 2.0
+  Jackson dataformat: Smile under The Apache Software License, Version 2.0
+  Jackson datatype: jdk8 under The Apache Software License, Version 2.0
+  Jackson datatype: JSR310 under The Apache Software License, Version 2.0
+  Jackson-annotations under The Apache Software License, Version 2.0
+  Jackson-core under The Apache Software License, Version 2.0
+  jackson-databind under The Apache Software License, Version 2.0
+  Jackson-dataformat-YAML under The Apache Software License, Version 2.0
+  Jackson-module-parameter-names under The Apache Software License, Version 2.0
+  Java Native Access under LGPL, version 2.1 or Apache License v2.0
+  JavaBeans Activation Framework (JAF) under Common Development and Distribution License (CDDL) v1.0
+  JavaMail API under CDDL/GPLv2+CE
+  javax.annotation API under CDDL + GPLv2 with classpath exception
+  jbcrypt under ISC/BSD License
+  JBoss Logging 3 under Apache License, version 2.0
+  Joda-Time under Apache 2
+  JOpt Simple under The MIT License
+  jquery under MIT License
+  JSON library from Android SDK under Apache License 2.0
+  JSON Small and Fast Parser under The Apache Software License, Version 2.0
+  JSON Web Token support for the JVM under Apache License, Version 2.0
+  JSONassert under The Apache Software License, Version 2.0
+  JSQLParser library under GNU Library or Lesser General Public License (LGPL) V2.1 or The Apache Software License, Version 2.0
+  JTS Topology Suite under Lesser General Public License (LGPL)
+  JUL to SLF4J bridge under MIT License
+  JUnit under Eclipse Public License 1.0
+  lang-mustache under The Apache Software License, Version 2.0
+  Lettuce under Apache License, Version 2.0
+  Logback Classic Module under Eclipse Public License - v 1.0 or GNU Lesser General Public License
+  Logback Core Module under Eclipse Public License - v 1.0 or GNU Lesser General Public License
+  Lucene Common Analyzers under Apache 2
+  Lucene Core under Apache 2
+  Lucene Grouping under Apache 2
+  Lucene Highlighter under Apache 2
+  Lucene Join under Apache 2
+  Lucene Memory under Apache 2
+  Lucene Miscellaneous under Apache 2
+  Lucene Queries under Apache 2
+  Lucene QueryParsers under Apache 2
+  Lucene Sandbox under Apache 2
+  Lucene Spatial under Apache 2
+  Lucene Spatial 3D under Apache 2
+  Lucene Spatial Extras under Apache 2
+  Lucene Suggest under Apache 2
+  MapStruct Core under The Apache Software License, Version 2.0
+  mchange-commons-java under GNU Lesser General Public License, Version 2.1 or Eclipse Public License, Version 1.0
+  mockito-core under The MIT License
+  mybatis under The Apache Software License, Version 2.0
+  mybatis-spring under The Apache Software License, Version 2.0
+  mybatis-spring-boot-autoconfigure under The Apache Software License, Version 2.0
+  mybatis-spring-boot-starter under The Apache Software License, Version 2.0
+  MySQL Connector/J under The GNU General Public License, Version 2
+  Netty under Apache License, Version 2.0
+  Netty/Buffer under Apache License, Version 2.0
+  Netty/Codec under Apache License, Version 2.0
+  Netty/Codec/HTTP under Apache License, Version 2.0
+  Netty/Common under Apache License, Version 2.0
+  Netty/Handler under Apache License, Version 2.0
+  Netty/Resolver under Apache License, Version 2.0
+  Netty/Transport under Apache License, Version 2.0
+  Non-Blocking Reactive Foundation for the JVM under The Apache Software License, Version 2.0
+  Objenesis under Apache 2
+  org.xmlunit:xmlunit-core under The Apache Software License, Version 2.0
+  pagehelper 5 under The MIT License (MIT)
+  pagehelper-spring-boot-autoconfigure under The MIT License (MIT)
+  pagehelper-spring-boot-starter under The MIT License (MIT)
+  percolator under The Apache Software License, Version 2.0
+  project ':json-path' under The Apache Software License, Version 2.0
+  Project Lombok under The MIT License
+  quartz under The Apache Software License, Version 2.0
+  reactive-streams under CC0
+  reindex under The Apache Software License, Version 2.0
+  rest under The Apache Software License, Version 2.0
+  SLF4J API Module under MIT License
+  SnakeYAML under Apache License, Version 2.0
+  Spatial4J under The Apache Software License, Version 2.0
+  Spring AOP under Apache License, Version 2.0
+  Spring Beans under Apache License, Version 2.0
+  Spring Boot under Apache License, Version 2.0
+  Spring Boot AutoConfigure under Apache License, Version 2.0
+  Spring Boot Cache Starter under Apache License, Version 2.0
+  Spring Boot Data Redis Starter under Apache License, Version 2.0
+  Spring Boot JDBC Starter under Apache License, Version 2.0
+  Spring Boot Json Starter under Apache License, Version 2.0
+  Spring Boot Logging Starter under Apache License, Version 2.0
+  Spring Boot Mail Starter under Apache License, Version 2.0
+  Spring Boot Starter under Apache License, Version 2.0
+  Spring Boot Test under Apache License, Version 2.0
+  Spring Boot Test Auto-Configure under Apache License, Version 2.0
+  Spring Boot Test Starter under Apache License, Version 2.0
+  Spring Boot Thymeleaf Starter under Apache License, Version 2.0
+  Spring Boot Tomcat Starter under Apache License, Version 2.0
+  Spring Boot Web Starter under Apache License, Version 2.0
+  Spring Commons Logging Bridge under Apache License, Version 2.0
+  Spring Context under Apache License, Version 2.0
+  Spring Context Support under Apache License, Version 2.0
+  Spring Core under Apache License, Version 2.0
+  Spring Data Core under Apache License, Version 2.0
+  Spring Data KeyValue under Apache License, Version 2.0
+  Spring Data Redis under Apache License, Version 2.0
+  Spring Expression Language (SpEL) under Apache License, Version 2.0
+  Spring JDBC under Apache License, Version 2.0
+  Spring Object/XML Marshalling under Apache License, Version 2.0
+  Spring Plugin - Core under Apache License, Version 2.0
+  Spring Plugin - Metadata Extension under Apache License, Version 2.0
+  Spring TestContext Framework under Apache License, Version 2.0
+  Spring Transaction under Apache License, Version 2.0
+  Spring Web under Apache License, Version 2.0
+  Spring Web MVC under Apache License, Version 2.0
+  springfox-core under The Apache Software License, Version 2.0
+  springfox-schema under The Apache Software License, Version 2.0
+  springfox-spi under The Apache Software License, Version 2.0
+  springfox-spring-web under The Apache Software License, Version 2.0
+  springfox-swagger-common under The Apache Software License, Version 2.0
+  springfox-swagger-ui under The Apache Software License, Version 2.0
+  springfox-swagger2 under The Apache Software License, Version 2.0
+  StAX API under The Apache Software License, Version 2.0
+  StringTemplate 4 under BSD licence
+  swagger-annotations under Apache License 2.0
+  swagger-models under Apache License 2.0
+  T-Digest under The Apache Software License, Version 2.0
+  thymeleaf under The Apache Software License, Version 2.0
+  thymeleaf-extras-java8time under The Apache Software License, Version 2.0
+  thymeleaf-spring5 under The Apache Software License, Version 2.0
+  tomcat-embed-core under Apache License, Version 2.0
+  tomcat-embed-el under Apache License, Version 2.0
+  tomcat-embed-websocket under Apache License, Version 2.0
+  transport under The Apache Software License, Version 2.0
+  transport-netty3 under The Apache Software License, Version 2.0
+  transport-netty4 under The Apache Software License, Version 2.0
+  unbescape under The Apache Software License, Version 2.0
+  XmlBeans under The Apache Software License, Version 2.0
+

+ 87 - 0
README-CH.md

@@ -0,0 +1,87 @@
+Davinci
+============
+
+[![License](https://img.shields.io/badge/license-Apache%202-4EB1BA.svg)](https://www.apache.org/licenses/LICENSE-2.0.html)
+[![Total Lines](https://tokei.rs/b1/github/edp963/davinci?category=lines)](https://github.com/edp963/davinci)
+[![Build Status](https://travis-ci.org/edp963/davinci.svg?branch=master)](https://travis-ci.org/edp963/davinci)
+[![GitHub release](https://img.shields.io/github/release/edp963/davinci.svg)](https://github.com/edp963/davinci/releases)
+[![Stargazers over time](https://starcharts.herokuapp.com/edp963/davinci.svg)](https://starcharts.herokuapp.com/edp963/davinci)
+
+**Davinci是一个DVAAS(Data Visualization as a Service)平台解决方案。**
+
+Davinci面向业务人员/数据工程师/数据分析师/数据科学家,致力于提供一站式数据可视化解决方案。既可作为公有云/私有云独立使用,也可作为可视化插件集成到三方系统。用户只需在可视化UI上简单配置即可满足多种数据可视化需求,并支持高级交互/行业分析/模式探索/社交智能等可视化功能。
+
+## 设计理念
+
+* **围绕 View(数据视图)和 Widget(可视组件)两个核心概念设计**
+  * View是数据的结构化形态,一切逻辑/权限/服务等相关都是从View展开。
+  * Widget是数据的可视化形态,一切展示/交互/引导等都是从Widget展开。
+  * 作为数据的两种不同形态,二者相辅相成,让用户拥有一致的体验和认识。
+* **强化集成定制能力和社交智能能力**
+  * 集成定制能力指无缝集成到三方系统,并提供强大的定制化能力,使其和三方系统融为一体。
+  * 社交智能能力指共享优秀的数据可视化思想,激发用户对数据可视化表达能力和艺术美感的追求,同时也使Davinci更加智能的引导和提高用户的数据可视化能力。
+  * 在数据可视化领域里,Davinci重视基础的交互能力和多种多样的图表选择能力,同时更加重视集成定制能力和社交智能能力。
+
+## 功能特点
+
+- **数据源**
+  - 支持多种 JDBC 数据源
+  - 支持 CSV 数据文件上传
+
+- **数据模型**
+  - 支持友好 SQL 编辑器进行数据处理和转换
+  - 支持自动和自定义数据模型设计和共享
+
+- **可视化组件**
+  - 支持基于数据模型拖拽智能生成可视化组件
+  - 支持各种可视化组件样式配置
+  - 支持自由分析能力
+
+- **数据门户**
+  - 支持基于可视化组件创建可视化仪表板
+  - 支持可视化组件自动布局
+  - 支持可视化组件全屏显示、本地控制器、高级过滤器、组件间联动、群控控制器可视组件
+  - 支持可视化组件大数据量展示分页和滑块
+  - 支持可视化组件 CSV 数据下载、公共分享授权分享以及可视化仪表板的公共分享和授权分享
+  - 支持基于可视化仪表板创建数据门户
+
+- **数据大屏**
+  - 支持可视化组件自由布局
+  - 支持图层、透明度设置、边框、背景色、对齐、标签等更丰富大屏美化功能
+  - 支持多种屏幕自适应方式
+
+- **用户体系**
+  - 支持多租户用户体系
+  - 支持每个用户自建一整套组织架构层级结构
+  - 支持浅社交能力
+
+- **安全权限**
+  - 支持 LDAP 登录认证
+  - 支持动态 Token 鉴权
+  - 支持细粒度操作权限矩阵配置
+  - 支持数据列权限、行权限
+
+- **集成能力**
+  - 支持安全 URL 嵌入式集成
+  - 支持 JS 融入式集成
+
+- **多屏适应**
+  - 支持大屏、PC、Pad、手机移动端等多屏自适应
+
+Documentation
+=============
+Please refer to [Davinci用户手册](https://edp963.github.io/davinci/).
+
+Latest Release
+=============
+Please download the latest [RELEASE](https://github.com/edp963/davinci/releases/download/v0.3.0-rc/davinci-assembly_0.3.1-0.3.1-SNAPSHOT-dist-rc.zip).
+
+Get Help
+============
+The fastest way to get response from our developers is to join our WeChat group for online discussion.
+
+![二维码](https://github.com/edp963/edp-resource/raw/master/WeChat.jpg)
+
+License
+============
+Please refer to [LICENSE](https://github.com/edp963/davinci/blob/master/LICENSE) file.

+ 85 - 0
assembly/pom.xml

@@ -0,0 +1,85 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xmlns="http://maven.apache.org/POM/4.0.0"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+    <modelVersion>4.0.0</modelVersion>
+
+    <parent>
+        <artifactId>davinci-parent_0.3.1</artifactId>
+        <groupId>edp.davinci</groupId>
+        <version>0.3.1-SNAPSHOT</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+
+    <artifactId>davinci-assembly_0.3.1</artifactId>
+    <packaging>pom</packaging>
+
+    <licenses>
+        <license>
+            <name>Apache License, Version 2.0</name>
+            <url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
+            <distribution>repo</distribution>
+        </license>
+    </licenses>
+
+    <properties>
+        <skipTests>true</skipTests>
+
+        <main.basedir>${project.parent.basedir}</main.basedir>
+        <sbt.project.name>assembly</sbt.project.name>
+        <build.testJarPhase>none</build.testJarPhase>
+        <build.copyDependenciesPhase>package</build.copyDependenciesPhase>
+    </properties>
+
+    <dependencies>
+        <dependency>
+            <groupId>edp.davinci</groupId>
+            <artifactId>davinci-server_0.3.1</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-antrun-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>run</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-assembly-plugin</artifactId>
+                <version>3.0.0</version>
+                <executions>
+                    <execution>
+                        <id>dist</id>
+                        <phase>package</phase>
+                        <goals>
+                            <goal>single</goal>
+                        </goals>
+                        <configuration>
+                            <descriptors>
+                                <descriptor>src/main/assembly/assembly.xml</descriptor>
+                            </descriptors>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>dist</id>
+        </profile>
+    </profiles>
+</project>

+ 103 - 0
assembly/src/main/assembly/assembly.xml

@@ -0,0 +1,103 @@
+<!--
+  <<
+  Davinci
+  ==
+  Copyright (C) 2016 - 2018 EDP
+  ==
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+  
+       http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  >>
+  -->
+
+
+<assembly>
+    <id>dist-rc</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+
+    <fileSets>
+        <fileSet>
+            <directory>${project.parent.basedir}</directory>
+            <outputDirectory>/</outputDirectory>
+            <includes>
+                <include>README*</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>
+                ${project.parent.basedir}/config
+            </directory>
+            <outputDirectory>config</outputDirectory>
+            <includes>
+                <include>application.yml.example</include>
+                <include>datasource_driver.yml.example</include>
+                <include>logback.xml</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>
+                ${project.parent.basedir}/bin
+            </directory>
+            <outputDirectory>bin</outputDirectory>
+            <excludes>
+                <exclude>upgrade/**</exclude>
+                <exclude>upgrade.*</exclude>
+                <exclude>upgrade-*</exclude>
+            </excludes>
+        </fileSet>
+        <fileSet>
+            <directory>
+                ${project.parent.basedir}
+            </directory>
+            <outputDirectory>userfiles</outputDirectory>
+            <excludes>
+                <exclude>*/**</exclude>
+            </excludes>
+        </fileSet>
+        <fileSet>
+            <directory>
+                ${project.parent.basedir}
+            </directory>
+            <outputDirectory>logs/sys</outputDirectory>
+            <excludes>
+                <exclude>*/**</exclude>
+            </excludes>
+        </fileSet>
+        <fileSet>
+            <directory>
+                ${project.parent.basedir}
+            </directory>
+            <outputDirectory>logs/user</outputDirectory>
+            <excludes>
+                <exclude>*/**</exclude>
+            </excludes>
+        </fileSet>
+        <fileSet>
+            <directory>
+                ${project.parent.basedir}/davinci-ui
+            </directory>
+            <outputDirectory>davinci-ui</outputDirectory>
+        </fileSet>
+    </fileSets>
+
+    <dependencySets>
+        <dependencySet>
+            <outputDirectory>lib</outputDirectory>
+            <useTransitiveDependencies>true</useTransitiveDependencies>
+            <unpack>false</unpack>
+            <scope>runtime</scope>
+            <useProjectArtifact>false</useProjectArtifact>
+        </dependencySet>
+    </dependencySets>
+</assembly>

+ 101 - 0
assembly/src/main/assembly/release.xml

@@ -0,0 +1,101 @@
+<!--
+  <<
+  Davinci
+  ==
+  Copyright (C) 2016 - 2018 EDP
+  ==
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+  
+       http://www.apache.org/licenses/LICENSE-2.0
+  
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+  >>
+  -->
+
+
+
+
+
+
+<assembly>
+    <id>release-beta.4</id>
+    <formats>
+        <format>zip</format>
+    </formats>
+    <includeBaseDirectory>false</includeBaseDirectory>
+
+    <fileSets>
+        <fileSet>
+            <directory>${project.parent.basedir}</directory>
+            <outputDirectory>/</outputDirectory>
+            <includes>
+                <include>README*</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>
+                ${project.parent.basedir}/config
+            </directory>
+            <outputDirectory>config</outputDirectory>
+            <includes>
+                <include>datasource_driver.yml.example</include>
+                <include>application.yml.example</include>
+                <include>logback.xml</include>
+            </includes>
+        </fileSet>
+        <fileSet>
+            <directory>
+                ${project.parent.basedir}/bin
+            </directory>
+            <outputDirectory>bin</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>
+                ${project.parent.basedir}/userfiles
+            </directory>
+            <outputDirectory>userfiles</outputDirectory>
+            <excludes>
+                <exclude>*</exclude>
+            </excludes>
+        </fileSet>
+        <fileSet>
+            <directory>
+                ${project.parent.basedir}/logs
+            </directory>
+            <outputDirectory>logs</outputDirectory>
+            <excludes>
+                <exclude>*</exclude>
+            </excludes>
+        </fileSet>
+        <fileSet>
+            <directory>
+                ${project.parent.basedir}/davinci-ui
+            </directory>
+            <outputDirectory>davinci-ui</outputDirectory>
+        </fileSet>
+
+    </fileSets>
+
+    <dependencySets>
+        <dependencySet>
+            <outputDirectory>lib</outputDirectory>
+            <useTransitiveDependencies>true</useTransitiveDependencies>
+            <unpack>false</unpack>
+            <scope>runtime</scope>
+            <useProjectArtifact>false</useProjectArtifact>
+        </dependencySet>
+    </dependencySets>
+
+    <!--<files>
+        <file>
+            <source>${project.parent.basedir}/server/target/davinci-server_2.11-${project.parent.version}-jar-with-dependencies.jar</source>
+            <outputDirectory>plugin</outputDirectory>
+        </file>
+    </files>-->
+</assembly>

+ 9 - 0
bin/build.sh

@@ -0,0 +1,9 @@
+#!/usr/bin/env bash
+
+current_dir=`pwd`
+script_dir=$(cd `dirname $0`; pwd)
+echo $script_dir
+echo $current_dir
+cd $script_dir
+cd ..
+cd $current_dir

+ 707 - 0
bin/davinci.sql

@@ -0,0 +1,707 @@
+SET NAMES utf8mb4;
+SET FOREIGN_KEY_CHECKS = 0;
+
+-- ----------------------------
+-- Table structure for cron_job
+-- ----------------------------
+DROP TABLE IF EXISTS `cron_job`;
+CREATE TABLE `cron_job`
+(
+    `id`              bigint(20)                          NOT NULL AUTO_INCREMENT,
+    `name`            varchar(45) COLLATE utf8_unicode_ci NOT NULL,
+    `project_id`      bigint(20)                          NOT NULL,
+    `job_type`        varchar(45) COLLATE utf8_unicode_ci NOT NULL,
+    `job_status`      varchar(10) COLLATE utf8_unicode_ci NOT NULL DEFAULT '',
+    `cron_expression` varchar(45) COLLATE utf8_unicode_ci NOT NULL,
+    `start_date`      datetime                            NOT NULL,
+    `end_date`        datetime                            NOT NULL,
+    `config`          text COLLATE utf8_unicode_ci        NOT NULL,
+    `description`     varchar(255) COLLATE utf8_unicode_ci         DEFAULT NULL,
+    `exec_log`        text COLLATE utf8_unicode_ci,
+    `create_by`       bigint(20)                          NOT NULL,
+    `create_time`     timestamp                           NOT NULL DEFAULT CURRENT_TIMESTAMP,
+    `update_by`       bigint(20)                                   DEFAULT NULL,
+    `update_time`     timestamp                           NULL     DEFAULT NULL,
+    `parent_id`       bigint(20)                                   DEFAULT NULL,
+    `full_parent_id`  varchar(255) COLLATE utf8_unicode_ci         DEFAULT NULL,
+    `is_folder`       tinyint(1)                                   DEFAULT NULL,
+    `index`           int(5)                                       DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    UNIQUE KEY `idx_name_project` (`name`,`project_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8
+  COLLATE = utf8_unicode_ci;
+
+-- ----------------------------
+-- Table structure for dashboard
+-- ----------------------------
+DROP TABLE IF EXISTS `dashboard`;
+CREATE TABLE `dashboard`
+(
+    `id`                  bigint(20)   NOT NULL AUTO_INCREMENT,
+    `name`                varchar(255) NOT NULL,
+    `dashboard_portal_id` bigint(20)   NOT NULL,
+    `type`                smallint(1)  NOT NULL,
+    `index`               int(4)       NOT NULL,
+    `parent_id`           bigint(20)   NOT NULL DEFAULT '0',
+    `config`              text,
+    `full_parent_Id`      varchar(100)          DEFAULT NULL,
+    `create_by`           bigint(20)            DEFAULT NULL,
+    `create_time`         datetime              DEFAULT NULL,
+    `update_by`           bigint(20)            DEFAULT NULL,
+    `update_time`         datetime              DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    KEY `idx_portal_id` (`dashboard_portal_id`) USING BTREE,
+    KEY `idx_parent_id` (`parent_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- ----------------------------
+-- Table structure for dashboard_portal
+-- ----------------------------
+DROP TABLE IF EXISTS `dashboard_portal`;
+CREATE TABLE `dashboard_portal`
+(
+    `id`          bigint(20)   NOT NULL AUTO_INCREMENT,
+    `name`        varchar(255) NOT NULL,
+    `description` varchar(255)          DEFAULT NULL,
+    `project_id`  bigint(20)   NOT NULL,
+    `avatar`      varchar(255)          DEFAULT NULL,
+    `publish`     tinyint(1)   NOT NULL DEFAULT '0',
+    `create_by`   bigint(20)            DEFAULT NULL,
+    `create_time` datetime              DEFAULT NULL,
+    `update_by`   bigint(20)            DEFAULT NULL,
+    `update_time` datetime              DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    KEY `idx_project_id` (`project_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- ----------------------------
+-- Table structure for display
+-- ----------------------------
+DROP TABLE IF EXISTS `display`;
+CREATE TABLE `display`
+(
+    `id`          bigint(20)   NOT NULL AUTO_INCREMENT,
+    `name`        varchar(255) NOT NULL,
+    `description` varchar(255) DEFAULT NULL,
+    `project_id`  bigint(20)   NOT NULL,
+    `avatar`      varchar(255) DEFAULT NULL,
+    `publish`     tinyint(1)   NOT NULL,
+    `config`      text         NULL,
+    `create_by`   bigint(20)   DEFAULT NULL,
+    `create_time` datetime     DEFAULT NULL,
+    `update_by`   bigint(20)   DEFAULT NULL,
+    `update_time` datetime     DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    KEY `idx_project_id` (`project_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- ----------------------------
+-- Table structure for display_slide
+-- ----------------------------
+DROP TABLE IF EXISTS `display_slide`;
+CREATE TABLE `display_slide`
+(
+    `id`          bigint(20) NOT NULL AUTO_INCREMENT,
+    `display_id`  bigint(20) NOT NULL,
+    `index`       int(12)    NOT NULL,
+    `config`      text       NOT NULL,
+    `create_by`   bigint(20) DEFAULT NULL,
+    `create_time` datetime   DEFAULT NULL,
+    `update_by`   bigint(20) DEFAULT NULL,
+    `update_time` datetime   DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    KEY `idx_display_id` (`display_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- ----------------------------
+-- Table structure for download_record
+-- ----------------------------
+DROP TABLE IF EXISTS `download_record`;
+CREATE TABLE `download_record`
+(
+    `id`                 bigint(20)   NOT NULL AUTO_INCREMENT,
+    `name`               varchar(255) NOT NULL,
+    `user_id`            bigint(20)   NOT NULL,
+    `path`               varchar(255) DEFAULT NULL,
+    `status`             smallint(1)  NOT NULL,
+    `create_time`        datetime     NOT NULL,
+    `last_download_time` datetime     DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    KEY `idx_user` (`user_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+-- ----------------------------
+-- Table structure for favorite
+-- ----------------------------
+DROP TABLE IF EXISTS `favorite`;
+CREATE TABLE `favorite`
+(
+    `id`          bigint(20) NOT NULL AUTO_INCREMENT,
+    `user_id`     bigint(20) NOT NULL,
+    `project_id`  bigint(20) NOT NULL,
+    `create_time` datetime   NOT NULL ON UPDATE CURRENT_TIMESTAMP,
+    PRIMARY KEY (`id`) USING BTREE,
+    UNIQUE KEY `idx_user_project` (`user_id`, `project_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- ----------------------------
+-- Table structure for mem_dashboard_widget
+-- ----------------------------
+DROP TABLE IF EXISTS `mem_dashboard_widget`;
+CREATE TABLE `mem_dashboard_widget`
+(
+    `id`           bigint(20) NOT NULL AUTO_INCREMENT,
+    `alias`        varchar(30) NULL,
+    `dashboard_id` bigint(20) NOT NULL,
+    `widget_Id`    bigint(20)          DEFAULT NULL,
+    `x`            int(12)    NOT NULL,
+    `y`            int(12)    NOT NULL,
+    `width`        int(12)    NOT NULL,
+    `height`       int(12)    NOT NULL,
+    `polling`      tinyint(1) NOT NULL DEFAULT '0',
+    `frequency`    int(12)             DEFAULT NULL,
+    `config`       text,
+    `create_by`    bigint(20)          DEFAULT NULL,
+    `create_time`  datetime            DEFAULT NULL,
+    `update_by`    bigint(20)          DEFAULT NULL,
+    `update_time`  datetime            DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    KEY `idx_dashboard_id` (`dashboard_id`) USING BTREE,
+    KEY `idx_widget_id` (`widget_Id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- ----------------------------
+-- Table structure for mem_display_slide_widget
+-- ----------------------------
+DROP TABLE IF EXISTS `mem_display_slide_widget`;
+CREATE TABLE `mem_display_slide_widget`
+(
+    `id`               bigint(20)   NOT NULL AUTO_INCREMENT,
+    `display_slide_id` bigint(20)   NOT NULL,
+    `widget_id`        bigint(20)            DEFAULT NULL,
+    `name`             varchar(255) NOT NULL,
+    `params`           text         NOT NULL,
+    `type`             smallint(1)  NOT NULL,
+    `sub_type`         smallint(2)           DEFAULT NULL,
+    `index`            int(12)      NOT NULL DEFAULT '0',
+    `create_by`        bigint(20)            DEFAULT NULL,
+    `create_time`      datetime              DEFAULT NULL,
+    `update_by`        bigint(20)            DEFAULT NULL,
+    `update_time`      datetime              DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    KEY `idx_slide_id` (`display_slide_id`) USING BTREE,
+    KEY `idx_widget_id` (`widget_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- ----------------------------
+-- Table structure for organization
+-- ----------------------------
+DROP TABLE IF EXISTS `organization`;
+CREATE TABLE `organization`
+(
+    `id`                   bigint(20)   NOT NULL AUTO_INCREMENT,
+    `name`                 varchar(255) NOT NULL,
+    `description`          varchar(255)          DEFAULT NULL,
+    `avatar`               varchar(255)          DEFAULT NULL,
+    `user_id`              bigint(20)   NOT NULL,
+    `project_num`          int(20)               DEFAULT '0',
+    `member_num`           int(20)               DEFAULT '0',
+    `role_num`             int(20)               DEFAULT '0',
+    `allow_create_project` tinyint(1)            DEFAULT '1',
+    `member_permission`    smallint(1)  NOT NULL DEFAULT '0',
+    `create_time`          timestamp    NOT NULL DEFAULT CURRENT_TIMESTAMP,
+    `create_by`            bigint(20)   NOT NULL DEFAULT '0',
+    `update_time`          timestamp    NULL,
+    `update_by`            bigint(20)            DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    KEY `idx_user_id` (`user_id`),
+    KEY `idx_allow_create_project` (`allow_create_project`),
+    KEY `idx_member_permission` (`member_permission`)
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- ----------------------------
+-- Table structure for platform
+-- ----------------------------
+DROP TABLE IF EXISTS `platform`;
+CREATE TABLE `platform`
+(
+    `id`               bigint(20)   NOT NULL,
+    `name`             varchar(255) NOT NULL,
+    `platform`         varchar(255) NOT NULL,
+    `code`             varchar(32)  NOT NULL,
+    `checkCode`        varchar(255) DEFAULT NULL,
+    `checkSystemToken` varchar(255) DEFAULT NULL,
+    `checkUrl`         varchar(255) DEFAULT NULL,
+    `alternateField1`  varchar(255) DEFAULT NULL,
+    `alternateField2`  varchar(255) DEFAULT NULL,
+    `alternateField3`  varchar(255) DEFAULT NULL,
+    `alternateField4`  varchar(255) DEFAULT NULL,
+    `alternateField5`  varchar(255) DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- ----------------------------
+-- Table structure for project
+-- ----------------------------
+DROP TABLE IF EXISTS `project`;
+CREATE TABLE `project`
+(
+    `id`             bigint(20)   NOT NULL AUTO_INCREMENT,
+    `name`           varchar(255) NOT NULL,
+    `description`    varchar(255)          DEFAULT NULL,
+    `pic`            varchar(255)          DEFAULT NULL,
+    `org_id`         bigint(20)   NOT NULL,
+    `user_id`        bigint(20)   NOT NULL,
+    `visibility`     tinyint(1)            DEFAULT '1',
+    `star_num`       int(11)               DEFAULT '0',
+    `is_transfer`    tinyint(1)   NOT NULL DEFAULT '0',
+    `initial_org_id` bigint(20)   NOT NULL,
+    `create_by`      bigint(20)            DEFAULT NULL,
+    `create_time`    datetime              DEFAULT NULL,
+    `update_by`      bigint(20)            DEFAULT NULL,
+    `update_time`    datetime              DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    KEY `idx_org_id` (`org_id`),
+    KEY `idx_user_id` (`user_id`),
+    KEY `idx_visibility` (`visibility`)
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- ----------------------------
+-- Table structure for rel_project_admin
+-- ----------------------------
+DROP TABLE IF EXISTS `rel_project_admin`;
+CREATE TABLE `rel_project_admin`
+(
+    `id`          bigint(20) NOT NULL AUTO_INCREMENT,
+    `project_id`  bigint(20) NOT NULL,
+    `user_id`     bigint(20) NOT NULL,
+    `create_by`   bigint(20) DEFAULT NULL,
+    `create_time` datetime   DEFAULT NULL,
+    `update_by`   bigint(20) DEFAULT NULL,
+    `update_time` datetime   DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    UNIQUE KEY `idx_project_user` (`project_id`, `user_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4 COMMENT ='project admin表';
+
+-- ----------------------------
+-- Table structure for rel_role_dashboard
+-- ----------------------------
+DROP TABLE IF EXISTS `rel_role_dashboard`;
+CREATE TABLE `rel_role_dashboard`
+(
+    `role_id`      bigint(20) NOT NULL,
+    `dashboard_id` bigint(20) NOT NULL,
+    `visible`      tinyint(1) NOT NULL DEFAULT '0',
+    `create_by`    bigint(20)          DEFAULT NULL,
+    `create_time`  datetime            DEFAULT NULL,
+    `update_by`    bigint(20)          DEFAULT NULL,
+    `update_time`  datetime            DEFAULT NULL,
+    PRIMARY KEY (`role_id`, `dashboard_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+-- ----------------------------
+-- Table structure for rel_role_display
+-- ----------------------------
+DROP TABLE IF EXISTS `rel_role_display`;
+CREATE TABLE `rel_role_display`
+(
+    `role_id`     bigint(20) NOT NULL,
+    `display_id`  bigint(20) NOT NULL,
+    `visible`     tinyint(1) NOT NULL DEFAULT '0',
+    `create_by`   bigint(20)          DEFAULT NULL,
+    `create_time` datetime            DEFAULT NULL,
+    `update_by`   bigint(20)          DEFAULT NULL,
+    `update_time` datetime            DEFAULT NULL,
+    PRIMARY KEY (`role_id`, `display_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+-- ----------------------------
+-- Table structure for rel_role_portal
+-- ----------------------------
+DROP TABLE IF EXISTS `rel_role_portal`;
+CREATE TABLE `rel_role_portal`
+(
+    `role_id`     bigint(20) NOT NULL,
+    `portal_id`   bigint(20) NOT NULL,
+    `visible`     tinyint(1) NOT NULL DEFAULT '0',
+    `create_by`   bigint(20)          DEFAULT NULL,
+    `create_time` datetime            DEFAULT NULL,
+    `update_by`   bigint(20)          DEFAULT NULL,
+    `update_time` datetime            DEFAULT NULL,
+    PRIMARY KEY (`role_id`, `portal_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+-- ----------------------------
+-- Table structure for rel_role_project
+-- ----------------------------
+DROP TABLE IF EXISTS `rel_role_project`;
+CREATE TABLE `rel_role_project`
+(
+    `id`                  bigint(20)  NOT NULL AUTO_INCREMENT,
+    `project_id`          bigint(20)  NOT NULL,
+    `role_id`             bigint(20)  NOT NULL,
+    `source_permission`   smallint(1) NOT NULL DEFAULT '1',
+    `view_permission`     smallint(1) NOT NULL DEFAULT '1',
+    `widget_permission`   smallint(1) NOT NULL DEFAULT '1',
+    `viz_permission`      smallint(1) NOT NULL DEFAULT '1',
+    `schedule_permission` smallint(1) NOT NULL DEFAULT '1',
+    `share_permission`    tinyint(1)  NOT NULL DEFAULT '0',
+    `download_permission` tinyint(1)  NOT NULL DEFAULT '0',
+    `create_by`           bigint(20)           DEFAULT NULL,
+    `create_time`         datetime             DEFAULT NULL,
+    `update_by`           bigint(20)           DEFAULT NULL,
+    `update_time`         datetime             DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    UNIQUE KEY `idx_role_project` (`project_id`, `role_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+-- ----------------------------
+-- Table structure for rel_role_slide
+-- ----------------------------
+DROP TABLE IF EXISTS `rel_role_slide`;
+CREATE TABLE `rel_role_slide`
+(
+    `role_id`     bigint(20) NOT NULL,
+    `slide_id`    bigint(20) NOT NULL,
+    `visible`     tinyint(1) NOT NULL DEFAULT '0',
+    `create_by`   bigint(20)          DEFAULT NULL,
+    `create_time` datetime            DEFAULT NULL,
+    `update_by`   bigint(20)          DEFAULT NULL,
+    `update_time` datetime            DEFAULT NULL,
+    PRIMARY KEY (`role_id`, `slide_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+-- ----------------------------
+-- Table structure for rel_role_user
+-- ----------------------------
+DROP TABLE IF EXISTS `rel_role_user`;
+CREATE TABLE `rel_role_user`
+(
+    `id`          bigint(20) NOT NULL AUTO_INCREMENT,
+    `user_id`     bigint(20) NOT NULL,
+    `role_id`     bigint(20) NOT NULL,
+    `create_by`   bigint(20) DEFAULT NULL,
+    `create_time` datetime   DEFAULT NULL,
+    `update_by`   bigint(20) DEFAULT NULL,
+    `update_time` datetime   DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    UNIQUE KEY `idx_role_user` (`user_id`, `role_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+-- ----------------------------
+-- Table structure for rel_role_view
+-- ----------------------------
+DROP TABLE IF EXISTS `rel_role_view`;
+CREATE TABLE `rel_role_view`
+(
+    `view_id`     bigint(20) NOT NULL,
+    `role_id`     bigint(20) NOT NULL,
+    `row_auth`    text,
+    `column_auth` text,
+    `create_by`   bigint(20) DEFAULT NULL,
+    `create_time` datetime   DEFAULT NULL,
+    `update_by`   bigint(20) DEFAULT NULL,
+    `update_time` datetime   DEFAULT NULL,
+    PRIMARY KEY (`view_id`, `role_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- ----------------------------
+-- Table structure for rel_user_organization
+-- ----------------------------
+DROP TABLE IF EXISTS `rel_user_organization`;
+CREATE TABLE `rel_user_organization`
+(
+    `id`      bigint(20)  NOT NULL AUTO_INCREMENT,
+    `org_id`  bigint(20)  NOT NULL,
+    `user_id` bigint(20)  NOT NULL,
+    `role`    smallint(1) NOT NULL DEFAULT '0',
+    `create_by`   bigint(20)   DEFAULT NULL,
+    `create_time` datetime     DEFAULT NULL,
+    `update_by`   bigint(20)   DEFAULT NULL,
+    `update_time` datetime     DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    UNIQUE KEY `idx_org_user` (`org_id`, `user_id`) USING BTREE,
+    KEY `idx_role` (`role`)
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- ----------------------------
+-- Table structure for role
+-- ----------------------------
+DROP TABLE IF EXISTS `role`;
+CREATE TABLE `role`
+(
+    `id`          bigint(20)   NOT NULL AUTO_INCREMENT,
+    `org_id`      bigint(20)   NOT NULL,
+    `name`        varchar(100) NOT NULL,
+    `description` varchar(255) DEFAULT NULL,
+    `create_by`   bigint(20)   DEFAULT NULL,
+    `create_time` datetime     DEFAULT NULL,
+    `update_by`   bigint(20)   DEFAULT NULL,
+    `update_time` datetime     DEFAULT NULL,
+    `avatar`      varchar(255) DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    KEY `idx_org_id` (`org_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4 COMMENT ='权限表';
+
+-- ----------------------------
+-- Table structure for source
+-- ----------------------------
+DROP TABLE IF EXISTS `source`;
+CREATE TABLE `source`
+(
+    `id`             bigint(20)   NOT NULL AUTO_INCREMENT,
+    `name`           varchar(255) NOT NULL,
+    `description`    varchar(255) DEFAULT NULL,
+    `config`         text         NOT NULL,
+    `type`           varchar(10)  NOT NULL,
+    `project_id`     bigint(20)   NOT NULL,
+    `create_by`      bigint(20)   DEFAULT NULL,
+    `create_time`    datetime     DEFAULT NULL,
+    `update_by`      bigint(20)   DEFAULT NULL,
+    `update_time`    datetime     DEFAULT NULL,
+    `parent_id`      bigint(20)   DEFAULT NULL,
+    `full_parent_id` varchar(255) DEFAULT NULL,
+    `is_folder`      tinyint(1)   DEFAULT NULL,
+    `index`          int(5)       DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    KEY `idx_project_id` (`project_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- ----------------------------
+-- Table structure for star
+-- ----------------------------
+DROP TABLE IF EXISTS `star`;
+CREATE TABLE `star`
+(
+    `id`        bigint(20)  NOT NULL AUTO_INCREMENT,
+    `target`    varchar(20) NOT NULL,
+    `target_id` bigint(20)  NOT NULL,
+    `user_id`   bigint(20)  NOT NULL,
+    `star_time` datetime    NOT NULL ON UPDATE CURRENT_TIMESTAMP,
+    PRIMARY KEY (`id`) USING BTREE,
+    KEY `idx_target_id` (`target_id`) USING BTREE,
+    KEY `idx_user_id` (`user_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- ----------------------------
+-- Table structure for user
+-- ----------------------------
+DROP TABLE IF EXISTS `user`;
+CREATE TABLE `user`
+(
+    `id`          bigint(20)   NOT NULL AUTO_INCREMENT,
+    `email`       varchar(255) NOT NULL,
+    `username`    varchar(255) NOT NULL,
+    `password`    varchar(255) NOT NULL,
+    `admin`       tinyint(1)   NOT NULL,
+    `active`      tinyint(1)            DEFAULT NULL,
+    `name`        varchar(255)          DEFAULT NULL,
+    `description` varchar(255)          DEFAULT NULL,
+    `department`  varchar(255)          DEFAULT NULL,
+    `avatar`      varchar(255)          DEFAULT NULL,
+    `create_time` timestamp    NOT NULL DEFAULT CURRENT_TIMESTAMP,
+    `create_by`   bigint(20)   NOT NULL DEFAULT '0',
+    `update_time` timestamp    NULL,
+    `update_by`   bigint(20)            DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    KEY `idx_email` (`email`),
+    KEY `idx_username` (`username`)
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- ----------------------------
+-- Table structure for view
+-- ----------------------------
+DROP TABLE IF EXISTS `view`;
+CREATE TABLE `view`
+(
+    `id`             bigint(20)   NOT NULL AUTO_INCREMENT,
+    `name`           varchar(255) NOT NULL,
+    `description`    varchar(255) DEFAULT NULL,
+    `project_id`     bigint(20)   NOT NULL,
+    `source_id`      bigint(20)   NOT NULL,
+    `sql`            text,
+    `model`          text,
+    `variable`       text,
+    `config`         text,
+    `create_by`      bigint(20)   DEFAULT NULL,
+    `create_time`    datetime     DEFAULT NULL,
+    `update_by`      bigint(20)   DEFAULT NULL,
+    `update_time`    datetime     DEFAULT NULL,
+    `parent_id`      bigint(20)   DEFAULT NULL,
+    `full_parent_id` varchar(255) DEFAULT NULL,
+    `is_folder`      tinyint(1)   DEFAULT NULL,
+    `index`          int(5)       DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    KEY `idx_project_id` (`project_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+-- ----------------------------
+-- Table structure for widget
+-- ----------------------------
+DROP TABLE IF EXISTS `widget`;
+CREATE TABLE `widget`
+(
+    `id`             bigint(20)   NOT NULL AUTO_INCREMENT,
+    `name`           varchar(255) NOT NULL,
+    `description`    varchar(255) DEFAULT NULL,
+    `view_id`        bigint(20)   NOT NULL,
+    `project_id`     bigint(20)   NOT NULL,
+    `type`           bigint(20)   NOT NULL,
+    `publish`        tinyint(1)   NOT NULL,
+    `config`         longtext     NOT NULL,
+    `create_by`      bigint(20)   DEFAULT NULL,
+    `create_time`    datetime     DEFAULT NULL,
+    `update_by`      bigint(20)   DEFAULT NULL,
+    `update_time`    datetime     DEFAULT NULL,
+    `parent_id`      bigint(20)   DEFAULT NULL,
+    `full_parent_id` varchar(255) DEFAULT NULL,
+    `is_folder`      tinyint(1)   DEFAULT NULL,
+    `index`          int(5)       DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    KEY `idx_project_id` (`project_id`) USING BTREE,
+    KEY `idx_view_id` (`view_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8;
+
+
+DROP TABLE IF EXISTS `rel_role_display_slide_widget`;
+CREATE TABLE `rel_role_display_slide_widget`
+(
+    `role_id`                     bigint(20) NOT NULL,
+    `mem_display_slide_widget_id` bigint(20) NOT NULL,
+    `visible`                     tinyint(1) NOT NULL DEFAULT '0',
+    `create_by`                   bigint(20)          DEFAULT NULL,
+    `create_time`                 datetime            DEFAULT NULL,
+    `update_by`                   bigint(20)          DEFAULT NULL,
+    `update_time`                 datetime            DEFAULT NULL,
+    PRIMARY KEY (`role_id`, `mem_display_slide_widget_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_dashboard_widget`;
+CREATE TABLE `rel_role_dashboard_widget`
+(
+    `role_id`                 bigint(20) NOT NULL,
+    `mem_dashboard_widget_id` bigint(20) NOT NULL,
+    `visible`                 tinyint(1) NOT NULL DEFAULT '0',
+    `create_by`               bigint(20)          DEFAULT NULL,
+    `create_time`             datetime            DEFAULT NULL,
+    `update_by`               bigint(20)          DEFAULT NULL,
+    `update_time`             datetime            DEFAULT NULL,
+    PRIMARY KEY (`role_id`, `mem_dashboard_widget_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+DROP TABLE IF EXISTS `davinci_statistic_visitor_operation`;
+CREATE TABLE `davinci_statistic_visitor_operation` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `user_id` bigint(20) DEFAULT NULL,
+  `email` varchar(255) DEFAULT NULL,
+  `action` varchar(255) DEFAULT NULL COMMENT 'login/visit/initial/sync/search/linkage/drill/download/print',
+  `org_id` bigint(20) DEFAULT NULL,
+  `project_id` bigint(20) DEFAULT NULL,
+  `project_name` varchar(255) DEFAULT NULL,
+  `viz_type` varchar(255) DEFAULT NULL COMMENT 'dashboard/display',
+  `viz_id` bigint(20) DEFAULT NULL,
+  `viz_name` varchar(255) DEFAULT NULL,
+  `sub_viz_id` bigint(20) DEFAULT NULL,
+  `sub_viz_name` varchar(255) DEFAULT NULL,
+  `widget_id` bigint(20) DEFAULT NULL,
+  `widget_name` varchar(255) DEFAULT NULL,
+  `variables` varchar(500) DEFAULT NULL,
+  `filters` varchar(500) DEFAULT NULL,
+  `groups` varchar(500) DEFAULT NULL,
+  `create_time` timestamp NULL DEFAULT NULL,
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+DROP TABLE IF EXISTS `davinci_statistic_terminal`;
+CREATE TABLE `davinci_statistic_terminal` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `user_id` bigint(20) DEFAULT NULL,
+  `email` varchar(255) DEFAULT NULL,
+  `browser_name` varchar(255) DEFAULT NULL,
+  `browser_version` varchar(255) DEFAULT NULL,
+  `engine_name` varchar(255) DEFAULT NULL,
+  `engine_version` varchar(255) DEFAULT NULL,
+  `os_name` varchar(255) DEFAULT NULL,
+  `os_version` varchar(255) DEFAULT NULL,
+  `device_model` varchar(255) DEFAULT NULL,
+  `device_type` varchar(255) DEFAULT NULL,
+  `device_vendor` varchar(255) DEFAULT NULL,
+  `cpu_architecture` varchar(255) DEFAULT NULL,
+  `create_time` timestamp NULL DEFAULT NULL,
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+
+DROP TABLE IF EXISTS `davinci_statistic_duration`;
+CREATE TABLE `davinci_statistic_duration`
+(
+    `id`         bigint(20) NOT NULL AUTO_INCREMENT,
+    `user_id`    bigint(20)      DEFAULT NULL,
+    `email`      varchar(255)    DEFAULT NULL,
+    `org_id` bigint(20) DEFAULT NULL COMMENT '报表关联组织ID',
+    `project_id` bigint(20) DEFAULT NULL COMMENT '报表关联项目ID',
+    `project_name` varchar(255) DEFAULT NULL COMMENT '报表关联项目名称',
+    `viz_type` varchar(10) DEFAULT NULL COMMENT '报表关联应用类型(dashboard/display)',
+    `viz_id` bigint(20) DEFAULT NULL COMMENT '报表关联应用ID',
+    `viz_name` varchar(255) DEFAULT NULL COMMENT '报表关联应用名称',
+    `sub_viz_id` bigint(20) DEFAULT NULL COMMENT '报表ID',
+    `sub_viz_name` varchar(255) DEFAULT NULL COMMENT '报表名称',
+    `start_time` timestamp  NULL DEFAULT NULL,
+    `end_time`   timestamp  NULL DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4;
+
+DROP TABLE IF EXISTS `share_download_record`;
+CREATE TABLE `share_download_record` (
+  `id` bigint(20) NOT NULL AUTO_INCREMENT,
+  `uuid` varchar(50) DEFAULT NULL,
+  `name` varchar(255) NOT NULL,
+  `path` varchar(255) DEFAULT NULL,
+  `status` smallint(1) NOT NULL,
+  `create_time` datetime NOT NULL,
+  `last_download_time` datetime DEFAULT NULL,
+  PRIMARY KEY (`id`) USING BTREE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
+
+
+SET FOREIGN_KEY_CHECKS = 1;
+
+
+INSERT INTO `user` (`id`, `email`, `username`, `password`, `admin`, `active`, `name`, `description`, `department`, `avatar`, `create_time`, `create_by`, `update_by`, `update_time`)
+VALUES (1, 'guest@davinci.cn', 'guest', '$2a$10$RJKb4jhMgRYnGPlVRV036erxQ3oGZ8NnxZrlrrBJJha9376cAuTRO', 1, 1, NULL, NULL, NULL, NULL, '2020-01-01 00:00:00', 0, NULL, NULL);
+
+INSERT INTO `organization` (`id`, `name`, `description`, `avatar`, `user_id`, `project_num`, `member_num`, `role_num`, `allow_create_project`, `member_permission`, `create_time`, `create_by`, `update_time`, `update_by`)
+VALUES (1, 'guest\'s Organization', NULL, NULL, 1, 0, 1, 0, 1, 1, '2020-01-01 00:00:00', 1, NULL, NULL);
+
+INSERT INTO `rel_user_organization` (`id`, `org_id`, `user_id`, `role`, `create_by`, `create_time`, `update_by`, `update_time`)
+VALUES (1, 1, 1, 1, 1, '2020-01-01 00:00:00', NULL, NULL);

+ 22 - 0
bin/initdb.bat

@@ -0,0 +1,22 @@
+:: <<
+:: Davinci
+:: ==
+:: Copyright (C) 2016 - 2019 EDP
+:: ==
+:: Licensed under the Apache License, Version 2.0 (the "License");
+:: you may not use this file except in compliance with the License.
+:: You may obtain a copy of the License at
+::       http://www.apache.org/licenses/LICENSE-2.0
+::  Unless required by applicable law or agreed to in writing, software
+::  distributed under the License is distributed on an "AS IS" BASIS,
+::  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+::  See the License for the specific language governing permissions and
+::  limitations under the License.
+:: >>
+
+@echo off
+
+for %%x in ("%MYSQL_HOME%") do set MYSQL_HOME=%%~sx
+for %%x in ("%DAVINCI3_HOME%") do set DAVINCI3_HOME=%%~sx
+
+%MYSQL_HOME%\bin\mysql.exe -h localhost -uroot -proot davinci0.3 < %DAVINCI3_HOME%\bin\davinci.sql

+ 2 - 0
bin/initdb.sh

@@ -0,0 +1,2 @@
+#!/bin/bash
+mysql -P 3306 -h localhost -u root -proot davinci0.3 < $DAVINCI3_HOME/bin/davinci.sql

+ 14 - 0
bin/migration/beta5/README.md

@@ -0,0 +1,14 @@
+### 注意!
+
+1. **升级前请务必备份数据!!!, 升级前请务必备份数据!!!, 升级前请务必备份数据!!!**
+2. 本次升级只针对 davinci0.3 beta.4 升级至 beta.5, 其他版本请不要执行!
+3. 已安装 beta.5 及之后版本无须执行此脚本;
+4. 本次升级默认读取 config 下 application.yml 中配置的 davinci 数据源,也可通过参数指定,更多信息请执行 ‘upgrade -help’ 查看;
+5. 本次升级可能造成部分 View 中定义的`变量值`错误,请手动修改;
+6. 升级脚本为二进制文件,不同平台执行相应脚本即可,无须重复执行:
+
+   | 平台 | 对应脚本 |
+   | --- | --- |
+   |Windows | upgrade.exe |
+   |Mac OS  |  upgrade_darwin |
+   |Linux   |  upgrade_linux |

BIN
bin/migration/beta5/upgrade.exe


BIN
bin/migration/beta5/upgrade_darwin


BIN
bin/migration/beta5/upgrade_linux


+ 13 - 0
bin/migration/beta8/README.md

@@ -0,0 +1,13 @@
+### 注意!
+
+1. **升级前请务必备份数据!!!, 升级前请务必备份数据!!!, 升级前请务必备份数据!!!**
+2. 本次升级只针对 davinci0.3 beta.7 升级至 beta.8, 其他版本请不要执行!
+3. 已安装 beta.8 及之后版本无须执行此脚本;
+4. 本次升级默认读取 config 下 application.yml 中配置的 davinci 数据源,也可通过参数指定,更多信息请执行 ‘upgrade -help’ 查看;
+5. 升级脚本为二进制文件,不同平台执行相应脚本即可,无须重复执行:
+
+   | 平台 | 对应脚本 |
+   | --- | --- |
+   |Windows | upgrade.exe |
+   |Mac OS  |  upgrade_darwin |
+   |Linux   |  upgrade_linux |

BIN
bin/migration/beta8/upgrade.exe


BIN
bin/migration/beta8/upgrade_darwin


BIN
bin/migration/beta8/upgrade_linux


+ 1191 - 0
bin/patch/001_beta5.sql

@@ -0,0 +1,1191 @@
+set @data_base = 'davinci0.3';
+
+DROP TABLE IF EXISTS `platform`;
+CREATE TABLE `platform`
+(
+    `id`               bigint(20)   NOT NULL,
+    `name`             varchar(255) NOT NULL,
+    `platform`         varchar(255) NOT NULL,
+    `code`             varchar(32)  NOT NULL,
+    `checkCode`        varchar(255) DEFAULT NULL,
+    `checkSystemToken` varchar(255) DEFAULT NULL,
+    `checkUrl`         varchar(255) DEFAULT NULL,
+    `alternateField1`  varchar(255) DEFAULT NULL,
+    `alternateField2`  varchar(255) DEFAULT NULL,
+    `alternateField3`  varchar(255) DEFAULT NULL,
+    `alternateField4`  varchar(255) DEFAULT NULL,
+    `alternateField5`  varchar(255) DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+DROP TABLE IF EXISTS `download_record`;
+CREATE TABLE `download_record`
+(
+    `id`                 bigint(20)   NOT NULL AUTO_INCREMENT,
+    `name`               varchar(255) NOT NULL,
+    `user_id`            bigint(20)   NOT NULL,
+    `path`               varchar(255) DEFAULT NULL,
+    `status`             smallint(1)  NOT NULL,
+    `create_time`        datetime     NOT NULL,
+    `last_download_time` datetime     DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    KEY `idx_user` (`user_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_project_admin`;
+CREATE TABLE `rel_project_admin`
+(
+    `id`          bigint(20) NOT NULL AUTO_INCREMENT,
+    `project_id`  bigint(20) NOT NULL,
+    `user_id`     bigint(20) NOT NULL,
+    `create_by`   bigint(20) DEFAULT NULL,
+    `create_time` datetime   DEFAULT NULL,
+    `update_by`   bigint(20) DEFAULT NULL,
+    `update_time` datetime   DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    UNIQUE KEY `idx_project_user` (`project_id`, `user_id`) USING BTREE
+) ENGINE = InnoDB
+  AUTO_INCREMENT = 6
+  DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_dashboard`;
+CREATE TABLE `rel_role_dashboard`
+(
+    `role_id`      bigint(20) NOT NULL,
+    `dashboard_id` bigint(20) NOT NULL,
+    `visible`      tinyint(1) NOT NULL DEFAULT '0',
+    `create_by`    bigint(20)          DEFAULT NULL,
+    `create_time`  datetime            DEFAULT NULL,
+    `update_by`    bigint(20)          DEFAULT NULL,
+    `update_time`  datetime            DEFAULT NULL,
+    PRIMARY KEY (`role_id`, `dashboard_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_display`;
+CREATE TABLE `rel_role_display`
+(
+    `role_id`     bigint(20) NOT NULL,
+    `display_id`  bigint(20) NOT NULL,
+    `visible`     tinyint(1) NOT NULL DEFAULT '0',
+    `create_by`   bigint(20)          DEFAULT NULL,
+    `create_time` datetime            DEFAULT NULL,
+    `update_by`   bigint(20)          DEFAULT NULL,
+    `update_time` datetime            DEFAULT NULL,
+    PRIMARY KEY (`role_id`, `display_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_portal`;
+CREATE TABLE `rel_role_portal`
+(
+    `role_id`     bigint(20) NOT NULL,
+    `portal_id`   bigint(20) NOT NULL,
+    `visible`     tinyint(1) NOT NULL DEFAULT '0',
+    `create_by`   bigint(20)          DEFAULT NULL,
+    `create_time` datetime            DEFAULT NULL,
+    `update_by`   bigint(20)          DEFAULT NULL,
+    `update_time` datetime            DEFAULT NULL,
+    PRIMARY KEY (`role_id`, `portal_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_project`;
+CREATE TABLE `rel_role_project`
+(
+    `id`                  bigint(20)  NOT NULL AUTO_INCREMENT,
+    `project_id`          bigint(20)  NOT NULL,
+    `role_id`             bigint(20)  NOT NULL,
+    `source_permission`   smallint(1) NOT NULL DEFAULT '1',
+    `view_permission`     smallint(1) NOT NULL DEFAULT '1',
+    `widget_permission`   smallint(1) NOT NULL DEFAULT '1',
+    `viz_permission`      smallint(1) NOT NULL DEFAULT '1',
+    `schedule_permission` smallint(1) NOT NULL DEFAULT '1',
+    `share_permission`    tinyint(1)  NOT NULL DEFAULT '0',
+    `download_permission` tinyint(1)  NOT NULL DEFAULT '0',
+    `create_by`           bigint(20)           DEFAULT NULL,
+    `create_time`         datetime             DEFAULT NULL,
+    `update_by`           bigint(20)           DEFAULT NULL,
+    `update_time`         datetime             DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    UNIQUE KEY `idx_role_project` (`project_id`, `role_id`) USING BTREE
+) ENGINE = InnoDB
+  AUTO_INCREMENT = 40
+  DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_slide`;
+CREATE TABLE `rel_role_slide`
+(
+    `role_id`     bigint(20) NOT NULL,
+    `slide_id`    bigint(20) NOT NULL,
+    `visible`     tinyint(1) NOT NULL DEFAULT '0',
+    `create_by`   bigint(20)          DEFAULT NULL,
+    `create_time` datetime            DEFAULT NULL,
+    `update_by`   bigint(20)          DEFAULT NULL,
+    `update_time` datetime            DEFAULT NULL,
+    PRIMARY KEY (`role_id`, `slide_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_user`;
+CREATE TABLE `rel_role_user`
+(
+    `id`          bigint(20) NOT NULL AUTO_INCREMENT,
+    `user_id`     bigint(20) NOT NULL,
+    `role_id`     bigint(20) NOT NULL,
+    `create_by`   bigint(20) DEFAULT NULL,
+    `create_time` datetime   DEFAULT NULL,
+    `update_by`   bigint(20) DEFAULT NULL,
+    `update_time` datetime   DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    UNIQUE KEY `idx_role_user` (`user_id`, `role_id`) USING BTREE
+) ENGINE = InnoDB
+  AUTO_INCREMENT = 30
+  DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_view`;
+CREATE TABLE `rel_role_view`
+(
+    `view_id`     bigint(20) NOT NULL,
+    `role_id`     bigint(20) NOT NULL,
+    `row_auth`    text,
+    `column_auth` text,
+    `create_by`   bigint(20) DEFAULT NULL,
+    `create_time` datetime   DEFAULT NULL,
+    `update_by`   bigint(20) DEFAULT NULL,
+    `update_time` datetime   DEFAULT NULL,
+    PRIMARY KEY (`view_id`, `role_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `role`;
+CREATE TABLE `role`
+(
+    `id`          bigint(20)   NOT NULL AUTO_INCREMENT,
+    `org_id`      bigint(20)   NOT NULL,
+    `name`        varchar(100) NOT NULL,
+    `description` varchar(255) DEFAULT NULL,
+    `avatar`      varchar(255) DEFAULT NULL,
+    `create_by`   bigint(20)   DEFAULT NULL,
+    `create_time` datetime     DEFAULT NULL,
+    `update_by`   bigint(20)   DEFAULT NULL,
+    `update_time` datetime     DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE,
+    KEY `idx_orgid` (`org_id`) USING BTREE
+) ENGINE = InnoDB
+  AUTO_INCREMENT = 24
+  DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_display_slide_widget`;
+CREATE TABLE `rel_role_display_slide_widget`
+(
+    `role_id`                     bigint(20) NOT NULL,
+    `mem_display_slide_widget_id` bigint(20) NOT NULL,
+    `visible`                     tinyint(1) NOT NULL DEFAULT '0',
+    `create_by`                   bigint(20)          DEFAULT NULL,
+    `create_time`                 datetime            DEFAULT NULL,
+    `update_by`                   bigint(20)          DEFAULT NULL,
+    `update_time`                 datetime            DEFAULT NULL,
+    PRIMARY KEY (`role_id`, `mem_display_slide_widget_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `rel_role_dashboard_widget`;
+CREATE TABLE `rel_role_dashboard_widget`
+(
+    `role_id`                 bigint(20) NOT NULL,
+    `mem_dashboard_widget_id` bigint(20) NOT NULL,
+    `visible`                 tinyint(1) NOT NULL DEFAULT '0',
+    `create_by`               bigint(20)          DEFAULT NULL,
+    `create_time`             datetime            DEFAULT NULL,
+    `update_by`               bigint(20)          DEFAULT NULL,
+    `update_time`             datetime            DEFAULT NULL,
+    PRIMARY KEY (`role_id`, `mem_dashboard_widget_id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+
+ALTER TABLE `organization`
+    ADD INDEX `idx_user_id` (`user_id`),
+    ADD INDEX `idx_allow_create_project` (`allow_create_project`),
+    ADD INDEX `idx_member_permisson` (`member_permission`);
+
+ALTER TABLE `project`
+    ADD INDEX `idx_org_id` (`org_id`),
+    ADD INDEX `idx_user_id` (`user_id`),
+    ADD INDEX `idx_visibility` (`visibility`);
+
+ALTER TABLE `rel_user_organization`
+    ADD INDEX `idx_role` (`role`);
+
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'cron_job'
+                                AND column_name = 'update_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `cron_job` ADD `update_by` bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'cron_job'
+                                AND column_name = 'parent_id') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `cron_job` ADD `parent_id` bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'cron_job'
+                                AND column_name = 'full_parent_id') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `cron_job`  ADD `full_parent_id`  varchar(100)  DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'cron_job'
+                                AND column_name = 'is_folder') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `cron_job`  ADD `is_folder`  tinyint(1) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'cron_job'
+                                AND column_name = 'index') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `cron_job` ADD `index` int(5) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'dashboard'
+                                AND column_name = 'full_parent_Id') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `dashboard` ADD `full_parent_Id`  varchar(100) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'dashboard'
+                                AND column_name = 'create_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `dashboard` ADD `create_by` bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'dashboard'
+                                AND column_name = 'create_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `dashboard` ADD `create_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'dashboard'
+                                AND column_name = 'update_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `dashboard` ADD `update_by` bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'dashboard'
+                                AND column_name = 'update_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `dashboard` ADD `update_time`     datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'dashboard_portal'
+                                AND column_name = 'create_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `dashboard_portal` ADD `create_by`   bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'dashboard_portal'
+                                AND column_name = 'create_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `dashboard_portal` ADD `create_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'dashboard_portal'
+                                AND column_name = 'update_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `dashboard_portal`  ADD `update_by`   bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'dashboard_portal'
+                                AND column_name = 'update_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `dashboard_portal` ADD `update_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'display'
+                                AND column_name = 'create_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `display` ADD `create_by`   bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'display'
+                                AND column_name = 'create_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `display` ADD `create_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'display'
+                                AND column_name = 'update_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `display` ADD `update_by`   bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'display'
+                                AND column_name = 'update_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `display` ADD `update_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'display_slide'
+                                AND column_name = 'create_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `display_slide` ADD `create_by`   bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'display_slide'
+                                AND column_name = 'create_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `display_slide` ADD `create_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'display_slide'
+                                AND column_name = 'update_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `display_slide` ADD `update_by`   bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'display_slide'
+                                AND column_name = 'update_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `display_slide` ADD `update_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'mem_dashboard_widget'
+                                AND column_name = 'config') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `mem_dashboard_widget` ADD `config` text;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'mem_dashboard_widget'
+                                AND column_name = 'create_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `mem_dashboard_widget` ADD `create_by`  bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'mem_dashboard_widget'
+                                AND column_name = 'create_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `mem_dashboard_widget` ADD `create_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'mem_dashboard_widget'
+                                AND column_name = 'update_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `mem_dashboard_widget` ADD `update_by`   bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'mem_dashboard_widget'
+                                AND column_name = 'update_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `mem_dashboard_widget` ADD `update_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'mem_display_slide_widget'
+                                AND column_name = 'create_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `mem_display_slide_widget` ADD `create_by`   bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'mem_display_slide_widget'
+                                AND column_name = 'create_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `mem_display_slide_widget` ADD `create_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'mem_display_slide_widget'
+                                AND column_name = 'update_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `mem_display_slide_widget` ADD `update_by`   bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'mem_display_slide_widget'
+                                AND column_name = 'update_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `mem_display_slide_widget` ADD `update_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'project'
+                                AND column_name = 'create_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `project` ADD `create_by`   bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'project'
+                                AND column_name = 'create_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `project` ADD `create_time` datetime NULL DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'project'
+                                AND column_name = 'update_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `project` ADD `update_by`   bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'project'
+                                AND column_name = 'update_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `project` ADD `update_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'source'
+                                AND column_name = 'create_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `source` ADD `create_by` bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'source'
+                                AND column_name = 'create_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `source` ADD `create_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'source'
+                                AND column_name = 'update_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `source` ADD `update_by` bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'source'
+                                AND column_name = 'update_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `source` ADD `update_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'source'
+                                AND column_name = 'parent_id') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `source` ADD `parent_id` bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'source'
+                                AND column_name = 'full_parent_id') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `source` ADD `full_parent_id` varchar(255) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'source'
+                                AND column_name = 'is_folder') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `source` ADD `is_folder` tinyint(1) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'source'
+                                AND column_name = 'index') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `source` ADD `index` int(5) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'view'
+                                AND column_name = 'variable') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `view` ADD `variable` text;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'view'
+                                AND column_name = 'create_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `view` ADD `create_by` bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'view'
+                                AND column_name = 'create_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `view` ADD `create_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'view'
+                                AND column_name = 'update_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `view` ADD `update_by` bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'view'
+                                AND column_name = 'update_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `view` ADD `update_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'view'
+                                AND column_name = 'parent_id') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `view` ADD `parent_id` bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'view'
+                                AND column_name = 'full_parent_id') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `view` ADD `full_parent_id` varchar(255) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'view'
+                                AND column_name = 'is_folder') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `view` ADD `is_folder` tinyint(1) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'view'
+                                AND column_name = 'index') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `view` ADD `index` int(5) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'rel_user_organization'
+                                AND column_name = 'create_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `rel_user_organization` ADD `create_by` bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'rel_user_organization'
+                                AND column_name = 'create_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `rel_user_organization` ADD `create_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'rel_user_organization'
+                                AND column_name = 'update_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `rel_user_organization` ADD `update_by` bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'rel_user_organization'
+                                AND column_name = 'update_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `rel_user_organization` ADD `update_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'widget'
+                                AND column_name = 'create_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `widget` ADD `create_by` bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'widget'
+                                AND column_name = 'create_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `widget` ADD `create_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'widget'
+                                AND column_name = 'update_by') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `widget` ADD `update_by` bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'widget'
+                                AND column_name = 'update_time') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `widget` ADD `update_time` datetime DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'widget'
+                                AND column_name = 'parent_id') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `widget` ADD `parent_id` bigint(20) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'widget'
+                                AND column_name = 'full_parent_id') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `widget` ADD `full_parent_id` varchar(255) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'widget'
+                                AND column_name = 'is_folder') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `widget` ADD `is_folder` varchar(255) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'widget'
+                                AND column_name = 'index') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `widget` ADD `index` int(5) DEFAULT NULL;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+
+SET @s = (SELECT IF(
+                             (SELECT COUNT(*)
+                              FROM INFORMATION_SCHEMA.COLUMNS
+                              WHERE table_schema = @data_base
+                                AND table_name = 'organization'
+                                AND column_name = 'role_num') > 0,
+                             "SELECT 1",
+                             "ALTER TABLE `organization` CHANGE COLUMN `team_num` `role_num` int(20) NULL DEFAULT 0 AFTER `member_num`;"
+                     ));
+
+PREPARE stmt FROM @s;
+EXECUTE stmt;
+DEALLOCATE PREPARE stmt;
+
+update organization
+set role_num = 0;
+
+update download_record
+set status = 4
+where last_download_time is not null
+  and status = 2;

+ 74 - 0
bin/patch/002_beta7.sql

@@ -0,0 +1,74 @@
+DROP TABLE IF EXISTS `davinci_statistic_visitor_operation`;
+CREATE TABLE `davinci_statistic_visitor_operation`
+(
+    `id`           bigint(20) NOT NULL AUTO_INCREMENT,
+    `user_id`      bigint(20)      DEFAULT NULL,
+    `email`        varchar(255)    DEFAULT NULL,
+    `action`       varchar(255)    DEFAULT NULL COMMENT 'login/visit/initial/sync/search/linkage/drill/download/print',
+    `org_id`       bigint(20)      DEFAULT NULL,
+    `project_id`   bigint(20)      DEFAULT NULL,
+    `project_name` varchar(255)    DEFAULT NULL,
+    `viz_type`     varchar(255)    DEFAULT NULL COMMENT 'dashboard/display',
+    `viz_id`       bigint(20)      DEFAULT NULL,
+    `viz_name`     varchar(255)    DEFAULT NULL,
+    `sub_viz_id`   bigint(20)      DEFAULT NULL,
+    `sub_viz_name` varchar(255)    DEFAULT NULL,
+    `widget_id`    bigint(20)      DEFAULT NULL,
+    `widget_name`  varchar(255)    DEFAULT NULL,
+    `variables`    varchar(500)    DEFAULT NULL,
+    `filters`      varchar(500)    DEFAULT NULL,
+    `groups`       varchar(500)    DEFAULT NULL,
+    `create_time`  timestamp  NULL DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+DROP TABLE IF EXISTS `davinci_statistic_terminal`;
+CREATE TABLE `davinci_statistic_terminal`
+(
+    `id`               bigint(20) NOT NULL AUTO_INCREMENT,
+    `user_id`          bigint(20)      DEFAULT NULL,
+    `email`            varchar(255)    DEFAULT NULL,
+    `browser_name`     varchar(255)    DEFAULT NULL,
+    `browser_version`  varchar(255)    DEFAULT NULL,
+    `engine_name`      varchar(255)    DEFAULT NULL,
+    `engine_version`   varchar(255)    DEFAULT NULL,
+    `os_name`          varchar(255)    DEFAULT NULL,
+    `os_version`       varchar(255)    DEFAULT NULL,
+    `device_model`     varchar(255)    DEFAULT NULL,
+    `device_type`      varchar(255)    DEFAULT NULL,
+    `device_vendor`    varchar(255)    DEFAULT NULL,
+    `cpu_architecture` varchar(255)    DEFAULT NULL,
+    `create_time`      timestamp  NULL DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `davinci_statistic_duration`;
+CREATE TABLE `davinci_statistic_duration`
+(
+    `id`         bigint(20) NOT NULL AUTO_INCREMENT,
+    `user_id`    bigint(20)      DEFAULT NULL,
+    `email`      varchar(255)    DEFAULT NULL,
+    `start_time` timestamp  NULL DEFAULT NULL,
+    `end_time`   timestamp  NULL DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+
+
+DROP TABLE IF EXISTS `share_download_record`;
+CREATE TABLE `share_download_record`
+(
+    `id`                 bigint(20)   NOT NULL AUTO_INCREMENT,
+    `uuid`               varchar(50)  DEFAULT NULL,
+    `name`               varchar(255) NOT NULL,
+    `path`               varchar(255) DEFAULT NULL,
+    `status`             smallint(1)  NOT NULL,
+    `create_time`        datetime     NOT NULL,
+    `last_download_time` datetime     DEFAULT NULL,
+    PRIMARY KEY (`id`) USING BTREE
+) ENGINE = InnoDB
+  DEFAULT CHARSET = utf8mb4;
+

+ 10 - 0
bin/patch/003_beta8.sql

@@ -0,0 +1,10 @@
+ALTER TABLE `cron_job`
+MODIFY COLUMN `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `create_by`;
+
+
+ALTER TABLE `organization`
+MODIFY COLUMN `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `member_permission`;
+
+
+ALTER TABLE `user`
+MODIFY COLUMN `create_time` timestamp(0) NOT NULL DEFAULT CURRENT_TIMESTAMP AFTER `avatar`;

+ 20 - 0
bin/patch/004_beta9.sql

@@ -0,0 +1,20 @@
+ALTER TABLE `davinci_statistic_duration`
+ADD COLUMN `org_id` BIGINT(20) NULL   COMMENT '报表关联组织ID' AFTER `email`;
+ALTER TABLE `davinci_statistic_duration`
+ADD COLUMN `project_id` BIGINT(20) NULL   COMMENT '报表关联项目ID' AFTER `org_id`;
+ALTER TABLE `davinci_statistic_duration`
+ADD COLUMN `project_name` VARCHAR(255) NULL   COMMENT '报表关联项目名称' AFTER `project_id`;
+ALTER TABLE `davinci_statistic_duration`
+ADD COLUMN `viz_type` VARCHAR(10) NULL   COMMENT '报表关联应用类型(dashboard/display)' AFTER `project_name`;
+ALTER TABLE `davinci_statistic_duration`
+ADD COLUMN `viz_id` BIGINT(20) NULL   COMMENT '报表关联应用ID' AFTER `viz_type`;
+ALTER TABLE `davinci_statistic_duration`
+ADD COLUMN `viz_name` VARCHAR(255) NULL   COMMENT '报表关联应用名称' AFTER `viz_id`;
+ALTER TABLE `davinci_statistic_duration`
+ADD COLUMN `sub_viz_id` BIGINT(20) NULL   COMMENT '报表ID' AFTER `viz_name`;
+ALTER TABLE `davinci_statistic_duration`
+ADD COLUMN `sub_viz_name` VARCHAR(255) NULL   COMMENT '报表名称' AFTER `sub_viz_id`;
+ALTER TABLE `display`
+ADD COLUMN `config` text NULL AFTER `publish`;
+ALTER TABLE `cron_job`
+MODIFY COLUMN `update_by` bigint(20) NULL DEFAULT NULL AFTER `create_time`;

+ 20 - 0
bin/patch/005_rc.sql

@@ -0,0 +1,20 @@
+/*
+ * <<
+ *  Davinci
+ *  ==
+ *  Copyright (C) 2016 - 2020 EDP
+ *  ==
+ *  Licensed under the Apache License, Version 2.0 (the "License");
+ *  you may not use this file except in compliance with the License.
+ *  You may obtain a copy of the License at
+ *        http://www.apache.org/licenses/LICENSE-2.0
+ *   Unless required by applicable law or agreed to in writing, software
+ *   distributed under the License is distributed on an "AS IS" BASIS,
+ *   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ *   See the License for the specific language governing permissions and
+ *   limitations under the License.
+ *  >>
+ */
+
+ALTER TABLE `mem_dashboard_widget`
+ADD COLUMN `alias` varchar(30) NULL AFTER `id`;

+ 24 - 0
bin/restart-server.sh

@@ -0,0 +1,24 @@
+#!/bin/bash
+
+#  <<
+#  Davinci
+#  ==
+#  Copyright (C) 2016 - 2019 EDP
+#  ==
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#        http://www.apache.org/licenses/LICENSE-2.0
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#  >>
+
+
+script_dir=$(cd `dirname $0`; pwd)
+cd $script_dir/
+
+./stop-server.sh
+./start-server.sh

+ 32 - 0
bin/run.bat

@@ -0,0 +1,32 @@
+:: <<
+:: Davinci
+:: ==
+:: Copyright (C) 2016 - 2019 EDP
+:: ==
+:: Licensed under the Apache License, Version 2.0 (the "License");
+:: you may not use this file except in compliance with the License.
+:: You may obtain a copy of the License at
+::       http://www.apache.org/licenses/LICENSE-2.0
+::  Unless required by applicable law or agreed to in writing, software
+::  distributed under the License is distributed on an "AS IS" BASIS,
+::  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+::  See the License for the specific language governing permissions and
+::  limitations under the License.
+:: >>
+
+@echo off
+
+for %%x in ("%JAVA_HOME%") do set JAVA_HOME=%%~sx
+for %%x in ("%DAVINCI3_HOME%") do set DAVINCI3_HOME=%%~sx
+
+if "%1" == "start" (
+    echo start Davinci Server
+    start "Davinci Server" java -Dfile.encoding=UTF-8 -cp .;%JAVA_HOME%\lib\*;%DAVINCI3_HOME%\lib\*; edp.DavinciServerApplication --spring.config.additional-location=file:%DAVINCI3_HOME%\config\application.yml
+) else if "%1" == "stop" (
+    echo stop Davinci Server
+    taskkill /fi "WINDOWTITLE eq Davinci Server"
+) else (
+    echo please use "run.bat start" or "run.bat stop"
+)
+
+pause

+ 51 - 0
bin/start-server.sh

@@ -0,0 +1,51 @@
+#!/bin/bash
+
+#  <<
+#  Davinci
+#  ==
+#  Copyright (C) 2016 - 2019 EDP
+#  ==
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#        http://www.apache.org/licenses/LICENSE-2.0
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#  >>
+
+
+#start server
+
+if [ -z "$DAVINCI3_HOME" ]; then
+  echo "DAVINCI3_HOME not found"
+  echo "Please export DAVINCI3_HOME to your environment variable"
+  exit
+fi
+
+cd $DAVINCI3_HOME
+Lib_dir=`ls | grep lib`
+if [ -z "$Lib_dir" ]; then
+  echo "Invalid DAVINCI3_HOME"
+  exit
+fi
+
+Server=`ps -ef | grep java | grep edp.DavinciServerApplication | grep -v grep | awk '{print $2}'`
+if [[ $Server -gt 0 ]]; then
+  echo "[Davinci Server] is already started"
+  exit
+fi
+
+cd $DAVINCI3_HOME
+TODAY=`date "+%Y-%m-%d"`
+LOG_PATH=$DAVINCI3_HOME/logs/sys/davinci.$TODAY.log
+nohup java -Dfile.encoding=UTF-8 -cp $JAVA_HOME/lib/*:lib/* edp.DavinciServerApplication > $LOG_PATH  2>&1 &
+
+echo "=========================================="
+echo "Starting..., press \`CRTL + C\` to exit log"
+echo "=========================================="
+
+sleep 3s
+tail -f $LOG_PATH

+ 19 - 0
bin/start.bat

@@ -0,0 +1,19 @@
+:: <<
+:: Davinci
+:: ==
+:: Copyright (C) 2016 - 2019 EDP
+:: ==
+:: Licensed under the Apache License, Version 2.0 (the "License");
+:: you may not use this file except in compliance with the License.
+:: You may obtain a copy of the License at
+::       http://www.apache.org/licenses/LICENSE-2.0
+::  Unless required by applicable law or agreed to in writing, software
+::  distributed under the License is distributed on an "AS IS" BASIS,
+::  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+::  See the License for the specific language governing permissions and
+::  limitations under the License.
+:: >>
+
+@echo off
+call run.bat start
+exit

+ 25 - 0
bin/stop-server.sh

@@ -0,0 +1,25 @@
+#!/bin/bash
+
+#  <<
+#  Davinci
+#  ==
+#  Copyright (C) 2016 - 2019 EDP
+#  ==
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#        http://www.apache.org/licenses/LICENSE-2.0
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#  >>
+
+
+Server=`ps -ef | grep java | grep edp.DavinciServerApplication | grep -v grep | awk '{print $2}'`
+if [[ $Server -gt 0 ]]; then
+  kill -9 $Server
+else
+  echo "[Davinci Server] System did not run."
+fi

+ 19 - 0
bin/stop.bat

@@ -0,0 +1,19 @@
+:: <<
+:: Davinci
+:: ==
+:: Copyright (C) 2016 - 2019 EDP
+:: ==
+:: Licensed under the Apache License, Version 2.0 (the "License");
+:: you may not use this file except in compliance with the License.
+:: You may obtain a copy of the License at
+::       http://www.apache.org/licenses/LICENSE-2.0
+::  Unless required by applicable law or agreed to in writing, software
+::  distributed under the License is distributed on an "AS IS" BASIS,
+::  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+::  See the License for the specific language governing permissions and
+::  limitations under the License.
+:: >>
+
+@echo off
+call run.bat stop
+exit

+ 211 - 0
config/application.yml.example

@@ -0,0 +1,211 @@
+#  <<
+#  Davinci
+#  ==
+#  Copyright (C) 2016 - 2019 EDP
+#  ==
+#  Licensed under the Apache License, Version 2.0 (the "License");
+#  you may not use this file except in compliance with the License.
+#  You may obtain a copy of the License at
+#        http://www.apache.org/licenses/LICENSE-2.0
+#   Unless required by applicable law or agreed to in writing, software
+#   distributed under the License is distributed on an "AS IS" BASIS,
+#   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+#   See the License for the specific language governing permissions and
+#   limitations under the License.
+#  >>
+
+
+server:
+  protocol: http
+  address: 127.0.0.1
+  port: 8080
+
+  servlet:
+    context-path: /
+
+  # Used for mail and download services, can be empty, careful configuration
+  # By default, 'server.address' and 'server.port' is used as the string value.
+  # access:
+  #  address:
+  #  port:
+
+
+## jwt is one of the important configuration of the application
+## jwt config cannot be null or empty
+jwtToken:
+  secret: secret
+  timeout: 1800000
+  algorithm: HS512
+
+
+## your datasource config
+source:
+  initial-size: 1
+  min-idle: 1
+  max-wait: 30000
+  max-active: 10
+  break-after-acquire-failure: false
+  connection-error-retry-attempts: 1
+  time-between-eviction-runs-millis: 2000
+  min-evictable-idle-time-millis: 600000
+  max-evictable-idle-time-millis: 900000
+  time-between-connect-error-millis: 60000
+  test-while-idle: true
+  test-on-borrow: false
+  test-on-return: false
+  validation-query: select 1
+  validation-query-timeout: 10
+  keep-alive: false
+  filters: stat
+
+  enable-query-log: false
+  result-limit: 1000000
+
+
+spring:
+  mvc:
+    async:
+      request-timeout: 30s
+  rest:
+    proxy-host:
+    proxy-port:
+    proxy-ignore:
+
+
+  ## davinci datasource config
+  datasource:
+    type: com.alibaba.druid.pool.DruidDataSource
+    url: jdbc:mysql://localhost:3306/davinci0.3?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
+    username: root
+    password: root
+    driver-class-name: com.mysql.jdbc.Driver
+    initial-size: 1
+    min-idle: 1
+    max-wait: 30000
+    max-active: 10
+    break-after-acquire-failure: false
+    connection-error-retry-attempts: 1
+    time-between-eviction-runs-millis: 2000
+    min-evictable-idle-time-millis: 600000
+    max-evictable-idle-time-millis: 900000
+    time-between-connect-error-millis: 60000
+    test-while-idle: true
+    test-on-borrow: false
+    test-on-return: false
+    validation-query: select 1
+    validation-query-timeout: 10
+    keep-alive: false
+    filters: stat
+
+  ## redis config
+  ## please choose either of the two ways
+  redis:
+    isEnable: false
+
+  ## standalone config
+    host: 127.0.0.1
+    port: 6379
+
+  ## cluster config
+  #  cluster:
+  #       nodes:
+
+    password:
+    database: 0
+    timeout: 1000
+    jedis:
+      pool:
+        max-active: 8
+        max-wait: 1
+        max-idle: 8
+        min-idle: 0
+
+  ## mail is one of the important configuration of the application
+  ## mail config cannot be null or empty
+  ## some mailboxes need to be set separately password for the SMTP service)
+  mail:
+    host:
+    port:
+    username:
+    fromAddress:
+    password:
+    nickname:
+
+    properties:
+      smtp:
+        starttls:
+          enable: true
+          required: true
+        auth: true
+      mail:
+        smtp:
+          ssl:
+            enable: false
+
+  ldap:
+    urls:
+    username:
+    password:
+    base:
+    domainName:    # domainName 指 企业邮箱后缀,如企业邮箱为:xxx@example.com,这里值为 '@example.com'
+
+  security:
+    oauth2:
+      enable: false
+#      client:
+#        registration:
+#          cas:
+#            provider: cas
+#            client-id: "xxxxx"
+#            client-name: "Sign in with XXX"
+#            client-secret: "xxxxx"
+#            authorization-grant-type: authorization_code
+#            client-authentication-method: post
+#            redirect-uri-template: "{baseUrl}/login/oauth2/code/{registrationId}"
+#            scope: userinfo
+#        provider:
+#          cas:
+#            authorization-uri: https://cas.xxxxx.cn/cas/oauth2.0/authorize
+#            token-uri: https://cas.xxxxx.cn/cas/oauth2.0/accessToken
+#            user-info-uri: https://cas.xxxxx.cn/cas/oauth2.0/profile
+#            user-name-attribute: id
+#            userMapping:
+#              email: "attributes.Email"
+#              name: "attributes.CnName1"
+#              avatar: "attributes.Avatar"
+
+screenshot:
+  default_browser: CHROME
+  timeout_second: 600
+  chromedriver_path: $your_chromedriver_path$
+  remote_webdriver_url: $your_remote_webdriver_url$
+
+data-auth-center:
+  channels:
+    - name:
+      base-url:
+      auth-code:
+
+statistic:
+  enable: false
+
+  # You can use external elasticsearch storage [127.0.0.1:9300]
+  elastic_urls:
+  elastic_user:
+  elastic_index_prefix:
+
+  # You can also use external mysql storage
+  mysql_url:
+  mysql_username:
+  mysql_password:
+
+  # You can also use external kafka
+  kafka.bootstrap.servers:
+  kafka.topic:
+  java.security.krb5.conf:
+  java.security.keytab:
+  java.security.principal:
+
+encryption:
+  maxEncryptSize: 1024
+  type: Off # Off is to turn off encryption, to enable encryption, please select AES or RSA

+ 65 - 0
config/datasource_driver.yml.example

@@ -0,0 +1,65 @@
+##  <<
+##  Davinci
+##  ==
+##  Copyright (C) 2016 - 2019 EDP
+##  ==
+##  Licensed under the Apache License, Version 2.0 (the "License");
+##  you may not use this file except in compliance with the License.
+##  You may obtain a copy of the License at
+##        http://www.apache.org/licenses/LICENSE-2.0
+##   Unless required by applicable law or agreed to in writing, software
+##   distributed under the License is distributed on an "AS IS" BASIS,
+##   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+##   See the License for the specific language governing permissions and
+##   limitations under the License.
+##  >>
+
+## This file is used to add databases with jdbc drivers that are not supported by Davinci,
+## ignore this file if your datasource is already supported,
+## the datasource list that have been supported by Davinci:
+##     mysql:           com.mysql.jdbc.Driver
+##     oracle:          oracle.jdbc.driver.OracleDriver
+##     sqlserver:       com.microsoft.sqlserver.jdbc.SQLServerDriver
+##     h2:              org.h2.Driver
+##     phoenix:         org.apache.phoenix.jdbc.PhoenixDriver
+##     mongodb:         mongodb.jdbc.MongoDriver
+##     elasticSearch:   nl.anchormen.sql4es.jdbc.ESDriver
+##     presto:          com.facebook.presto.jdbc.PrestoDriver
+##     moonbox:         moonbox.jdbc.MbDriver
+##     cassandra:       com.github.adejanovski.cassandra.jdbc.CassandraDriver
+##     clickhouse:      ru.yandex.clickhouse.ClickHouseDriver
+##     kylin:           org.apache.kylin.jdbc.Driver
+##     vertica:         com.vertica.jdbc.Driver
+##     hana:            com.sap.db.jdbc.Driver
+##     impala:          com.cloudera.impala.jdbc41.Driver
+## this means that if your datasource is in the above list, you don't need to use this way,
+## unless you know what you are doing.
+
+## How to use:
+##     1. configure your datasource like examples below,
+##     2. add the corresponding dependency file (jar) in lib package,
+##     3. restart your Davinci server
+##  In theory, all databases with jdbc drivers are supported,
+##  if you have problems during using, please with contact us.
+
+## Configuration is as follows:
+
+# mysql:
+#   name: mysql
+#   desc: mysql
+#   version:
+#   driver: com.mysql.jdbc.Driver
+#   keyword_prefix: \`
+#   keyword_suffix: \`
+#   alias_prefix: \'
+#   alias_suffix: \'
+
+# oracle:
+#   name: oracle
+#   desc: oracle
+#   version: 
+#   driver: oracle.jdbc.driver.OracleDriver
+#   keyword_prefix: \"
+#   keyword_suffix: \"
+#   alias_prefix: \'
+#   alias_suffix: \'

+ 136 - 0
config/logback.xml

@@ -0,0 +1,136 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+  ~ <<
+  ~  Davinci
+  ~  ==
+  ~  Copyright (C) 2016 - 2019 EDP
+  ~  ==
+  ~  Licensed under the Apache License, Version 2.0 (the "License");
+  ~  you may not use this file except in compliance with the License.
+  ~  You may obtain a copy of the License at
+  ~        http://www.apache.org/licenses/LICENSE-2.0
+  ~   Unless required by applicable law or agreed to in writing, software
+  ~   distributed under the License is distributed on an "AS IS" BASIS,
+  ~   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  ~   See the License for the specific language governing permissions and
+  ~   limitations under the License.
+  ~  >>
+  ~
+  -->
+
+<configuration scan="true" scanPeriod="60 seconds">
+
+    <include resource="org/springframework/boot/logging/logback/defaults.xml"/>
+    <include resource="org/springframework/boot/logging/logback/console-appender.xml"/>
+
+    <property name="APP_NAME" value="davinci"/>
+
+    <property name="SYS" value="sys"/>
+    <property name="USER" value="user"/>
+
+    <property name="SQL" value="sql"/>
+    <property name="SCHEDULE" value="schedule"/>
+    <property name="OPT" value="opt"/>
+    <property name="DOWNLOAD" value="download"/>
+
+    <property name="LOG_HOME_PATH" value="${DAVINCI3_HOME}/logs"/>
+
+    <property name="SYS_LOG_PATTERN"
+              value="${FILE_LOG_PATTERN:-%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} ${LOG_LEVEL_PATTERN:-%5p} ${PID:- } --- [%t] %-40.40logger{39} : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
+
+    <property name="BUSINESS_SQL_LOG_PATTERN"
+              value="${BUSINESS_SQL_LOG_PATTERN:-%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} --- %file:%line : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
+
+    <property name="BUSINESS_OPERATION_LOG_PATTERN"
+              value="${BUSINESS_OPERATION_LOG_PATTERN:-%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} --- %file:%line : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
+
+    <property name="BUSINESS_SCHEDULE_LOG_PATTERN"
+              value="${BUSINESS_SCHEDULE_LOG_PATTERN:-%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} --- %file:%line : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
+
+    <property name="BUSINESS_DOWNLOAD_LOG_PATTERN"
+              value="${BUSINESS_DOWNLOAD_LOG_PATTERN:-%d{${LOG_DATEFORMAT_PATTERN:-yyyy-MM-dd HH:mm:ss.SSS}} --- %file:%line : %m%n${LOG_EXCEPTION_CONVERSION_WORD:-%wEx}}"/>
+
+    <appender name="SYS_LOG" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <FileNamePattern>${LOG_HOME_PATH}/${SYS}/${APP_NAME}.%d{yyyy-MM-dd}.log</FileNamePattern>
+            <MaxHistory>30</MaxHistory>
+        </rollingPolicy>
+
+        <encoder>
+            <charset>UTF-8</charset>
+            <pattern>${SYS_LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+
+    <appender name="BUSINESS_SQL_LOG_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <FileNamePattern>${LOG_HOME_PATH}/${USER}/${SQL}/%d{yyyy-MM-dd}.log</FileNamePattern>
+            <MaxHistory>10</MaxHistory>
+        </rollingPolicy>
+
+        <encoder>
+            <charset>UTF-8</charset>
+            <pattern>${BUSINESS_SQL_LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+
+    <appender name="BUSINESS_OPERATION_LOG_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <FileNamePattern>${LOG_HOME_PATH}/${USER}/${OPT}/%d{yyyy-MM-dd}.log</FileNamePattern>
+            <MaxHistory>10</MaxHistory>
+        </rollingPolicy>
+
+        <encoder>
+            <charset>UTF-8</charset>
+            <pattern>${BUSINESS_OPERATION_LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+
+    <appender name="BUSINESS_SCHEDULE_LOG_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <FileNamePattern>${LOG_HOME_PATH}/${USER}/${SCHEDULE}/%d{yyyy-MM-dd}.log</FileNamePattern>
+            <MaxHistory>10</MaxHistory>
+        </rollingPolicy>
+
+        <encoder>
+            <charset>UTF-8</charset>
+            <pattern>${BUSINESS_SCHEDULE_LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+    <appender name="BUSINESS_DOWNLOAD_LOG_APPENDER" class="ch.qos.logback.core.rolling.RollingFileAppender">
+        <rollingPolicy class="ch.qos.logback.core.rolling.TimeBasedRollingPolicy">
+            <FileNamePattern>${LOG_HOME_PATH}/${USER}/${DOWNLOAD}/%d{yyyy-MM-dd}.log</FileNamePattern>
+            <MaxHistory>10</MaxHistory>
+        </rollingPolicy>
+
+        <encoder>
+            <charset>UTF-8</charset>
+            <pattern>${BUSINESS_DOWNLOAD_LOG_PATTERN}</pattern>
+        </encoder>
+    </appender>
+
+
+    <logger name="BUSINESS_SQL" additivity="false" level="INFO">
+        <appender-ref ref="BUSINESS_SQL_LOG_APPENDER"/>
+    </logger>
+    <logger name="BUSINESS_OPERATION" additivity="false" level="INFO">
+        <appender-ref ref="BUSINESS_OPERATION_LOG_APPENDER"/>
+    </logger>
+    <logger name="BUSINESS_SCHEDULE" additivity="false" level="INFO">
+        <appender-ref ref="BUSINESS_SCHEDULE_LOG_APPENDER"/>
+    </logger>
+    <logger name="BUSINESS_DOWNLOAD" additivity="false" level="INFO">
+        <appender-ref ref="BUSINESS_DOWNLOAD_LOG_APPENDER"/>
+    </logger>
+
+
+    <root level="INFO">
+        <appender-ref ref="CONSOLE"/>
+        <appender-ref ref="SYS_LOG"/>
+    </root>
+
+</configuration>

+ 4 - 0
docs/.gitignore

@@ -0,0 +1,4 @@
+_site
+.sass-cache
+.jekyll-metadata
+Gemfile.lock

+ 24 - 0
docs/404.html

@@ -0,0 +1,24 @@
+---
+layout: default
+---
+
+<style type="text/css" media="screen">
+  .container {
+    margin: 10px auto;
+    max-width: 600px;
+    text-align: center;
+  }
+  h1 {
+    margin: 30px 0;
+    font-size: 4em;
+    line-height: 1;
+    letter-spacing: -1px;
+  }
+</style>
+
+<div class="container">
+  <h1>404</h1>
+
+  <p><strong>Page not found :(</strong></p>
+  <p>The requested page could not be found.</p>
+</div>

+ 34 - 0
docs/Gemfile

@@ -0,0 +1,34 @@
+source "https://rubygems.org"
+
+# Hello! This is where you manage which Jekyll version is used to run.
+# When you want to use a different version, change it below, save the
+# file and run `bundle install`. Run Jekyll with `bundle exec`, like so:
+#
+#     bundle exec jekyll serve
+#
+# This will help ensure the proper Jekyll version is running.
+# Happy Jekylling!
+gem "jekyll", "~> 3.8.3"
+
+# If you want to use GitHub Pages, remove the "gem "jekyll"" above and
+# uncomment the line below. To upgrade, run `bundle update github-pages`.
+# gem "github-pages", group: :jekyll_plugins
+
+# If you have any plugins, put them here!
+group :jekyll_plugins do
+  gem "jekyll-feed", "~> 0.6"
+  gem "jekyll-include-cache"
+end
+
+# Windows does not include zoneinfo files, so bundle the tzinfo-data gem
+# and associated library.
+install_if -> { RUBY_PLATFORM =~ %r!mingw|mswin|java! } do
+  gem "tzinfo", "~> 1.2"
+  gem "tzinfo-data"
+end
+
+# Performance-booster for watching directories on Windows
+gem "wdm", "~> 0.1.0", :install_if => Gem.win_platform?
+
+# gem "minimal-mistakes-jekyll"
+gem "github-pages", group: :jekyll_plugins

+ 20 - 0
docs/_config.yml

@@ -0,0 +1,20 @@
+title: Davinci 用户手册
+zh_masthead_title: 用户手册
+baseurl: "/davinci"
+logo: "assets/images/logo.svg"
+
+# theme: minimal-mistakes-jekyll
+remote_theme: "mmistakes/minimal-mistakes@4.16.5"
+markdown: kramdown
+minimal_mistakes_skin: "default"
+plugins:
+  - jekyll-feed
+  - jekyll-include-cache
+
+collections:
+  docs:
+    permalink: /:collection/:path
+    output: true
+
+DAVINCI_VERSION: 0.3
+DAVINCI_VERSION_SHORT: 0.3

+ 67 - 0
docs/_data/navigation.yml

@@ -0,0 +1,67 @@
+zh:
+  - title: "概览"
+    url: /
+  - title: "文档"
+    url: /docs/zh/1.1-deployment
+  - title: "更多"
+    url: /blueprint
+en:
+  - title: "Overview"
+    url: /
+  - title: "Docs"
+    url: /docs/en/1.1-deployment
+  - title: "More"
+    url: /blueprint
+
+zh_docs_sidebar:
+  - title: 快速上手
+    children:
+      - title: 1.1 安装
+        url: "/docs/zh/1.1-deployment"
+      - title: 1.2 第一个应用
+        url: "/docs/zh/1.2-quick_start"
+  - title: 功能详解
+    children:
+      - title: 2.1 数据源 - Source
+        url: "/docs/zh/2.1-source"
+      - title: 2.2 数据视图 - View
+        url: "/docs/zh/2.2-view"
+      - title: 2.3 可视化组件 - Widget
+        url: "/docs/zh/2.3-widget"
+      - title: 2.4 仪表板 - Dashboard
+        url: "/docs/zh/2.4-dashboard"
+      - title: 2.5 大屏 - Display
+        url: "/docs/zh/2.5-display"
+      - title: 2.6 定时任务 - Schedule
+        url: "/docs/zh/2.6-schedule"
+  - title: 用户与权限
+    children:
+      - title: 3.1 组织
+        url: "/docs/zh/3.1-organization"
+      - title: 3.2 成员
+        url: "/docs/zh/3.2-member"
+      - title: 3.3 角色
+        url: "/docs/zh/3.3-role"
+      - title: 3.4 项目
+        url: "/docs/zh/3.4-project"
+      - title: 3.5 用户设置
+        url: "/docs/zh/3.5-user_setting"
+      - title: 3.6 重置密码
+        url: "/docs/zh/3.6-reset_password"
+  - title: 其他
+    children:
+      - title: 4.1 使用统计
+        url: "/docs/zh/4.1-statistic"
+  - title: 附录
+    children:
+      - title: 5.1 图表配置
+        url: "/docs/zh/5.1-chart_config"
+zh_more_sidebar:
+  - title: 其他
+    children:
+      - title: 蓝图
+        url: "/blueprint"
+      - title: 更多信息
+        url: "/more_info"
+      - title: 0.2版本文档
+        url: "/old_version"

+ 414 - 0
docs/_docs/zh/1.1-deployment.md

@@ -0,0 +1,414 @@
+---
+layout: zh_single
+title: 安装
+sidebar:
+  nav: "zh_docs_sidebar"
+toc: true
+toc_label: 安装
+toc_icon: "cog"
+last_modified_at: "2020-10-29"
+---
+
+## 1 环境准备
+
+- JDK 1.8(或更高版本)
+- MySql5.5(或更高版本)
+- Mail Server
+- [Chrome](https://chromedriver.chromium.org/)(需同时安装chromedriver,清注意版本)
+- Redis(可选)
+
+## 2 配置部署
+
+### 2.1 初始化目录
+
+将下载好的 Davinci 包(Release 包,不是 Source 包)解压到某个系统目录,如:~/app/davinci
+
+```bash
+cd ~/app/davinci
+unzip davinci-assembly_3.0.1-0.3.0-SNAPSHOT-dist.zip
+```
+
+解压后目录结构如下图所示:
+
+![初始化目录](../../assets/images/deployment/2.1.1.png)
+
+### 2.2 配置环境变量
+
+将上述解压后的目录配置到环境变量 DAVINCI3_HOME
+
+```bash
+export DAVINCI3_HOME=~/app/davinci/davinci-assembly_3.0.1-0.3.0-SNAPSHOT-dist
+```
+
+### 2.3 初始化数据库
+
+修改 bin 目录下 initdb.sh 中要的数据库信息为要初始化的数据库,如 davinci0.3
+
+```bash
+mysql -P 3306 -h localhost -u root -proot davinci0.3 < $DAVINCI3_HOME/bin/davinci.sql
+```
+
+运行脚本初始化数据库(注:由于 Davinci 系统数据库中包含存储过程,请务必在创建数据库时赋予执行权限)
+
+```bash
+sh bin/initdb.sh
+```
+
+### 2.4 初始化配置
+
+Davinci 的配置主要包括:server、datasource、mail、chrome、cache 等配置
+
+进入`config`目录,将`application.yml.example`重命名为`application.yml`
+后开始配置
+
+```bash
+cd config
+mv application.yml.example application.yml
+```
+
+<b style="color: red">注意:由于 Davinci 使用 ymal 作为应用配置文件格式,请务必确保每个配置项键后的冒号和值之间至少有一个空格</b>
+
+#### 2.4.1 server 配置
+
+```yaml
+server:
+  protocol: http
+  address: 127.0.0.1
+  port: 8080
+
+  access:
+    address: 192.168.1.1
+    port: 80
+```
+
+server 配置如上示例所示,`server.access.address`和`server.access.port`表示真实访问地址和端口,默认不开启,其值默认为`server.address`和`server.port`
+
+如你在虚拟主机上部署 Davinci,启动端口为`8080`,该主机真实访问IP地址为`192.168.1.1`,你将虚拟主机的`8080`端口映射到`80`端口,则需打开 access 配置项,否则将不能正常使用 Davinci 的部分功能,如激活账号、下载、分享等
+
+#### 2.4.2 datasource 配置
+
+这里的 datasource 配置指 Davinci 系统的数据源,配置如下:
+
+```yaml
+spring:
+  datasource:
+    url: jdbc:mysql://localhost:3306/davinci0.3?useUnicode=true&characterEncoding=UTF-8&zeroDateTimeBehavior=convertToNull&allowMultiQueries=true
+    username: root
+    password: root
+    driver-class-name: com.mysql.jdbc.Driver
+    initial-size: 2
+    min-idle: 1
+    max-wait: 60000
+    max-active: 10
+```
+
+将上一步初始化的数据库地址配置到`url`中,url 中的参数不要做任何修改,然后修改正确的数据库访问用户和密码即`username`和`password`
+
+`initial-size`、`min-idle`、`max-wait`、`max-active`是连接池参数,具体属性请参考[DruidDataSource配置属性列表](https://github.com/alibaba/druid/wiki/DruidDataSource%E9%85%8D%E7%BD%AE%E5%B1%9E%E6%80%A7%E5%88%97%E8%A1%A8)
+
+#### 2.4.3 mail 配置
+
+***注:Davinci 使用注册--邮件激活添加用户,所以 mail 配置是必不可少的,且 mail 配置出错率较高,请务必注意***
+
+```yaml
+spring:
+  mail:
+    host: smtp.****.com
+    port: 25
+    username: example@***.com
+    fromAddress: 
+    password: example_password
+    nickname: Davinci
+    
+    properties:
+      smtp:
+        starttls:
+          enable: true
+          required: true
+        auth: true
+      mail:
+        smtp:
+          ssl:
+            enable: false
+            
+```
+
+mail 配置并不复杂,以上就是完整的 mail 配置了,`username`为邮箱地址,`password`邮箱服务密码,需要注意的是常见免费邮箱(如 163 邮箱、QQ 邮箱、gmail 等)这里应填客户端独立密码,可前往对应邮箱账号设置页面开启 SMTP 服务,并申请客户端授权码(或独立密码,各邮箱提供商叫法不同)
+
+`fromAddress` 为可选项,默认为 `username` 的值,其存在的意义在于部分邮箱服务可能在认证时 `username` 和 `addresss` 不同,这时需要配置 `fromAddress` 作为邮件真实发送地址,`username` 为连接邮箱服务认证使用
+
+下表为常见免费邮箱 SMTP 服务地址及端口:
+
+![server](../../assets/images/deployment/2.4.3.1.png)
+
+#### 2.4.4 截图配置
+
+截图配置用于[定时任务](2.6-schedule)功能发送邮件正文中对可视化应用进行截图
+
+```yaml
+screenshot:
+  default_browser: CHROME
+  timeout_second: 600
+  chromedriver_path: $your_chromedriver_path$
+```
+`default_browser` 为默认截图浏览器,目前仅支持 `CHROME`
+
+**注意:`chromedriver_path` 需配置 Chromedriver (非Chrome)可执行文件绝对地址**
+
+#### 2.4.5 cache 配置(可选)
+
+cache 这里用 redis 作为缓存服务,配置如下:
+
+```yaml
+spring:
+  redis:
+    isEnable: false
+    host: 10.143.131.119
+    port: 6379
+    
+  #  cluster:
+  #       nodes:
+
+    password:
+    database: 0
+    timeout: 1000
+    jedis:
+      pool:
+        max-active: 8
+        max-wait: 1
+        max-idle: 8
+        min-idle: 0
+```
+
+如果要开启 cache 服务,请将`isEnable`设为`true`,并要设置相关配置(单机方式请打开`host`和`port`,集群方式请打开`cluster`配置项,二者只能选择一种)
+
+由于 Davinci Cache 配置遵循 Spring 配置, 所以 Redis 配置除 `isEnable` 外,不必拘泥以上配置格式,如通过 `sentinel` 方式连接
+
+#### 2.4.6 LDAP配置与实现(可选)
+
+LDAP 配置项如下:
+
+```yaml
+spring:
+  ldap:
+    urls: 
+    username: 
+    password: 
+    base: 
+    domainName: 
+```
+
+除`domainName`需配置企业邮箱后缀外,其他配置项遵循[`SpringBoot`关于LDAP的配置](https://docs.spring.io/spring-boot/docs/current/reference/html/spring-boot-features.html#boot-features-ldap), 需要注意的是,由于各组织、公司 LDAP 服务字段、域都不尽相同,如需对接 LDAP, 需自行修改源码打包使用,具体修改文件为:
+`server/src/main/java/edp/davinci/service/impl/LdapServiceImpl.java`,只需修改`findByUsername`方法中关于 LDAP 相关字段即可。
+
+#### 2.4.7 OAuth2配置(可选)
+
+```yaml
+security:
+    oauth2:
+      enable: false
+      client:
+        registration:
+          cas:
+            provider: cas
+            client-id: "xxxxx"
+            client-name: "Sign in with XXX"
+            client-secret: "xxxxx"
+            authorization-grant-type: authorization_code
+            client-authentication-method: post
+            redirect-uri-template: "{baseUrl}/login/oauth2/code/{registrationId}"
+            scope: userinfo
+        provider:
+          cas:
+            authorization-uri: https://cas.xxxxx.cn/cas/oauth2.0/authorize
+            token-uri: https://cas.xxxxx.cn/cas/oauth2.0/accessToken
+            user-info-uri: https://cas.xxxxx.cn/cas/oauth2.0/profile
+            user-name-attribute: id
+            userMapping:
+              email: "attributes.Email"
+              name: "attributes.CnName1"
+              avatar: "attributes.Avatar"
+```
+
+oauth2配置如上示例所示,已cas endpoint为例
+
+security.oauth2.enable设置为true表示启用oauth2
+
+security.oauth2.client.registration.cas.client-id表示客户端id
+
+security.oauth2.client.registration.cas.client-secret表示客户端密钥
+
+security.oauth2.client.registration.cas.authorization-grant-type表示客户端授权方式,authorization_code表示授权码模式
+
+security.oauth2.client.registration.cas.redirect-uri-template表示重定向地址
+
+security.oauth2.client.registration.cas.scope表示访问请求范围
+
+security.oauth2.client.provider.cas.authorization-uri表示授权服务器地址
+
+security.oauth2.client.provider.cas.token-uri表示授权服务器的令牌端点URI
+
+security.oauth2.client.provider.cas.user-info-uri表示UserInfo端点URI
+
+security.oauth2.client.provider.cas.user-name-attribute表示UserInfo响应中返回的属性的名称
+
+security.oauth2.client.provider.cas.userMapping表示用户信息字段映射关系,根据返回的用户的用户信息,获取对应字段的值
+
+security.oauth2.client.provider.cas.userMapping.email表示用户信息的email字段,取值路径为attributes.Email,用户需要根据授权服务器的实际返回自行调整
+
+security.oauth2.client.provider.cas.userMapping.name表示用户信息的name字段,取值路径为attributes.CnName1,用户需要根据授权服务器的实际返回自行调整
+
+security.oauth2.client.provider.cas.userMapping.avatar表示用户信息的name字段,取值路径为attributes.Avatar,用户需要根据授权服务器的实际返回自行调整
+
+#### 2.4.8 使用统计配置
+
+[使用统计](4.1-statistic)开启后将记录可视化应用的使用数据和登录终端信息
+
+```yaml
+statistic:
+  enable: false
+  # You can use external elasticsearch storage [127.0.0.1:9300], default davinci datasouce
+  elastic_urls:
+  elastic_index_prefix:
+```
+
+如果要开启使用统计,请将`enable`设为`true`。统计数据默认情况下会存储到 Davinci 自身使用的 mysql 数据库中,也可以选择存储到 ElasticSearch 中
+
+#### 2.4.9 数据源信息加密配置(可选)
+
+```yaml
+encryption:
+  maxEncryptSize: 1024
+  type: Off # Off is to turn off encryption, to enable encryption, please select AES or RSA
+```
+
+数据源密码支持加密存储,启用步骤如下:
+
+1. 运行 `SourcePasswordEncryptUtils` 的 `main` 方法,会在 `userfiles` 目录下生成三个密钥文件 `${DAVINCI3_HOME}/userfiles/AES/private.txt` (对称加密密钥),`${DAVINCI3_HOME}/userfiles/RSA/private.txt` (非对称加密私钥),`${DAVINCI3_HOME}/userfiles/RSA/public.txt` (非对称加密公钥)。生成以后请务必进行备份,以免由于密钥丢失导致系统无法正确的加解密。
+
+2. 修改 `${DAVINCI3_HOME}/config/application.yml` 中的 `encryption.type` 为 AES 或 RSA,根据实际情况选择
+
+3. `encryption.maxEncryptSize` 为最大加密长度,`encryption.type` 为 RSA 时有效,根据实际情况调整
+
+#### 2.4.10 其他配置
+
+日志配置文件为`config/logback.xml`,如当前的日志配置不能满足你的要求,可自定义配置日志模式
+
+## 3 数据源配置
+
+Davinci 理论上支持所有有 JDBC 的数据源,我们默认支持的数据源有:
+
+| 数据源名称    | 驱动类                                                |
+| ------------- | ----------------------------------------------------- |
+| mysql         | com.mysql.jdbc.Driver                                 |
+| oracle        | oracle.jdbc.driver.OracleDriver                       |
+| sqlserver     | com.microsoft.sqlserver.jdbc.SQLServerDriver          |
+| h2            | org.h2.Driver                                         |
+| phoenix       | org.apache.phoenix.jdbc.PhoenixDriver                 |
+| mongodb       | mongodb.jdbc.MongoDriver                              |
+| elasticSearch | --                                                    |
+| presto        | com.facebook.presto.jdbc.PrestoDriver                 |
+| moonbox       | moonbox.jdbc.MbDriver                                 |
+| cassandra     | com.github.adejanovski.cassandra.jdbc.CassandraDriver |
+| clickhouse    | ru.yandex.clickhouse.ClickHouseDriver                 |
+| kylin         | org.apache.kylin.jdbc.Driver                          |
+| vertica       | com.vertica.jdbc.Driver                               |
+| hana          | com.sap.db.jdbc.Driver                                |
+| impala        | com.cloudera.impala.jdbc41.Driver                     |
+
+**注意:**
+
+1. Davinci 内部只提供了 MySql 的驱动包,也就是说,如果你要使用其他数据源,还需将对应驱动jar 包手动拷贝到`lib`目录并重新启动 Davinci 服务  
+
+2. 如果你的数据源不在以上列表中,也可以通过[自定义配置注入数据源](1.1-deployment#31-自定义数据源),否则没必要开启,除非你知道在做什么
+
+3. 关于 ElasticSearch 数据源的配置情况说明:
+
+    Davinci 默认提供了 [NLPchina提供的elasticsearch-sql(version: 5.3.2)](https://github.com/NLPchina/elasticsearch-sql/tree/elastic5.3.2) 驱动,其强依赖 [Druid(version: 1.0.15)](https://github.com/alibaba/druid/tree/1.0.15),所以为了避免 Druid 版本冲突,我们建议你在连接 ElasticSearch 时使用版本隔离的方式进行连接,具体请参考[多版本隔离配置](1.1-deployment#32-多版本隔离),你可以根据你的 ES 服务自由选择驱动版本和 Druid 版本,甚至非 NLPChina 提供且**支持 JDBC 的**驱动包
+
+    使用 NLPchina 提供的驱动包需要确认包含以下依赖文件 `elasticsearch-xxx.jar`、`transport-xxx.jar`、`x-pack-api-xxx.jar`、`x-pack-transport-xxx.jar`、`elasticsearch-sql-XXX.jar`(`xxx`表示你的 ElasticSearch 版本号,`XXX`表示 NLPchina 对应 elasticsearch-sql 版本号)
+
+4. 关于 Mongo 数据源的配置情况说明:
+
+    由于 MongoDB 官方提供的驱动包没有 Driver 类,需自行查找相应驱动包,目前 Davinci 默认指定的 Mongo 连接方式为(未提供驱动 jar 包):
+
+    ```yaml
+    mongo:
+      name: mongo
+      desc: mongodb
+      version:
+      driver: mongodb.jdbc.MongoDriver
+      keyword_prefix: \`
+      keyword_suffix: \`
+      alias_prefix: \"
+      alias_suffix: \"
+    ``` 
+
+    jdbc url 以 `jdbc:mongo://` 开头,如果不符合你的需求,可通过配置[自定义数据源解决](1.1-deployment#31-自定义数据源)
+
+### 3.1 自定义数据源
+
+1. 打开自定义数据源配置文件
+
+  ```bash
+  mv datasource_driver.yml.example datasource_driver.yml
+  ```
+
+2. 如下配置你的数据源,这里以 postgresql 为例
+
+  ```yaml
+  postgresql:
+    name: postgresql
+    desc: postgresql
+    version:
+    driver: org.postgresql.Driver
+    keyword_prefix:
+    keyword_suffix:
+    alias_prefix: \"
+    alias_suffix: \"
+  ```
+
+  ***注意***
+
+  - `keyword_prefix`和`keyword_suffix`表示关键字前缀和后缀,假设使用 mysql 数据库,并将`desc`关键字作为字段使用,那么你的查询语句应该是:
+
+    ```select `desc` from table```
+    这里的 ‘`’ 就是前后缀,它们必须成对被配置,可以都为空
+
+  - `alias_prefix`和`alias_suffix`表示别名前后缀,仍以 mysql 为例,假设你的 sql 语句如下:
+
+    ```select column as '列' from table```  
+
+    这里为 ‘column’ 起了别名为‘列’,那么‘'’将作为前后缀配置,前后缀必须成对被配置,可以都为空
+
+  - 对于以上别名配置,你可以使用`''`将字符包起来,也可以使用转义符`\`,二者只能出现一种
+
+3. 手动将相应的驱动 jar 包拷贝到`lib`目录下
+
+4. 重启 Davinci 服务
+
+### 3.2 多版本隔离
+
+如果你需要同时使用某个数据源的不同版本,需要以下配置:
+
+1. 在 datasource_driver.yml 中新增数据源配置,使用 version 字段标记数据源对应版本。version 字段为空时,默认读取 `lib` 目录下的驱动文件。这里以 hive 为例
+  ```yaml
+  hive1.1.0:
+    name: hive2
+    desc: hive
+    version: 1.1.0
+    driver: org.apache.hive.jdbc.HiveDriver
+    keyword_prefix: \` 
+    keyword_suffix: \`
+    alias_prefix: \`
+    alias_suffix: \`
+  ```
+
+2. 在 lib/ext 下创建相应数据库及其版本目录(如无 ext 目录,可自行创建) 如:lib/ext/hive2/1.1.0
+
+3. 将对应数据源的驱动包放入步骤2 创建的目录
+
+4. 重启服务器
+
+5. 在 source 新增或修改时选择数据源,详情参考 [数据源 - 新增数据源](2.1-source#1-新增数据源)
+

+ 105 - 0
docs/_docs/zh/1.2-quick_start.md

@@ -0,0 +1,105 @@
+---
+layout: zh_single
+title: 第一个应用
+sidebar:
+  nav: "zh_docs_sidebar"
+toc: true
+toc_label: 第一个应用
+toc_icon: "cog"
+last_modified_at: "2019-08-20"
+---
+
+我们先来实现第一个应用。如果某一步不会操作,别担心,你可以到后面的章节中找对应的介绍
+
+## 1 注册与登录
+
+Davinci 提供了一个默认账户,用户名 guest,密码 123456
+
+也可以选择注册新账户,注册前确保邮件服务器已正确配置,填写真实的邮箱地址,用于接收激活邮件,点击注册后,到对应的邮箱中激活即可进入系统
+
+![注册与登录1](../../assets/images/quick_start/1.1.png)
+
+![注册与登录2](../../assets/images/quick_start/1.2.png)
+
+
+## 2 创建项目
+
+首次登录成功后,系统会默认为你创建一个组织,你可以在该组织下创建项目
+
+![创建项目1](../../assets/images/quick_start/2.1.png)
+
+![创建项目2](../../assets/images/quick_start/2.2.png)
+
+![创建项目3](../../assets/images/quick_start/2.3.png)
+
+## 3 创建数据源
+
+创建好项目之后,点击进入项目,先创建数据源
+
+![创建数据源1](../../assets/images/quick_start/3.1.png)
+
+![创建数据源2](../../assets/images/quick_start/3.2.png)
+
+点击测试成功之后,保存数据源
+
+## 4 创建数据视图
+
+数据源创建成功之后,开始创建数据视图
+
+![创建数据视图1](../../assets/images/quick_start/4.1.png)
+
+在左侧选择刚才创建的数据源,写 SQL
+
+![创建数据视图2](../../assets/images/quick_start/4.2.png)
+
+执行成功后,下一步编辑数据模型
+
+![创建数据视图3](../../assets/images/quick_start/4.3.png)
+
+确认无误后,保存数据视图
+
+## 5 创建可视化组件
+
+数据视图创建成功之后,开始创建可视化组件
+
+![创建可视化组件1](../../assets/images/quick_start/5.1.png)
+
+在左上角选择刚才创建的数据视图,加载出数据模型字段列表后,简单地拖拽两个字段到“数据”页签,并选择一个图表类型
+
+![创建可视化组件2](../../assets/images/quick_start/5.2.png)
+
+保存可视化组件
+
+## 6 创建可视化应用
+
+可视化组件创建成功之后,开始创建可视化应用,点击“创建新 Dashboard”按钮创建仪表板门户
+
+![创建可视化应用1](../../assets/images/quick_start/6.1.png)
+
+![创建可视化应用2](../../assets/images/quick_start/6.2.png)
+
+仪表板门户创建成功后,点击进入,在左侧菜单创建仪表板
+
+![创建可视化应用3](../../assets/images/quick_start/6.3.png)
+
+![创建可视化应用4](../../assets/images/quick_start/6.4.png)
+
+![创建可视化应用5](../../assets/images/quick_start/6.5.png)
+
+仪表板创建成功后,点击仪表板左上角“+”按钮,将刚才创建的可视化组件添加进来
+
+![创建可视化应用6](../../assets/images/quick_start/6.6.png)
+
+![创建可视化应用7](../../assets/images/quick_start/6.7.png)
+
+![创建可视化应用8](../../assets/images/quick_start/6.8.png)
+
+点击保存之后,就能在仪表板上看到刚才创建的可视化组件了
+
+![创建可视化应用9](../../assets/images/quick_start/6.9.png)
+
+拽住可视化组件右下角稍作尺寸调整,第一个可视化应用就创建成功了!
+
+![创建可视化应用10](../../assets/images/quick_start/6.10.png)
+
+点击 [下一页](2.1-source) 进一步了解功能详情

+ 75 - 0
docs/_docs/zh/2.1-source.md

@@ -0,0 +1,75 @@
+---
+layout: zh_single
+title: 数据源
+sidebar:
+  nav: "zh_docs_sidebar"
+toc: true
+toc_label: 数据源
+toc_icon: "cog"
+last_modified_at: "2020-10-29"
+---
+
+数据源(Source)用于管理用户数据源连接配置。Davinci 目前支持两种类型数据源:
+1. 通过 JDBC 连接的数据源(配置详情参考 [安装 - 数据源配置](1.1-deployment#3-数据源配置));
+1. 上传 CSV 文件到指定数据库中作为数据源
+
+## 1 新增数据源
+
+在数据源列表页,点击右上角“+”按钮弹出新增数据源表单
+![新增数据源1](../../assets/images/source/1.1.png)
+![新增数据源2](../../assets/images/source/1.2.png)
+
+目前支持 JDBC 和 CSV 两种数据源类型;**需要注意,CSV 类型数据源也需要指定一个数据库来存储上传的 CSV 文件内容,目前仅支持 mysql 数据库**
+
+数据库为可选项,当所选的数据源在服务器配置了多个版本的情况下,必须选择数据库及其版本号。选择数据库之后连接 Url 会自动填充前缀
+
+用户名和密码为数据源连接账户及密码,连接 URL 请填写完整 JDBC 连接地址,通常格式为
+```
+jdbc:<数据源名称>://<数据源域名或IP>:(<端口>)/<数据源实例>(?<连接参数>)
+```
+
+其中端口和连接参数为可选项。部分数据源在写法上有少许差异,比如名称和域名/IP之间不需要 `//`、参数连接符使用 `;` 等等
+
+配置信息栏填写连接参数,以键值对的形式,可根据不同数据源情况自行填写
+
+在输入完上述内容之后,可以点击“点击测试”按钮检查数据源是否可以正常连接;测试成功并填写完毕之后,点击下方的保存按钮保存数据源配置
+
+## 2 上传 CSV 文件数据
+
+数据源添加完毕之后,如果是 CSV 类型数据源,下一步将准备上传 CSV 文件到数据库中
+
+第一步,准备 CSV 文件,需要注意:
+- 第一行为字段名称,建议使用英文
+- 第二行为字段类型,使用大写字母
+- 第三行之后为明细数据
+- CSV 文件需要保存为 **UTF-8 格式**
+
+![CSV1](../../assets/images/source/2.1.jpg)
+
+第二步,点击“上传”按钮弹出配置表单
+
+![CSV2](../../assets/images/source/2.2.png)
+
+第三步,填写配置和上传 CSV 文件,其中表名为 CSV 文件内容在数据库中生成的表名称,主键和索引键为可选项,选择适当的导入方式
+
+- 新增:在数据库中新建表并上传数据,当库中有相同名称表时会报错
+- 替换:清空表原始数据并上传新数据
+- 追加:在表原始数据基础上增量追加新数据
+- 覆盖:重建表结构、清空表原始数据并上传新数据
+
+其中“替换”和“覆盖”都会清空表原始数据,但区别在于,“替换”不改变表结构,“覆盖”会按照 CSV 文件中的字段信息重建表结构
+
+最后,选择 CSV 文件,点击确定
+
+![CSV3](../../assets/images/source/2.3.png)
+
+## 3 编辑和删除数据源
+
+在数据源列表中可以对现有的数据源进行编辑和删除操作
+![编辑和删除数据源](../../assets/images/source/3.1.png)
+
+## 4 重置连接
+
+Davinci 会在数据源连接断开之后自动尝试重连;当然,也可以在数据源列表页手动重新连接
+
+![重置连接](../../assets/images/source/4.1.png)

+ 139 - 0
docs/_docs/zh/2.2-view.md

@@ -0,0 +1,139 @@
+---
+layout: zh_single
+title: 数据视图
+sidebar:
+  nav: "zh_docs_sidebar"
+toc: true
+toc_label: 数据视图
+toc_icon: "cog"
+last_modified_at: "2020-10-29"
+---
+
+数据视图(View)用于管理用户编写的 SQL 模板,和对执行 SQL 后获取到的数据模型以及行列权限进行配置
+
+## 1 SQL 编辑器
+
+在数据视图列表页,点击右上角“+”按钮进入编辑器
+
+![SQL](../../assets/images/view/1.1.png)
+
+编辑器共分为4个区域:
+- 左侧:数据源信息与数据视图表单
+
+  数据视图表单包含名称、描述和关联数据源。当选择了关联数据源之后,下方的数据源信息会展示该数据源下的所有数据库;如果该数据源实例中只有一个数据库,会展示该数据库下的所有表。点击表名称前方的三角箭头会展示该表下的所有字段。通过上方的搜索框可以快速对数据库 / 表 / 字段信息做检索校对。目前数据源信息内容仅可以做预览校对作用
+
+- 中上:SQL 编辑区
+
+  编辑器会对以下内容自动提示:
+  
+  - 常用 SQL 关键字
+  - 所选数据源的数据库 / 表 / 字段名称
+  - 变量名称
+
+- 中下:数据展示区
+
+  展示 SQL 模板执行后获取的数据列表,默认展示 500 条预览数据,可配置
+
+- 右侧:变量声明区
+
+  管理 SQL 模板中使用的变量
+
+![SQL](../../assets/images/view/1.2.png)
+
+### 1.1 变量
+
+变量提供了将 SQL 动态化的能力;Davinci 支持两种变量类型:查询变量和权限变量
+
+点击变量声明区右上角的“+“弹出新增变量表单
+
+#### 1.1.1 查询变量
+
+查询变量通过与 Widget 和 Dashboard 中的控制器关联,起到动态变化 SQL 模板的作用
+
+![查询变量](../../assets/images/view/1.1.1.png)
+
+查询变量有字符串、数字、布尔、日期、SQL表达式共 5 种值类型,值类型是为了对用户输入的变量值做正确的处理之后注入到 SQL 模板,Davinci 会自动给字符串、日期类型的变量值加上引号
+
+查询变量通常需要添加默认值以避免 SQL 执行错误,用户可以选择手动添加或使用表达式(SQL函数)作为默认值
+
+![查询变量](../../assets/images/view/1.1.2.png)
+
+如果没有给查询变量添加默认值,可以参考 [条件语句](2.2-view#12-条件语句) 章节的写法避免 SQL 执行错误
+
+填写完表单保存之后,就可以在 SQL 模板中使用 `$变量名称$` 语法引入查询变量
+
+![查询变量](../../assets/images/view/1.1.3.png)
+
+另外值得一说的是,Davinci 不会对 SQL 表达式类型的查询变量值做任何处理,所以理论上 SQL 表达式类型的查询变量值可以是任意 SQL 片段,用户可以通过与控制器搭配使用以达到非常灵活的效果
+
+![查询变量](../../assets/images/view/1.1.4.png)
+![查询变量](../../assets/images/view/1.1.5.png)
+
+#### 1.1.2 权限变量
+
+权限变量可以通过与角色关联,起到控制数据行权限的作用
+
+![权限变量](../../assets/images/view/1.2.1.png)
+
+权限变量同样有字符串、数字、布尔、日期、SQL表达式共 5 种值类型。填写完表单保存之后,在 SQL 模板中使用 `(<字段> <运算符> $变量名称$)` 语法引入权限变量,**注意:权限变量所在的条件判断片段一定要使用小括号包裹**
+
+![权限变量](../../assets/images/view/1.2.2.png)
+
+点击下一步,在 Auth 页签里管理项目所关联角色与权限变量的对应关系。当复选框未被勾选时,意味着该权限变量对该角色不生效,那么对该角色来说 `(<字段> <运算符> $变量名称$)` 小括号内的条件判断片段会被替换为 `(1 = 1)`;当复选框被勾选后,权限变量对该角色将会应用用户添加的值。单个权限变量可以添加多个值。
+
+![权限变量](../../assets/images/view/1.2.3.png)
+
+#### 1.1.3 系统变量
+
+系统变量用于做用户粒度权限控制,Davinci 内置了以下5个系统变量
+- $DAVINCI.USER.ID$:登录用户ID
+- $DAVINCI.USER.NAME$:登录用户姓名
+- $DAVINCI.USER.USERNAME$:登录用户用户名
+- $DAVINCI.USER.EMAIL$:登录用户邮箱
+- $DAVINCI.USER.DEPARTMENT$:登录用户部门
+
+在 dashboard 和 display 中获取数据时,系统变量会替换为登录用户的相关信息。系统变量对组织拥有者和项目管理员不生效。
+
+### 1.2 条件语句
+
+SQL 模板支持简单的条件语句结合变量一起使用。Davinci 服务端使用 [StringTemplate](https://www.stringtemplate.org/) 对 SQL 模板进行解析,因此在条件语法上支持 `if...else...` 以及 `&& || !` 判断(不支持算数运算符,点击此处 [查看详情](https://github.com/antlr/stringtemplate4/blob/master/doc/templates.md#conditionals))。如果对查询变量进行了条件判断,那么不设置默认值也不会报错。
+
+![条件语句1](../../assets/images/view/1.2.4.png)
+
+如果期望多个变量同时作用于过滤条件且互不影响,可以考虑如下写法
+
+![条件语句2](../../assets/images/view/1.2.5.png)
+
+### 1.3 快捷操作
+
+在 SQL 编辑区中,可以使用 `Command` + `Enter`(MacOS)`Ctrl` + `Enter`(Windows)组合键来快捷执行/中止 SQL。
+
+![快捷操作1](../../assets/images/view/1.3.1.png)
+
+同时,也可以使用光标选择部分 SQL 语句执行。但仅执行部分 SQL 语句是无法点击下一步按钮的,必须执行完整 SQL 语句
+
+![快捷操作2](../../assets/images/view/1.3.2.png)
+
+## 2 数据模型
+
+数据模型是对数据视图中的数据进行提前归类,以便更好地进行可视化开发。在编写完 SQL 模板并成功执行之后,点击下一步,在 Model 页签中编辑数据模型
+
+![数据模型](../../assets/images/view/2.1.png)
+
+数据类型有维度和指标 2 种,用于可视化组件生成基本的可视化编码逻辑;可视化类型有字符、数字、日期、地理国家、地理省份、地理城市 6 种,用于字段格式设置、提示和地图显示。**如果准备在可视化组件中使用地图显示数据的话,请提前将对应的省份、城市字段标记可视化类型(目前仅支持中国地图),否则将无法正常显示**
+
+Davinci 前端在拿到数据视图执行结果的 meta 信息之后会对字段的数据类型和可视化类型做预匹配,无法正确匹配的字段将会默认数据类型为维度、可视化类型为字符。人手原因我们很难将所有数据库的字段类型进行预置,所以欢迎大家贡献 [SQL_STRING_TYPES](https://github.com/edp963/davinci/blob/master/webapp/app/globalConstants.ts#L176)、[SQL_NUMBER_TYPES](https://github.com/edp963/davinci/blob/master/webapp/app/globalConstants.ts#L183)、[SQL_DATE_TYPES](https://github.com/edp963/davinci/blob/master/webapp/app/globalConstants.ts#L188)
+
+## 3 行列权限
+
+在 Auth 页签里可以配置项目所关联角色的数据行权限与列权限
+
+### 3.1 行权限
+
+在 [权限变量](2.2-view#112-权限变量) 章节中介绍了如何设置角色的数据行权限
+
+### 3.2 列权限
+
+通过点击“可见字段”列的标签会弹出字段列表,通过勾选来控制角色的数据列权限,默认全部可见。
+
+![行列权限](../../assets/images/view/3.1.png)

+ 242 - 0
docs/_docs/zh/2.3-widget.md

@@ -0,0 +1,242 @@
+---
+layout: zh_single
+title: 可视化组件
+sidebar:
+  nav: "zh_docs_sidebar"
+toc: true
+toc_label: 可视化组件
+toc_icon: "cog"
+last_modified_at: "2020-10-29"
+---
+
+可视化组件(Widget)是 Davinci 打造可视化应用的最小单元。依据数据视图(View)提供的数据模型对SQL结果进行二次聚合分组,然后将二次加工的数据进行可视化编码。
+
+## 1 设计原理
+
+可视化组件编辑器通过将数据视图中的原始 SQL 语句与数据模型进行组合,生成新的 SQL 语句到数据库中执行,拿到图表展示所需要的数据
+
+![设计原理](../../assets/images/widget/1.1.png)
+
+## 2 组件配置
+
+在数据视图列表页,点击右上角“+”按钮进入编辑器
+
+![图表配置1](../../assets/images/widget/2.1.png)
+
+编辑器共分为3个区域:
+- 左侧:数据模型展示区
+
+  在左上角选择了对应的数据视图(View)之后,会将所选视图的模型分类展示在下方,维度字段展示在“分类型”列表中,指标字段展示在“数值型”列表中。用户可拖拽字段到图表配置区“数据”页签对应的区域中
+
+- 中部:图表配置区
+
+  顶部用于选择驱动模式与图表类型,将鼠标移动到图表类型图标上会提示使用该图表需要的维度和指标数量
+  
+  下方有3个页签:
+
+  数据:用于添加图表所需的模型字段,用户通过拖拽数据模型展示区的字段来满足可视化展示需求
+
+  样式:图表样式配置
+
+  配置:功能性配置,如控制器、缓存
+
+- 右侧:图表展示区
+
+![图表配置2](../../assets/images/widget/2.2.png)
+
+### 2.1 驱动模式
+
+Davinci 支持两种可视化展示逻辑:透视驱动和图表驱动,用于支持不同的使用场景
+
+#### 2.1.1 透视驱动
+
+透视驱动是以[透视表](https://en.wikipedia.org/wiki/Pivot_table)为基础的可视化展示逻辑。图表可视为对透视表进行可视化编码,通过将透视表中的维度和指标转换为轴来做图形化展示。在透视驱动逻辑下,每个指标可以做不同的图形编码,在维度栏中最下层级的维度可以视为公用的维度轴
+
+透视驱动适用于少量数据在客户端的自由分析场景
+
+*目前透视驱动的配置项完善度不如图表驱动,我们会在未来逐步完善透视驱动的功能*
+
+#### 2.1.2 图表驱动
+
+图表驱动即为常规的、基于图表分类的可视化展示逻辑。图表驱动下的图表种类要丰富很多,维度和指标可视为固定配置项,与其他的样式配置一同服务于图表。
+
+图表驱动适用于大多数可视化展示场景
+
+### 2.2 数据配置
+
+用户需要拖拽数据模型展示区的字段到“数据”页签对应的区域中来完成图表展示所需的数据配置,字段可放置区域会高亮提示
+
+![数据配置](../../assets/images/widget/2.2.1.gif)
+
+#### 2.2.1 维度
+
+维度区域只能放置分类型字段,会对拖入的字段在 SQL 中进行分组
+
+#### 2.2.2 指标
+
+指标区域只能放置数值型字段,会对拖入的字段在 SQL 中进行聚合,目前支持以下6种聚合函数:
+1. 总计(sum)
+1. 平均数(avg)
+1. 计数(count)
+1. 去重计数(count_distinct)
+1. 最大值(max)
+1. 最小值(min)
+
+点击字段名称进行聚合函数选择
+
+![指标1](../../assets/images/widget/2.2.2.1.png)
+
+指标区域内的字段可以进行数值格式设置,目前支持以下格式:
+1. 默认格式
+1. 数值:可以设置小数位数、单位和启用千分位分隔符
+1. 货币:可以设置小数位数、单位、启用千分位分隔符和前/后缀文本
+1. 百分比:可以设置小数位数
+1. 科学型:可以设置小数位数
+
+![指标2](../../assets/images/widget/2.2.2.2.png)
+
+#### 2.2.3 筛选
+筛选区域支持任意类型字段,会对拖入的字段在 SQL 中进行条件过滤,支持固定值、条件和日期三种筛选方式
+- 固定值筛选:界面左侧会陈列出所选字段的值列表(distinct),用户通过选择左侧的内容到右侧进行固定值筛选
+
+![筛选1](../../assets/images/widget/2.2.3.1.png)
+
+- 条件筛选:用户可以在界面中自由配置所选字段的过滤条件,同时可以配置各个条件之间的“与”(and)“或”(or)关系,是最灵活的筛选方式
+
+![筛选2](../../assets/images/widget/2.2.3.2.png)
+
+
+- 日期筛选:支持所选字段的动态和固定时间范围筛选
+
+![筛选3](../../assets/images/widget/2.2.3.3.png)
+
+筛选区域中的字段会根据用户在数据视图中设置的可视化类型来选择性地展示对应的筛选方式
+- 字符和地理位置:固定值筛选和条件筛选
+- 数值:条件筛选
+- 日期:日期筛选
+
+#### 2.2.4 颜色
+
+颜色区域目前只能放置一个分类型字段,会对拖入的字段在 SQL 中进行分组。在图表展示上会根据所选字段值进行系列分组,可以通过图例来查看各个系列
+
+![颜色1](../../assets/images/widget/2.2.4.1.png)
+
+需要注意,诸如展示饼图时需要通过某个维度来进行分组,那么只需将这个字段拖拽到颜色区域即可
+
+![颜色2](../../assets/images/widget/2.2.4.2.png)
+
+#### 2.2.5 其他
+
+- 尺寸:用于散点图做节点大小编码,只能放置数值型字段,会对拖入的字段在 SQL 中进行聚合
+- 提示信息:仅部分直角坐标系图表支持,只能放置数值型字段,会对拖入的字段在 SQL 中进行聚合
+- 透视驱动下的图表标签需要拖拽字段指定,支持任意类型字段,会对拖入的分类型字段在 SQL 中进行分组、数值型字段在 SQL 中进行聚合
+- 透视驱动下的散点图需要额外指定x轴指标,只能放置数值型字段,会对拖入的字段在 SQL 中进行聚合
+- 图表驱动下的双Y轴图可以分别指定左右Y轴指标
+
+
+#### 2.2.6 通用设置
+##### 2.2.6.1 别名
+
+点击字段名称,选“字段设置”项,可进行字段别名设置。支持固定别名和动态别名设置
+
+动态别名通过编写 JavaScript 代码来生成,可以和变量一起使用,目前仅支持表格组件
+
+![别名1](../../assets/images/widget/2.2.6.1.1.png)
+
+内置了 JavaScript Moment 类库,可以结合变量动态生成日期别名
+
+![别名2](../../assets/images/widget/2.2.6.1.2.png)
+
+##### 2.2.6.2 描述
+
+点击字段名称,选“字段设置”项,可进行字段描述设置,目前仅在图表驱动的表格里作用
+
+![描述1](../../assets/images/widget/2.2.6.2.1.png)
+
+##### 2.2.6.3 排序
+
+点击字段名称,在“排序”项进行字段排序设置,目前支持:
+1. 默认,即不排序
+1. 升序,在 SQL 中以此字段升序
+1. 降序,在 SQL 中以此字段降序
+1. 自定义,仅分类型字段支持,用户可拖拽字段值决定展示顺序,**在浏览器端以用户自定义顺序排序**
+
+### 2.3 图表配置
+
+在选择完字段之后,可以点击图表配置区顶部的小图标来选择进行可视化编码的图表。鼠标移动到小图标上可以查看该图表展示的先决条件,当先决条件不满足时图标呈置灰状态且不可点击,满足后图标呈高亮状态,点击后右侧会展示图表
+
+![图表配置1](../../assets/images/widget/2.3.1.png)
+
+图表配置区下方“样式”页签中,用户可以对图表进行表单化配置,详情可以查看[图表配置](5.1-chart_config)附录
+
+Davinci 中使用的图表主要来自[echarts](https://www.echartsjs.com/)
+
+### 2.4 功能配置
+
+图表配置区下方“配置”页签中,用户可以配置控制器、参考线、展示数据量、缓存以及是否自动加载数据
+
+![功能配置1](../../assets/images/widget/2.4.1.png)
+
+#### 2.4.1 控制器
+
+组件控制器的配置过程和仪表板[全局控制器](2.4-dashboard#26-全局控制器)基本类似,除了不用关联图表;功能上也基本一致
+
+![控制器1](../../assets/images/widget/2.4.1.1.png)
+
+在仪表板中添加带有控制器的组件之后,可以点击组件左上角按钮打开控制器面板,选择内容之后,点击面板右下角查询按钮进行查询。组件控制器与全局控制的过滤条件对组件叠加生效
+
+![控制器2](../../assets/images/widget/2.4.1.2.png)
+
+#### 2.4.2 参考线
+
+可以给部分直角坐标系图表设置参考线和参考区间,目前仅支持折线图、柱状图、散点图和双Y轴图
+
+##### 2.4.2.1 参考线
+
+参考线需要关联到1个指标,数值可以选择关联指标的最大值、最小值、平均值,也可以选择手动设置常量值
+
+![参考线1](../../assets/images/widget/2.4.2.1.1.png)
+
+![参考线2](../../assets/images/widget/2.4.2.1.2.png)
+
+##### 2.4.2.2 参考区间
+
+参考区间需要设置起始值和结束值,每个值分别需要关联1个指标,数值可以选择关联指标的最大值、最小值、平均值,也可以选择手动设置常量值
+
+![参考区间1](../../assets/images/widget/2.4.2.2.1.png)
+
+![参考区间2](../../assets/images/widget/2.4.2.2.2.png)
+
+#### 2.4.3 展示数据量
+
+用于限制图表展示数据量
+
+![展示数据量](../../assets/images/widget/2.4.3.1.png)
+
+#### 2.4.4 缓存
+
+用户可以配置缓存的开启/关闭和有效期。开启缓存后,在可视化应用(Viz)中该组件首次查询会将结果存储到 redis 中,使用 SQL 语句作为 key。之后在缓存有效期内的、SQL 语句相同的查询将直接返回缓存结果,不再访问数据源
+
+缓存功能需要[配置redis](1.1-deployment#245-cache-配置可选)之后才可以正常使用
+
+#### 2.4.5 初始化加载
+
+在有些查询压力较大的场景下,用户不希望在打开仪表板时组件立即加载数据,可以设置“自动加载数据”项为否,默认情况为是。
+
+## 3 编辑器设置
+
+点击编辑器右上角的设置按钮可以设置查询触发模式和多选拖拽
+
+![编辑器设置](../../assets/images/widget/3.1.png)
+
+### 3.1 查询触发模式
+
+默认为立即触发,即拖拽字段到数据页签后立即查询并刷新右侧图表。如果数据视图的查询时间较长,可以尝试设置查询触发模式为手动来缓解数据库压力;设置为手动之后,图表配置区中间会显示一个查询按钮,拖拽字段不再触发查询,需要点击按钮触发
+
+![查询触发模式](../../assets/images/widget/3.1.1.png)
+
+### 3.2 多选拖拽
+
+有些场景下表格需要展示10个以上字段,在这种情况下多选拖拽可以很好地辅助编辑者工作
+
+![多选拖拽](../../assets/images/widget/3.2.1.gif)

+ 429 - 0
docs/_docs/zh/2.4-dashboard.md

@@ -0,0 +1,429 @@
+---
+layout: zh_single
+title: 仪表板
+sidebar:
+  nav: "zh_docs_sidebar"
+toc: true
+toc_label: 仪表板
+toc_icon: "cog"
+last_modified_at: "2020-10-29"
+---
+
+Davinci 提供了两个可视化应用(Viz),仪表板(Dashboard)是其中之一;仪表板提供自动布局和可交互能力,帮助用户快速打造可视化报表
+
+## 1 仪表板门户
+
+在可视化应用首页,点击“创建新 Dashboard”按钮来创建仪表板门户
+
+![仪表板门户1](../../assets/images/dashboard/1.1.png)
+
+制作中的仪表板门户可以选择“编辑”,这样对于[可视化应用模块只读权限的角色](3.4-project#32-权限设置)是不可见的
+
+![仪表板门户2](../../assets/images/dashboard/1.2.png)
+
+权限管理页签可以选择该仪表板门户对哪些[角色](3.3-role)可见
+
+![仪表板门户3](../../assets/images/dashboard/1.3.png)
+
+点击保存之后,可以看到刚才创建的仪表板门户卡片,编辑状态的仪表板门户卡片是置灰的;发布之后卡片会正常显示,卡片右上角有编辑和删除按钮
+
+![仪表板门户4](../../assets/images/dashboard/1.4.png)
+
+![仪表板门户5](../../assets/images/dashboard/1.5.png)
+
+点击卡片进入门户,门户页分为左右两部分,左侧展示仪表板菜单树,点击菜单上的仪表板名称,在右侧展示仪表板
+
+![仪表板门户6](../../assets/images/dashboard/1.6.png)
+
+点击左侧上方的“+”按钮弹出新建表单,可以选择新建仪表板或文件夹;与仪表板门户一样,在“权限管理”页签可以选择该仪表板/文件夹对哪些角色可见
+
+![仪表板门户7](../../assets/images/dashboard/1.7.png)
+
+![仪表板门户8](../../assets/images/dashboard/1.8.png)
+
+左侧菜单可以拖拽仪表板选择其所属文件夹;在仪表板数量较多的情况下还可以通过上方的搜索按钮快速定位仪表板
+
+![仪表板门户9](../../assets/images/dashboard/1.9.gif)
+
+鼠标移动到菜单项上在右侧会显示扩展按钮,可以点击扩展按钮对仪表板/文件夹进行编辑、移动和删除操作
+
+![仪表板门户10](../../assets/images/dashboard/1.10.png)
+
+## 2 功能介绍
+### 2.1 添加组件
+
+点击仪表板右上角的“+”按钮,弹出可视化组件列表,选择需要添加到该仪表板上的组件
+
+![添加组件1](../../assets/images/dashboard/2.1.1.png)
+
+下一步中指定组件数据更新模式,支持以下两种模式:
+1. 手动更新:通过点击组件右上角“同步数据”按钮更新数据
+1. 定时更新:根据所设置的更新时长定时自动轮询更新数据,时长单位为秒
+
+![添加组件2](../../assets/images/dashboard/2.1.2.png)
+
+![添加组件3](../../assets/images/dashboard/2.1.3.png)
+
+点击保存按钮后组件会添加到仪表板上
+
+![添加组件4](../../assets/images/dashboard/2.1.4.png)
+
+### 2.2 自动布局
+
+用户可以拽住组件右下角调整尺寸
+
+![自动布局1](../../assets/images/dashboard/2.2.1.gif)
+
+可以拽住组件标题调整位置
+
+![自动布局2](../../assets/images/dashboard/2.2.2.gif)
+
+在调整组件尺寸和位置时,其他组件会适应该组件变化进行流式布局
+
+仪表板可视区域宽度在 768 像素以上时组件会按照用户定义的比例进行显示,在 768 像素以下时会响应为移动端观看模式
+
+![自动布局3](../../assets/images/dashboard/2.2.3.gif)
+
+### 2.3 分享
+
+分享功能有普通分享、口令分享和授权分享3种,仪表板分享按钮在仪表板右上角左数第二个,组件分享按钮在组件右上角左数第四个
+
+![分享1](../../assets/images/dashboard/2.3.1.png)
+
+![分享2](../../assets/images/dashboard/2.3.2.png)
+
+#### 2.3.1 普通分享
+
+输入有效期后,点击生成分享链接,在任意浏览器打开链接即可查看分享页,分享页的数据权限与分享者一致
+
+![普通分享1](../../assets/images/dashboard/2.3.1.1.png)
+
+![普通分享2](../../assets/images/dashboard/2.3.1.2.png)
+
+#### 2.3.2 口令分享
+
+输入有效期后,点击生成分享链接和口令,在任意浏览器打开链接,需要输入正确口令才能查看分享页,分享页的数据权限与分享者一致
+
+![口令分享1](../../assets/images/dashboard/2.3.2.1.png)
+
+![口令分享2](../../assets/images/dashboard/2.3.2.2.png)
+
+#### 2.3.3 授权分享
+
+授权分享可以将仪表板分享给所属组织里的角色和成员,仅有授权的角色及成员登录后才能查看分享页
+
+在配置界面,可以选择想要授权的角色和成员,同样需要输入有效期;授权分享页的数据权限有2种,在配置界面可以选择
+
+1. 与分享者一致:分享页的数据权限与分享者一致
+2. 使用被分享者自身权限:授权用户登录进入分享页之后,看到的数据与他自身在组织、项目内的权限保持一致
+
+![授权分享1](../../assets/images/dashboard/2.3.3.1.png)
+
+![授权分享2](../../assets/images/dashboard/2.3.3.2.png)
+
+### 2.4 下载
+
+用户可以下载仪表板和可视化组件的明细数据 Excel 文件;仪表板下载按钮在仪表板右上角左数第三个,组件下载按钮在组件右上角左数第五个。
+
+![下载1](../../assets/images/dashboard/2.4.1.png)
+
+当用户下载的仪表板中包含多个组件时,将分不同 sheet 页存储各个组件的明细数据
+
+整个下载过程是异步的;点击下载按钮后,服务端生成下载任务,用户可以通过点击屏幕右上角云状按钮查看下载任务列表,当任务处理完毕之后,可以点击文件名称下载 Excel 文件
+
+![下载2](../../assets/images/dashboard/2.4.2.png)
+
+分享页下载流程也与上述一致
+
+### 2.5 联动
+
+仪表板中的组件之间可以配置联动关系,点击仪表板右上角左数第四个按钮打开配置面板
+
+![联动1](../../assets/images/dashboard/2.5.1.png)
+
+一个仪表板中可以配置多条联动关系,每条关系中包含一个触发器和一个联动图表,用户需要指定触发器与联动图表之间的字段对应关系
+
+触发器只能选择图表所用到的字段,联动图表可以选择数据视图模型中的任意字段和变量;触发器与联动图表所选的字段类型必须一致
+
+以下图为例,当添加了“学历年龄分布”组件作为触发器、其“education”字段作为输出条件,“城市薪水排名”作为联动图表、其“education”字段作为输入条件这样一条联动关系之后,点击“学历年龄分布”组件中的图表元素会根据输入的“education”内容对“城市薪水排名”中的数据做条件过滤
+
+![联动2](../../assets/images/dashboard/2.5.2.png)
+
+![联动3](../../assets/images/dashboard/2.5.3.png)
+
+![联动4](../../assets/images/dashboard/2.5.4.gif)
+
+通过配置多条联动关系,可以支持一个触发器联动多个图表,也支持多个触发器联动一张图表、过滤条件叠加生效;在配置界面右侧的关系图中可以一览联动关系
+
+![联动5](../../assets/images/dashboard/2.5.5.png)
+
+作为联动触发器的组件左上角有操作提示
+
+![联动6](../../assets/images/dashboard/2.5.6.png)
+
+### 2.6 全局控制器
+
+全局控制器能够支持用户对仪表板中的一个或多个组件做条件过滤或是变量输入;点击仪表板右上角最右侧按钮打开配置面板,面板左侧为控制器列表,右侧为配置表单
+
+![全局控制器1](../../assets/images/dashboard/2.6.1.png)
+
+#### 2.6.1 查询模式
+
+左下角可选择查询模式,默认为立即查询,即控制器值发生变化后立即触发关联图表进行查询,文本输入框、数字范围输入框在立即查询模式下需要敲回车键触发查询
+
+![查询模式1](../../assets/images/dashboard/2.6.1.1.png)
+
+手动查询模式时,全局控制器栏右侧会显示查询和重置两个按钮,只有点击查询按钮时会触发查询
+
+![查询模式2](../../assets/images/dashboard/2.6.1.2.png)
+
+#### 2.6.2 控制器配置
+
+点击列表上方的“+”按钮添加控制器,默认名称为“新建控制器”。鼠标移动到控制器名称上时右侧会显示编辑名称和删除按钮
+
+![全局控制器2](../../assets/images/dashboard/2.6.2.1.png)
+
+中上方选择控制器关联图表,勾选完之后在中下方选择关联数据视图的字段或变量。当控制器关联字段时,控制器的输入内容将作为关联字段的过滤条件作用到 SQL 中;当控制器关联变量时,控制器的输入内容将替换变量作用于 SQL 模板中
+
+右侧进行控制器及相关配置
+
+##### 2.6.2.1 通用配置
+
+- 缓存:下拉菜单、单选按钮和下拉树可以选择开启缓存来帮助加速获取选项值,此选项与可视化组件缓存一样需要[配置redis](1.1-deployment#245-cache-配置可选)之后才可以正常使用
+
+![通用配置1](../../assets/images/dashboard/2.6.2.1.1.png)
+
+- 是否可见:控制器默认常驻显示,可以选择隐藏和条件展示。目前条件展示仅支持关联下拉菜单,当关联下拉菜单所选值满足条件公式时,该控制器才会显示
+
+##### 2.6.2.2 下拉菜单
+
+![下拉菜单1](../../assets/images/dashboard/2.6.2.2.1.png)
+
+下拉菜单控制器只能关联维度字段
+
+选项取值目前支持3种模式
+
+- 自动关联:取值来源即为关联数据视图字段的值列表(distinct);如果关联多个数据视图,即为多个值列表的并集
+
+![下拉菜单2](../../assets/images/dashboard/2.6.2.2.2.png)
+
+- 手动关联:可以手动选择项目中任意数据视图字段供选项取值;文本字段为选项展示的内容,当不选择时,选项默认展示取值字段的值
+
+![下拉菜单3](../../assets/images/dashboard/2.6.2.2.3.png)
+
+- 自定义:如果不希望从数据视图字段中取值,可以自定义选项
+
+![下拉菜单4](../../assets/images/dashboard/2.6.2.2.4.png)
+
+![下拉菜单5](../../assets/images/dashboard/2.6.2.2.5.png)
+
+![下拉菜单6](../../assets/images/dashboard/2.6.2.2.6.png)
+
+点击加载之后,可以设置默认值,非必选
+
+![下拉菜单7](../../assets/images/dashboard/2.6.2.2.7.png)
+
+当开启多选配置时,需要注意,如果关联的是变量,多选选项最终会以诸如 `'选项1','选项2','选项3'` 的格式传递给变量,需要 SQL 语句改变为 `in ()` 语法来保证执行正确
+
+![下拉菜单8](../../assets/images/dashboard/2.6.2.2.8.png)
+
+##### 2.6.2.3 单选按钮
+
+![单选按钮1](../../assets/images/dashboard/2.6.2.3.1.png)
+
+单选按钮控制器的配置项与[下拉菜单](2.4-dashboard#2622-下拉菜单)基本一致,除了默认值为必选项
+
+##### 2.6.2.4 日期选择
+
+![日期1](../../assets/images/dashboard/2.6.2.4.1.png)
+
+日期选择控制器只能关联维度字段
+
+支持将所选日期转换为以下格式:
+- 日期(如 2019-01-01)
+- 日期时间(如 2019-01-01 12:00:00)
+- 日期时间分钟(如 2019-01-01 12:00)
+- 月(如 2019-01)
+- 周(如 2019-5周)
+- 年(如 2019)
+
+![日期2](../../assets/images/dashboard/2.6.2.4.2.png)
+
+默认值支持固定值和动态值,非必选
+
+![日期3](../../assets/images/dashboard/2.6.2.4.3.png)
+
+![日期4](../../assets/images/dashboard/2.6.2.4.4.png)
+
+日期控制器同样支持多选配置,在多选的情况下,日期格式将只支持“日期”、“月”、“年”三种,默认值只支持固定值;与[下拉菜单](2.4-dashboard#2622-下拉菜单)一样,在关联变量时也需要注意 SQL 语法问题
+
+##### 2.6.2.5 日期范围
+
+![日期范围1](../../assets/images/dashboard/2.6.2.5.1.png)
+
+日期范围控制器只能关联维度字段,支持格式与[日期控制器](2.4-dashboard#2624-日期选择)相同
+
+在关联变量时,日期范围控制器必须关联两个变量,用于做起始时间与截止时间输入
+
+默认值支持固定值和动态值,非必选
+
+![日期范围2](../../assets/images/dashboard/2.6.2.5.2.png)
+
+![日期范围3](../../assets/images/dashboard/2.6.2.5.3.png)
+
+##### 2.6.2.6 文本输入框
+
+![文本输入框1](../../assets/images/dashboard/2.6.2.6.1.png)
+
+文本输入框控制器只能关联维度字段,在[立即查询模式](2.4-dashboard#261-查询模式)下需要敲回车键触发查询
+
+支持固定默认值,非必填
+
+##### 2.6.2.7 数字范围输入框
+
+![数字范围输入框1](../../assets/images/dashboard/2.6.2.7.1.png)
+
+数字范围输入框控制器只能关联指标字段,在[立即查询模式](2.4-dashboard#264-查询模式)下需要敲回车键触发查询
+
+在关联变量时,数字范围输入框控制器必须关联两个变量,用于做起始与截止数值输入
+
+支持固定默认值,非必填
+
+##### 2.6.2.8 数字滑块
+
+![数字滑块1](../../assets/images/dashboard/2.6.2.8.1.png)
+
+数字滑块控制器只能关联指标字段,可以设置最大值、最小值和滑动步长
+
+在关联变量时,数字滑块控制器必须关联两个变量,用于做起始与截止数值输入
+
+默认值为必选项
+
+##### 2.6.2.9 下拉树
+
+![下拉树1](../../assets/images/dashboard/2.6.2.9.1.png)
+
+下拉树控制器只能关联维度字段
+
+选项取值需要手动关联数据视图、取值字段、父ID字段;文本字段为选项展示的内容,当不选择时,选项默认展示取值字段的值
+
+![下拉树2](../../assets/images/dashboard/2.6.2.9.2.png)
+
+点击加载之后,可以设置默认值,非必选
+
+当开启多选配置时,与[下拉菜单](2.4-dashboard#2622-下拉菜单)一样,在关联变量时也需要注意 SQL 语法问题
+
+#### 2.6.3 级联
+
+控制器之间可以通过拖拽的方式配置级联关系,当控制器之间为级联关系时,上级控制器的输入内容将作为下级控制器(下拉菜单)选项取值的过滤条件
+
+![级联1](../../assets/images/dashboard/2.6.3.1.gif)
+
+![级联2](../../assets/images/dashboard/2.6.3.2.gif)
+
+#### 2.6.4 分享页参数传递
+
+在分享页可以通过 URL 给全局控制器传递参数,具体格式如下
+
+`<分享页URL>&<控制器名称>=<值>`
+
+可以同时给多个控制器传参,控制器如预设了默认值会被参数值覆盖
+
+该功能可以配合[全局控制器](2.4-dashboard#26-全局控制器)隐藏一起使用,在分享页嵌入第三方系统展示时,可以通过这种方式传递参数并避免用户直接操作控制器
+
+![分享页参数传递1](../../assets/images/dashboard/2.6.4.1.png)
+
+#### 2.6.5 自定义选项关联变量
+
+ 如果需要使用单个下拉菜单传递不同的/多个变量值,这个功能会很有用处。参考如下场景,原始 SQL 中有3个 SQL 表达式类型变量,分别对不同字段内容进行控制,在仪表板中可以通过下拉菜单自定义选项关联变量来对多个变量值进行输入
+
+![自定义选项关联变量1](../../assets/images/dashboard/2.6.5.1.png)
+
+![自定义选项关联变量2](../../assets/images/dashboard/2.6.5.2.png)
+
+![自定义选项关联变量3](../../assets/images/dashboard/2.6.5.3.png)
+
+![自定义选项关联变量4](../../assets/images/dashboard/2.6.5.4.png)
+
+![自定义选项关联变量5](../../assets/images/dashboard/2.6.5.5.png)
+
+以上场景仅为举例,实际使用中可以合理利用该功能满足更有意义的数据呈现需求
+
+### 2.7 同步数据(更新缓存)
+
+当可视化组件需要获取最新数据时,点击组件右上角左数第一个按钮可以触发查询;如果组件开启了缓存,点此按钮可以更新缓存
+
+![同步数据1](../../assets/images/dashboard/2.7.1.png)
+
+### 2.8 全屏展示
+
+点击组件右上角左数第三个按钮可打开全屏模式展示图表
+
+![全屏展示1](../../assets/images/dashboard/2.8.1.png)
+
+### 2.9 自由钻取
+
+仪表板中部分图表类型支持自由[钻取](https://en.wikipedia.org/wiki/Data_drilling);Davinci 中自由钻取的基本逻辑是:先点击图表元素进行条件过滤,然后点击鼠标右键选择维度进行钻取
+
+以下图为例,用户选择“上海”、“深圳”、“广州”三项图表元素,钻取到“education”字段,此时图表的展示逻辑是:上海、深圳、广州三个城市的教育程度与薪水分布图
+
+![自由钻取1](../../assets/images/dashboard/2.9.1.gif)
+
+可视化组件左下角会展示图表的钻取路径,用户可以选择之前任意一级路径返回
+
+![自由钻取2](../../assets/images/dashboard/2.9.2.gif)
+
+支持自由钻取的组件在左上角有操作提示
+
+![自由钻取3](../../assets/images/dashboard/2.9.3.png)
+
+需要注意,作为[联动](2.4-dashboard#25-联动)触发器的图表将无法进行自由钻取操作
+
+自由钻取在透视驱动与图表驱动模式下有一定的区别
+
+#### 2.9.1 透视驱动
+
+透视驱动下的自由钻取,是在条件过滤的基础上,在透视表中增加/减少维度来观察数据变化
+
+在透视表中,可以选择钻取方式为上卷或下钻,上卷即为去掉该维度,下钻即为增加该维度;同时透视表中可以选择钻取到行或列
+
+![透视驱动1](../../assets/images/dashboard/2.9.1.1.gif)
+
+#### 2.9.2 图表驱动
+
+在图表驱动下,表格的自由钻取逻辑与透视表类似;其他图表是在条件过滤的基础上,将钻取的维度对图表中现有维度进行替换,以另一个维度观察数据变化
+
+目前图表驱动中支持自由钻取的图表类型有
+- 表格
+- 柱状图
+- 折线图
+- 散点图
+- 饼图
+- 漏斗图
+- 双Y轴图
+
+### 2.10 组件设置
+
+#### 2.10.1 编辑组件
+
+需要编辑组件时,可点击组件右上角左数第二个按钮快捷进入组件编辑界面
+
+![编辑组件1](../../assets/images/dashboard/2.10.1.1.png)
+
+#### 2.10.2 设置组件别名
+
+点击组件右上角扩展按钮,点击基本信息,在弹出的面板中,可以设置组件别名,设置的别名将会在该仪表板中替代原始名称进行展示
+
+![设置组件别名1](../../assets/images/dashboard/2.10.2.1.png)
+
+![设置组件别名2](../../assets/images/dashboard/2.10.2.2.png)
+
+![设置组件别名3](../../assets/images/dashboard/2.10.2.3.png)
+
+#### 2.10.3 修改组件基本信息
+
+在基本信息面板中,还可以编辑组件数据更新模式
+
+#### 2.10.4 删除组件
+
+点击组件右上角扩展按钮,选择删除并确认,将会从仪表板中删除该组件

+ 190 - 0
docs/_docs/zh/2.5-display.md

@@ -0,0 +1,190 @@
+---
+layout: zh_single
+title: 大屏
+sidebar:
+  nav: "zh_docs_sidebar"
+toc: true
+toc_label: 大屏
+toc_icon: "cog"
+last_modified_at: "2020-10-29"
+---
+
+大屏(Display)是 Davinci 提供的第二个可视化应用,提供自由布局和自定义样式能力,通过可视化组件和一系列内置辅助图形来打造视觉呈现丰富的可视化大屏
+
+大屏的定位与仪表板不一样,仪表板倾向于快速打造可视化报表,而大屏通常被广泛用于静置或滚动观看和演示的场景,因此大屏的制作过程通常需要比仪表板花更多的时间,需要用户准备素材(如背景图)来丰富大屏的样式
+
+## 1 新建大屏
+
+在可视化应用首页,点击“创建新 Display”按钮来创建大屏
+
+![新建大屏1](../../assets/images/display/1.1.png)
+
+与仪表板一样,制作中的大屏可以选择“编辑”,这样对于[可视化应用模块只读权限的角色](3.4-project#32-权限设置)是不可见的
+
+权限管理页签可以选择该大屏对哪些[角色](3.3-role)可见
+
+![新建大屏2](../../assets/images/display/1.2.png)
+
+点击保存之后,可以看到刚才创建的大屏卡片,编辑状态的大屏卡片是置灰的;发布之后卡片会正常显示,卡片右上角有编辑、复制和删除按钮
+
+![新建大屏3](../../assets/images/display/1.3.png)
+
+## 2 编辑器
+
+点击大屏卡片进入编辑器,编辑器顶部左右分别为标题区和工具区,下方左侧为大屏页目录,中间是大屏主编辑区,右侧依次包含画布、图层列表和参数配置表单
+
+![编辑器1](../../assets/images/display/2.1.png)
+
+### 2.1 大屏页
+
+每个大屏可以有多张大屏页,工具栏左侧为大屏页目录,点击目录切换大屏页,内容会展示到编辑区
+
+#### 2.1.1 添加大屏页
+
+点击工具栏添加大屏页按钮,会在当前编辑中大屏页之后添加一张新大屏页
+
+#### 2.1.2 目录操作
+
+在左侧目录可以进行如下操作:
+
+1. 打开右键菜单,可以将该大屏页截图设为大屏封面(前提是该大屏页已[设置封面](2.5-display#232-底部栏)),以及删除大屏页
+
+![目录操作1](../../assets/images/display/2.0.2.1.png)
+
+2. 拖拽大屏页改变顺序
+
+#### 2.1.3 删除大屏页
+
+在目录中打开右键菜单,或是在目录中选择大屏页后按 `Delete` 键,都可以删除大屏页
+
+### 2.2 工具栏
+
+工具栏共有6组按钮:
+- 添加大屏页
+- 大屏设置
+- 组件与辅助图形:选择要展示在画布中的组件和辅助图形
+- 操作键:用于对画布图层的功能操作
+- 预览
+- 分享
+
+#### 2.2.1 大屏设置
+
+点击大屏设置按钮打开全局设置面板,可以设置以下内容
+1. 全局播放设置
+2. 全局动画设置
+
+这两个是对于大屏最终展现而设置的
+
+播放设置说明了屏与屏之间应该怎样切换(自动或手动)。当选择自动播放时,该间隔时间(秒)参数需要指定;当取消自动播放时,则由用户通过键盘左右键或者点击大屏中的左右箭头进行手动切换屏
+
+动画设置说明了屏与屏之间切换的动画效果以及过度动画的速度
+
+3. 拖动栅格设置
+
+对于一个大屏页,有长高像素参数。在设计时,为方便布局以及规整,往往将大屏横纵方向分别切成若干个块来进行设计。出于此,栅格设置提供了 x 轴 y 轴方向的最小单位拖动像素大小,设置的值与大屏设计稿结合,可加快大屏的编辑,免去细微像素的计算麻烦
+
+![大屏设置1](../../assets/images/display/2.1.0.1.png)
+
+#### 2.2.2 添加组件
+
+点击 Widgets 按钮会弹出可视化组件列表,点击组件卡片进行选择;在下一步中指定组件数据刷新模式,支持以下两种模式:
+1. 手动刷新:通过点击组件右上角“同步数据”按钮更新数据
+1. 定时刷新:根据所设置的更新时长定时自动轮询更新数据,时长单位为秒
+
+![添加组件1](../../assets/images/display/2.1.1.1.png)
+
+![添加组件2](../../assets/images/display/2.1.1.2.png)
+
+点击保存按钮后,所选组件会添加到画布图层中
+
+拖动图层更改位置,鼠标拖拽图层右下角更改大小
+
+![添加组件3](../../assets/images/display/2.1.1.3.png)
+
+#### 2.2.3 添加辅助图形
+
+点击辅助图形下拉列表,可以看到目前支持的4种辅助图形:
+- 矩形:支持设置背景颜色、背景图片和边框,一般用于给组件做背景修饰
+- 标签:用于做文本展示,双击进行编辑
+- 视频:支持播放在线视频
+- 时间器:展示一个动态变化的时钟
+
+![添加辅助图形1](../../assets/images/display/2.1.2.1.png)
+
+点击列表项即可添加辅助图形到画布中
+
+#### 2.2.4 操作键
+
+操作键有复制、粘贴2个按钮,其中复制、粘贴和删除按钮支持多选图层后批量操作
+
+上述操作键同时也支持通过键盘快捷键控制,和我们平时使用的快捷键一致
+
+| 功能 | Mac 快捷键 | Windows 快捷键 |
+| - | - | - |
+| 复制/粘贴 | `Cmd + C` / `Cmd + V` | `Ctrl + C`/ `Ctrl + V` |
+| 删除 | `Delete` | Backspace |
+
+#### 2.2.5 预览与分享
+
+制作完成大屏之后,可以点击预览按钮进行预览;分享功能则与[仪表板分享](2.4-dashboard#23-分享)一致,有普通分享、口令分享和授权分享
+
+### 2.3 编辑区
+#### 2.3.1 画布
+
+组件和辅助图形添加到画布后可视为画布中的图层,用户可以在画布中通过拖拽编辑图层的尺寸和位置;为辅助对图层定位,在编辑图层时,图层顶部会实时显示当前位置,画布会显示相应的辅助线来帮助用户对齐图层
+
+![画布1](../../assets/images/display/2.2.1.1.gif)
+
+![画布2](../../assets/images/display/2.2.1.2.gif)
+
+在画布中按住 `Cmd` 或 `Alt` 键点击图层可以批量选中,然后进行复制、删除和对齐等操作
+
+![画布4](../../assets/images/display/2.2.1.4.png)
+
+对于选中图层,可以使用键盘方向键对图层位置进行微调
+
+另外对于画布中的组件,可以点击右上角的编辑按钮进入组件编辑界面
+
+点击画布中的空白区域,可以去掉对图层的选中状态
+
+#### 2.3.2 底部栏
+
+画布的底部栏的左下角是截图按钮,当前大屏页编辑完毕之后,可点击按钮生成缩略图,生成成功之后,我们发现左侧大屏列表中改大屏页的缩略图已经更新
+
+右下角的滑块可以对画布进行缩放,辅助用户编辑局部样式
+
+![画布3](../../assets/images/display/2.2.1.3.gif)
+
+#### 2.3.3 图层列表
+
+用户可以在图层列表编辑以下操作:
+- 选择图层:点击列表项可以让画布中的图层处于被选中状态
+- 批量选中图层:按住 `Cmd` 或 `Alt` 键点击图层列表项可以批量选中图层
+- 编辑图层 Z 轴位置:选择图层之后,可以点击图层列表顶部的按钮改变图层 Z 轴位置
+
+#### 2.3.4 配置表单
+
+默认状态下,配置表单中显示画布配置项,其中包括:
+- 屏幕尺寸:用户可根据实际展示大屏设备设置画布尺寸
+- 背景
+  - 背景颜色
+  - 背景图片
+- 播放设置
+  - 我们在 2.1.1 中的“全局播放设置”是对于所有大屏页播放的默认设置,在这里也是默认“跟随全局”的,可以通过取消勾选个性化设置当前大屏页的自动播放以及停留时间(秒)
+- 过渡动画
+  - 与“播放设置”设置原理相同
+- 缩放方式:
+  - 等比缩放宽度:画布宽度与显示终端宽度一致,高度等比缩放
+  - 等比缩放高度:画布高度与显示终端高度一致,宽度等比缩放
+  - 全屏铺满:画布宽、高皆与显示终端一致,此时画布有可能变形
+  - 实际尺寸
+
+在图层处于选中状态时,配置表单中显示图层配置项,其中包括:
+- 尺寸
+- 位置
+- 背景色
+- 边框
+- 数据刷新模式
+- 特有配置
+
+在批量选中图层时,配置表单中显示图层对齐方式

+ 72 - 0
docs/_docs/zh/2.6-schedule.md

@@ -0,0 +1,72 @@
+---
+layout: zh_single
+title: 定时任务
+sidebar:
+  nav: "zh_docs_sidebar"
+toc: true
+toc_label: 定时任务
+toc_icon: "cog"
+last_modified_at: "2020-10-29"
+---
+
+定时任务(Schedule)功能支持用户对已制作完成的可视化应用配置定时事件,目前支持邮件和企业微信
+
+邮件功能需要正确[配置邮箱](1.1-deployment#243-mail-配置)才能正常使用
+
+## 1 新建定时任务
+
+在定时任务列表页,点击右上角“+”按钮进入新建表单页
+
+![新建定时任务1](../../assets/images/schedule/1.1.png)
+
+新建表单页分为3部分:
+- 基本设置:任务名称、类型、描述、定时任务生效时间范围和执行周期
+- 各类定时任务的私有设置
+- 发送内容设置:选择要在邮件中发送的仪表板/大屏,可多选
+  - 其中部分选择大屏页时,鼠标悬浮在大屏页图标上时,若该大屏有缩略图,则会悬浮显示,方便用户的勾选
+
+![新建定时任务2](../../assets/images/schedule/1.2.png)
+
+![新建定时任务3](../../assets/images/schedule/1.3.gif)
+
+点击保存定时任务配置
+
+### 1.1 邮件
+
+邮件类型定时任务的设置有:
+
+- 邮件主题
+- 文件类型:
+  - 图片:附件及邮件正文中添加所选仪表板/大屏截图,可以设置图片宽度,高度为自适应
+  - Excel:附件中添加所选仪表板/大屏明细数据 Excel 文件,其中每个组件对应一个 sheet 页
+  - 图片 + Excel
+- 收件人:支持多人,输入 Davinci 系统用户邮箱前缀时会有列表提示
+- 抄送、密送:支持多人
+- 内容:邮件正文,可富文本编辑,支持插入图片
+
+### 1.2 企业微信
+
+企业微信类型定时任务的设置有:
+
+- 机器人webhook地址:企业微信群聊机器人的 webhook 地址
+- 文件类型:同邮件一致
+
+## 2 执行定时任务
+
+回到定时任务列表,可以看到刚创建的定时任务状态为“new”
+
+![执行定时任务1](../../assets/images/schedule/2.1.png)
+
+点击操作列左数第一个按钮执行/暂停定时任务,
+
+![执行定时任务2](../../assets/images/schedule/2.2.png)
+
+## 3 立即执行定时任务
+
+点击操作列左数第二个按钮可以立即执行定时任务一次,不受有效时间范围限制
+
+![立即执行定时任务1](../../assets/images/schedule/3.1.png)
+
+## 4 编辑和删除定时任务
+
+操作列中还可以对定时任务进行编辑和删除操作,需要注意,执行中的定时任务无法编辑与删除

+ 43 - 0
docs/_docs/zh/3.1-organization.md

@@ -0,0 +1,43 @@
+---
+layout: zh_single
+title: 组织
+sidebar:
+  nav: "zh_docs_sidebar"
+toc: true
+toc_label: 组织
+toc_icon: "cog"
+last_modified_at: "2019-08-20"
+---
+
+组织是 Davinci 多租户体系的基本单元。每个组织内可以创建多个项目和角色,可以邀请其他用户加入组织。组织内部通过项目(资源)/ 用户 / 角色构成基本的 [RBAC](https://en.wikipedia.org/wiki/Role-based_access_control) 模型来进行权限管理。每位 Davinci 用户都可以通过创建不同的组织来对不同的项目和用户进行管理。
+
+点击导航栏右上角的用户图标 -> 用户设置进入个人页,点击左侧二级菜单“我的组织”即可进入组织列表页,用户创建的组织和受邀参与的组织都会显示在列表上。
+![组织入口1](../../assets/images/organization/0.1.png)
+![组织入口2](../../assets/images/organization/0.2.png)
+
+## 1 创建组织
+
+在组织列表页,点击右上角“+”按钮会弹出创建组织表单
+![创建组织1](../../assets/images/organization/1.1.png)
+
+创建成功之后,新创建的组织会显示在组织列表上;点击列表上的组织名称可以进入到组织详情页。
+
+## 2 项目、成员与角色
+
+组织详情页共有4个页签,分别是项目列表、成员列表、角色列表和设置页。
+![项目成员角色1](../../assets/images/organization/2.1.png)
+![项目成员角色2](../../assets/images/organization/2.2.png)
+![项目成员角色3](../../assets/images/organization/2.3.png)
+
+## 3 组织设置
+
+在组织设置页,组织拥有者可以
+- 更换组织图标
+- 编辑组织名称和描述
+- 设置成员创建项目权限
+  - 当设为“禁止”时,普通成员不可以创建项目
+- 设置成员对项目的可见权限
+  - 当设为“之可见公开”时,普通成员可以看到公开项目和自己所在角色参与的授权项目
+  - 当设为“不可见任何”时,普通成员只能看到自己所在角色参与的授权项目
+- 删除组织
+![组织设置1](../../assets/images/organization/3.1.png)

+ 40 - 0
docs/_docs/zh/3.2-member.md

@@ -0,0 +1,40 @@
+---
+layout: zh_single
+title: 成员
+sidebar:
+  nav: "zh_docs_sidebar"
+toc: true
+toc_label: 成员
+toc_icon: "cog"
+last_modified_at: "2020-10-29"
+---
+
+参与组织的用户都是组织成员。组织成员有两种类型:
+- 拥有者:可视为组织管理员,拥有以下权限
+  - 创建、编辑和删除项目
+  - 邀请和移除成员,改变成员类型
+  - 创建、编辑和删除角色,给成员关联角色
+  - 给项目关联角色,分配角色在项目中的权限
+  - 添加和移除项目管理员
+  - 编辑组织设置
+  - 默认拥有所有项目管理员权限
+- 普通成员:
+  - 在关联角色之后,拥有所关联角色在项目中的权限
+  - 可以被指定为项目管理员,拥有所指定项目的最大权限
+
+## 1 添加成员
+
+在成员页签,点击右侧的“+”按钮弹出成员邀请框。**只能邀请已登录过的用户**加入组织,可输入用户名 / 邮箱 / 用户姓名进行搜索,可以选择是否需要邮件确认
+![添加成员1](../../assets/images/member/1.1.png)
+
+点击“邀请成员”后,系统会发送邀请邮件到受邀用户邮箱,受邀用户需要点击邮箱中的确认按钮并登录确认。
+
+## 2 成员设置
+
+普通成员可以查看组织中其他成员的角色列表
+
+![成员设置1](../../assets/images/member/2.1.png)
+
+组织拥有者可以改变成员类型和移除成员
+![成员设置2](../../assets/images/member/2.2.png)
+![成员设置3](../../assets/images/member/2.3.png)

+ 29 - 0
docs/_docs/zh/3.3-role.md

@@ -0,0 +1,29 @@
+---
+layout: zh_single
+title: 角色
+sidebar:
+  nav: "zh_docs_sidebar"
+toc: true
+toc_label: 角色
+toc_icon: "cog"
+last_modified_at: "2019-08-20"
+---
+
+一个组织内可以创建多个角色,用户可以按照自己的习惯给角色赋予意义,当角色与项目进行关联之后,便可以设置该角色在该项目中的功能权限与可视化权限;同时,与此角色关联的用户在项目里将拥有该角色的权限。
+
+如果同一个用户关联了多个角色,在一个项目中又同时关联了这多个角色,那么用户在该项目中拥有权限将是这多个角色权限的并集。
+
+## 1 添加角色
+
+点击角色页签右侧的“+”按钮弹出创建角色表单
+![添加角色1](../../assets/images/role/1.1.png)
+
+## 2 关联成员
+
+点击列表操作栏中“关联成员”弹出关联成员穿梭框,移动到穿梭框右侧的成员在保存后将与该角色进行关联
+![关联成员1](../../assets/images/role/2.1.png)
+![关联成员2](../../assets/images/role/2.2.png)
+
+## 3 角色设置
+组织拥有者可以编辑和删除角色
+![角色设置1](../../assets/images/role/3.1.png)

+ 65 - 0
docs/_docs/zh/3.4-project.md

@@ -0,0 +1,65 @@
+---
+layout: zh_single
+title: 项目
+sidebar:
+  nav: "zh_docs_sidebar"
+toc: true
+toc_label: 项目
+toc_icon: "cog"
+last_modified_at: "2019-08-20"
+---
+
+项目可以看做一组完整的可视化功能单元。Davinci 通过项目来对可视化功能(资源)来进行划分。一个项目中包含 Source(数据源)、View(数据视图)、Widget(可视化组件)、Viz(可视化应用)、Schedule(定时任务)5个功能模块,用户通过正确使用这些功能就可以打造自己的可视化应用。
+
+关于功能模块的使用请回到 [功能详解](2.1-source) 进行了解。
+
+## 1 创建项目
+
+在项目页签,点击右侧的“+”按钮弹出创建项目表单
+![创建项目1](../../assets/images/project/1.1.png)
+
+当可见选“公开”时,任何组织成员都可以看到该项目,并拥有项目 Viz 模块的只读权限;选“授权”时,只有该项目所关联角色关联的成员才能看到项目。
+
+## 2 项目设置
+
+点击项目名称下方的“齿轮”按钮弹出项目设置弹窗
+![项目设置1](../../assets/images/project/2.1.png)
+![项目设置2](../../assets/images/project/2.2.png)
+
+在基础设置中,组织拥有者可以:
+- 编辑项目的名称和描述
+- 更改项目可见性
+- 移交项目:用户可以将项目归属权移交给另一个**自己所在的组织**,需要注意的是,如果用户在另一个组织里不是拥有者,项目移交过去之后用户将不再拥有项目的管理权限。除了在这里,还可以在首页点击项目卡片右上角的小图标来移交项目
+- 删除项目
+
+## 3 角色权限设置
+在项目设置里,组织拥有者可以管理项目与组织内角色的关联关系,并可以设置所关联角色在项目里的功能权限与可视化权限。
+
+### 3.1 关联角色
+
+在角色管理菜单,点击右侧的“关联角色”按钮弹出关联角色穿梭框,移动到穿梭框右侧的角色在保存后将与项目进行关联
+![项目设置1](../../assets/images/project/3.1.1.png)
+![项目设置1](../../assets/images/project/3.1.2.png)
+
+### 3.2 权限设置
+
+关联成功后,点击角色列表设置栏中的“权限设置”按钮弹出权限设置面板,面板中分为功能权限和可视化权限。
+
+![权限设置1](../../assets/images/project/3.2.1.png)
+![权限设置2](../../assets/images/project/3.2.2.png)
+
+#### 3.2.1 功能权限
+功能权限中除了基础的 5 个功能模块之外,还有包括分享和下载权限的设置。基础功能权限选项的意义如下:
+- 隐藏:该功能模块对角色不可见
+- 只读:角色仅拥有该功能模块的访问权限
+- 修改:角色拥有该功能模块的访问、编辑权限
+- 删除:角色拥有该功能模块的访问、新增、编辑和删除权限
+
+#### 3.2.2 可视化权限
+可视化权限可以管理仪表板和大屏包括所有子项的展示权限。可视化权限除了在这里设置之外,还可以在创建[仪表板](2.4-dashboard)和[大屏](2.5-display)时进行设置。
+
+## 4 管理员设置
+
+在管理员设置菜单,点击右侧的“添加管理员”按钮弹出添加管理员穿梭框,移动到穿梭框右侧的成员在保存后将成为项目管理员,拥有项目最大权限
+![管理员设置1](../../assets/images/project/4.1.png)
+![管理员设置2](../../assets/images/project/4.2.png)

+ 20 - 0
docs/_docs/zh/3.5-user_setting.md

@@ -0,0 +1,20 @@
+---
+layout: zh_single
+title: 用户设置
+sidebar:
+  nav: "zh_docs_sidebar"
+toc: true
+toc_label: 用户设置
+toc_icon: "cog"
+last_modified_at: "2019-08-20"
+---
+
+## 1 个人信息
+
+点击导航栏右上角的用户图标 -> 用户设置进入个人信息页,在个人信息页可以编辑姓名、描述和部门
+![个人信息1](../../assets/images/user/1.1.png)
+
+## 2 修改密码
+
+点击左侧二级菜单“修改密码”可进入修改密码页
+![修改密码1](../../assets/images/user/2.1.png)

+ 37 - 0
docs/_docs/zh/3.6-reset_password.md

@@ -0,0 +1,37 @@
+---
+layout: zh_single
+title: 重置密码
+sidebar:
+  nav: "zh_docs_sidebar"
+toc: true
+toc_label: 重置密码
+toc_icon: "cog"
+last_modified_at: "2020-10-29"
+---
+
+当忘记密码时,可以在登录页找到“忘记密码?”链接
+
+![描述1](../../assets/images/reset_password/0.0.png)
+
+点击进入后,可以选择通过邮件重置和通过用户名重置两种方式
+
+## 1 通过邮件重置
+
+输入邮箱后,一封确认邮件会发到邮箱里
+
+![通过邮件重置1](../../assets/images/reset_password/1.1.png)
+
+![通过邮件重置2](../../assets/images/reset_password/1.2.png)
+
+点击下一步,输入新密码和邮件中的验证码,就可以重置密码了
+
+![通过邮件重置3](../../assets/images/reset_password/1.3.png)
+
+
+## 2 通过用户名重置
+
+输入用户名后,一封确认邮件会发到该用户关联的邮件
+
+![通过邮件重置1](../../assets/images/reset_password/2.1.png)
+
+点击下一步,输入新密码和邮件中的验证码,就可以重置密码了

+ 89 - 0
docs/_docs/zh/4.1-statistic.md

@@ -0,0 +1,89 @@
+---
+layout: zh_single
+title: 使用统计
+sidebar:
+  nav: "zh_docs_sidebar"
+toc: true
+toc_label: 使用统计
+toc_icon: "cog"
+last_modified_at: "2019-08-20"
+---
+
+使用统计会记录用户在可视化应用中的使用数据以及登录终端信息,在使用之前请确保在服务器配置中[开启使用统计](1.1-deployment#246-使用统计配置)
+
+默认配置下,统计数据会记录到  `davinci_statistic_visitor_operation`  
+`davinci_statistic_duration`  
+`davinci_statistic_terminal`  
+三张表中,以下是这三张表的字段详情
+
+## 1 可视化应用操作记录表
+
+davinci_statistic_visitor_operation
+
+| 字段 | 描述 |
+| - | - |
+| id | ID |
+| user_id | 用户ID |
+| email | 用户邮箱 |
+| action | 用户操作(见附录) |
+| org_id | 组织ID |
+| project_id | 项目ID |
+| project_name | 项目名称 |
+| viz_type | 应用类型:dashboard / display |
+| viz_id | 应用ID |
+| viz_name | 应用名称 |
+| sub_viz_id | 子应用ID |
+| sub_viz_name | 子应用名称 |
+| widget_id | 组件ID |
+| widget_name | 组件名称 |
+| filters | 过滤参数 |
+| variables | 变量参数 |
+| groups | 分组参数 |
+| create_time | 创建时间 |
+
+### 1.1 附录
+
+| 用户操作 | 描述 |
+| - | - |
+| login | 登录 |
+| visit | 访问应用 |
+| initial | 初始化查询 |
+| sync | 同步数据 |
+| search | 控制器查询 |
+| linkage | 联动查询 |
+| drill | 钻取查询 |
+| download | 下载 |
+| print | 打印 |
+
+## 2 用户使用时长记录表
+
+davinci_statistic_duration
+
+| 字段 | 描述 |
+| - | - |
+| id | ID |
+| user_id | 用户ID |
+| email | 用户邮箱 |
+| start_time | 开始时间 |
+| end_time | 结束时间 |
+
+## 3 登录终端信息记录表
+
+davinci_statistic_terminal
+
+| 字段 | 描述 |
+| - | - |
+| id | ID |
+| user_id | 用户ID |
+| email | 用户邮箱 |
+| browser_name | 浏览器名称 |
+| browser_version | 浏览器版本 |
+| engine_name | 内核名称 |
+| engine_version | 内核版本 |
+| os_name | 操作系统名称 |
+| os_version | 操作系统版本 |
+| device_model | 设备型号 |
+| device_type | 设备类型 |
+| device_vendor | 设备供应商 |
+| cpu_architecture | CPU架构 |
+| create_time | 创建时间 |

+ 269 - 0
docs/_docs/zh/5.1-chart_config.md

@@ -0,0 +1,269 @@
+---
+layout: zh_single
+title: 图表配置
+sidebar:
+  nav: "zh_docs_sidebar"
+toc: true
+toc_label: 图表配置
+toc_icon: "cog"
+last_modified_at: "2019-08-20"
+---
+
+## 1 透视表
+
+[透视表](https://en.wikipedia.org/wiki/Pivot_table)支持常规的数据透视、行列转换,还可以使用颜色给指标分组
+
+![透视表1](../../assets/images/chart_config/1.1.gif)
+
+如果需要按名称将指标值分开展示,可以使用“指标名称”字段
+
+![透视表2](../../assets/images/chart_config/1.2.png)
+
+当有多个指标需要进行不同图表展示时,可以点击指标左侧进行图表切换
+
+![透视表3](../../assets/images/chart_config/1.3.gif)
+
+## 2 表格
+
+表格是基于[Ant Design](https://ant.design/components/table-cn/)的表格组件做的封装,样式上支持如下配置:
+- 表头样式配置
+- 合并多级表头、二级以上表头顺序调整
+- 固定表头
+- 列样式配置
+- 列排序
+- 列样式条件判断
+- 左、右固定列
+- 行大小与边框
+- 合并维度列中相同内容
+- 分页
+- 使用原始数据
+
+其中列样式条件判断目前支持根据预设条件改变单元格背景色、字体和条形图,可以多条件叠加生效
+
+![表格1](../../assets/images/chart_config/2.1.png)
+
+当选择使用原始数据之后,Davinci 将**不再**对维度列做分组、指标列做聚合,而是展示数据视图中 SQL 执行后返回的明细数据
+
+*注意:合并列命名后需要回车确认*
+
+## 3 翻牌器
+
+翻牌器展示不需要维度,可以设置1-3个指标。支持对指标字体、前后缀文字进行设置。展示形式固定,文字大小会随组件在仪表板或大屏中的尺寸发生变化
+
+![翻牌器](../../assets/images/chart_config/3.png)
+
+## 4 折线图
+
+[折线图](https://en.wikipedia.org/wiki/Line_chart)展示需要1个维度、1个或多个指标
+
+![折线图](../../assets/images/chart_config/4.png)
+
+样式上支持如下配置:
+- 线条平滑或阶梯展示
+- 坐标轴
+- 标签
+- 图例
+- 分隔线
+
+## 5 柱状图
+
+[柱状图](https://en.wikipedia.org/wiki/Bar_chart)展示有两种模式:
+- 常规:1个维度、1个到多个指标
+- 指标对比:0个维度,2个到多个指标
+
+![柱状图](../../assets/images/chart_config/5.png)
+
+样式上支持如下配置:
+- 条形图(90度翻转)
+- 堆叠
+  - 指标自由分组
+  - 百分比显示
+  - 总计
+- 柱条样式
+- 坐标轴
+- 标签
+- 图例
+- 分隔线
+
+## 6 散点图
+
+[散点图](https://en.wikipedia.org/wiki/Scatter_plot)展示需要0个到多个维度、2个指标
+
+![散点图](../../assets/images/chart_config/6.png)
+
+样式上支持如下配置:
+- 坐标轴
+- 标签
+- 图例
+- 分隔线
+
+## 7 饼图
+
+[饼图](https://en.wikipedia.org/wiki/Pie_chart)展示有两种模式:
+- 常规:1个指标,并使用维度做颜色分组
+- 指标对比:2个到多个指标进行对比
+
+![饼图](../../assets/images/chart_config/7.png)
+
+样式上支持如下配置:
+- 环形图
+- 南丁格尔玫瑰图
+- 标签
+- 图例
+
+## 8 漏斗图
+
+[漏斗图](https://en.wikipedia.org/wiki/Funnel_chart)展示有两种模式:
+- 常规:1个指标,并使用维度做颜色分组
+- 指标对比:2个到多个指标进行对比
+
+样式上支持如下配置:
+- 排序
+- 间距与对齐
+- 标签
+- 图例
+
+## 9 雷达图
+
+[雷达图](https://en.wikipedia.org/wiki/Radar_chart)展示有两种模式:
+- 常规:1个维度、1个到多个指标
+- 指标对比:0个维度,2个到多个指标
+
+![雷达图](../../assets/images/chart_config/9.png)
+
+样式上支持如下配置:
+- 形状
+- 轴段数
+- 内外标签
+- 图例
+
+## 10 桑基图
+
+[桑基图](https://en.wikipedia.org/wiki/Sankey_diagram)展示需要2个到多个维度、1个指标
+
+![桑基图](../../assets/images/chart_config/10.png)
+
+样式上支持如下配置:
+- 节点
+  - 拖动
+  - 布局方向
+  - 尺寸
+- 标签
+
+## 11 平行坐标图
+
+[平行坐标图](https://en.wikipedia.org/wiki/Parallel_coordinates)展示需要1个到多个维度、1个到多个指标
+
+![平行坐标图](../../assets/images/chart_config/11.png)
+
+样式上支持如下配置:
+- 线条样式
+- 坐标轴
+- 坐标轴排列
+- 坐标轴框选
+
+## 12 地图
+
+使用地图之前,请确认地图展示所需的维度字段已经正确设置[可视化类型](2.2-view#2-数据模型),需要1个指标
+
+地图通过样式配置可以选择一下4种类型
+
+常规地图
+
+![地图1](../../assets/images/chart_config/12.1.png)
+
+气泡图
+
+![地图2](../../assets/images/chart_config/12.2.png)
+
+热力图
+
+![地图3](../../assets/images/chart_config/12.3.png)
+
+飞行图
+
+![地图4](../../assets/images/chart_config/12.4.png)
+
+选择飞行图时注意,需要2个维度,飞行轨迹从维度一到维度二
+
+样式上支持如下配置:
+- 移动&缩放
+- 标签
+- 视觉映射
+- 飞行速度及标记
+
+## 13 词云
+
+[词云](https://en.wikipedia.org/wiki/Tag_cloud)展示需要1个维度、1个指标
+
+![词云](../../assets/images/chart_config/13.png)
+
+## 14 瀑布图
+
+[瀑布图](https://en.wikipedia.org/wiki/Waterfall_chart)展示需要1个维度、1个指标
+
+![瀑布图](../../assets/images/chart_config/14.png)
+
+样式上支持如下配置:
+- 坐标轴
+- 标签
+- 分隔线
+
+## 15 内嵌网页
+
+内嵌网页展示不需要维度和指标,需要在样式栏输入内嵌网页地址
+
+![内嵌网页](../../assets/images/chart_config/15.png)
+
+## 16 富文本
+
+富文本展示上不强依赖于维度和指标,支持用户自定义文本样式,包括:
+- 文字尺寸、字体、样式、颜色
+- 列表样式
+- 对齐方式
+- 超链接
+- 图片
+- 清除样式
+
+如果想将维度和指标值用于动态展示,可以将鼠标悬停在富文本工具栏最右侧的按钮上,点击列表项,这时维度和指标会以占位符形式插入到富文本中
+
+![富文本1](../../assets/images/chart_config/16.1.png)
+
+点击右下角按钮预览富文本样式
+
+![富文本2](../../assets/images/chart_config/16.2.png)
+
+需要注意,当所选维度有多个值时会全部显示,使用逗号分隔;同时指标值也会被分组
+
+![富文本3](../../assets/images/chart_config/16.3.png)
+
+![富文本4](../../assets/images/chart_config/16.4.png)
+
+## 17 双Y轴图
+
+双Y轴图展示需要1个维度,2个到多个指标
+
+![双Y轴图](../../assets/images/chart_config/17.png)
+
+样式上支持如下配置:
+- Y轴图形选择
+- 坐标轴
+- 折线线条平滑或阶梯展示
+- 柱堆叠
+- 图例
+- 分隔线
+
+## 18 仪表盘
+
+仪表盘展示需要1个指标
+
+![仪表盘](../../assets/images/chart_config/18.png)
+
+样式上支持如下配置:
+- 目标值
+- 仪表盘样式
+- 标题
+- 数值
+- 指针
+- 轴
+- 分隔线

+ 1 - 0
docs/_includes/footer.html

@@ -0,0 +1 @@
+<div class="page__footer-copyright">&copy; {{ site.time | date: '%Y' }} {{ site.name | default: site.title }}. {{ site.data.ui-text[site.locale].powered_by | default: "Powered by" }} <a href="https://jekyllrb.com" rel="nofollow">Jekyll</a> &amp; <a href="https://mademistakes.com/work/minimal-mistakes-jekyll-theme/" rel="nofollow">Minimal Mistakes</a>.</div>

+ 46 - 0
docs/_includes/zh_masthead.html

@@ -0,0 +1,46 @@
+{% if site.logo contains "://" %}
+  {% capture logo_path %}{{ site.logo }}{% endcapture %}
+{% else %}
+  {% capture logo_path %}{{ site.logo }}{% endcapture %}
+{% endif %}
+
+<div class="masthead">
+  <div class="masthead__inner-wrap">
+    <div class="masthead__menu">
+      <nav id="site-nav" class="greedy-nav">
+        {% unless logo_path == empty %}
+          <a class="site-logo" href="{{ '/' | relative_url }}"><img src="{{ logo_path | relative_url }}" alt=""></a>
+        {% endunless %}
+        <a class="site-title" href="{{ '/' | relative_url }}">
+          {{ site.zh_masthead_title | default: site.title }}
+          {% if site.subtitle %}<span class="site-subtitle">{{ site.subtitle }}</span>{% endif %}
+        </a>
+        <ul class="visible-links">
+          {%- for link in site.data.navigation.zh -%}
+            {%- if link.url contains '://' -%}
+              {%- assign url = link.url -%}
+            {%- else -%}
+              {%- assign url = link.url | relative_url -%}
+            {%- endif -%}
+            <li class="masthead__menu-item">
+              <a href="{{ url }}" {% if link.description %}title="{{ link.description }}"{% endif %}>{{ link.title }}</a>
+            </li>
+          {%- endfor -%}
+        </ul>
+        {% if site.search == true %}
+        <button class="search__toggle" type="button">
+          <span class="visually-hidden">{{ site.data.ui-text[site.locale].search_label | default: "Toggle search" }}</span>
+          <svg class="icon" width="16" height="16" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 15.99 16">
+            <path d="M15.5,13.12L13.19,10.8a1.69,1.69,0,0,0-1.28-.55l-0.06-.06A6.5,6.5,0,0,0,5.77,0,6.5,6.5,0,0,0,2.46,11.59a6.47,6.47,0,0,0,7.74.26l0.05,0.05a1.65,1.65,0,0,0,.5,1.24l2.38,2.38A1.68,1.68,0,0,0,15.5,13.12ZM6.4,2A4.41,4.41,0,1,1,2,6.4,4.43,4.43,0,0,1,6.4,2Z" transform="translate(-.01)"></path>
+          </svg>
+        </button>
+        {% endif %}
+        <button class="greedy-nav__toggle hidden" type="button">
+          <span class="visually-hidden">{{ site.data.ui-text[site.locale].menu_label | default: "Toggle menu" }}</span>
+          <div class="navicon"></div>
+        </button>
+        <ul class="hidden-links hidden"></ul>
+      </nav>
+    </div>
+  </div>
+</div>

+ 123 - 0
docs/_layouts/global.html

@@ -0,0 +1,123 @@
+
+<!DOCTYPE html>
+<!--[if lt IE 7]>      <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
+<!--[if IE 7]>         <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
+<!--[if IE 8]>         <html class="no-js lt-ie9"> <![endif]-->
+<!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
+    <head>
+        <meta charset="utf-8">
+        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
+        <title>{{ page.title }} - Davinci {{site.DAVINCI_VERSION_SHORT}} Documentation</title>
+        {% if page.description %}
+          <meta name="description" content="{{page.description | replace: 'WH_VERSION_SHORT', site.WH_VERSION_SHORT}}">
+        {% endif %}
+
+        {% if page.redirect %}
+          <meta http-equiv="refresh" content="0; url={{page.redirect}}">
+          <link rel="canonical" href="{{page.redirect}}" />
+        {% endif %}
+
+        <!-- <link rel="stylesheet" href="css/bootstrap.min.css"> -->
+        <!-- <style>
+            body {
+                padding-top: 60px;
+                padding-bottom: 40px;
+            }
+        </style> -->
+        <meta name="viewport" content="width=device-width">
+        <!-- <link rel="stylesheet" href="css/bootstrap-responsive.min.css"> -->
+        <link rel="stylesheet" href="css/main.css">
+        <link rel="stylesheet" href="css/markdown.css">
+
+        <!-- <script src="js/vendor/modernizr-2.6.1-respond-1.1.0.min.js"></script> -->
+
+        <link rel="stylesheet" href="css/pygments-default.css">
+
+        <!-- <link rel="shortcut icon" href="../../webapp/app/favicon.ico" type="image/x-icon"> -->
+
+        <!-- Google analytics script -->
+        <script type="text/javascript">
+          var _gaq = _gaq || [];
+          _gaq.push(['_setAccount', 'UA-32518208-2']);
+          _gaq.push(['_trackPageview']);
+
+          (function() {
+            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+            ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+          })();
+        </script>
+
+    </head>
+    <body>
+        <!--[if lt IE 7]>
+            <p class="chromeframe">You are using an outdated browser. <a href="http://browsehappy.com/">Upgrade your browser today</a> or <a href="http://www.google.com/chromeframe/?redirect=true">install Google Chrome Frame</a> to better experience this site.</p>
+        <![endif]-->
+
+        <!-- This code is taken from http://twitter.github.com/bootstrap/examples/hero.html -->
+
+        <div class="navbar navbar-fixed-top" id="topbar">
+            <div class="navbar-inner">
+                <div class="container">
+                    <div class="brand" style="width:200px;"/><a href="index.html">
+                      <img src="img/logo.svg" style="width:130px; height:48px;margin-left: 25px;"/></a>
+                      <!-- <span class="version">{{site.DAVINCI_VERSION_SHORT}}</span> -->
+                    </div>
+                    <ul class="nav">
+                        <li><a href="index.html">Overview</a></li>
+                        <li><a href="deployment.html">Deployment</a></li>
+                        <li><a href="quickStart.html">Quick Start</a></li>
+
+                        <li class="dropdown">
+                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Tutorial<b class="caret"></b></a>
+                            <ul class="dropdown-menu">
+                                <li><a href="concept.html">Concept</a></li>
+                                <li><a href="project_org_team_user_auth_guide.html">User and Permission System</a></li>
+                                <li><a href="source_guide.html">Source</a></li>
+                                <li><a href="view_guide.html">View</a></li>
+                                <li><a href="widget_guide.html">Widget</a></li>
+                                <li><a href="dashboard_guide.html">Dashboard</a></li>
+                                <li><a href="display_guide.html">Display</a></li>
+                                <li><a href="schedule_guide.html">Schedule</a></li>
+                            </ul>
+                        </li>
+                        
+                        <li><a href="integration_guide.html">Integration</a></li>
+                        <li class="dropdown">
+                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">More<b class="caret"></b></a>
+                            <ul class="dropdown-menu">
+                                <li><a href="blueprint.html">Blueprint</a></li>
+                                <li><a href="more_Infomation.html">More Infomation</a></li>
+                                <li><a href="FAQ.html">FAQ</a></li>
+                            </ul>
+                        </li>
+                        <li class="dropdown">
+                            <a href="#" class="dropdown-toggle" data-toggle="dropdown">Davinci 0.2 用户手册<b class="caret"></b></a>
+                            <ul class="dropdown-menu">
+                                <li><a href="https://edp-davinci.gitbooks.io/davinci-user-guide-cn/content/">在线查看</a></li>
+                                <li><a href="https://legacy.gitbook.com/download/pdf/book/edp-davinci/davinci-user-guide-cn" rel="nofollow">PDF下载</a></li>                                
+                            </ul>
+                        </li>
+                    </ul>
+                </div>
+            </div>
+        </div>
+
+        <div class="container-wrapper">
+            <div class="content markdown-body" id="content">
+                {% if page.displayTitle %}
+                    <h1 class="title">{{ page.displayTitle }}</h1>
+                {% else %}
+                    <h1 class="title">{{ page.title }}</h1>
+                {% endif %}
+
+                {{ content }}
+            </div>
+        </div>
+
+        <!-- <script src="js/vendor/jquery-1.8.0.min.js"></script>
+        <script src="js/vendor/bootstrap.min.js"></script>
+        <script src="js/vendor/anchor.min.js"></script>
+        <script src="js/main.js"></script> -->
+    </body>
+</html>

+ 42 - 0
docs/_layouts/zh_base.html

@@ -0,0 +1,42 @@
+---
+---
+
+<!doctype html>
+<!--
+  Minimal Mistakes Jekyll Theme 4.16.5 by Michael Rose
+  Copyright 2013-2019 Michael Rose - mademistakes.com | @mmistakes
+  Free for personal and commercial use under the MIT license
+  https://github.com/mmistakes/minimal-mistakes/blob/master/LICENSE
+-->
+<html lang="{{ site.locale | slice: 0,2 | default: "en" }}" class="no-js">
+  <head>
+    {% include head.html %}
+    {% include head/custom.html %}
+  </head>
+
+  <body class="layout--{{ page.layout | default: layout.layout }}{% if page.classes or layout.classes %}{{ page.classes | default: layout.classes | join: ' ' | prepend: ' ' }}{% endif %}">
+    {% include_cached skip-links.html %}
+    {% include_cached browser-upgrade.html %}
+    {% include_cached zh_masthead.html %}
+
+    <div class="initial-content">
+      {{ content }}
+    </div>
+
+    {% if site.search == true %}
+      <div class="search-content">
+        {% include_cached search/search_form.html %}
+      </div>
+    {% endif %}
+
+    <div id="footer" class="page__footer">
+      <footer>
+        {% include footer/custom.html %}
+        {% include_cached footer.html %}
+      </footer>
+    </div>
+
+    {% include scripts.html %}
+
+  </body>
+</html>

+ 65 - 0
docs/_layouts/zh_single.html

@@ -0,0 +1,65 @@
+---
+layout: zh_base
+---
+
+{% if page.header.overlay_color or page.header.overlay_image or page.header.image %}
+  {% include page__hero.html %}
+{% elsif page.header.video.id and page.header.video.provider %}
+  {% include page__hero_video.html %}
+{% endif %}
+
+{% if page.url != "/" and site.breadcrumbs %}
+  {% unless paginator %}
+    {% include breadcrumbs.html %}
+  {% endunless %}
+{% endif %}
+
+<div id="main" role="main">
+  {% include sidebar.html %}
+
+  <article class="page" itemscope itemtype="https://schema.org/CreativeWork">
+    {% if page.title %}<meta itemprop="headline" content="{{ page.title | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
+    {% if page.excerpt %}<meta itemprop="description" content="{{ page.excerpt | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
+    {% if page.date %}<meta itemprop="datePublished" content="{{ page.date | date: "%B %d, %Y" }}">{% endif %}
+    {% if page.last_modified_at %}<meta itemprop="dateModified" content="{{ page.last_modified_at | date: "%B %d, %Y" }}">{% endif %}
+
+    <div class="page__inner-wrap">
+      {% unless page.header.overlay_color or page.header.overlay_image %}
+        <header>
+          {% if page.title %}<h1 id="page-title" class="page__title" itemprop="headline">{{ page.title | markdownify | remove: "<p>" | remove: "</p>" }}</h1>{% endif %}
+        </header>
+      {% endunless %}
+
+      <section class="page__content" itemprop="text">
+        {% if page.toc %}
+          <aside class="sidebar__right {% if page.toc_sticky %}sticky{% endif %}">
+            <nav class="toc">
+              <header><h4 class="nav__title"><i class="fas fa-{{ page.toc_icon | default: 'file-alt' }}"></i> {{ page.toc_label | default: site.data.ui-text[site.locale].toc_label | default: "On this page" }}</h4></header>
+              {% include toc.html sanitize=true html=content h_min=1 h_max=6 class="toc__menu" %}
+            </nav>
+          </aside>
+        {% endif %}
+        {{ content }}
+        {% if page.link %}<div><a href="{{ page.link }}" class="btn btn--primary">{{ site.data.ui-text[site.locale].ext_link_label | default: "Direct Link" }}</a></div>{% endif %}
+      </section>
+
+      <footer class="page__meta">
+        {% if site.data.ui-text[site.locale].meta_label %}
+          <h4 class="page__meta-title">{{ site.data.ui-text[site.locale].meta_label }}</h4>
+        {% endif %}
+        {% include page__taxonomy.html %}
+        {% if page.last_modified_at %}
+          <p class="page__date"><strong><i class="fas fa-fw fa-calendar-alt" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}</strong> <time datetime="{{ page.last_modified_at | date: "%Y-%m-%d" }}">{{ page.last_modified_at | date: "%B %d, %Y" }}</time></p>
+        {% elsif page.date %}
+          <p class="page__date"><strong><i class="fas fa-fw fa-calendar-alt" aria-hidden="true"></i> {{ site.data.ui-text[site.locale].date_label | default: "Updated:" }}</strong> <time datetime="{{ page.date | date_to_xmlschema }}">{{ page.date | date: "%B %d, %Y" }}</time></p>
+        {% endif %}
+      </footer>
+
+      {% include post_pagination.html %}
+    </div>
+
+    {% if jekyll.environment == 'production' and site.comments.provider and page.comments %}
+      {% include comments.html %}
+    {% endif %}
+  </article>
+</div>

+ 22 - 0
docs/_layouts/zh_splash.html

@@ -0,0 +1,22 @@
+---
+layout: zh_base
+---
+
+{% if page.header.overlay_color or page.header.overlay_image or page.header.image %}
+  {% include page__hero.html %}
+{% elsif page.header.video.id and page.header.video.provider %}
+  {% include page__hero_video.html %}
+{% endif %}
+
+<div id="main" role="main">
+  <article class="splash" itemscope itemtype="https://schema.org/CreativeWork">
+    {% if page.title %}<meta itemprop="headline" content="{{ page.title | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
+    {% if page.excerpt %}<meta itemprop="description" content="{{ page.excerpt | markdownify | strip_html | strip_newlines | escape_once }}">{% endif %}
+    {% if page.date %}<meta itemprop="datePublished" content="{{ page.date | date: "%B %d, %Y" }}">{% endif %}
+    {% if page.last_modified_at %}<meta itemprop="dateModified" content="{{ page.last_modified_at | date: "%B %d, %Y" }}">{% endif %}
+
+    <section class="page__content" itemprop="text">
+      {{ content }}
+    </section>
+  </article>
+</div>

BIN
docs/assets/images/More_WeChat.jpg


BIN
docs/assets/images/chart_config/1.1.gif


BIN
docs/assets/images/chart_config/1.2.png


BIN
docs/assets/images/chart_config/1.3.gif


BIN
docs/assets/images/chart_config/10.png


BIN
docs/assets/images/chart_config/11.png


BIN
docs/assets/images/chart_config/12.1.png


BIN
docs/assets/images/chart_config/12.2.png


BIN
docs/assets/images/chart_config/12.3.png


BIN
docs/assets/images/chart_config/12.4.png


BIN
docs/assets/images/chart_config/13.png


BIN
docs/assets/images/chart_config/14.png


BIN
docs/assets/images/chart_config/15.png


BIN
docs/assets/images/chart_config/16.1.png


BIN
docs/assets/images/chart_config/16.2.png


BIN
docs/assets/images/chart_config/16.3.png


BIN
docs/assets/images/chart_config/16.4.png


BIN
docs/assets/images/chart_config/17.png


BIN
docs/assets/images/chart_config/18.png


BIN
docs/assets/images/chart_config/2.1.png


BIN
docs/assets/images/chart_config/3.png


BIN
docs/assets/images/chart_config/4.png


BIN
docs/assets/images/chart_config/5.png


BIN
docs/assets/images/chart_config/6.png


BIN
docs/assets/images/chart_config/7.png


BIN
docs/assets/images/chart_config/9.png


BIN
docs/assets/images/dashboard/1.1.png


BIN
docs/assets/images/dashboard/1.10.png


BIN
docs/assets/images/dashboard/1.2.png


BIN
docs/assets/images/dashboard/1.3.png


BIN
docs/assets/images/dashboard/1.4.png


BIN
docs/assets/images/dashboard/1.5.png


BIN
docs/assets/images/dashboard/1.6.png


BIN
docs/assets/images/dashboard/1.7.png


BIN
docs/assets/images/dashboard/1.8.png


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