mirror of
https://github.com/clash-verge-rev/clash-verge-rev
synced 2025-05-05 07:13:44 +08:00
feat: front-end use RunningMode enum instead of string literals
This commit is contained in:
parent
7ede91599c
commit
7280635741
@ -147,7 +147,7 @@ export const ProxyTunCard: FC = () => {
|
||||
const { enable_system_proxy, enable_tun_mode } = verge ?? {};
|
||||
|
||||
// 是否以sidecar模式运行
|
||||
const isSidecarMode = runningMode === "Sidecar";
|
||||
const isSidecarMode = runningMode === RunningMode.Sidecar;
|
||||
|
||||
// 处理错误
|
||||
const handleError = (err: Error) => {
|
||||
|
@ -31,7 +31,7 @@ export const SystemInfoCard = () => {
|
||||
);
|
||||
|
||||
// 是否以sidecar模式运行
|
||||
const isSidecarMode = runningMode === "Sidecar";
|
||||
const isSidecarMode = runningMode === RunningMode.Sidecar;
|
||||
|
||||
// 初始化系统信息
|
||||
useEffect(() => {
|
||||
|
@ -58,7 +58,7 @@ const SettingSystem = ({ onError }: Props) => {
|
||||
}, [autoLaunchEnabled]);
|
||||
|
||||
// 是否以sidecar模式运行
|
||||
const isSidecarMode = runningMode === "Sidecar";
|
||||
const isSidecarMode = runningMode === RunningMode.Sidecar;
|
||||
|
||||
const sysproxyRef = useRef<DialogRef>(null);
|
||||
const tunRef = useRef<DialogRef>(null);
|
||||
|
@ -52,7 +52,7 @@ const ProxyControlSwitches = ({ label, onError }: ProxySwitchProps) => {
|
||||
);
|
||||
|
||||
// 是否以sidecar模式运行
|
||||
const isSidecarMode = runningMode === "Sidecar";
|
||||
const isSidecarMode = runningMode === RunningMode.Sidecar;
|
||||
|
||||
const sysproxyRef = useRef<DialogRef>(null);
|
||||
const tunRef = useRef<DialogRef>(null);
|
||||
|
6
src/services/types.d.ts
vendored
6
src/services/types.d.ts
vendored
@ -806,3 +806,9 @@ interface IWebDavConfig {
|
||||
username: string;
|
||||
password: string;
|
||||
}
|
||||
|
||||
enum RunningMode {
|
||||
Service = "Service",
|
||||
Sidecar = "Sidecar",
|
||||
NotRunning = "NotRunning",
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user