|
@@ -1,6 +1,6 @@
|
|
import React from 'react';
|
|
import React from 'react';
|
|
import { useHistory, useParams } from 'react-router-dom';
|
|
import { useHistory, useParams } from 'react-router-dom';
|
|
-import { ConnectorState } from 'generated-sources';
|
|
|
|
|
|
+import { ConnectorState, ConnectorAction } from 'generated-sources';
|
|
import { ClusterName, ConnectName, ConnectorName } from 'redux/interfaces';
|
|
import { ClusterName, ConnectName, ConnectorName } from 'redux/interfaces';
|
|
import {
|
|
import {
|
|
clusterConnectConnectorEditPath,
|
|
clusterConnectConnectorEditPath,
|
|
@@ -34,6 +34,12 @@ export interface ActionsProps {
|
|
connectName: ConnectName,
|
|
connectName: ConnectName,
|
|
connectorName: ConnectorName
|
|
connectorName: ConnectorName
|
|
): void;
|
|
): void;
|
|
|
|
+ restartTasks(
|
|
|
|
+ clusterName: ClusterName,
|
|
|
|
+ connectName: ConnectName,
|
|
|
|
+ connectorName: ConnectorName,
|
|
|
|
+ action: ConnectorAction
|
|
|
|
+ ): void;
|
|
pauseConnector(
|
|
pauseConnector(
|
|
clusterName: ClusterName,
|
|
clusterName: ClusterName,
|
|
connectName: ConnectName,
|
|
connectName: ConnectName,
|
|
@@ -52,11 +58,13 @@ const Actions: React.FC<ActionsProps> = ({
|
|
isConnectorDeleting,
|
|
isConnectorDeleting,
|
|
connectorStatus,
|
|
connectorStatus,
|
|
restartConnector,
|
|
restartConnector,
|
|
|
|
+ restartTasks,
|
|
pauseConnector,
|
|
pauseConnector,
|
|
resumeConnector,
|
|
resumeConnector,
|
|
isConnectorActionRunning,
|
|
isConnectorActionRunning,
|
|
}) => {
|
|
}) => {
|
|
const { clusterName, connectName, connectorName } = useParams<RouterParams>();
|
|
const { clusterName, connectName, connectorName } = useParams<RouterParams>();
|
|
|
|
+
|
|
const history = useHistory();
|
|
const history = useHistory();
|
|
const [
|
|
const [
|
|
isDeleteConnectorConfirmationVisible,
|
|
isDeleteConnectorConfirmationVisible,
|
|
@@ -76,6 +84,13 @@ const Actions: React.FC<ActionsProps> = ({
|
|
restartConnector(clusterName, connectName, connectorName);
|
|
restartConnector(clusterName, connectName, connectorName);
|
|
}, [restartConnector, clusterName, connectName, connectorName]);
|
|
}, [restartConnector, clusterName, connectName, connectorName]);
|
|
|
|
|
|
|
|
+ const restartTasksHandler = React.useCallback(
|
|
|
|
+ (actionType) => {
|
|
|
|
+ restartTasks(clusterName, connectName, connectorName, actionType);
|
|
|
|
+ },
|
|
|
|
+ [restartTasks, clusterName, connectName, connectorName]
|
|
|
|
+ );
|
|
|
|
+
|
|
const pauseConnectorHandler = React.useCallback(() => {
|
|
const pauseConnectorHandler = React.useCallback(() => {
|
|
pauseConnector(clusterName, connectName, connectorName);
|
|
pauseConnector(clusterName, connectName, connectorName);
|
|
}, [pauseConnector, clusterName, connectName, connectorName]);
|
|
}, [pauseConnector, clusterName, connectName, connectorName]);
|
|
@@ -128,6 +143,32 @@ const Actions: React.FC<ActionsProps> = ({
|
|
</span>
|
|
</span>
|
|
<span>Restart Connector</span>
|
|
<span>Restart Connector</span>
|
|
</Button>
|
|
</Button>
|
|
|
|
+ <Button
|
|
|
|
+ buttonSize="M"
|
|
|
|
+ buttonType="primary"
|
|
|
|
+ type="button"
|
|
|
|
+ onClick={() => restartTasksHandler(ConnectorAction.RESTART_ALL_TASKS)}
|
|
|
|
+ disabled={isConnectorActionRunning}
|
|
|
|
+ >
|
|
|
|
+ <span>
|
|
|
|
+ <i className="fas fa-sync-alt" />
|
|
|
|
+ </span>
|
|
|
|
+ <span>Restart All Tasks</span>
|
|
|
|
+ </Button>
|
|
|
|
+ <Button
|
|
|
|
+ buttonSize="M"
|
|
|
|
+ buttonType="primary"
|
|
|
|
+ type="button"
|
|
|
|
+ onClick={() =>
|
|
|
|
+ restartTasksHandler(ConnectorAction.RESTART_FAILED_TASKS)
|
|
|
|
+ }
|
|
|
|
+ disabled={isConnectorActionRunning}
|
|
|
|
+ >
|
|
|
|
+ <span>
|
|
|
|
+ <i className="fas fa-sync-alt" />
|
|
|
|
+ </span>
|
|
|
|
+ <span>Restart Failed Tasks</span>
|
|
|
|
+ </Button>
|
|
<Button
|
|
<Button
|
|
buttonSize="M"
|
|
buttonSize="M"
|
|
buttonType="primary"
|
|
buttonType="primary"
|