mirror of
https://github.com/ReCloudStudio/WebHooker.git
synced 2026-09-23 00:21:28 +00:00
feat: add group filter to send logs view
- Add groupId query param to GET /api/logs endpoint - Add group filter dropdown in SendLogs component - Pass groups list and filter state from admin.vue - Update useLogs.ts to accept optional groupId parameter - Add groupId to SendRecord type - Add i18n keys and CSS for filter UI
This commit is contained in:
parent
03eef7ae89
commit
589558a20d
7 changed files with 94 additions and 16 deletions
|
|
@ -6,12 +6,14 @@ export function useSendLogs() {
|
|||
const needLogin = ref(false);
|
||||
const error = ref("");
|
||||
|
||||
async function load(limit = 50): Promise<void> {
|
||||
async function load(limit = 50, groupId?: string): Promise<void> {
|
||||
loading.value = true;
|
||||
error.value = "";
|
||||
needLogin.value = false;
|
||||
try {
|
||||
const res = await fetch(`/admin/api/logs?limit=${limit}`, {
|
||||
let url = `/admin/api/logs?limit=${limit}`;
|
||||
if (groupId) url += `&groupId=${encodeURIComponent(groupId)}`;
|
||||
const res = await fetch(url, {
|
||||
headers: { accept: "application/json" },
|
||||
credentials: "same-origin",
|
||||
});
|
||||
|
|
@ -44,4 +46,4 @@ export function useSendLogs() {
|
|||
}
|
||||
|
||||
return { logs, loading, needLogin, error, load, loadById };
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue