Revert "feat: disable running with admin permission and check service mode"

This reverts commit a0f9fb90ee.
This commit is contained in:
MystiPanda
2024-06-16 12:04:20 +08:00
parent 19b6f78c8a
commit a9ef32c32f
4 changed files with 16 additions and 71 deletions

View File

@@ -24,7 +24,6 @@ export const StackModeSwitch = (props: Props) => {
>
gVisor
</Button>
<Button
variant={value?.toLowerCase() === "mixed" ? "contained" : "outlined"}
onClick={() => onChange?.("mixed")}

View File

@@ -22,15 +22,11 @@ const SettingSystem = ({ onError }: Props) => {
const { verge, mutateVerge, patchVerge } = useVerge();
// service mode
const { data: serviceStatus, mutate: mutateCheck } = useSWR(
"checkService",
checkService,
{
revalidateIfStale: false,
shouldRetryOnError: false,
focusThrottleInterval: 36e5, // 1 hour
}
);
const { data: serviceStatus } = useSWR("checkService", checkService, {
revalidateIfStale: false,
shouldRetryOnError: false,
focusThrottleInterval: 36e5, // 1 hour
});
const serviceRef = useRef<DialogRef>(null);
const sysproxyRef = useRef<DialogRef>(null);
@@ -88,7 +84,7 @@ const SettingSystem = ({ onError }: Props) => {
onChange={(e) => onChangeData({ enable_tun_mode: e })}
onGuard={(e) => patchVerge({ enable_tun_mode: e })}
>
<Switch disabled={serviceStatus !== "active"} edge="end" />
<Switch edge="end" />
</GuardState>
</SettingItem>
@@ -113,10 +109,7 @@ const SettingSystem = ({ onError }: Props) => {
onCatch={onError}
onFormat={onSwitchFormat}
onChange={(e) => onChangeData({ enable_service_mode: e })}
onGuard={(e) => {
setTimeout(() => mutateCheck(), 1000);
return patchVerge({ enable_service_mode: e });
}}
onGuard={(e) => patchVerge({ enable_service_mode: e })}
>
<Switch
edge="end"