feat: home page
This commit is contained in:
@@ -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;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -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");
|
||||
|
||||
1
src/services/types.d.ts
vendored
1
src/services/types.d.ts
vendored
@@ -787,6 +787,7 @@ interface IVergeConfig {
|
||||
webdav_url?: string;
|
||||
webdav_username?: string;
|
||||
webdav_password?: string;
|
||||
home_cards?: Record<string, boolean>;
|
||||
}
|
||||
|
||||
interface IWebDavFile {
|
||||
|
||||
Reference in New Issue
Block a user