diff --git a/hubble-fe/src/components/common/AppBar.tsx b/hubble-fe/src/components/common/AppBar.tsx index 86fd8bdd..6267f370 100644 --- a/hubble-fe/src/components/common/AppBar.tsx +++ b/hubble-fe/src/components/common/AppBar.tsx @@ -26,8 +26,7 @@ const AppBar: React.FC = observer(() => {
- {/* fe-community-beta.28 */} - {/* fe-v1.6.0-alpha.2 */} +
); diff --git a/hubble-fe/src/components/graph-management/GraphManagement.less b/hubble-fe/src/components/graph-management/GraphManagement.less index 9cea3d4d..afde29f3 100644 --- a/hubble-fe/src/components/graph-management/GraphManagement.less +++ b/hubble-fe/src/components/graph-management/GraphManagement.less @@ -19,9 +19,8 @@ &-description { margin-right: auto; display: block; - font-size: 12px; + font-size: 14px; line-height: 32px; - color: #666; } &-description-community { diff --git a/hubble-fe/src/components/graph-management/GraphManagementList.tsx b/hubble-fe/src/components/graph-management/GraphManagementList.tsx index bd8eea5b..25a102ab 100644 --- a/hubble-fe/src/components/graph-management/GraphManagementList.tsx +++ b/hubble-fe/src/components/graph-management/GraphManagementList.tsx @@ -53,12 +53,6 @@ const commonInputProps = { width: 420 }; -const isRequiredInputProps = { - ...commonInputProps, - isRequired: true, - requiredErrorMessage: '必填项' -}; - const listVariants = { initial: { opacity: 0, @@ -267,20 +261,9 @@ const GraphManagementListItem: React.FC< hint
@@ -293,56 +276,26 @@ const GraphManagementListItem: React.FC< hint
主机名:
端口号:
diff --git a/hubble-fe/src/components/graph-management/async-tasks/AsyncTaskList.tsx b/hubble-fe/src/components/graph-management/async-tasks/AsyncTaskList.tsx index 4975faed..c0f65903 100644 --- a/hubble-fe/src/components/graph-management/async-tasks/AsyncTaskList.tsx +++ b/hubble-fe/src/components/graph-management/async-tasks/AsyncTaskList.tsx @@ -248,8 +248,8 @@ const AsyncTaskList: React.FC = observer(() => {
{t('async-tasks.table-filters.status.all')}
-
- {t('async-tasks.table-filters.status.new')} +
+ {t('async-tasks.table-filters.status.scheduling')}
{t('async-tasks.table-filters.status.queued')} @@ -337,7 +337,8 @@ const AsyncTaskList: React.FC = observer(() => { !isUndefined( asyncTasksStore.asyncTaskList.find( ({ task_status }) => - task_status === 'new' || + task_status === 'scheduling' || + task_status === 'scheduled' || task_status === 'queued' || task_status === 'running' || task_status === 'restoring' @@ -561,7 +562,8 @@ const AsyncTaskList: React.FC = observer(() => { const { task_status } = records; return { disabled: - task_status === 'new' || + task_status === 'scheduling' || + task_status === 'scheduled' || task_status === 'queued' || task_status === 'running' || task_status === 'restoring' || @@ -672,7 +674,8 @@ export const AsyncTaskListManipulation: React.FC {t('async-tasks.manipulations.check-reason')} )} - {status !== 'new' && + {status !== 'scheduling' && + status !== 'scheduled' && status !== 'queued' && status !== 'running' && status !== 'restoring' && ( @@ -766,7 +769,8 @@ export const AsyncTaskListManipulation: React.FC {t('async-tasks.manipulations.delete')} )} - {(status === 'new' || + {(status === 'scheduling' || + status === 'scheduled' || status === 'queued' || status === 'running' || status === 'restoring') && ( diff --git a/hubble-fe/src/components/graph-management/data-import/import-tasks/datamap-configs/EdgeMap.tsx b/hubble-fe/src/components/graph-management/data-import/import-tasks/datamap-configs/EdgeMap.tsx index ea7c3f31..01fd7c7a 100644 --- a/hubble-fe/src/components/graph-management/data-import/import-tasks/datamap-configs/EdgeMap.tsx +++ b/hubble-fe/src/components/graph-management/data-import/import-tasks/datamap-configs/EdgeMap.tsx @@ -795,7 +795,13 @@ const EdgeMap: React.FC = observer( .editedEdgeMap!.null_values.checked.filter( (value) => value !== 'null' ) - .map((value) => (value === '' ? '空值' : value)) + .map((value) => + value === '' + ? '空值' + : value === 'NULL' + ? 'NULL/null' + : value + ) .concat(dataMapStore.editedEdgeMap!.null_values.customized) .join(',')} diff --git a/hubble-fe/src/components/graph-management/data-import/import-tasks/datamap-configs/VertexMap.tsx b/hubble-fe/src/components/graph-management/data-import/import-tasks/datamap-configs/VertexMap.tsx index 2ae95119..102de8a9 100644 --- a/hubble-fe/src/components/graph-management/data-import/import-tasks/datamap-configs/VertexMap.tsx +++ b/hubble-fe/src/components/graph-management/data-import/import-tasks/datamap-configs/VertexMap.tsx @@ -688,7 +688,13 @@ const VertexMap: React.FC = observer( .editedVertexMap!.null_values.checked.filter( (value) => value !== 'null' ) - .map((value) => (value === '' ? '空值' : value)) + .map((value) => + value === '' + ? '空值' + : value === 'NULL' + ? 'NULL/null' + : value + ) .concat( dataMapStore.editedVertexMap!.null_values.customized ) diff --git a/hubble-fe/src/components/graph-management/metadata-configs/edge-type/EdgeTypeList.tsx b/hubble-fe/src/components/graph-management/metadata-configs/edge-type/EdgeTypeList.tsx index d492afa2..9c9d16a0 100644 --- a/hubble-fe/src/components/graph-management/metadata-configs/edge-type/EdgeTypeList.tsx +++ b/hubble-fe/src/components/graph-management/metadata-configs/edge-type/EdgeTypeList.tsx @@ -493,8 +493,14 @@ const EdgeTypeList: React.FC = observer(() => { }} />
+
+ 确认删除以下边? +
- 使用中边不可删除,确认删除以下未使用边? + 删除元数据耗时较久,详情可在任务管理中查看。
{
{ + onChange={(checked: boolean) => { currentProperties[ index ].nullable = !currentProperties[index].nullable; @@ -391,6 +391,16 @@ const NewVertexType: React.FC = observer(() => { ...edgeTypeStore.newEdgeType, properties: currentProperties }); + + // remove primary keys since it could be empty value + if (checked) { + edgeTypeStore.mutateNewEdgeType({ + ...edgeTypeStore.newEdgeType, + sort_keys: edgeTypeStore.newEdgeType.sort_keys.filter( + (key) => key !== property.name + ) + }); + } }} size="large" /> diff --git a/hubble-fe/src/components/graph-management/metadata-configs/graph-view/CheckAndEditEdge.tsx b/hubble-fe/src/components/graph-management/metadata-configs/graph-view/CheckAndEditEdge.tsx index ad27b410..25edfd92 100644 --- a/hubble-fe/src/components/graph-management/metadata-configs/graph-view/CheckAndEditEdge.tsx +++ b/hubble-fe/src/components/graph-management/metadata-configs/graph-view/CheckAndEditEdge.tsx @@ -324,8 +324,9 @@ const CheckAndEditEdge: React.FC = observer(() => { }} tooltipWrapper={
-

确认删除此边类型?

-

删除后无法恢复,请谨慎操作。

+

确认删除此边类型?

+

删除后无法恢复,请谨慎操作

+

删除元数据耗时较久,详情可在任务管理中查看

{

当前顶点类型正在使用中,不可删除。

) : ( <> -

确认删除此顶点?

-

删除后无法恢复,请谨慎操作。

+

确认删除此顶点类型?

+

删除后无法恢复,请谨慎操作

+

删除元数据耗时较久,详情可在任务管理中查看

{ placement="bottom-end" tooltipShown={index === deletePopIndex} tooltipWrapperProps={{ - className: 'metadata-properties-tooltips' + className: 'metadata-properties-tooltips', + style: { zIndex: 1041 } }} tooltipWrapper={
@@ -1062,6 +1063,8 @@ const CreateEdge: React.FC = observer(() => { edgeTypeStore.validateNewEdgeType( 'propertyIndexes' ); + + setDeletePopIndex(null); }} > 确认 diff --git a/hubble-fe/src/components/graph-management/metadata-configs/graph-view/CreateVertex.tsx b/hubble-fe/src/components/graph-management/metadata-configs/graph-view/CreateVertex.tsx index 60cc04a0..28f36165 100644 --- a/hubble-fe/src/components/graph-management/metadata-configs/graph-view/CreateVertex.tsx +++ b/hubble-fe/src/components/graph-management/metadata-configs/graph-view/CreateVertex.tsx @@ -34,6 +34,7 @@ import type { VertexTypeValidatePropertyIndexes } from '../../../../stores/types import BlueArrowIcon from '../../../../assets/imgs/ic_arrow_blue.svg'; import HintIcon from '../../../../assets/imgs/ic_question_mark.svg'; import closeIcon from '../../../../assets/imgs/ic_close_16.svg'; +import { clearObserving } from 'mobx/lib/internal'; const CreateVertex: React.FC = observer(() => { const dataAnalyzeStore = useContext(DataAnalyzeStore); @@ -967,7 +968,8 @@ const CreateVertex: React.FC = observer(() => { } }} tooltipWrapperProps={{ - className: 'metadata-properties-tooltips' + className: 'metadata-properties-tooltips', + style: { zIndex: 1041 } }} tooltipWrapper={
diff --git a/hubble-fe/src/components/graph-management/metadata-configs/graph-view/GraphView.tsx b/hubble-fe/src/components/graph-management/metadata-configs/graph-view/GraphView.tsx index 0c1e9fe8..a035e436 100644 --- a/hubble-fe/src/components/graph-management/metadata-configs/graph-view/GraphView.tsx +++ b/hubble-fe/src/components/graph-management/metadata-configs/graph-view/GraphView.tsx @@ -284,6 +284,11 @@ const GraphDataView: React.FC = observer(() => { graphViewStore.setCurrentDrawer('check-vertex'); graphViewStore.switchNodeOrEdgeClicked(true); + + // check if vertex type being used + vertexTypeStore.checkIfUsing([ + vertexTypeStore.selectedVertexType!.name + ]); } return; diff --git a/hubble-fe/src/components/graph-management/metadata-configs/property/MetadataProperties.tsx b/hubble-fe/src/components/graph-management/metadata-configs/property/MetadataProperties.tsx index c7a4438d..a7e4e57a 100644 --- a/hubble-fe/src/components/graph-management/metadata-configs/property/MetadataProperties.tsx +++ b/hubble-fe/src/components/graph-management/metadata-configs/property/MetadataProperties.tsx @@ -6,7 +6,7 @@ import React, { useCallback } from 'react'; import { observer } from 'mobx-react'; -import { intersection, size, without } from 'lodash-es'; +import { intersection, size, without, values } from 'lodash-es'; import { motion } from 'framer-motion'; import { Input, @@ -166,6 +166,20 @@ const MetadataProperties: React.FC = observer(() => { }; const batchDeleteProperties = async () => { + if ( + values(currentSelectedRowKeys).every( + (key) => metadataPropertyStore.metadataPropertyUsingStatus?.[key] + ) + ) { + Message.error({ + content: '无可删除属性', + size: 'medium', + showCloseIcon: false + }); + + return; + } + switchShowModal(false); // need to set a copy in store since local row key state would be cleared metadataPropertyStore.mutateSelectedMetadataProperyNames( diff --git a/hubble-fe/src/components/graph-management/metadata-configs/vertex-type/NewVertexType.tsx b/hubble-fe/src/components/graph-management/metadata-configs/vertex-type/NewVertexType.tsx index 41545c69..8828e9c6 100644 --- a/hubble-fe/src/components/graph-management/metadata-configs/vertex-type/NewVertexType.tsx +++ b/hubble-fe/src/components/graph-management/metadata-configs/vertex-type/NewVertexType.tsx @@ -267,6 +267,7 @@ const NewVertexType: React.FC = observer(() => { const currentProperties = cloneDeep( vertexTypeStore.newVertexType.properties ); + return (
{
{ - currentProperties[ - index - ].nullable = !currentProperties[index].nullable; + onChange={(checked: boolean) => { + currentProperties[index].nullable = checked; vertexTypeStore.mutateNewProperty({ ...vertexTypeStore.newVertexType, properties: currentProperties }); + + // remove primary keys since it could be empty value + if (checked) { + vertexTypeStore.mutateNewProperty({ + ...vertexTypeStore.newVertexType, + primary_keys: vertexTypeStore.newVertexType.primary_keys.filter( + (key) => key !== property.name + ) + }); + } }} size="large" /> diff --git a/hubble-fe/src/components/graph-management/metadata-configs/vertex-type/VertexTypeList.tsx b/hubble-fe/src/components/graph-management/metadata-configs/vertex-type/VertexTypeList.tsx index 4d4e99fa..15baa76b 100644 --- a/hubble-fe/src/components/graph-management/metadata-configs/vertex-type/VertexTypeList.tsx +++ b/hubble-fe/src/components/graph-management/metadata-configs/vertex-type/VertexTypeList.tsx @@ -12,7 +12,8 @@ import { size, without, isEmpty, - isUndefined + isUndefined, + values } from 'lodash-es'; import { useLocation } from 'wouter'; import classnames from 'classnames'; @@ -160,12 +161,25 @@ const VertexTypeList: React.FC = observer(() => { }; const batchDeleteProperties = async () => { + if ( + values(currentSelectedRowKeys).every( + (key) => vertexTypeStore.vertexTypeUsingStatus?.[key] + ) + ) { + Message.error({ + content: '无可删除顶点类型', + size: 'medium', + showCloseIcon: false + }); + + return; + } + switchShowModal(false); // need to set a copy in store since local row key state would be cleared vertexTypeStore.mutateSelectedVertexTypeNames(currentSelectedRowKeys); // mutateSelectedRowKeys([]); await vertexTypeStore.deleteVertexType(currentSelectedRowKeys); - // vertexTypeStore.mutateSelectedVertexTypeNames([]); if (vertexTypeStore.requestStatus.deleteVertexType === 'success') { Message.success({ @@ -486,8 +500,14 @@ const VertexTypeList: React.FC = observer(() => { }} />
+
+ 使用中顶点类型不可删除,确认删除以下未使用顶点类型? +
- 使用中顶点不可删除,确认删除以下未使用顶点? + 删除元数据耗时较久,详情可在任务管理中查看。
= observe ) : ( <>

- 确认删除此顶点? + 确认删除此顶点类型?

-

确认删除此属性?删除后无法恢复,请谨慎操作

+

确认删除此顶点类型?删除后无法恢复,请谨慎操作

删除元数据耗时较久,详情可在任务管理中查看