fix: Config data display error

#417
This commit is contained in:
MystiPanda 2024-02-21 10:02:28 +08:00
parent f59be465ea
commit 1cff162649
No known key found for this signature in database
GPG Key ID: 47D0F0284DC57888
3 changed files with 10 additions and 10 deletions

View File

@ -113,7 +113,7 @@ export const TunViewer = forwardRef<DialogRef>((props, ref) => {
spellCheck="false" spellCheck="false"
sx={{ width: 250 }} sx={{ width: 250 }}
value={values.device} value={values.device}
placeholder="Mihomo" placeholder="Meta"
onChange={(e) => onChange={(e) =>
setValues((v) => ({ ...v, device: e.target.value })) setValues((v) => ({ ...v, device: e.target.value }))
} }

View File

@ -1,17 +1,16 @@
import useSWR, { mutate } from "swr"; import useSWR, { mutate } from "swr";
import { useLockFn } from "ahooks"; import { useLockFn } from "ahooks";
import { getAxios, getVersion, updateConfigs } from "@/services/api";
import { import {
getAxios, getClashInfo,
getClashConfig, patchClashConfig,
getVersion, getRuntimeConfig,
updateConfigs, } from "@/services/cmds";
} from "@/services/api";
import { getClashInfo, patchClashConfig } from "@/services/cmds";
export const useClash = () => { export const useClash = () => {
const { data: clash, mutate: mutateClash } = useSWR( const { data: clash, mutate: mutateClash } = useSWR(
"getClashConfig", "getRuntimeConfig",
getClashConfig getRuntimeConfig
); );
const { data: versionData, mutate: mutateVersion } = useSWR( const { data: versionData, mutate: mutateVersion } = useSWR(

View File

@ -90,8 +90,9 @@ export async function getClashInfo() {
return invoke<IClashInfo | null>("get_clash_info"); return invoke<IClashInfo | null>("get_clash_info");
} }
// Get runtime config which controlled by verge
export async function getRuntimeConfig() { export async function getRuntimeConfig() {
return invoke<any | null>("get_runtime_config"); return invoke<IConfigData | null>("get_runtime_config");
} }
export async function getRuntimeYaml() { export async function getRuntimeYaml() {