mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-05-01 13:13:58 +00:00
SYNC: chart UX
This commit is contained in:
committed by
Diflow
parent
68551ae176
commit
69ed9172b8
@@ -154,7 +154,14 @@ module.exports = {
|
|||||||
|
|
||||||
logger.info({ sesid, sql }, 'Processing query');
|
logger.info({ sesid, sql }, 'Processing query');
|
||||||
this.dispatchMessage(sesid, 'Query execution started');
|
this.dispatchMessage(sesid, 'Query execution started');
|
||||||
session.subprocess.send({ msgtype: 'executeQuery', sql, autoCommit, autoDetectCharts, limitRows, frontMatter });
|
session.subprocess.send({
|
||||||
|
msgtype: 'executeQuery',
|
||||||
|
sql,
|
||||||
|
autoCommit,
|
||||||
|
autoDetectCharts: autoDetectCharts || !!frontMatter?.['selected-chart'],
|
||||||
|
limitRows,
|
||||||
|
frontMatter,
|
||||||
|
});
|
||||||
|
|
||||||
return { state: 'ok' };
|
return { state: 'ok' };
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -91,6 +91,12 @@
|
|||||||
props: {
|
props: {
|
||||||
jslid: info.jslid,
|
jslid: info.jslid,
|
||||||
initialCharts: info.charts,
|
initialCharts: info.charts,
|
||||||
|
onCloseChart: () => {
|
||||||
|
charts = charts.filter(x => x.resultIndex !== info.resultIndex);
|
||||||
|
onSetFrontMatterField?.(`chart-${info.resultIndex + 1}`, undefined);
|
||||||
|
const value = _.findIndex(allTabs, x => x.isResult && x.resultIndex === info.resultIndex);
|
||||||
|
domTabs.setValue(value >= 0 ? value : 0);
|
||||||
|
},
|
||||||
onEditDefinition: definition => {
|
onEditDefinition: definition => {
|
||||||
onSetFrontMatterField?.(`chart-${info.resultIndex + 1}`, definition ?? undefined);
|
onSetFrontMatterField?.(`chart-${info.resultIndex + 1}`, definition ?? undefined);
|
||||||
},
|
},
|
||||||
@@ -148,14 +154,14 @@
|
|||||||
|
|
||||||
export function openCurrentChart() {
|
export function openCurrentChart() {
|
||||||
const currentIndex = domTabs.getValue();
|
const currentIndex = domTabs.getValue();
|
||||||
console.log('Current index:', currentIndex);
|
// console.log('Current index:', currentIndex);
|
||||||
const currentTab = allTabs[currentIndex];
|
const currentTab = allTabs[currentIndex];
|
||||||
console.log('Current tab:', currentTab);
|
// console.log('Current tab:', currentTab);
|
||||||
if (currentTab?.isChart) {
|
if (currentTab?.isChart) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const resultIndex = currentTab?.resultIndex;
|
const resultIndex = currentTab?.resultIndex;
|
||||||
console.log('Result index:', resultIndex);
|
// console.log('Result index:', resultIndex);
|
||||||
if (resultIndex != null) {
|
if (resultIndex != null) {
|
||||||
handleOpenChart(resultIndex);
|
handleOpenChart(resultIndex);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user