Skip to content

Commit fd7d490

Browse files
committed
Merge branch 'main' of https://github.com/dataease/SQLBot
2 parents 90af17b + b0271e1 commit fd7d490

File tree

4 files changed

+56
-11
lines changed

4 files changed

+56
-11
lines changed

Dockerfile

Lines changed: 40 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,45 @@ COPY g2-ssr/charts/* /app/charts/
4545

4646
RUN npm install
4747

48+
FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-base:latest AS python-builder
4849
# Runtime stage
49-
FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-base:latest
50+
# FROM registry.cn-qingdao.aliyuncs.com/dataease/sqlbot-base:latest
51+
FROM registry.cn-qingdao.aliyuncs.com/dataease/postgres:17.6
52+
53+
# python environment
54+
COPY --from=python-builder /usr/local /usr/local
55+
56+
RUN python --version && pip --version
57+
58+
# Install uv tool
59+
COPY --from=ghcr.io/astral-sh/uv:0.7.8 /uv /uvx /bin/
60+
61+
RUN apt-get update && apt-get install -y --no-install-recommends \
62+
build-essential \
63+
curl \
64+
gnupg \
65+
gcc \
66+
g++ \
67+
libcairo2-dev \
68+
libpango1.0-dev \
69+
libjpeg-dev \
70+
libgif-dev \
71+
librsvg2-dev \
72+
&& curl -fsSL https://deb.nodesource.com/setup_18.x | bash - \
73+
&& apt-get install -y nodejs \
74+
&& rm -rf /var/lib/apt/lists/* \
75+
&& chmod g-xr /usr/local/bin/* /usr/bin/* /bin/* /usr/sbin/* /sbin/* /usr/lib/postgresql/17/bin/* \
76+
&& chmod g+xr /usr/bin/ld.so \
77+
&& chmod g+x /usr/local/bin/python*
78+
79+
ARG DEPENDENCIES=" \
80+
vim \
81+
postgresql-17-pgvector"
82+
83+
# ENV PGDATA=/var/lib/postgresql/data \
84+
# POSTGRES_USER=root \
85+
# POSTGRES_PASSWORD=Password123@pg \
86+
# POSTGRES_DB=sqlbot
5087

5188
# Set runtime environment variables
5289
ENV PYTHONUNBUFFERED=1
@@ -65,10 +102,11 @@ WORKDIR ${SQLBOT_HOME}/app
65102

66103
RUN mkdir -p /opt/sqlbot/images /opt/sqlbot/g2-ssr
67104

68-
EXPOSE 3000 8000 8001
105+
EXPOSE 3000 8000 8001 5432
69106

70107
# Add health check
71108
HEALTHCHECK --interval=30s --timeout=10s --start-period=5s --retries=3 \
72109
CMD curl -f http://localhost:8000 || exit 1
73110

111+
CMD ["/usr/local/bin/docker-entrypoint.sh"]
74112
ENTRYPOINT ["sh", "start.sh"]

backend/apps/system/crud/assistant.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,14 @@ def get_assistant_ds(session: Session, llm_service) -> list[dict]:
4040
stmt = select(CoreDatasource.id, CoreDatasource.name, CoreDatasource.description).where(
4141
CoreDatasource.oid == oid)
4242
if not assistant.online:
43-
private_list: list[int] = config.get('private_list') or None
43+
public_list: list[int] = config.get('public_list') or None
44+
if public_list:
45+
stmt = stmt.where(CoreDatasource.id.in_(public_list))
46+
else:
47+
raise RuntimeError('no public datasource valid')
48+
""" private_list: list[int] = config.get('private_list') or None
4449
if private_list:
45-
stmt = stmt.where(~CoreDatasource.id.in_(private_list))
50+
stmt = stmt.where(~CoreDatasource.id.in_(private_list)) """
4651
db_ds_list = session.exec(stmt)
4752

4853
result_list = [

frontend/src/entity/supplier.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -217,11 +217,11 @@ export const supplierList: Array<{
217217
model_options: [
218218
{
219219
name: 'kimi-k2-0711-preview',
220-
args: [{ key: 'temperature', val: 0.6, type: 'number', range: '[0, 1]' }],
220+
args: [{ key: 'temperature', val: 0.3, type: 'number', range: '[0, 1]' }],
221221
},
222222
{
223223
name: 'kimi-k2-turbo-preview',
224-
args: [{ key: 'temperature', val: 0.6, type: 'number', range: '[0, 1]' }],
224+
args: [{ key: 'temperature', val: 0.3, type: 'number', range: '[0, 1]' }],
225225
},
226226
{ name: 'moonshot-v1-8k' },
227227
{ name: 'moonshot-v1-32k' },

frontend/src/views/system/embedded/iframe.vue

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -407,11 +407,13 @@ const handleEmbedded = (row: any) => {
407407
script.src = "${origin + pathname}xpack_static/sqlbot-embedded-dynamic.umd.js";
408408
document.head.appendChild(script);
409409
})()
410-
411-
sqlbot_embedded_handler.mounted('.copilot', {
412-
"embeddedId": "${row.id}",
413-
"online": true
414-
})`
410+
let sqlbot_embedded_timer = setInterval(() => {
411+
if (sqlbot_embedded_handler?.mounted) {
412+
sqlbot_embedded_handler.mounted('.copilot', { "embeddedId": "${row.id}" })
413+
clearInterval(sqlbot_embedded_timer)
414+
}
415+
}, 1000)
416+
`
415417
}
416418
const copyJsCode = () => {
417419
copy(jsCodeElement.value)

0 commit comments

Comments
 (0)