From bf6374af52af0e54f543524cfa0ec2275e6179c6 Mon Sep 17 00:00:00 2001 From: Dream Hunter Date: Tue, 12 Dec 2023 16:33:54 +0800 Subject: [PATCH] feat: add admin query emails (#39) * feat: add NPagination * feat: admin query emails --- frontend/src/api/index.js | 11 +-- frontend/src/views/Admin.vue | 171 +++++++++++++++++++++++++++++++-- frontend/src/views/Content.vue | 25 ++++- frontend/src/views/Header.vue | 7 +- worker/src/router.js | 108 +++++++++++++++++++-- 5 files changed, 290 insertions(+), 32 deletions(-) diff --git a/frontend/src/api/index.js b/frontend/src/api/index.js index a4e1aa58..3ab0538a 100644 --- a/frontend/src/api/index.js +++ b/frontend/src/api/index.js @@ -14,6 +14,7 @@ const apiFetch = async (path, options = {}) => { try { const response = await instance.request(path, { method: options.method || 'GET', + data: options.body || null, headers: { 'x-custom-auth': auth.value, 'x-admin-auth': adminAuth.value, @@ -88,20 +89,10 @@ const adminDeleteAddress = async (id) => { } } -const adminGetAddress = async () => { - try { - return await apiFetch("/admin/addresss"); - } catch (error) { - throw error; - } -} - - export const api = { fetch: apiFetch, getSettings: getSettings, getOpenSettings: getOpenSettings, adminShowPassword: adminShowPassword, adminDeleteAddress: adminDeleteAddress, - adminGetAddress: adminGetAddress, } diff --git a/frontend/src/views/Admin.vue b/frontend/src/views/Admin.vue index 6db3821f..b472552b 100644 --- a/frontend/src/views/Admin.vue +++ b/frontend/src/views/Admin.vue @@ -1,8 +1,9 @@ - + + +
+ +
+ + {{ t('refresh') }} + + +
+ + + + + {{ t('refresh') }} + + + +
+ +
+ + + +
+
+
+
+
+ + + {{ t('refresh') }} + + +
+ +
+ + + +
+
+
+
+
+
@@ -193,4 +341,9 @@ onMounted(async () => { align-items: center; justify-content: space-between; } + +.n-pagination { + margin-top: 10px; + margin-bottom: 10px; +} diff --git a/frontend/src/views/Content.vue b/frontend/src/views/Content.vue index 129bf1df..c8360f91 100644 --- a/frontend/src/views/Content.vue +++ b/frontend/src/views/Content.vue @@ -1,6 +1,6 @@