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;
};
};