diff --git a/backend/proxy/__init__.py b/backend/proxy/__init__.py index 9c8b2c7..e3733c3 100755 --- a/backend/proxy/__init__.py +++ b/backend/proxy/__init__.py @@ -44,7 +44,7 @@ class Proxy: self.config_file_path = config_file_path def start(self, in_pause=False): - if self.process is None: + if not self.isactive(): self.filter_map = self.compile_filters() filters_codes = list(self.filter_map.keys()) if not in_pause else [] proxy_binary_path = os.path.join(os.path.dirname(os.path.abspath(__file__)),"./proxy") @@ -66,8 +66,9 @@ class Proxy: finally: self.__delete_config() + def stop(self): - if self.process: + if self.isactive(): self.process.terminate() try: self.process.wait(timeout=3) @@ -101,6 +102,8 @@ class Proxy: self.trigger_reload_config() def isactive(self): + if self.process and not self.process.poll() is None: + self.process = None return True if self.process else False def trigger_reload_config(self): diff --git a/frontend/src/components/Header/index.tsx b/frontend/src/components/Header/index.tsx index f1000e2..1d98b53 100755 --- a/frontend/src/components/Header/index.tsx +++ b/frontend/src/components/Header/index.tsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { ActionIcon, Badge, Button, Divider, Group, Image, Menu, Modal, Notification, Space, Switch, TextInput, Tooltip, FloatingTooltip, MediaQuery, PasswordInput } from '@mantine/core'; +import { ActionIcon, Badge, Button, Divider, Group, Image, Menu, Modal, Notification, Space, Switch, Tooltip, FloatingTooltip, MediaQuery, PasswordInput } from '@mantine/core'; import style from "./Header.module.scss"; import { changepassword, errorNotify, eventUpdateName, generalstats, logout, okNotify } from '../../js/utils'; import { ChangePassword, GeneralStats } from '../../js/models';