diff --git a/config-ui/src/pages/blueprint/detail/api.ts b/config-ui/src/pages/blueprint/detail/api.ts index a919d2b52833..d632939585a3 100644 --- a/config-ui/src/pages/blueprint/detail/api.ts +++ b/config-ui/src/pages/blueprint/detail/api.ts @@ -24,8 +24,8 @@ export const getBlueprint = (id: ID): Promise => request(`/bluepr export const getBlueprintPipelines = (id: ID) => request(`/blueprints/${id}/pipelines`); -export const runBlueprint = (id: ID, skipCollectors: boolean) => - request(`/blueprints/${id}/trigger`, { method: 'post', data: { skipCollectors } }); +export const runBlueprint = (id: ID, data: { skipCollectors: boolean; fullSync: boolean }) => + request(`/blueprints/${id}/trigger`, { method: 'post', data }); export const updateBlueprint = (id: ID, payload: BlueprintType) => request(`/blueprints/${id}`, { method: 'patch', data: payload }); diff --git a/config-ui/src/pages/blueprint/detail/configuration-panel.tsx b/config-ui/src/pages/blueprint/detail/configuration-panel.tsx index 5dd944917f98..58eb17694638 100644 --- a/config-ui/src/pages/blueprint/detail/configuration-panel.tsx +++ b/config-ui/src/pages/blueprint/detail/configuration-panel.tsx @@ -109,7 +109,7 @@ export const ConfigurationPanel = ({ from, blueprint, onRefresh, onChangeTab }: }; const handleRun = async () => { - const [success] = await operator(() => API.runBlueprint(blueprint.id, false), { + const [success] = await operator(() => API.runBlueprint(blueprint.id, { skipCollectors: false, fullSync: false }), { setOperating, formatMessage: () => 'Trigger blueprint successful.', }); diff --git a/config-ui/src/pages/blueprint/detail/status-panel.tsx b/config-ui/src/pages/blueprint/detail/status-panel.tsx index 11320384fdfb..e1cd0cf4748d 100644 --- a/config-ui/src/pages/blueprint/detail/status-panel.tsx +++ b/config-ui/src/pages/blueprint/detail/status-panel.tsx @@ -18,10 +18,10 @@ import { useState, useMemo } from 'react'; import { useNavigate } from 'react-router-dom'; -import { Button, Switch, Icon, Intent, Position } from '@blueprintjs/core'; +import { Button, Switch, Icon, Intent, Position, Popover, Menu, MenuItem } from '@blueprintjs/core'; import { Tooltip2 } from '@blueprintjs/popover2'; -import { Card, IconButton, Dialog } from '@/components'; +import { Card, IconButton, Dialog, Message } from '@/components'; import { getCron } from '@/config'; import { useAutoRefresh } from '@/hooks'; import * as PipelineT from '@/routes/pipeline/types'; @@ -41,7 +41,7 @@ interface Props { } export const StatusPanel = ({ from, blueprint, pipelineId, onRefresh }: Props) => { - const [isOpen, setIsOpen] = useState(false); + const [type, setType] = useState<'delete' | 'fullSync'>(); const [operating, setOperating] = useState(false); const navigate = useNavigate(); @@ -70,16 +70,18 @@ export const StatusPanel = ({ from, blueprint, pipelineId, onRefresh }: Props) = }, ); - const handleShowDeleteDialog = () => { - setIsOpen(true); + const handleResetType = () => { + setType(undefined); }; - const handleHideDeleteDialog = () => { - setIsOpen(false); - }; - - const handleRun = async (skipCollectors: boolean) => { - const [success] = await operator(() => API.runBlueprint(blueprint.id, skipCollectors), { + const handleRun = async ({ + skipCollectors = false, + fullSync = false, + }: { + skipCollectors?: boolean; + fullSync?: boolean; + }) => { + const [success] = await operator(() => API.runBlueprint(blueprint.id, { skipCollectors, fullSync }), { setOperating, formatMessage: () => 'Trigger blueprint successful.', }); @@ -134,7 +136,7 @@ export const StatusPanel = ({ from, blueprint, pipelineId, onRefresh }: Props) = loading={operating} intent={Intent.PRIMARY} text="Re-transform Data" - onClick={() => handleRun(true)} + onClick={() => handleRun({ skipCollectors: true })} />