From 3c4e7aba510b0c7fea0402af2adee59b4ffb35b1 Mon Sep 17 00:00:00 2001 From: Leto Date: Tue, 5 Sep 2023 14:11:50 +0800 Subject: [PATCH 1/2] feat(dashboard): show query name in url params --- dashboard/src/api-caller/index.ts | 11 ++++++----- .../render-model/dashboard/content/queries/query.ts | 3 ++- 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/dashboard/src/api-caller/index.ts b/dashboard/src/api-caller/index.ts index f11df7dce..143fb880d 100644 --- a/dashboard/src/api-caller/index.ts +++ b/dashboard/src/api-caller/index.ts @@ -11,12 +11,12 @@ export type QueryFailureError = { }; interface IQueryBySQL { - title: string; + name: string; query: { type: DataSourceType; key: string; sql: string; pre_process: string; post_process: string }; payload: TPayloadForSQL; } -export async function queryBySQL({ query, payload }: IQueryBySQL, signal: AbortSignal) { +export async function queryBySQL({ query, name, payload }: IQueryBySQL, signal: AbortSignal) { if (!query.sql) { return []; } @@ -24,7 +24,7 @@ export async function queryBySQL({ query, payload }: IQueryBySQL, signal: AbortS const formattedSQL = formatSQL(sql, payload); const finalSQL = preProcessSQLQuery({ sql: formattedSQL, pre_process }); - let data = await APIClient.query(signal)({ type, key, query: finalSQL }, {}); + let data = await APIClient.query(signal)({ type, key, query: finalSQL }, { params: { name } }); data = postProcessSQLQuery(post_process, data); return data; } @@ -33,10 +33,11 @@ interface IQueryByHTTP { type: DataSourceType; key: string; configString: string; + name: string; } -export async function queryByHTTP({ type, key, configString }: IQueryByHTTP, signal: AbortSignal) { - const res = await APIClient.query(signal)({ type, key, query: configString }, {}); +export async function queryByHTTP({ type, key, configString, name }: IQueryByHTTP, signal: AbortSignal) { + const res = await APIClient.query(signal)({ type, key, query: configString }, { params: { name } }); return res; } diff --git a/dashboard/src/model/render-model/dashboard/content/queries/query.ts b/dashboard/src/model/render-model/dashboard/content/queries/query.ts index 50307dc93..d2f5a603b 100644 --- a/dashboard/src/model/render-model/dashboard/content/queries/query.ts +++ b/dashboard/src/model/render-model/dashboard/content/queries/query.ts @@ -109,7 +109,7 @@ export const QueryRenderModel = types queryBySQL( { payload, - title: self.name, + name: self.name, query: self.json, }, self.controller.signal, @@ -152,6 +152,7 @@ export const QueryRenderModel = types type, key, configString: JSON.stringify(config), + name: self.name, }, self.controller.signal, ), From 34fac83a84de959f9c8a8f7a802361e46739adf5 Mon Sep 17 00:00:00 2001 From: Leto Date: Tue, 5 Sep 2023 14:12:10 +0800 Subject: [PATCH 2/2] chore: publish v10.29.0 --- api/package.json | 2 +- dashboard/package.json | 2 +- package.json | 2 +- settings-form/package.json | 2 +- website/package.json | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/api/package.json b/api/package.json index 03417967c..a372acf99 100644 --- a/api/package.json +++ b/api/package.json @@ -1,6 +1,6 @@ { "name": "@devtable/api", - "version": "10.28.0", + "version": "10.29.0", "description": "", "main": "index.js", "scripts": { diff --git a/dashboard/package.json b/dashboard/package.json index c8031853c..1a122a483 100644 --- a/dashboard/package.json +++ b/dashboard/package.json @@ -1,6 +1,6 @@ { "name": "@devtable/dashboard", - "version": "10.28.0", + "version": "10.29.0", "license": "Apache-2.0", "publishConfig": { "access": "public", diff --git a/package.json b/package.json index db98bc5e7..73754480b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@devtable/root", - "version": "10.28.0", + "version": "10.29.0", "private": true, "workspaces": [ "api", diff --git a/settings-form/package.json b/settings-form/package.json index cd7ec0183..c96c11b1b 100644 --- a/settings-form/package.json +++ b/settings-form/package.json @@ -1,6 +1,6 @@ { "name": "@devtable/settings-form", - "version": "10.28.0", + "version": "10.29.0", "license": "Apache-2.0", "publishConfig": { "access": "public", diff --git a/website/package.json b/website/package.json index 4996217f2..c991327a2 100644 --- a/website/package.json +++ b/website/package.json @@ -2,7 +2,7 @@ "name": "@devtable/website", "private": true, "license": "Apache-2.0", - "version": "10.28.0", + "version": "10.29.0", "scripts": { "dev": "vite", "preview": "vite preview"