mirror of
https://github.com/comit-network/xmr-btc-swap.git
synced 2025-11-25 18:26:28 -05:00
feat: cargo project at root
This commit is contained in:
parent
aa0c0623ca
commit
709a2820c4
313 changed files with 1 additions and 740 deletions
74
src-gui/src/renderer/components/pages/help/RpcControlBox.tsx
Normal file
74
src-gui/src/renderer/components/pages/help/RpcControlBox.tsx
Normal file
|
|
@ -0,0 +1,74 @@
|
|||
import { Box, makeStyles } from '@material-ui/core';
|
||||
import IpcInvokeButton from 'renderer/components/IpcInvokeButton';
|
||||
import { useAppSelector } from 'store/hooks';
|
||||
import StopIcon from '@material-ui/icons/Stop';
|
||||
import PlayArrowIcon from '@material-ui/icons/PlayArrow';
|
||||
import { RpcProcessStateType } from 'models/rpcModel';
|
||||
import InfoBox from '../../modal/swap/InfoBox';
|
||||
import CliLogsBox from '../../other/RenderedCliLog';
|
||||
import FolderOpenIcon from '@material-ui/icons/FolderOpen';
|
||||
|
||||
const useStyles = makeStyles((theme) => ({
|
||||
actionsOuter: {
|
||||
display: 'flex',
|
||||
gap: theme.spacing(1),
|
||||
alignItems: 'center',
|
||||
},
|
||||
}));
|
||||
|
||||
export default function RpcControlBox() {
|
||||
const rpcProcess = useAppSelector((state) => state.rpc.process);
|
||||
const isRunning =
|
||||
rpcProcess.type === RpcProcessStateType.STARTED ||
|
||||
rpcProcess.type === RpcProcessStateType.LISTENING_FOR_CONNECTIONS;
|
||||
const classes = useStyles();
|
||||
|
||||
return (
|
||||
<InfoBox
|
||||
title={`Swap Daemon (${rpcProcess.type})`}
|
||||
mainContent={
|
||||
isRunning || rpcProcess.type === RpcProcessStateType.EXITED ? (
|
||||
<CliLogsBox
|
||||
label="Swap Daemon Logs (current session only)"
|
||||
logs={rpcProcess.logs}
|
||||
/>
|
||||
) : null
|
||||
}
|
||||
additionalContent={
|
||||
<Box className={classes.actionsOuter}>
|
||||
<IpcInvokeButton
|
||||
variant="contained"
|
||||
ipcChannel="spawn-start-rpc"
|
||||
ipcArgs={[]}
|
||||
endIcon={<PlayArrowIcon />}
|
||||
disabled={isRunning}
|
||||
requiresRpc={false}
|
||||
>
|
||||
Start Daemon
|
||||
</IpcInvokeButton>
|
||||
<IpcInvokeButton
|
||||
variant="contained"
|
||||
ipcChannel="stop-cli"
|
||||
ipcArgs={[]}
|
||||
endIcon={<StopIcon />}
|
||||
disabled={!isRunning}
|
||||
requiresRpc={false}
|
||||
>
|
||||
Stop Daemon
|
||||
</IpcInvokeButton>
|
||||
<IpcInvokeButton
|
||||
ipcChannel="open-data-dir-in-file-explorer"
|
||||
ipcArgs={[]}
|
||||
endIcon={<FolderOpenIcon />}
|
||||
requiresRpc={false}
|
||||
isIconButton
|
||||
size="small"
|
||||
tooltipTitle="Open the data directory of the Swap Daemon in your file explorer"
|
||||
/>
|
||||
</Box>
|
||||
}
|
||||
icon={null}
|
||||
loading={false}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue