Signed-off-by: 吴文峰 <kevin@lmve.net>

This commit is contained in:
2026-04-08 20:11:43 +08:00
commit d3e7ae5724
20 changed files with 2647 additions and 0 deletions
+48
View File
@@ -0,0 +1,48 @@
import axios from 'axios'
// Go 搜索服务器地址(端口 80,带 CORS)
const BASE = import.meta.env.VITE_API_BASE || 'http://localhost:80'
export async function fetchRecent(limit = 50) {
const { data } = await axios.get(`${BASE}/admin/recent`, {
params: { limit },
timeout: 15000,
})
return data
}
export async function fetchStats() {
const { data } = await axios.get(`${BASE}/admin/stats`, {
timeout: 15000,
})
return data
}
export async function fetchPriority() {
const { data } = await axios.get(`${BASE}/admin/priority`, {
timeout: 15000,
})
return data
}
export async function addPriority(url) {
const { data } = await axios.post(`${BASE}/admin/priority`, { url }, {
timeout: 15000,
})
return data
}
export async function removePriority(url) {
const { data } = await axios.delete(`${BASE}/admin/priority`, {
params: { url },
timeout: 15000,
})
return data
}
export async function flushIndex() {
const { data } = await axios.post(`${BASE}/admin/flush`, null, {
timeout: 60000,
})
return data
}