|
@@ -37,6 +37,7 @@ import { cloneObj, generateVector } from '../../utils/Common';
|
|
import { CustomDatePicker } from '../../components/customDatePicker/CustomDatePicker';
|
|
import { CustomDatePicker } from '../../components/customDatePicker/CustomDatePicker';
|
|
import { useTimeTravelHook } from '../../hooks/TimeTravel';
|
|
import { useTimeTravelHook } from '../../hooks/TimeTravel';
|
|
import { LOADING_STATE } from '../../consts/Milvus';
|
|
import { LOADING_STATE } from '../../consts/Milvus';
|
|
|
|
+import { getLabelDisplayedRows } from './Utils';
|
|
|
|
|
|
const VectorSearch = () => {
|
|
const VectorSearch = () => {
|
|
useNavigationHook(ALL_ROUTER_TYPES.SEARCH);
|
|
useNavigationHook(ALL_ROUTER_TYPES.SEARCH);
|
|
@@ -45,6 +46,7 @@ const VectorSearch = () => {
|
|
// i18n
|
|
// i18n
|
|
const { t: searchTrans } = useTranslation('search');
|
|
const { t: searchTrans } = useTranslation('search');
|
|
const { t: btnTrans } = useTranslation('btn');
|
|
const { t: btnTrans } = useTranslation('btn');
|
|
|
|
+
|
|
const classes = getVectorSearchStyles();
|
|
const classes = getVectorSearchStyles();
|
|
|
|
|
|
// data stored inside the component
|
|
// data stored inside the component
|
|
@@ -71,6 +73,9 @@ const VectorSearch = () => {
|
|
const [expression, setExpression] = useState<string>('');
|
|
const [expression, setExpression] = useState<string>('');
|
|
const [vectors, setVectors] = useState<string>('');
|
|
const [vectors, setVectors] = useState<string>('');
|
|
|
|
|
|
|
|
+ // latency
|
|
|
|
+ const [latency, setLatency] = useState<number>(0);
|
|
|
|
+
|
|
const {
|
|
const {
|
|
pageSize,
|
|
pageSize,
|
|
handlePageSize,
|
|
handlePageSize,
|
|
@@ -133,7 +138,7 @@ const VectorSearch = () => {
|
|
align: 'left',
|
|
align: 'left',
|
|
disablePadding: false,
|
|
disablePadding: false,
|
|
label: key,
|
|
label: key,
|
|
- needCopy: primaryKeyField === key
|
|
|
|
|
|
+ needCopy: primaryKeyField === key,
|
|
}))
|
|
}))
|
|
: [];
|
|
: [];
|
|
}, [searchResult, primaryKeyField]);
|
|
}, [searchResult, primaryKeyField]);
|
|
@@ -330,6 +335,7 @@ const VectorSearch = () => {
|
|
|
|
|
|
const result = transferSearchResult(res.results);
|
|
const result = transferSearchResult(res.results);
|
|
setSearchResult(result);
|
|
setSearchResult(result);
|
|
|
|
+ setLatency(res.latency);
|
|
} catch (err) {
|
|
} catch (err) {
|
|
setTableLoading(false);
|
|
setTableLoading(false);
|
|
}
|
|
}
|
|
@@ -542,6 +548,7 @@ const VectorSearch = () => {
|
|
isLoading={tableLoading}
|
|
isLoading={tableLoading}
|
|
orderBy={orderBy}
|
|
orderBy={orderBy}
|
|
order={order}
|
|
order={order}
|
|
|
|
+ labelDisplayedRows={getLabelDisplayedRows(`(${latency} ms)`)}
|
|
handleSort={handleGridSort}
|
|
handleSort={handleGridSort}
|
|
tableCellMaxWidth="100%"
|
|
tableCellMaxWidth="100%"
|
|
/>
|
|
/>
|