feat: add usage IP geolocation lookup

This commit is contained in:
DaydreamCoding
2026-07-01 21:49:49 +08:00
parent 7dc7cfce1d
commit 0ff93aca7a
11 changed files with 938 additions and 3 deletions
+5
View File
@@ -118,6 +118,7 @@
:default-sort-order="'desc'"
@sort="handleSort"
@userClick="handleUserClick"
@ipGeoBatchFailed="handleIpGeoBatchFailed"
/>
<Pagination v-if="pagination.total > 0" :page="pagination.page" :total="pagination.total" :page-size="pagination.page_size" @update:page="handlePageChange" @update:pageSize="handlePageSizeChange" />
</div>
@@ -486,6 +487,10 @@ const handleSort = (key: string, order: 'asc' | 'desc') => {
pagination.page = 1
loadLogs()
}
const handleIpGeoBatchFailed = () => {
appStore.showError(t('usage.ipGeo.batchFailed'))
}
const cancelExport = () => exportAbortController?.abort()
const openCleanupDialog = () => { cleanupDialogVisible.value = true }
const getRequestTypeLabel = (log: AdminUsageLog): string => {
+5
View File
@@ -155,6 +155,7 @@
default-sort-key="created_at"
default-sort-order="desc"
@sort="handleSort"
@ipGeoBatchFailed="handleIpGeoBatchFailed"
/>
<Pagination
@@ -514,6 +515,10 @@ const handleSort = (key: string, order: 'asc' | 'desc') => {
void loadLogs()
}
const handleIpGeoBatchFailed = () => {
appStore.showError(t('usage.ipGeo.batchFailed'))
}
const getRequestTypeExportText = (log: UsageLog): string => {
const requestType = resolveUsageRequestType(log)
if (requestType === 'cyber') return 'Cyber'