Revert "feat: add proxy geo location"

This reverts commit 09c4f82927ddce1c9528c146a26457f53d02b034.
This commit is contained in:
LLLLLLiulei
2026-01-15 14:50:27 +08:00
parent 3a100339b9
commit 87b4662993
12 changed files with 44 additions and 151 deletions

View File

@@ -126,7 +126,6 @@ export async function testProxy(id: number): Promise<{
city?: string
region?: string
country?: string
country_code?: string
}> {
const { data } = await apiClient.post<{
success: boolean
@@ -136,7 +135,6 @@ export async function testProxy(id: number): Promise<{
city?: string
region?: string
country?: string
country_code?: string
}>(`/admin/proxies/${id}/test`)
return data
}

View File

@@ -1634,7 +1634,6 @@ export default {
name: 'Name',
protocol: 'Protocol',
address: 'Address',
location: 'Location',
status: 'Status',
accounts: 'Accounts',
latency: 'Latency',

View File

@@ -1719,7 +1719,6 @@ export default {
name: '名称',
protocol: '协议',
address: '地址',
location: '地理位置',
status: '状态',
accounts: '账号数',
latency: '延迟',

View File

@@ -367,11 +367,6 @@ export interface Proxy {
latency_ms?: number
latency_status?: 'success' | 'failed'
latency_message?: string
ip_address?: string
country?: string
country_code?: string
region?: string
city?: string
created_at: string
updated_at: string
}

View File

@@ -117,21 +117,6 @@
<code class="code text-xs">{{ row.host }}:{{ row.port }}</code>
</template>
<template #cell-location="{ row }">
<div class="flex items-center gap-2">
<img
v-if="row.country_code"
:src="flagUrl(row.country_code)"
:alt="row.country || row.country_code"
class="h-4 w-6 rounded-sm"
/>
<span v-if="formatLocation(row)" class="text-sm text-gray-700 dark:text-gray-200">
{{ formatLocation(row) }}
</span>
<span v-else class="text-sm text-gray-400">-</span>
</div>
</template>
<template #cell-account_count="{ row, value }">
<button
v-if="(value || 0) > 0"
@@ -680,7 +665,6 @@ const columns = computed<Column[]>(() => [
{ key: 'name', label: t('admin.proxies.columns.name'), sortable: true },
{ key: 'protocol', label: t('admin.proxies.columns.protocol'), sortable: true },
{ key: 'address', label: t('admin.proxies.columns.address'), sortable: false },
{ key: 'location', label: t('admin.proxies.columns.location'), sortable: false },
{ key: 'account_count', label: t('admin.proxies.columns.accounts'), sortable: true },
{ key: 'latency', label: t('admin.proxies.columns.latency'), sortable: false },
{ key: 'status', label: t('admin.proxies.columns.status'), sortable: true },
@@ -1074,47 +1058,20 @@ const handleUpdateProxy = async () => {
const applyLatencyResult = (
proxyId: number,
result: {
success: boolean
latency_ms?: number
message?: string
ip_address?: string
country?: string
country_code?: string
region?: string
city?: string
}
result: { success: boolean; latency_ms?: number; message?: string }
) => {
const target = proxies.value.find((proxy) => proxy.id === proxyId)
if (!target) return
if (result.success) {
target.latency_status = 'success'
target.latency_ms = result.latency_ms
target.ip_address = result.ip_address
target.country = result.country
target.country_code = result.country_code
target.region = result.region
target.city = result.city
} else {
target.latency_status = 'failed'
target.latency_ms = undefined
target.ip_address = undefined
target.country = undefined
target.country_code = undefined
target.region = undefined
target.city = undefined
}
target.latency_message = result.message
}
const formatLocation = (proxy: Proxy) => {
const parts = [proxy.country, proxy.city].filter(Boolean) as string[]
return parts.join(' · ')
}
const flagUrl = (code: string) =>
`https://unpkg.com/flag-icons/flags/4x3/${code.toLowerCase()}.svg`
const startTestingProxy = (proxyId: number) => {
testingProxyIds.value = new Set([...testingProxyIds.value, proxyId])
}