chore; lint

This commit is contained in:
karishmas6
2024-10-26 05:41:39 +05:30
parent 5ffccfbaf7
commit 2925d62fa4

View File

@@ -115,102 +115,102 @@ const ProxyForm: React.FC = () => {
return ( return (
<> <>
{ {
isProxyConfigured ? ( isProxyConfigured ? (
<Box sx={{ maxWidth: 600, width: '100%', textAlign: 'center', marginTop: '20px' }}> <Box sx={{ maxWidth: 600, width: '100%', textAlign: 'center', marginTop: '20px' }}>
<Typography variant="body1" gutterBottom component="div"> <Typography variant="body1" gutterBottom component="div">
Proxy is already configured. You can test the configuration below. Proxy is already configured. You can test the configuration below.
</Typography> </Typography>
<Button variant="contained" color="primary" onClick={testProxy} sx={{ marginTop: '20px'}}> <Button variant="contained" color="primary" onClick={testProxy} sx={{ marginTop: '20px' }}>
Test Proxy Configuration Test Proxy Configuration
</Button> </Button>
</Box> </Box>
) : ( ) : (
<FormContainer> <FormContainer>
<Typography variant="h6" gutterBottom component="div" style={{ marginTop: '20px' }}> <Typography variant="h6" gutterBottom component="div" style={{ marginTop: '20px' }}>
Proxy Configuration Proxy Configuration
</Typography> </Typography>
<Tabs value={tabIndex} onChange={handleTabChange}> <Tabs value={tabIndex} onChange={handleTabChange}>
<Tab label="Standard Proxy" /> <Tab label="Standard Proxy" />
<Tab label="Automatic Proxy Rotation" /> <Tab label="Automatic Proxy Rotation" />
</Tabs> </Tabs>
{tabIndex === 0 && ( {tabIndex === 0 && (
<Box component="form" onSubmit={handleSubmit} sx={{ maxWidth: 400, width: '100%' }}> <Box component="form" onSubmit={handleSubmit} sx={{ maxWidth: 400, width: '100%' }}>
<FormControl> <FormControl>
<TextField <TextField
label="Proxy Server URL" label="Proxy Server URL"
name="server_url" name="server_url"
value={proxyConfig.server_url} value={proxyConfig.server_url}
onChange={handleChange} onChange={handleChange}
fullWidth fullWidth
required required
error={!!errors.server_url} error={!!errors.server_url}
helperText={errors.server_url || `Proxy to be used for all robots. HTTP and SOCKS proxies are supported. helperText={errors.server_url || `Proxy to be used for all robots. HTTP and SOCKS proxies are supported.
Example http://myproxy.com:3128 or socks5://myproxy.com:3128. Example http://myproxy.com:3128 or socks5://myproxy.com:3128.
Short form myproxy.com:3128 is considered an HTTP proxy.`} Short form myproxy.com:3128 is considered an HTTP proxy.`}
/> />
</FormControl> </FormControl>
<FormControl> <FormControl>
<FormControlLabel <FormControlLabel
control={<Switch checked={requiresAuth} onChange={handleAuthToggle} />} control={<Switch checked={requiresAuth} onChange={handleAuthToggle} />}
label="Requires Authentication?" label="Requires Authentication?"
/> />
</FormControl> </FormControl>
{requiresAuth && ( {requiresAuth && (
<> <>
<FormControl> <FormControl>
<TextField <TextField
label="Username" label="Username"
name="username" name="username"
value={proxyConfig.username} value={proxyConfig.username}
onChange={handleChange} onChange={handleChange}
fullWidth
required={requiresAuth}
error={!!errors.username}
helperText={errors.username || ''}
/>
</FormControl>
<FormControl>
<TextField
label="Password"
name="password"
value={proxyConfig.password}
onChange={handleChange}
type="password"
fullWidth
required={requiresAuth}
error={!!errors.password}
helperText={errors.password || ''}
/>
</FormControl>
</>
)}
<Button
variant="contained"
color="primary"
type="submit"
fullWidth fullWidth
required={requiresAuth} disabled={!proxyConfig.server_url || (requiresAuth && (!proxyConfig.username || !proxyConfig.password))}
error={!!errors.username} >
helperText={errors.username || ''} Add Proxy
/> </Button>
</FormControl> </Box>
<FormControl> )}
<TextField {tabIndex === 1 && (
label="Password" <Box sx={{ maxWidth: 600, width: '100%', textAlign: 'center', marginTop: '20px' }}>
name="password" <>
value={proxyConfig.password} <Typography variant="body1" gutterBottom component="div">
onChange={handleChange} Coming Soon. Join our Cloud Waitlist to get early access.
type="password" </Typography>
fullWidth <Button variant="contained" color="primary" sx={{ marginTop: '20px' }}>
required={requiresAuth} Join Maxun Cloud Waitlist
error={!!errors.password} </Button>
helperText={errors.password || ''} </>
/> </Box>
</FormControl> )}
</> </FormContainer>
)} )
<Button }
variant="contained"
color="primary"
type="submit"
fullWidth
disabled={!proxyConfig.server_url || (requiresAuth && (!proxyConfig.username || !proxyConfig.password))}
>
Add Proxy
</Button>
</Box>
)}
{tabIndex === 1 && (
<Box sx={{ maxWidth: 600, width: '100%', textAlign: 'center', marginTop: '20px' }}>
<>
<Typography variant="body1" gutterBottom component="div">
Coming Soon. Join our Cloud Waitlist to get early access.
</Typography>
<Button variant="contained" color="primary" sx={{ marginTop: '20px'}}>
Join Maxun Cloud Waitlist
</Button>
</>
</Box>
)}
</FormContainer>
)
}
</> </>
); );
}; };