feat: home page

This commit is contained in:
wonfen
2025-03-14 13:31:34 +08:00
parent c25015ed54
commit 1f99cee78b
37 changed files with 4488 additions and 74 deletions

View File

@@ -253,7 +253,7 @@ export const deleteConnection = async (id: string) => {
// Close all connections
export const closeAllConnections = async () => {
const instance = await getAxios();
await instance.delete<any, any>(`/connections`);
await instance.delete("/connections");
};
// Get Group Proxy Delays
@@ -313,3 +313,22 @@ export const gc = async () => {
console.error(`Error gcing: ${error}`);
}
};
// Get current IP and geolocation information
export const getIpInfo = async () => {
// 使用axios直接请求IP.sb的API不通过clash代理
const response = await axios.get("https://api.ip.sb/geoip");
return response.data as {
ip: string;
country_code: string;
country: string;
region: string;
city: string;
organization: string;
asn: number;
asn_organization: string;
longitude: number;
latitude: number;
timezone: string;
};
};

View File

@@ -225,6 +225,10 @@ export async function exportDiagnosticInfo() {
return invoke("export_diagnostic_info");
}
export async function getSystemInfo() {
return invoke<string>("get_system_info");
}
export async function copyIconFile(
path: string,
name: "common" | "sysproxy" | "tun",
@@ -301,6 +305,11 @@ export const getRunningMode = async () => {
return invoke<string>("get_running_mode");
};
// 获取应用运行时间
export const getAppUptime = async () => {
return invoke<number>("get_app_uptime");
};
// 安装/重装系统服务
export const installService = async () => {
return invoke<void>("install_service");

View File

@@ -787,6 +787,7 @@ interface IVergeConfig {
webdav_url?: string;
webdav_username?: string;
webdav_password?: string;
home_cards?: Record<string, boolean>;
}
interface IWebDavFile {