onHistoryItem(gql)}>
@@ -266,6 +299,7 @@ const OutputBox = (props: IProps) => {
{`${intl.get('console.execTime')} ${data.timeCost /
1000000} (s)`}
+ {onExplorer && }
)}
>}
diff --git a/app/pages/Console/index.less b/app/pages/Console/index.less
index dea7475d..e3928e52 100644
--- a/app/pages/Console/index.less
+++ b/app/pages/Console/index.less
@@ -145,6 +145,15 @@
}
}
+.export-node-modal {
+ .select-type {
+ display: inline-flex;
+ }
+ .ant-modal-body {
+ text-align: center;
+ }
+}
+
.historyList, .favoriteList {
height: 80%;
overflow: hidden;
diff --git a/app/pages/Console/index.tsx b/app/pages/Console/index.tsx
index b250a30d..6b351bab 100644
--- a/app/pages/Console/index.tsx
+++ b/app/pages/Console/index.tsx
@@ -2,7 +2,7 @@ import { Button, Select, Tooltip, message } from 'antd';
import React, { useEffect, useRef, useState } from 'react';
import intl from 'react-intl-universal';
import { observer } from 'mobx-react-lite';
-import { trackPageView } from '@app/utils/stat';
+import { trackPageView, trackEvent } from '@app/utils/stat';
import { useStore } from '@app/stores';
import Instruction from '@app/components/Instruction';
import Icon from '@app/components/Icon';
@@ -12,6 +12,7 @@ import { maxLineNum } from '@app/config/nebulaQL';
import HistoryBtn from './HistoryBtn';
import FavoriteBtn from './FavoriteBtn';
import CypherParameterBox from './CypherParameterBox';
+import ExportModal from './ExportModal';
import './index.less';
const Option = Select.Option;
@@ -26,12 +27,22 @@ const getHistory = () => {
return [];
};
-const Console = () => {
+interface IProps {
+ onExplorer?: (params: {
+ space: string;
+ vertexes: any[],
+ edges: any[]
+ }) => void
+}
+const Console = (props: IProps) => {
const { schema, console, global } = useStore();
+ const { onExplorer } = props;
const { spaces, getSpaces, switchSpace, currentSpace } = schema;
const { runGQL, currentGQL, results, runGQLLoading, getParams, update, paramsMap } = console;
const { username, host } = global;
const [isUpDown, setUpDown] = useState(false);
+ const [modalVisible, setModalVisible] = useState(false);
+ const [modalData, setModalData] = useState
(null);
const editor = useRef(null);
useEffect(() => {
trackPageView('/console');
@@ -93,6 +104,20 @@ const Console = () => {
const addParam = (param: string) => {
update({ currentGQL: currentGQL + ` $${param}` });
};
+
+ const handleResultConfig = (data: any) => {
+ setModalData(data);
+ setModalVisible(true);
+ };
+
+ const handleExplorer = (data) => {
+ if(!onExplorer) {
+ return;
+ }
+ onExplorer!(data);
+ !modalVisible && setModalVisible(false);
+ trackEvent('navigation', 'view_explore', 'from_console_btn');
+ };
return (
@@ -146,7 +171,9 @@ const Console = () => {
index={index}
result={item}
gql={item.gql}
+ onExplorer={onExplorer ? handleExplorer : undefined}
onHistoryItem={gql => updateGql(gql)}
+ onResultConfig={handleResultConfig}
/>
)) : {
/>}
+ {modalVisible && setModalVisible(false)}
+ onExplorer={handleExplorer} />}
);
};
diff --git a/scripts/deb/start.sh b/scripts/deb/start.sh
index 0a9052d6..8c3f598f 100644
--- a/scripts/deb/start.sh
+++ b/scripts/deb/start.sh
@@ -1,4 +1,5 @@
#!/bin/bash
+mkdir -p /usr/lib/systemd/system
cd /usr/local/nebula-graph-studio/
cp ./lib/nebula-graph-studio.service /usr/lib/systemd/system/
sudo systemctl daemon-reload && sudo systemctl enable nebula-graph-studio.service && sudo systemctl start nebula-graph-studio.service
\ No newline at end of file