mirror of
https://github.com/Elysola/WebHooker.git
synced 2026-11-21 01:23:40 +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:
1 parent
03eef7ae89
commit
589558a20d
7 files changed
+94
-16
No files matched your search
@@ -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 };
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user