From 2a90685f1ddf0d91b55e2f081add8dec02491088 Mon Sep 17 00:00:00 2001 From: karishmas6 Date: Sat, 26 Oct 2024 05:51:02 +0530 Subject: [PATCH] feat: remove proxy config --- src/components/organisms/ProxyForm.tsx | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/components/organisms/ProxyForm.tsx b/src/components/organisms/ProxyForm.tsx index f8cf03c8..5f856038 100644 --- a/src/components/organisms/ProxyForm.tsx +++ b/src/components/organisms/ProxyForm.tsx @@ -1,7 +1,7 @@ import React, { useState, useEffect } from 'react'; import { styled } from '@mui/system'; import { TextField, Button, Switch, FormControlLabel, Box, Typography, Tabs, Tab } from '@mui/material'; -import { sendProxyConfig, getProxyConfig, testProxyConfig } from '../../api/proxy'; +import { sendProxyConfig, getProxyConfig, testProxyConfig, deleteProxyConfig } from '../../api/proxy'; import { useGlobalInfoStore } from '../../context/globalInfo'; const FormContainer = styled(Box)({ @@ -109,6 +109,17 @@ const ProxyForm: React.FC = () => { }); }; + const removeProxy = async () => { + await deleteProxyConfig().then((response) => { + if (response) { + notify('success', 'Proxy configuration removed successfully'); + setIsProxyConfigured(false); + } else { + notify('error', 'Failed to remove proxy configuration. Try again.'); + } + }); + } + useEffect(() => { fetchProxyConfig(); }, []); @@ -121,6 +132,7 @@ const ProxyForm: React.FC = () => { Proxy is already configured. You can test the configuration below. +