diff --git a/.github/scripts/gen_changelog.py b/.github/scripts/gen_changelog.py new file mode 100644 index 000000000..91793c919 --- /dev/null +++ b/.github/scripts/gen_changelog.py @@ -0,0 +1,139 @@ +#!/usr/bin/env python3 +""" +If version already exists in changelog.md, exit 0 without modification. +Usage: python .github/scripts/gen_changelog.py v4.10.9 +""" +from __future__ import annotations +import sys, json, re, html, urllib.request +from datetime import datetime, timezone, timedelta +from pathlib import Path + +API_URL = "https://community.fit2cloud.com/v1/products/dataease/releases" +CHANGELOG = Path('docs/changelog.md') +MARKER = '## 2 更新内容' +TZ = timezone(timedelta(hours=8)) + +TITLE_MAP = { + '安全漏洞修复': ('Warning', '**安全漏洞修复**', 'fix'), + '新增功能': ('Abstract', '新增功能 :star2:', 'feat'), + '功能优化': ('Abstract', '功能优化 :sunflower:', 'refactor'), + '问题修复': ('Abstract', '问题修复 :palm_tree:', 'fix'), + "What's new": ('Abstract', '新增功能 :star2:', 'feat'), + 'Improvements': ('Abstract', '功能优化 :sunflower:', 'refactor'), + 'Bug fixes': ('Abstract', '问题修复 :palm_tree:', 'fix'), +} +H2_UL = re.compile(r'
...
+H2_P_THANKS = re.compile(r'.*?
)', re.S) +LI = re.compile(r'(内容)
+ # 由于 ul_html 内容可能很长且有特殊字符,直接用 title 定位最安全 + safe_title = re.escape(title.strip()) + # 正则解释:匹配包含 title 的 h2,后面任意字符(非贪婪),然后匹配一个...
+ p_pattern = re.compile(r'(.*?)
', re.S) + p_match = p_pattern.search(html_content) + if p_match: + p_content = p_match.group(1) + # 清理 HTML 标签,只留文本 + clean_p = html.unescape(re.sub(r'<[^>]+>', '', p_content)).strip() + # 只有当内容包含"感谢"或者标题包含"安全"/"漏洞"时,才采纳 + if "感谢" in clean_p and "漏洞" in title: + thanks_note = f"\n {clean_p}" + if not cleaned: + continue + admon, nice, tag = TITLE_MAP.get(title, ('info', title, 'note')) + lines = '\n'.join(f" - {i}" for i in cleaned) + if thanks_note: + if lines: + lines += "\n" + thanks_note + sections.append(f"!!! {admon} \"{nice}\"\n\n{lines}\n") + if not sections: + clean = html.unescape(re.sub(r'<[^>]+>','', html_content)).strip() + if clean: + sections.append(f"!!! info \"发布说明\"\n - note: {clean}\n") + block = '\n'.join([f"### {version}", date_str, ''] + sections) + return block + + +def main(): + if len(sys.argv) < 2: + print('Version arg required, e.g. v2.10.1 or v2.10.1-lts or 2.10.1', file=sys.stderr) + return 1 + raw = sys.argv[1].strip() + # Accept forms: v2.10.1 or v2.10.1-lts or 2.10.1 + if not raw.startswith('v'): + raw = 'v' + raw + target = normalize(raw) # remove -lts suffix if present + data = fetch() + rel = find_release(target, data) + if not rel: + print(f'Target version {raw} (normalized {target}) not found in API list', file=sys.stderr) + return 1 + if not CHANGELOG.exists(): + print('Changelog file missing.') + return 1 + content = CHANGELOG.read_text(encoding='utf-8') + # 【修复】使用正则严格匹配 Markdown 标题行 (例如: ### v2.10.19) + # ^ 表示行首,#+ 表示一个或多个#,\s* 表示可选空格,re.escape 防止版本号中的点被当作通配符 + pattern = re.compile(r'^#+\s*' + re.escape(target) + r'\s*$', re.MULTILINE) + + if pattern.search(content): + print(f'⚠️ Version {target} already exists in changelog.md (Detected by regex). Skip.') + return 0 + block = build_block(rel) + if MARKER in content: + new_content = content.replace(MARKER, MARKER + '\n\n' + block, 1) + else: + new_content = MARKER + '\n\n' + block + content + CHANGELOG.write_text(new_content, encoding='utf-8') + print('Inserted changelog for', target) + return 0 + +if __name__ == '__main__': + raise SystemExit(main()) diff --git a/.github/workflows/auto-changelog.yml b/.github/workflows/auto-changelog.yml deleted file mode 100644 index 0716384ba..000000000 --- a/.github/workflows/auto-changelog.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: Auto Changelog - -on: - workflow_dispatch: - schedule: - - cron: '00 2-12/2 * * *' - -permissions: - contents: write - pull-requests: write - -jobs: - changelog: - runs-on: ubuntu-latest - steps: - - name: Checkout (full history) - uses: actions/checkout@v4 - with: - fetch-depth: 0 - - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version: '3.x' - - - name: Detect latest & base branch - id: detect - run: | - set -e - raw=$(curl -s https://community.fit2cloud.com/v1/products/dataease/releases | jq -r '.[0].version') - if [ -z "$raw" ] || [ "$raw" = "null" ]; then echo "No version"; exit 1; fi - version=${raw%-lts} - major=$(echo "$version" | sed -E 's/^v([0-9]+).*/\1/') - base_branch="v${major}" - echo "Latest version: $version (major=$major base=$base_branch)" - # verify base branch exists - if ! git ls-remote --exit-code --heads origin "$base_branch" >/dev/null 2>&1; then - echo "Base branch $base_branch not found. Skipping." >&2 - echo "update=false" >> $GITHUB_OUTPUT - echo "version=$version" >> $GITHUB_OUTPUT - echo "base=$base_branch" >> $GITHUB_OUTPUT - exit 0 - fi - # Check remote file content without checkout to avoid ambiguity/detached HEAD issues - if git show "origin/$base_branch:docs/changelog.md" | grep -q "^$version$"; then - echo "Already present in changelog."; upd=false - else - upd=true - fi - echo "version=$version" >> $GITHUB_OUTPUT - echo "base=$base_branch" >> $GITHUB_OUTPUT - echo "update=$upd" >> $GITHUB_OUTPUT - - - name: Generate changelog entry - if: ${{ steps.detect.outputs.update == 'true' }} - run: | - # 先切换到目标基础分支,确保读取正确的 changelog.md - git checkout -B "${{ steps.detect.outputs.base }}" "origin/${{ steps.detect.outputs.base }}" - python .github/scripts/gen_changelog.py "${{ steps.detect.outputs.version }}" - echo 'Preview:' - grep -n "^${{ steps.detect.outputs.version }}$" -A12 docs/changelog.md || true - - - name: Stage changes - if: ${{ steps.detect.outputs.update == 'true' }} - run: | - set -e - # Ensure we are on the correct base branch before staging - base="${{ steps.detect.outputs.base }}" - git checkout -B "$base" "origin/$base" - - # Run generation again to ensure file is updated in the correct branch context if needed - # (Optional, but safe if the previous step modified a file in a detached head or different branch) - python .github/scripts/gen_changelog.py "${{ steps.detect.outputs.version }}" - - git config user.name 'github-actions[bot]' - git config user.email 'github-actions[bot]@users.noreply.github.com' - git add docs/changelog.md - - - name: Create Pull Request - if: ${{ steps.detect.outputs.update == 'true' }} - uses: peter-evans/create-pull-request@v6 - with: - branch: chore/changelog-${{ steps.detect.outputs.version }} - title: "chore: add changelog for ${{ steps.detect.outputs.version }}" - commit-message: "chore: add changelog for ${{ steps.detect.outputs.version }}" - body: | - 自动生成的更新日志条目: **${{ steps.detect.outputs.version }}** - - 目标基础分支: `${{ steps.detect.outputs.base }}` - - 请 @Jackwonder 审核。 - base: ${{ steps.detect.outputs.base }} - reviewers: Jackwonder - delete-branch: true - - - name: Skip - if: ${{ steps.detect.outputs.update != 'true' }} - run: echo "No changelog update needed (version=${{ steps.detect.outputs.version }}, base=${{ steps.detect.outputs.base }})." diff --git a/.github/workflows/mike-deploy.yml b/.github/workflows/mike-deploy.yml new file mode 100644 index 000000000..9038630f7 --- /dev/null +++ b/.github/workflows/mike-deploy.yml @@ -0,0 +1,35 @@ +name: Mkdocs Build + +on: + push: + branches: [ "v1", "v2" ] + workflow_dispatch: + +jobs: + mike-deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Set up Python + uses: actions/setup-python@v3 + with: + python-version: '3.*' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools==80.10.2 + pip install -r requirements/requirements.txt + pip install mike==1.1.2 + - name: Config Git + run: | + git config user.name "$(git log -n 1 --pretty=format:%an)" + git config user.email "$(git log -n 1 --pretty=format:%ae)" + - name: Build package + run: | + git fetch origin deploy:deploy + mike deploy --push --branch deploy --rebase ${{ github.ref_name }} + mike set-default -b deploy ${{ github.ref_name }} diff --git a/.github/workflows/oss-deploy.yml b/.github/workflows/oss-deploy.yml deleted file mode 100644 index 6a04eb879..000000000 --- a/.github/workflows/oss-deploy.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Deploy Docs to OSS -on: - push: - branches: [ "deploy" ] - workflow_dispatch: -jobs: - ssh-deploy: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v3 - - name: Install ossutil - run: | - sudo -v ; curl https://gosspublic.alicdn.com/ossutil/install.sh | sudo bash - - - name: Deploy OSS - env: - ACCESS_KEY_ID: ${{ secrets.DATAEASE_OSS_AK }} - ACCESS_KEY_SECRET: ${{ secrets.DATAEASE_OSS_SK }} - ACCESS_KEY_BUCKET: ${{ secrets.DATAEASE_OSS_BUCKET }} - run: | - ossutil cp -r -f ./ oss://$ACCESS_KEY_BUCKET/docs --access-key-id=$ACCESS_KEY_ID --access-key-secret=$ACCESS_KEY_SECRET --endpoint=oss-cn-zhangjiakou.aliyuncs.com --exclude '.git*' diff --git a/.github/workflows/ssh-deploy-cn.yml b/.github/workflows/ssh-deploy-cn.yml deleted file mode 100644 index a8818f20e..000000000 --- a/.github/workflows/ssh-deploy-cn.yml +++ /dev/null @@ -1,21 +0,0 @@ -name: Deploy to dataease.cn server -on: - workflow_dispatch: -jobs: - deploy-to-server: - runs-on: ubuntu-latest - steps: - - name: Check - uses: actions/checkout@v4 - - name: ssh deploy - uses: easingthemes/ssh-deploy@v2.2.11 - with: - SSH_PRIVATE_KEY: ${{ secrets.DE_CN_HOST_KEY }} - REMOTE_HOST: ${{ secrets.DE_CN_HOST }} - REMOTE_USER: ${{ secrets.DE_CN_HOST_USERNAME }} - SOURCE: ./ - TARGET: /opt/dataease/docs/ - # Arguments to pass to rsync - ARGS: "-rltgoDzvO --delete" - # An array of folder to exclude - EXCLUDE: ".git/" diff --git a/.github/workflows/ssh-deploy.yml b/.github/workflows/ssh-deploy.yml deleted file mode 100644 index 68f400ec5..000000000 --- a/.github/workflows/ssh-deploy.yml +++ /dev/null @@ -1,39 +0,0 @@ -# This is a basic workflow to help you get started with Actions - -name: Deploy Docs to Server - -# Controls when the workflow will run -on: - # Triggers the workflow on push or pull request events but only for the "master" branch - push: - branches: [ "deploy" ] - - # Allows you to run this workflow manually from the Actions tab - workflow_dispatch: - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel -jobs: - # This workflow contains a single job called "build" - ssh-deploy: - # The type of runner that the job will run on - runs-on: ubuntu-latest - - # Steps represent a sequence of tasks that will be executed as part of the job - steps: - # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it - - uses: actions/checkout@v3 - - - name: ssh deploy - uses: easingthemes/ssh-deploy@v2.2.11 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - with: - SSH_PRIVATE_KEY: ${{ secrets.SSH_KEY }} - REMOTE_HOST: dataease.io - REMOTE_USER: root - SOURCE: ./ - TARGET: /opt/dataease/docs - # Arguments to pass to rsync - ARGS: "-rltgoDzvO --delete" - # An array of folder to exclude - EXCLUDE: ".git/" diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..7af512651 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +.idea/ +*.iml +target/ +.DS_Store diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..f288702d2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc.| + 功能模块 + | ++ 功能 + | ++ 功能描述 + | +
| + 工作台 + | ++ 工作台 + | ++ 支持统计并展示用户信息及个人权限内的资源信息 + | +
| + 支持快速创建数据源、数据集、仪表板、数据大屏 + | +||
| + 支持搜索及查看最近使用的资源 + | +||
| + 支持查看我的收藏 + | +||
| + 支持查看我的分享 + | ++ 仪表板 + | ++ 图表组件 + | ++ 支持通过简单的拖拉或点击操作,制作图表 + | + +
| + 支持多种图表类型,仪表盘、水波图、明细表、汇总表、基础折线图、面积图、堆叠折线图、基础柱状图、堆叠柱状图、百分比柱状图、分组柱状图、分组堆叠柱状图、瀑布图、横向柱状图、横向堆叠柱状图、横向百分比柱状图、饼图、环形图、玫瑰图、玫瑰环形图、雷达图、矩形树图、词云图、地图、散点图、漏斗图、富文本视图等 + | +||
| + 支持指标的多种汇总计算方式,例如求和、平均、最大值、最小值、标准差、方差、计数、去重计数等 + | +||
| + 支持指标的高级计算,例如同环比与占比 + | +||
| + 支持设置指标数值格式,例如小数位数、数量单位、单位后缀、千分符等 + | +||
| + 支持制作图表时快速切换图表类型与关联数据集 + | +||
| + 支持设置钻取、过滤、刷新频率、结果展示条数 + | +||
| + 支持丰富的图表背景、基础样式、标签、提示、标题、图例等设置 + | +||
| + 支持图表联动设置与跳转设置 + | +||
| + 支持柱状图、折线图设置缩略轴与阈值辅助线 + | +||
| + 支持仪表盘设置阈值区间 + | +||
| + 支持表格设置自动滚动、阈值样式 + | +||
| + 支持图表复制、放大、查看数据、导出 Excel 或图片等功能操作 + | ++ 其他组件 + | ++ 支持在仪表板中加入查询组件,可定义查询组件样式及标签,可为查询组件设置查询、清空、重置按钮。支持文本下拉、数字下拉、时间、时间范围等类型查询 + | + +
| + 支持富文本组件,可自定义文字内容,可绑定后台动态数据 + | +||
| + 支持图片等媒体组件 + | +||
| + 支持 Tab 组件,支持 Tab 组件样式设置,支持 Tab 每个页签下放入多个其他组件 + | ++ 仪表板制作 + | ++ 支持在线编辑仪表板,支持放入各种图表与其他组件 + | + +
| + 支持仪表板通过矩阵模式布局 + | +||
| + 支持仪表板多种配置,包括风格、主题色、组件间隙、刷新频率、图表结果数量、仪表板背景、图表与其他组件的整体配置等 + | +||
| + 支持图表与组件的复制与删除 + | +||
| + 支持图表与组件的批量复制、批量设置、批量删除 + | +||
| + 支持撤销及一键清空仪表板画布内容 + | ++ 仪表板管理 + | ++ 支持仪表板的新建、重命名、删除、复制、移动、搜索、预览等 + | + +
| + 支持仪表板分组的新建、重命名、删除、移动等 + | +||
| + 支持以树状形式展示仪表板分组 + | +||
| + 支持导出仪表板为 PDF 或图片 + | +||
| + 支持仪表板生成公共分享链接,并可设置链接有效期及访问密码 + | +||
| + 支持用户收藏仪表板 + | ++ 数据大屏 + | ++ 图表组件 + | ++ 支持通过简单的拖拉或点击操作,制作图表 + | + +
| + 支持多种图表类型,仪表盘、水波图、明细表、汇总表、基础折线图、面积图、堆叠折线图、基础柱状图、堆叠柱状图、百分比柱状图、分组柱状图、分组堆叠柱状图、瀑布图、横向柱状图、横向堆叠柱状图、横向百分比柱状图、饼图、环形图、玫瑰图、玫瑰环形图、雷达图、矩形树图、词云图、地图、散点图、漏斗图、富文本视图等 + | +||
| + 支持指标的多种汇总计算方式,例如求和、平均、最大值、最小值、标准差、方差、计数、去重计数等 + | +||
| + 支持指标的高级计算,例如同环比与占比 + | +||
| + 支持设置指标数值格式,例如小数位数、数量单位、单位后缀、千分符等 + | +||
| + 支持制作图表时快速切换关联数据集 + | +||
| + 支持设置钻取、过滤、刷新频率、结果展示条数 + | +||
| + 支持丰富的图表背景、基础样式、标签、提示、标题、图例等设置 + | +||
| + 支持图表联动设置与跳转设置 + | +||
| + 支持柱状图、折线图设置缩略轴与阈值辅助线 + | +||
| + 支持仪表盘设置阈值区间 + | +||
| + 支持表格设置自动滚动、阈值样式 + | ++ 其他组件 + | ++ 支持富文本组件,可自定义文字内容,可绑定后台动态数据 + | + +
| + 支持图片等媒体组件 + | +||
| + 支持边框、图标等素材组件 + | ++ 大屏制作 + | ++ 支持在线编辑大屏,支持放入各种图表与其他组件 + | + +
| + 支持大屏通过精确定位模式进行布局 + | +||
| + 支持大屏多种配置,包括尺寸、背景、配色、表格配色、刷新配置等 + | +||
| + 支持图表与组件的复制、粘贴、剪切、删除等操作 + | +||
| + 支持图层管理,包括上移、下移、置顶、置底、隐藏、锁定等操作 + | +||
| + 支持编辑大屏时使用快捷键操作 + | +||
| + 支持撤销操作 + | ++ 大屏管理 + | ++ 支持大屏的新建、重命名、删除、复制、移动、搜索、预览等 + | + +
| + 支持大屏分组的新建、重命名、删除、移动等 + | +||
| + 支持以树状形式展示大屏分组 + | +||
| + 支持导出大屏为 PDF 或图片 + | +||
| + 支持大屏生成公共分享链接,并可设置链接有效期及访问密码 + | +||
| + 支持用户收藏大屏 + | ++ 数据准备 + | ++ 数据集 + | ++ 支持数据集的创建、移动、重命名、删除、预览 + | + +
| + 支持数据集文件夹的创建、移动、重命名、删除 + | +||
| + 支持通过拖拉拽的方式引用数据表 + | +||
| + 支持自定义 SQL,支持快速复制表名与字段名、运行查看结果、设置 SQL 动态参数 + | +||
| + 支持设置多表关联,包括左连接、右连接、内连接 + | +||
| + 支持编辑数据集字段,包括指标与维度切换、更换字段类型、重命名、复制、删除 + | +||
| + 支持批量管理数据集字段 + | +||
| + 支持新建计算字段,内置常用计算函数,支持聚合计算 + | +||
| + 支持二次计算,即基于计算字段创建新的计算字段 + | +||
| + 支持 SQL 加密传输 + | ++ 数据源 + | ++ 支持多种数据源,包括多 Sheet 页的 Excel 文件,MySQL / Oracle / SQL Server / MariaDB / PostgreSQL / MongoDB-BI / Db2 / TiDB / Apache Doris / ClickHouse / StarRocks / AWS Redshift / Apache Impala / API 数据源等 + | + +
| + 支持数据源的新建、编辑、重命名、移动、删除 + | +||
| + 支持数据源配置的预览,数据源表的预览 + | +||
| + 支持数据源文件夹的创建、移动、重命名、删除 + | +||
| + 支持数据源有效性校验 + | +||
| + 支持定时检测数据源的连接状态 + | +||
| + 支持 Excel 数据源替换数据与追加数据 + | +
+ 系统管理 (X-Pack) + |
+ + 用户管理 + | ++ 支持用户的新建、编辑、删除、修改密码、启用、禁用、搜索、批量导入等 + | + +
| + 支持为用户分配一个或多个角色 + | +||
| + 支持用户通过切换组织管理及使用不同组织下的资源 + | ++ 角色管理 + | ++ 支持角色的新建、编辑、删除、搜索等 + | + +
| + 支持系统内置角色(系统管理员、组织管理员、普通用户)与自定义角色,支持自定义角色继承于系统内置角色 + | +||
| + 支持为角色添加与移除用户 + | ++ 组织管理 + | ++ 支持组织的新建、编辑、删除、搜索、排序、移动等 + | + +
| + 支持多级组织的创建与管理 + | +||
| + 支持组织间的用户与资源隔离 + | ++ 权限管理 + | ++ 支持按照用户视角窗口或资源视角窗口配置权限 + | + +
| + 支持菜单权限管理,包括工作台、仪表板、数据大屏、数据集、数据源模块的权限管理 + | +||
| + 支持资源权限管理,包括仪表板、数据大屏、数据集、数据源模块下的资源权限管理 + | +||
| + 支持数据集的行级权限控制、支持行级权限使用系统内置变量(用户 ID、用户名、组织、邮箱等) + | +||
| + 支持数据集的列级权限控制,支持设置列的禁用或脱敏,支持自定义脱敏规则 + | +||
| + 支持行列权限的白名单设置 + | +
+ 集成与扩展 (X-Pack) + |
+
+ + REST API + | ++ 支持完善的 API 接口及文档 + | + + ++ 嵌入式能力 + | ++ 支持通过 DIV 或 iframe 的方式将 DataEase 的单个视图、仪表板或数据大屏页面、仪表板或数据大屏设计器嵌入到第三方系统 + | + + + + +
| + name + | + 插件名称(保证唯一) + |
| + store + | + 来源 + |
| + free + | + 是否免费 + |
| + cost + | + 多少钱 + |
| + category + | + 插件类别 + |
| + descript + | + 描述 + |
| + version + | + 版本对应的后台工程版本 + |
| + creator + | + 作者 + |
| + moduleName + | + 模块名称对应后台工程模块名称 + |
| + require + | + 要求 DataEase 最低版本 + |
| + dsType + | + 数据来源类型 + |
| + name + | + 插件名称(保证唯一) + |
| + store + | + 您的公司名称 + |
| + free + | + 是否免费 + |
| + cost + | + 多少钱 + |
| + category + | + 插件类别 + |
| + descript + | + 描述 + |
| + version + | + 版本对应的后台工程版本 + |
| + creator + | + 作者 + |
| + loadMybatis + | ++ 是否使用 Mybatis + | +
| + moduleName + | + 模块名称对应后台工程模块名称 + |
| + require + | + 要求 DataEase 最低版本 + |