mirror of
https://github.com/Wei-Shaw/sub2api.git
synced 2026-10-29 16:20:27 +00:00
feat: add usage IP geolocation lookup
This commit is contained in:
@@ -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 => {
|
||||
|
||||
@@ -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'
|
||||
|
||||
Reference in New Issue
Block a user