From fbbf95e2fc452884df96c7f87fe8a79f8e5835d8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?=E7=8E=8B=E5=98=89=E8=B1=AA?=
<42510293+ziyujiahao@users.noreply.github.com>
Date: Wed, 3 Sep 2025 11:08:38 +0800
Subject: [PATCH 1/8] refactor: Optimize the tab component to resize internal
components and follow the tab component to jump proportionally (#106)
---
.../src/views/chat/chat-block/ChartBlock.vue | 4 +-
.../src/views/dashboard/canvas/CanvasCore.vue | 8 ++-
.../dashboard/components/sq-tab/index.vue | 66 +++++++++++--------
3 files changed, 47 insertions(+), 31 deletions(-)
diff --git a/frontend/src/views/chat/chat-block/ChartBlock.vue b/frontend/src/views/chat/chat-block/ChartBlock.vue
index a0553e8a..a8d8c502 100644
--- a/frontend/src/views/chat/chat-block/ChartBlock.vue
+++ b/frontend/src/views/chat/chat-block/ChartBlock.vue
@@ -63,6 +63,8 @@ const dataObject = computed<{
const assistantStore = useAssistantStore()
const isCompletePage = computed(() => !assistantStore.getAssistant || assistantStore.getEmbedded)
+const isAssistant = computed(() => assistantStore.getAssistant)
+
const chartId = computed(() => props.message?.record?.id + (props.enlarge ? '-fullscreen' : ''))
const data = computed(() => {
@@ -395,7 +397,7 @@ watch(
-
+
diff --git a/frontend/src/views/dashboard/canvas/CanvasCore.vue b/frontend/src/views/dashboard/canvas/CanvasCore.vue
index d1545078..e574ebb6 100644
--- a/frontend/src/views/dashboard/canvas/CanvasCore.vue
+++ b/frontend/src/views/dashboard/canvas/CanvasCore.vue
@@ -864,7 +864,7 @@ function startMove(e: MouseEvent, item: CanvasItem, index: number) {
html2canvas(clonedSlot).then((canvas) => {
img.src = canvas.toDataURL()
- infoBox.value.cloneItem.appendChild(img)
+ infoBox.value.cloneItem?.appendChild(img)
})
if (containerRef.value) {
@@ -994,6 +994,12 @@ function startMove(e: MouseEvent, item: CanvasItem, index: number) {
if (infoBox.value.resizeItem) {
delete infoBox.value.resizeItem.isPlayer
props.resizeEnd(e, infoBox.value.resizeItem, infoBox.value.resizeItem._dragId)
+
+ if (infoBox.value.resizeItem.component === 'SQTab') {
+ const refTabInstance =
+ currentInstance.refs['shape_component_' + infoBox.value.resizeItem.id][0]
+ refTabInstance.outResizeEnd()
+ }
}
if (infoBox.value.moveItem) {
props.dragEnd(e, infoBox.value.moveItem, infoBox.value.moveItem._dragId)
diff --git a/frontend/src/views/dashboard/components/sq-tab/index.vue b/frontend/src/views/dashboard/components/sq-tab/index.vue
index 2bb1c819..06a44e97 100644
--- a/frontend/src/views/dashboard/components/sq-tab/index.vue
+++ b/frontend/src/views/dashboard/components/sq-tab/index.vue
@@ -119,7 +119,12 @@ const beforeHandleCommand = (item: any, param: any) => {
}
}
const isEditMode = computed(() => props.showPosition === 'canvas')
-
+const outResizeEnd = () => {
+ state.tabShow = false
+ nextTick(() => {
+ state.tabShow = true
+ })
+}
const addTabItem = (item: CanvasItem) => {
// do addTabItem
const index = configItem.value.propValue.findIndex(
@@ -168,6 +173,7 @@ onMounted(() => {
defineExpose({
addTabItem,
+ outResizeEnd,
})
@@ -224,35 +230,37 @@ defineExpose({
-
-
-
emits('parentAddItemBox', item)"
+
+
-
-
+
+ emits('parentAddItemBox', item)"
+ >
+
+
+
Date: Wed, 3 Sep 2025 12:20:58 +0800
Subject: [PATCH 2/8] build: allinone
---
Dockerfile | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/Dockerfile b/Dockerfile
index b0e9884f..294c7a47 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -45,7 +45,7 @@ COPY g2-ssr/charts/* /app/charts/
RUN npm install
-FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-base:latest AS python-builder
+FROM python:3.11-slim-bookworm AS python-builder
# Runtime stage
# FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-base:latest
FROM registry.cn-qingdao.aliyuncs.com/dataease/postgres:17.6
@@ -74,6 +74,7 @@ ARG DEPENDENCIES=" \
RUN apt-get update && apt-get install -y --no-install-recommends $DEPENDENCIES \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs \
+ && curl -L --connect-timeout 60 -m 1800 https://fit2cloud-support.oss-cn-beijing.aliyuncs.com/xpack-license/get-validator-linux | sh \
&& rm -rf /var/lib/apt/lists/* \
&& chmod g-xr /usr/local/bin/* /usr/bin/* /bin/* /usr/sbin/* /sbin/* /usr/lib/postgresql/17/bin/* \
&& chmod g+xr /usr/bin/ld.so \
From 8db27b64813077b59dc7766e9c7d39f15981785e Mon Sep 17 00:00:00 2001
From: junjun
Date: Wed, 3 Sep 2025 13:17:21 +0800
Subject: [PATCH 3/8] build: allinone
---
.github/workflows/build_base_and_push.yml | 104 ++++++++++++++++++++++
Dockerfile-base | 32 +++++++
2 files changed, 136 insertions(+)
create mode 100644 .github/workflows/build_base_and_push.yml
create mode 100644 Dockerfile-base
diff --git a/.github/workflows/build_base_and_push.yml b/.github/workflows/build_base_and_push.yml
new file mode 100644
index 00000000..b4199820
--- /dev/null
+++ b/.github/workflows/build_base_and_push.yml
@@ -0,0 +1,104 @@
+name: build-and-push
+
+run-name: 构建镜像并推送仓库 ${{ github.event.inputs.dockerImageTag }} (${{ github.event.inputs.registry }}) (${{ github.event.inputs.architecture }})
+
+on:
+ workflow_dispatch:
+ inputs:
+ dockerImageTag:
+ description: 'Image Tag'
+ default: 'v0.9.0'
+ required: true
+ dockerImageTagWithLatest:
+ description: '是否发布latest tag(正式发版时选择,测试版本切勿选择)'
+ default: false
+ required: true
+ type: boolean
+ architecture:
+ description: 'Architecture'
+ required: true
+ default: 'linux/amd64'
+ type: choice
+ options:
+ - linux/amd64
+ - linux/arm64
+ - linux/amd64,linux/arm64
+ registry:
+ description: 'Push To Registry'
+ required: true
+ default: 'aliyun-registry'
+ type: choice
+ options:
+ - aliyun-registry
+ - dockerhub
+ - dockerhub, aliyun-registry
+
+jobs:
+ build-and-push-to-aliyun-registry:
+ if: ${{ contains(github.event.inputs.registry, 'aliyun') }}
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ github.ref_name }}
+ - name: Prepare
+ id: prepare
+ run: |
+ DOCKER_IMAGE=${{ secrets.ALIYUN_REGISTRY_HOST }}/dataease/sqlbot-python-pg
+ DOCKER_PLATFORMS=${{ github.event.inputs.architecture }}
+ TAG_NAME=${{ github.event.inputs.dockerImageTag }}
+ TAG_NAME_WITH_LATEST=${{ github.event.inputs.dockerImageTagWithLatest }}
+ if [[ ${TAG_NAME_WITH_LATEST} == 'true' ]]; then
+ DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:${TAG_NAME%%.*} --tag ${DOCKER_IMAGE}:latest"
+ else
+ DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME}"
+ fi
+ echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} --memory-swap -1 \
+ --build-arg DOCKER_IMAGE_TAG=${{ github.event.inputs.dockerImageTag }} --build-arg BUILD_AT=$(TZ=Asia/Shanghai date +'%Y-%m-%dT%H:%M') --build-arg GITHUB_COMMIT=`git rev-parse --short HEAD` --no-cache \
+ ${DOCKER_IMAGE_TAGS} .
+ - name: Set up Docker Buildx
+ uses: crazy-max/ghaction-docker-buildx@v3
+ - name: Login to Aliyun Registry
+ uses: docker/login-action@v2
+ with:
+ registry: ${{ secrets.ALIYUN_REGISTRY_HOST }}
+ username: ${{ secrets.ALIYUN_REGISTRY_USERNAME }}
+ password: ${{ secrets.ALIYUN_REGISTRY_PASSWORD }}
+ - name: Docker Buildx (build-and-push)
+ run: |
+ docker buildx build -f Dockerfile-base --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
+
+ build-and-push-to-dockerhub:
+ if: ${{ contains(github.event.inputs.registry, 'dockerhub') }}
+ runs-on: ubuntu-latest
+ steps:
+ - name: Checkout
+ uses: actions/checkout@v4
+ with:
+ ref: ${{ github.ref_name }}
+ - name: Prepare
+ id: prepare
+ run: |
+ DOCKER_IMAGE=dataease/sqlbot-python-pg
+ DOCKER_PLATFORMS=${{ github.event.inputs.architecture }}
+ TAG_NAME=${{ github.event.inputs.dockerImageTag }}
+ TAG_NAME_WITH_LATEST=${{ github.event.inputs.dockerImageTagWithLatest }}
+ if [[ ${TAG_NAME_WITH_LATEST} == 'true' ]]; then
+ DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME} --tag ${DOCKER_IMAGE}:${TAG_NAME%%.*} --tag ${DOCKER_IMAGE}:latest"
+ else
+ DOCKER_IMAGE_TAGS="--tag ${DOCKER_IMAGE}:${TAG_NAME}"
+ fi
+ echo ::set-output name=buildx_args::--platform ${DOCKER_PLATFORMS} --memory-swap -1 \
+ --build-arg DOCKER_IMAGE_TAG=${{ github.event.inputs.dockerImageTag }} --build-arg BUILD_AT=$(TZ=Asia/Shanghai date +'%Y-%m-%dT%H:%M') --build-arg GITHUB_COMMIT=`git rev-parse --short HEAD` --no-cache \
+ ${DOCKER_IMAGE_TAGS} .
+ - name: Set up Docker Buildx
+ uses: crazy-max/ghaction-docker-buildx@v3
+ - name: Login to Docker Hub
+ uses: docker/login-action@v3
+ with:
+ username: ${{ secrets.DOCKERHUB_USERNAME }}
+ password: ${{ secrets.DOCKERHUB_TOKEN }}
+ - name: Docker Buildx (build-and-push)
+ run: |
+ docker buildx build -f Dockerfile-base --output "type=image,push=true" ${{ steps.prepare.outputs.buildx_args }}
\ No newline at end of file
diff --git a/Dockerfile-base b/Dockerfile-base
new file mode 100644
index 00000000..cc277df7
--- /dev/null
+++ b/Dockerfile-base
@@ -0,0 +1,32 @@
+FROM python:3.11-slim-bookworm AS python-builder
+FROM registry.cn-qingdao.aliyuncs.com/dataease/postgres:17.6
+
+# python environment
+COPY --from=python-builder /usr/local /usr/local
+
+RUN python --version && pip --version
+
+# Install uv tool
+COPY --from=ghcr.io/astral-sh/uv:0.7.8 /uv /uvx /bin/
+
+ARG DEPENDENCIES=" \
+ wait-for-it \
+ build-essential \
+ curl \
+ gnupg \
+ gcc \
+ g++ \
+ libcairo2-dev \
+ libpango1.0-dev \
+ libjpeg-dev \
+ libgif-dev \
+ librsvg2-dev"
+
+RUN apt-get update && apt-get install -y --no-install-recommends $DEPENDENCIES \
+ && curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
+ && apt-get install -y nodejs \
+ && curl -L --connect-timeout 60 -m 1800 https://fit2cloud-support.oss-cn-beijing.aliyuncs.com/xpack-license/get-validator-linux | sh \
+ && rm -rf /var/lib/apt/lists/* \
+ && chmod g-xr /usr/local/bin/* /usr/bin/* /bin/* /usr/sbin/* /sbin/* /usr/lib/postgresql/17/bin/* \
+ && chmod g+xr /usr/bin/ld.so \
+ && chmod g+x /usr/local/bin/python*
\ No newline at end of file
From 2b1792fcee4fea5455eaf8a74f9d9056a58f49f3 Mon Sep 17 00:00:00 2001
From: junjun
Date: Wed, 3 Sep 2025 13:19:16 +0800
Subject: [PATCH 4/8] build: allinone
---
.github/workflows/build_base_and_push.yml | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/.github/workflows/build_base_and_push.yml b/.github/workflows/build_base_and_push.yml
index b4199820..2b565bbf 100644
--- a/.github/workflows/build_base_and_push.yml
+++ b/.github/workflows/build_base_and_push.yml
@@ -1,4 +1,4 @@
-name: build-and-push
+name: build-base-and-push
run-name: 构建镜像并推送仓库 ${{ github.event.inputs.dockerImageTag }} (${{ github.event.inputs.registry }}) (${{ github.event.inputs.architecture }})
From 0ee7b5faad1bb2243910df9283642a8b8fb5779f Mon Sep 17 00:00:00 2001
From: junjun
Date: Wed, 3 Sep 2025 13:34:10 +0800
Subject: [PATCH 5/8] build: allinone
---
Dockerfile | 43 +++----------------------------------------
1 file changed, 3 insertions(+), 40 deletions(-)
diff --git a/Dockerfile b/Dockerfile
index 294c7a47..87873ec5 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,6 +1,6 @@
# Build sqlbot
FROM ghcr.io/1panel-dev/maxkb-vector-model:v1.0.1 AS vector-model
-FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-base:latest AS sqlbot-builder
+FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-python-pg:latest AS sqlbot-builder
# Set build environment variables
ENV PYTHONUNBUFFERED=1
@@ -36,7 +36,7 @@ RUN --mount=type=cache,target=/root/.cache/uv \
uv sync --extra cpu
# Build g2-ssr
-FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-base:latest AS ssr-builder
+FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-python-pg:latest AS ssr-builder
WORKDIR /app
@@ -45,45 +45,8 @@ COPY g2-ssr/charts/* /app/charts/
RUN npm install
-FROM python:3.11-slim-bookworm AS python-builder
# Runtime stage
-# FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-base:latest
-FROM registry.cn-qingdao.aliyuncs.com/dataease/postgres:17.6
-
-# python environment
-COPY --from=python-builder /usr/local /usr/local
-
-RUN python --version && pip --version
-
-# Install uv tool
-COPY --from=ghcr.io/astral-sh/uv:0.7.8 /uv /uvx /bin/
-
-ARG DEPENDENCIES=" \
- wait-for-it \
- build-essential \
- curl \
- gnupg \
- gcc \
- g++ \
- libcairo2-dev \
- libpango1.0-dev \
- libjpeg-dev \
- libgif-dev \
- librsvg2-dev"
-
-RUN apt-get update && apt-get install -y --no-install-recommends $DEPENDENCIES \
- && curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
- && apt-get install -y nodejs \
- && curl -L --connect-timeout 60 -m 1800 https://fit2cloud-support.oss-cn-beijing.aliyuncs.com/xpack-license/get-validator-linux | sh \
- && rm -rf /var/lib/apt/lists/* \
- && chmod g-xr /usr/local/bin/* /usr/bin/* /bin/* /usr/sbin/* /sbin/* /usr/lib/postgresql/17/bin/* \
- && chmod g+xr /usr/bin/ld.so \
- && chmod g+x /usr/local/bin/python*
-
-# ENV PGDATA=/var/lib/postgresql/data \
-# POSTGRES_USER=root \
-# POSTGRES_PASSWORD=Password123@pg \
-# POSTGRES_DB=sqlbot
+FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-python-pg:latest
# Set runtime environment variables
ENV PYTHONUNBUFFERED=1
From 441bcec69c32c33cc8eaee7dd1c1f8f14a6721db Mon Sep 17 00:00:00 2001
From: junjun
Date: Wed, 3 Sep 2025 13:49:10 +0800
Subject: [PATCH 6/8] build: allinone
---
Dockerfile-base | 26 ++++++++++++--------------
1 file changed, 12 insertions(+), 14 deletions(-)
diff --git a/Dockerfile-base b/Dockerfile-base
index cc277df7..5030abf2 100644
--- a/Dockerfile-base
+++ b/Dockerfile-base
@@ -9,20 +9,18 @@ RUN python --version && pip --version
# Install uv tool
COPY --from=ghcr.io/astral-sh/uv:0.7.8 /uv /uvx /bin/
-ARG DEPENDENCIES=" \
- wait-for-it \
- build-essential \
- curl \
- gnupg \
- gcc \
- g++ \
- libcairo2-dev \
- libpango1.0-dev \
- libjpeg-dev \
- libgif-dev \
- librsvg2-dev"
-
-RUN apt-get update && apt-get install -y --no-install-recommends $DEPENDENCIES \
+RUN apt-get update && apt-get install -y --no-install-recommends \
+ wait-for-it \
+ build-essential \
+ curl \
+ gnupg \
+ gcc \
+ g++ \
+ libcairo2-dev \
+ libpango1.0-dev \
+ libjpeg-dev \
+ libgif-dev \
+ librsvg2-dev \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs \
&& curl -L --connect-timeout 60 -m 1800 https://fit2cloud-support.oss-cn-beijing.aliyuncs.com/xpack-license/get-validator-linux | sh \
From a53f647be59eccc27d50c656def14035a9e413a4 Mon Sep 17 00:00:00 2001
From: junjun
Date: Wed, 3 Sep 2025 14:23:10 +0800
Subject: [PATCH 7/8] build: allinone
---
Dockerfile-base | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/Dockerfile-base b/Dockerfile-base
index 5030abf2..88a773d8 100644
--- a/Dockerfile-base
+++ b/Dockerfile-base
@@ -24,7 +24,4 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs \
&& curl -L --connect-timeout 60 -m 1800 https://fit2cloud-support.oss-cn-beijing.aliyuncs.com/xpack-license/get-validator-linux | sh \
- && rm -rf /var/lib/apt/lists/* \
- && chmod g-xr /usr/local/bin/* /usr/bin/* /bin/* /usr/sbin/* /sbin/* /usr/lib/postgresql/17/bin/* \
- && chmod g+xr /usr/bin/ld.so \
- && chmod g+x /usr/local/bin/python*
\ No newline at end of file
+ && rm -rf /var/lib/apt/lists/*
\ No newline at end of file
From 069db60654368d7218d96291efbe0faa375fcd7a Mon Sep 17 00:00:00 2001
From: junjun
Date: Wed, 3 Sep 2025 14:25:02 +0800
Subject: [PATCH 8/8] build: allinone
---
Dockerfile-base | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/Dockerfile-base b/Dockerfile-base
index 88a773d8..259e560c 100644
--- a/Dockerfile-base
+++ b/Dockerfile-base
@@ -24,4 +24,6 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
&& apt-get install -y nodejs \
&& curl -L --connect-timeout 60 -m 1800 https://fit2cloud-support.oss-cn-beijing.aliyuncs.com/xpack-license/get-validator-linux | sh \
- && rm -rf /var/lib/apt/lists/*
\ No newline at end of file
+ && rm -rf /var/lib/apt/lists/* \
+ && chmod g+xr /usr/bin/ld.so \
+ && chmod g+x /usr/local/bin/python*
\ No newline at end of file