diff --git a/src/components/api-logs/ApiLogsFilterBar.vue b/src/components/api-logs/ApiLogsFilterBar.vue index bbd48f2e..0f2181a7 100644 --- a/src/components/api-logs/ApiLogsFilterBar.vue +++ b/src/components/api-logs/ApiLogsFilterBar.vue @@ -1,21 +1,21 @@ @@ -23,16 +23,35 @@ diff --git a/src/components/api-logs/ApiLogsListBar.vue b/src/components/api-logs/ApiLogsListBar.vue index ed067cd3..d085ca13 100644 --- a/src/components/api-logs/ApiLogsListBar.vue +++ b/src/components/api-logs/ApiLogsListBar.vue @@ -6,7 +6,7 @@ :content="tab.content" :width="tab.width" :sortBy="tab.sortBy" - :current-order-request="params.orderRequest" + :current-order-request="orderRequest" @toggle-sort-by="toggleSortBy" /> @@ -16,8 +16,13 @@ import { useLogsParamsStore } from '@/stores/params' import ListBarTab from '../lists/ListBarTab.vue' import { LOGS_LIST_BAR_TAB } from '@/constants/admin' import { useLogsParamsChange } from '../hooks/useLogsParamsChange' +import { computed } from 'vue' const { params } = useLogsParamsStore() +const orderRequest = computed(() => ({ + sortBy: 'REQUESTED_AT', + sortDirection: params.sortDirection +})) const { toggleSortBy } = useLogsParamsChange() diff --git a/src/components/api-logs/ApiLogsListCard.vue b/src/components/api-logs/ApiLogsListCard.vue index fd7c4756..31ce9289 100644 --- a/src/components/api-logs/ApiLogsListCard.vue +++ b/src/components/api-logs/ApiLogsListCard.vue @@ -15,15 +15,22 @@ diff --git a/src/components/hooks/useLogsParamsChange.ts b/src/components/hooks/useLogsParamsChange.ts index 9ebc4473..95b36e3e 100644 --- a/src/components/hooks/useLogsParamsChange.ts +++ b/src/components/hooks/useLogsParamsChange.ts @@ -3,6 +3,10 @@ import { useLogsParamsStore } from '@/stores/params' export const useLogsParamsChange = () => { const { params } = useLogsParamsStore() + const onArrayChange = (array: Value[], value: Value) => { + return array.includes(value) ? array.filter(el => el !== value) : [...array, value] + } + const onTermChange = (value: string) => { if (value === '') { params.term = '' @@ -10,14 +14,14 @@ export const useLogsParamsChange = () => { params.term = Number(value) } } - const onDivisionChange = (value: string) => { - params.division = value + const onLogStatusChange = (value: string) => { + params.logStatus = onArrayChange(params.logStatus!, value) } const onNickNameChange = (value: string) => { params.nickName = value } - const onIpAddressChange = (value: string) => { - params.ipAddress = value + const onClientIpChange = (value: string) => { + params.clientIp = value } const onPageSizeChange = (value: string) => { params.pageSize = Number(value) @@ -29,9 +33,9 @@ export const useLogsParamsChange = () => { return { onTermChange, - onDivisionChange, + onLogStatusChange, onNickNameChange, - onIpAddressChange, + onClientIpChange, onPageSizeChange, toggleSortBy } diff --git a/src/components/login-logs/LoginLogsFilterBar.vue b/src/components/login-logs/LoginLogsFilterBar.vue index bbd48f2e..451f82c9 100644 --- a/src/components/login-logs/LoginLogsFilterBar.vue +++ b/src/components/login-logs/LoginLogsFilterBar.vue @@ -1,21 +1,21 @@ @@ -23,16 +24,36 @@ diff --git a/src/components/login-logs/LoginLogsListBar.vue b/src/components/login-logs/LoginLogsListBar.vue index 1d64dcbf..a0fcaac5 100644 --- a/src/components/login-logs/LoginLogsListBar.vue +++ b/src/components/login-logs/LoginLogsListBar.vue @@ -6,7 +6,7 @@ :content="tab.content" :width="tab.width" :sortBy="tab.sortBy" - :current-order-request="params.orderRequest" + :current-order-request="orderRequest" @toggle-sort-by="toggleSortBy" /> @@ -16,8 +16,13 @@ import ListBarTab from '../lists/ListBarTab.vue' import { useLogsParamsStore } from '@/stores/params' import { LOGS_LIST_BAR_TAB } from '@/constants/admin' import { useLogsParamsChange } from '../hooks/useLogsParamsChange' +import { computed } from 'vue' const { params } = useLogsParamsStore() +const orderRequest = computed(() => ({ + sortBy: 'REQUESTED_AT', + sortDirection: params.sortDirection +})) const { toggleSortBy } = useLogsParamsChange() diff --git a/src/components/login-logs/LoginLogsListCard.vue b/src/components/login-logs/LoginLogsListCard.vue index fd7c4756..d8346563 100644 --- a/src/components/login-logs/LoginLogsListCard.vue +++ b/src/components/login-logs/LoginLogsListCard.vue @@ -15,15 +15,31 @@ diff --git a/src/components/member-management/MemberManagementFilterBar.vue b/src/components/member-management/MemberManagementFilterBar.vue index a53a7ac2..cfb892c4 100644 --- a/src/components/member-management/MemberManagementFilterBar.vue +++ b/src/components/member-management/MemberManagementFilterBar.vue @@ -10,8 +10,8 @@ @update:value="value => (params.nickName = value)" /> + :value="String(params.departmentName)" + @update:value="value => (params.departmentName = value)" /> + @@ -26,13 +27,28 @@ import ListContainer from '../lists/ListContainer.vue' import { useMemberManagementParamsStore } from '@/stores/params' import MemberManagementListBar from './MemberManagementListBar.vue' import MemberManagementListCard from './MemberManagementListCard.vue' -import { DUMMY_MEMBER_MANAGEMENT_LIST_DATA } from '@/datas/dummy' +import NoContent from '../lists/NoContent.vue' +import { axiosInstance } from '@/utils/axios' +import { useQuery } from '@tanstack/vue-query' +import { computed } from 'vue' +import type { MemberManagementResponse } from '@/types/admin' const { params } = useMemberManagementParamsStore() -const DUMMY_TOTAL_PAGE = 18 const onPageChange = (value: number) => { params.page = value } -// Data Handling +const fetchMemberList = async () => { + const response = await axiosInstance.get('/api/managements/members', { params }) + return response.data +} + +const { data } = useQuery({ + queryKey: ['member', params], + queryFn: fetchMemberList +}) + +const totalPage = computed(() => { + return data.value?.totalPages +}) diff --git a/src/components/member-management/MemberManagementListBar.vue b/src/components/member-management/MemberManagementListBar.vue index f4c26bc6..6c0ee5cf 100644 --- a/src/components/member-management/MemberManagementListBar.vue +++ b/src/components/member-management/MemberManagementListBar.vue @@ -20,7 +20,7 @@ import { computed } from 'vue' const { params } = useMemberManagementParamsStore() const orderRequest = computed(() => ({ - sortBy: params.sortBy, + sortBy: 'REGISTERED_AT', sortDirection: params.sortDirection })) diff --git a/src/components/member-management/MemberManagementListCard.vue b/src/components/member-management/MemberManagementListCard.vue index f410071b..f0573174 100644 --- a/src/components/member-management/MemberManagementListCard.vue +++ b/src/components/member-management/MemberManagementListCard.vue @@ -29,17 +29,29 @@ + @close="closeModal"> + + + + + + + :is-open="isModalVisible.invite" + @close="closeModal"> @@ -51,36 +63,53 @@ import type { MemberManagementListData } from '@/types/admin' import { useRouter } from 'vue-router' import ModalView from '../ModalView.vue' import { ref } from 'vue' +import { axiosInstance } from '@/utils/axios' +import { useQueryClient } from '@tanstack/vue-query' +import { formatDate } from '@/utils/date' const roleContent = (role: Role) => { - return role === 'USER' ? '사용자' : role === 'MANAGER' ? '담당자' : '관리자' + return role === 'ROLE_USER' ? '사용자' : role === 'ROLE_MANAGER' ? '담당자' : '관리자' } const { info } = defineProps<{ info: MemberManagementListData }>() const myRequestTabList: ListCardProps[] = [ { content: info.name, width: 60 }, - { content: info.nickName, width: 80 }, - { content: info.department, width: 80 }, + { content: info.nickname, width: 80 }, + { content: info.departmentName, width: 80 }, { content: info.departmentRole, width: 80 }, { content: info.email }, { content: roleContent(info.role), width: 60 }, - { content: info.permission ? '허용' : '', width: 60 }, - { content: info.registeredAt, width: 80 } + { content: info.isReviewer ? '허용' : '', width: 60 }, + { content: formatDate(info.createdAt), width: 80 } ] const router = useRouter() +const queryClient = useQueryClient() -const isModalOpen = ref({ +const isModalVisible = ref({ delete: false, - invite: false + invite: false, + fail: false, + success: false }) -const toggleModal = (key: keyof typeof isModalOpen.value) => { - isModalOpen.value[key] = !isModalOpen.value[key] +const toggleModal = (key: keyof typeof isModalVisible.value) => { + isModalVisible.value = Object.fromEntries( + Object.keys(isModalVisible.value).map(k => [k, k === key]) + ) as typeof isModalVisible.value +} +const closeModal = () => { + const prevSuccess = isModalVisible.value.success + isModalVisible.value = { delete: false, invite: false, fail: false, success: false } + if (prevSuccess) queryClient.invalidateQueries({ queryKey: ['member'] }) } -const onMemberDelete = (memberId: number) => { - console.log(memberId) - toggleModal('delete') +const onMemberDelete = async (memberId: number) => { + try { + await axiosInstance.patch(`/api/managements/members/delete`, { memberId }) + toggleModal('success') + } catch { + toggleModal('fail') + } } const onMemberInvite = (memberId: number) => { diff --git a/src/components/my-request/MyRequestList.vue b/src/components/my-request/MyRequestList.vue index 849a36eb..a53cfe21 100644 --- a/src/components/my-request/MyRequestList.vue +++ b/src/components/my-request/MyRequestList.vue @@ -42,12 +42,7 @@ const onPageChange = (value: number) => { const fetchMyRequestList = async () => { const { parseRequestParams } = useParseParams() const parsedParams = parseRequestParams(params) - const response = await axiosInstance.get('/api/tasks/requests', { - headers: { - Authorization: `Bearer ${import.meta.env.VITE_ACCESS_TOKEN}` - }, - params: parsedParams - }) + const response = await axiosInstance.get('/api/tasks/requests', { params: parsedParams }) return response.data } diff --git a/src/components/my-task/MyTaskList.vue b/src/components/my-task/MyTaskList.vue index d470a1e4..6e1c03dd 100644 --- a/src/components/my-task/MyTaskList.vue +++ b/src/components/my-task/MyTaskList.vue @@ -42,12 +42,7 @@ const onPageChange = (value: number) => { const fetchMyTaskList = async () => { const { parseRequestParams } = useParseParams() const parsedParams = parseRequestParams(params) - const response = await axiosInstance.get('/api/tasks/assigned', { - headers: { - Authorization: `Bearer ${import.meta.env.VITE_ACCESS_TOKEN}` - }, - params: parsedParams - }) + const response = await axiosInstance.get('/api/tasks/assigned', { params: parsedParams }) return response.data } diff --git a/src/components/request-history/RequestHistoryList.vue b/src/components/request-history/RequestHistoryList.vue index 2399d44e..f3ef6028 100644 --- a/src/components/request-history/RequestHistoryList.vue +++ b/src/components/request-history/RequestHistoryList.vue @@ -42,12 +42,7 @@ const onPageChange = (value: number) => { const fetchRequestHistoryList = async () => { const { parseRequestParams } = useParseParams() const parsedParams = parseRequestParams(params) - const response = await axiosInstance.get('/api/tasks', { - headers: { - Authorization: `Bearer ${import.meta.env.VITE_ACCESS_TOKEN}` - }, - params: parsedParams - }) + const response = await axiosInstance.get('/api/tasks', { params: parsedParams }) return response.data } diff --git a/src/components/requested/RequestedList.vue b/src/components/requested/RequestedList.vue index b5b25eab..a2defa6f 100644 --- a/src/components/requested/RequestedList.vue +++ b/src/components/requested/RequestedList.vue @@ -42,12 +42,7 @@ const onPageChange = (value: number) => { const fetchRequestedList = async () => { const { parseRequestParams } = useParseParams() const parsedParams = parseRequestParams(params) - const response = await axiosInstance.get('/api/tasks/requests/pending', { - headers: { - Authorization: `Bearer ${import.meta.env.VITE_ACCESS_TOKEN}` - }, - params: parsedParams - }) + const response = await axiosInstance.get('/api/tasks/requests/pending', { params: parsedParams }) return response.data } diff --git a/src/components/statistics/StatisticsCard.vue b/src/components/statistics/StatisticsCard.vue index 9a547990..e5194cfe 100644 --- a/src/components/statistics/StatisticsCard.vue +++ b/src/components/statistics/StatisticsCard.vue @@ -53,9 +53,6 @@ const changePeriod = (newPeriodType: PeriodType) => { const fetchStatistics = async () => { const response = await axiosInstance.get('/api/tasks/statistics', { - headers: { - Authorization: `Bearer ${import.meta.env.VITE_ACCESS_TOKEN}` - }, params: { periodType: periodType.value, statisticsType diff --git a/src/components/statistics/StatisticsCategoryCard.vue b/src/components/statistics/StatisticsCategoryCard.vue index 6fae0d6c..262779b1 100644 --- a/src/components/statistics/StatisticsCategoryCard.vue +++ b/src/components/statistics/StatisticsCategoryCard.vue @@ -45,9 +45,6 @@ const changeMainCategory = (value: string) => (mainCategory.value = value) const fetchMainStatistics = async () => { const response = await axiosInstance.get('/api/tasks/statistics', { - headers: { - Authorization: `Bearer ${import.meta.env.VITE_ACCESS_TOKEN}` - }, params: { periodType: periodType.value, statisticsType: 'REQUEST_BY_CATEGORY' @@ -69,9 +66,6 @@ const mainSeries = computed(() => { const fetchSubStatistics = async () => { const response = await axiosInstance.get('/api/tasks/statistics/subcategory', { - headers: { - Authorization: `Bearer ${import.meta.env.VITE_ACCESS_TOKEN}` - }, params: { periodType: periodType.value, mainCategory: mainCategory.value diff --git a/src/constants/admin.ts b/src/constants/admin.ts index 44c1e4be..7249051a 100644 --- a/src/constants/admin.ts +++ b/src/constants/admin.ts @@ -13,25 +13,31 @@ export const MEMBER_MANAGEMENT_LIST_BAR_TAB: ListBarTabProps[] = [ ] export const LOGIN_LOGS_DIVISION_LIST: Option[] = [ - { content: '전체', value: '' }, - { content: '로그인 시도', value: 'LOGIN_TRY' }, + { content: '로그인 시도', value: 'LOGIN' }, { content: '로그아웃', value: 'LOGOUT' } ] export const API_LOGS_DIVISION_LIST: Option[] = [ { content: '요청 생성', value: 'REQUEST_CREATED' }, - { content: '요청 수정', value: 'REQUEST_EDITED' }, - { content: '요청 취소', value: 'REQUEST_CANCELED' }, - { content: '요청 승인', value: 'REQUEST_APPROVED' } + { content: '요청 수정', value: 'REQUEST_UPDATED' }, + { content: '요청 취소', value: 'REQUEST_CANCELLED' }, + { content: '요청 승인', value: 'REQUEST_APPROVED' }, + { content: '처리자 변경', value: 'ASSIGNER_CHANGED' }, + { content: '댓글 추가', value: 'COMMENT_ADDED' }, + { content: '댓글 수정', value: 'COMMENT_UPDATED' }, + { content: '작업 상태 변경', value: 'STATUS_CHANGED' }, + { content: '작업 완료', value: 'TASK_COMPLETED' }, + { content: '작업 실패', value: 'TASK_FAILED' }, + { content: '작업 조회', value: 'TASK_VIEWED' } ] export const LOGS_LIST_BAR_TAB: ListBarTabProps[] = [ { content: '구분', width: 80 }, - { content: '시각', width: 180, sortBy: 'CREATED_AT' }, + { content: '시각', width: 180, sortBy: 'REQUESTED_AT' }, { content: '아이디', width: 80 }, { content: 'IP 주소', width: 120 }, { content: 'Status', width: 40 }, - { content: '결과' } + { content: '비고' } ] import type { RoleTypes, RoleTypesEnum, UserRegistrationProps } from '@/types/admin' diff --git a/src/constants/common.ts b/src/constants/common.ts index e8361b2c..3dd12c16 100644 --- a/src/constants/common.ts +++ b/src/constants/common.ts @@ -22,9 +22,9 @@ export const PAGE_SIZE_LIST = [ export const ROLE_LIST = [ { value: '', content: '전체' }, - { value: 'user', content: '사용자' }, - { value: 'manager', content: '담당자' }, - { value: 'admin', content: '관리자' } + { value: 'ROLE_USER', content: '사용자' }, + { value: 'ROLE_MANAGER', content: '담당자' }, + { value: 'ROLE_ADMIN', content: '관리자' } ] export const COLOR_LIST = [ diff --git a/src/datas/dummy.ts b/src/datas/dummy.ts index cccc0b4b..33376b86 100644 --- a/src/datas/dummy.ts +++ b/src/datas/dummy.ts @@ -1,553 +1,3 @@ -import type { LogsListData, MemberManagementListData } from '@/types/admin' - -export const DUMMY_MEMBER_MANAGEMENT_LIST_DATA: MemberManagementListData[] = [ - { - memberId: 1, - name: '김기기', - nickName: 'gigi.kim', - department: '백엔드 1팀', - departmentRole: '백엔드 개발자', - email: 'gigikim@gachon.ac.kr', - role: 'USER', - registeredAt: '2025.01.11' - }, - { - memberId: 2, - name: '남니니', - nickName: 'nini.nam', - department: '인프라팀', - departmentRole: '인프라 아키텍터', - email: 'nininam@gachon.ac.kr', - role: 'MANAGER', - registeredAt: '2025.01.11' - }, - { - memberId: 3, - name: '도디디', - nickName: 'didi.do', - department: '인프라팀', - departmentRole: '네트워크 엔지니어', - email: 'didido@gachon.ac.kr', - role: 'MANAGER', - registeredAt: '2025.01.11' - }, - { - memberId: 4, - name: '류리리', - nickName: 'riri.ryu', - department: '인프라팀', - departmentRole: '시스템 엔지니어', - email: 'ririryu@gachon.ac.kr', - role: 'MANAGER', - registeredAt: '2025.01.11' - }, - { - memberId: 5, - name: '민미미', - nickName: 'mimi.min', - department: '인프라팀', - departmentRole: '공통플랫폼 운영 담당자', - email: 'mimimin@gachon.ac.kr', - role: 'MANAGER', - registeredAt: '2025.01.11' - }, - { - memberId: 6, - name: '방비비', - nickName: 'bibi.bang', - department: '인프라팀', - departmentRole: 'Project Manager', - email: 'bibibang@gachon.ac.kr', - role: 'MANAGER', - permission: true, - registeredAt: '2025.01.11' - }, - { - memberId: 7, - name: '심시시', - nickName: 'sisi.shim', - department: '매니지먼트팀', - departmentRole: 'TMS 시스템 관리자', - email: 'sisishim@gachon.ac.kr', - role: 'ADMIN', - registeredAt: '2025.01.11' - }, - { - memberId: 8, - name: '김기기', - nickName: 'gigi.kim', - department: '백엔드 1팀', - departmentRole: '백엔드 개발자', - email: 'gigikim@gachon.ac.kr', - role: 'USER', - registeredAt: '2025.01.11' - }, - { - memberId: 9, - name: '남니니', - nickName: 'nini.nam', - department: '인프라팀', - departmentRole: '인프라 아키텍터', - email: 'nininam@gachon.ac.kr', - role: 'MANAGER', - registeredAt: '2025.01.11' - }, - { - memberId: 10, - name: '도디디', - nickName: 'didi.do', - department: '인프라팀', - departmentRole: '네트워크 엔지니어', - email: 'didido@gachon.ac.kr', - role: 'MANAGER', - registeredAt: '2025.01.11' - }, - { - memberId: 11, - name: '류리리', - nickName: 'riri.ryu', - department: '인프라팀', - departmentRole: '시스템 엔지니어', - email: 'ririryu@gachon.ac.kr', - role: 'MANAGER', - registeredAt: '2025.01.11' - }, - { - memberId: 12, - name: '민미미', - nickName: 'mimi.min', - department: '인프라팀', - departmentRole: '공통플랫폼 운영 담당자', - email: 'mimimin@gachon.ac.kr', - role: 'MANAGER', - registeredAt: '2025.01.11' - }, - { - memberId: 13, - name: '방비비', - nickName: 'bibi.bang', - department: '인프라팀', - departmentRole: 'Project Manager', - email: 'bibibang@gachon.ac.kr', - role: 'MANAGER', - permission: true, - registeredAt: '2025.01.11' - }, - { - memberId: 14, - name: '심시시', - nickName: 'sisi.shim', - department: '매니지먼트팀', - departmentRole: 'TMS 시스템 관리자', - email: 'sisishim@gachon.ac.kr', - role: 'ADMIN', - registeredAt: '2025.01.11' - }, - { - memberId: 15, - name: '김기기', - nickName: 'gigi.kim', - department: '백엔드 1팀', - departmentRole: '백엔드 개발자', - email: 'gigikim@gachon.ac.kr', - role: 'USER', - registeredAt: '2025.01.11' - }, - { - memberId: 16, - name: '남니니', - nickName: 'nini.nam', - department: '인프라팀', - departmentRole: '인프라 아키텍터', - email: 'nininam@gachon.ac.kr', - role: 'MANAGER', - registeredAt: '2025.01.11' - }, - { - memberId: 17, - name: '도디디', - nickName: 'didi.do', - department: '인프라팀', - departmentRole: '네트워크 엔지니어', - email: 'didido@gachon.ac.kr', - role: 'MANAGER', - registeredAt: '2025.01.11' - }, - { - memberId: 18, - name: '류리리', - nickName: 'riri.ryu', - department: '인프라팀', - departmentRole: '시스템 엔지니어', - email: 'ririryu@gachon.ac.kr', - role: 'MANAGER', - registeredAt: '2025.01.11' - }, - { - memberId: 19, - name: '민미미', - nickName: 'mimi.min', - department: '인프라팀', - departmentRole: '공통플랫폼 운영 담당자', - email: 'mimimin@gachon.ac.kr', - role: 'MANAGER', - registeredAt: '2025.01.11' - }, - { - memberId: 20, - name: '방비비', - nickName: 'bibi.bang', - department: '인프라팀', - departmentRole: 'Project Manager', - email: 'bibibang@gachon.ac.kr', - role: 'MANAGER', - permission: true, - registeredAt: '2025.01.11' - } -] - -export const DUMMY_LOGIN_LOGS_LIST_DATA: LogsListData[] = [ - { - logId: 1, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 400, - result: 'count=4' - }, - { - logId: 2, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 400, - result: 'count=3' - }, - { - logId: 3, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 400, - result: 'count=2' - }, - { - logId: 4, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 400, - result: 'count=1' - }, - { - logId: 5, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 6, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 400, - result: 'count=4' - }, - { - logId: 7, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 400, - result: 'count=3' - }, - { - logId: 8, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 400, - result: 'count=2' - }, - { - logId: 9, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 400, - result: 'count=1' - }, - { - logId: 10, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 11, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 400, - result: 'count=4' - }, - { - logId: 12, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 400, - result: 'count=3' - }, - { - logId: 13, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 400, - result: 'count=2' - }, - { - logId: 14, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 400, - result: 'count=1' - }, - { - logId: 15, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 16, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 400, - result: 'count=4' - }, - { - logId: 17, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 400, - result: 'count=3' - }, - { - logId: 18, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 400, - result: 'count=2' - }, - { - logId: 19, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 400, - result: 'count=1' - }, - { - logId: 20, - division: '로그인 시도', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - } -] - -export const DUMMY_API_LOGS_LIST_DATA: LogsListData[] = [ - { - logId: 1, - division: '요청 생성', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 2, - division: '요청 수정', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 3, - division: '요청 취소', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 4, - division: '요청 승인', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 5, - division: '요청 생성', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 6, - division: '요청 수정', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 7, - division: '요청 취소', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 8, - division: '요청 승인', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 9, - division: '요청 생성', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 10, - division: '요청 수정', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 11, - division: '요청 취소', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 12, - division: '요청 승인', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 13, - division: '요청 생성', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 14, - division: '요청 수정', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 15, - division: '요청 취소', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 16, - division: '요청 승인', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 17, - division: '요청 생성', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 18, - division: '요청 수정', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 19, - division: '요청 취소', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - }, - { - logId: 20, - division: '요청 승인', - createdAt: '2025.01.08 오전 12:23:04', - nickName: 'Tony.tsx', - ipAddress: '192.168.222.222', - status: 200 - } -] - export const DUMMY_TEAM_MEMBERS_LIST = [ { name: 'Tony.tsx', diff --git a/src/stores/params.ts b/src/stores/params.ts index b2bbec49..dddf9cf5 100644 --- a/src/stores/params.ts +++ b/src/stores/params.ts @@ -40,14 +40,13 @@ export const useRequestParamsStore = defineStore('requestParams', () => { export const useMemberManagementParamsStore = defineStore('userManagementParams', () => { const params = ref({ + page: 0, + pageSize: 20, name: '', - nickName: '', - department: '', email: '', + nickName: '', + departmentName: '', role: '', - pageSize: 20, - page: 1, - sortBy: 'REGISTERED_AT', sortDirection: 'DESC' }) @@ -56,24 +55,22 @@ export const useMemberManagementParamsStore = defineStore('userManagementParams' export const useLogsParamsStore = defineStore('logsParams', () => { const params = ref({ + page: 0, + pageSize: 20, term: '', - division: '', + logStatus: [], nickName: '', - ipAddress: '', - pageSize: 20, - page: 1, - sortBy: 'CREATED_AT', + clientIp: '', sortDirection: 'DESC' }) const $reset = () => { + params.value.page = 0 + params.value.pageSize = 20 params.value.term = '' - params.value.division = '' + params.value.logStatus = [] params.value.nickName = '' - params.value.ipAddress = '' - params.value.pageSize = 20 - params.value.page = 1 - params.value.sortBy = 'CREATED_AT' + params.value.clientIp = '' params.value.sortDirection = 'DESC' } diff --git a/src/types/admin.ts b/src/types/admin.ts index 3f27bc28..a299049c 100644 --- a/src/types/admin.ts +++ b/src/types/admin.ts @@ -3,23 +3,33 @@ import type { Category, Role } from './common' export interface MemberManagementListData { memberId: number name: string - nickName: string - department: string + nickname: string + departmentName: string departmentRole: string email: string role: Role - permission?: boolean - registeredAt: string + isReviewer: boolean + createdAt: string } -export interface LogsListData { +export interface LoginLogsListData { logId: number - division: string - createdAt: string + logStatus: string + requestAt: string nickName: string - ipAddress: string - status: number - result?: string + clientIp: string + statusCode: number + customStatusCode: string + failedAttempts: number +} + +export interface ApiLogsListData { + logId: number + logStatus: string + requestAt: string + nickName: string + clientIp: string + statusCode: number } export interface UserRegistrationProps { @@ -61,3 +71,33 @@ export interface StatisticsData { key: string count: number } + +export interface MemberManagementResponse { + content: MemberManagementListData[] + totalElements: number + totalPages: number + pageNumber: number + pageSize: number + isFirst: boolean + isLast: boolean +} + +export interface LoginLogsResponse { + content: LoginLogsListData[] + totalElements: number + totalPages: number + pageNumber: number + pageSize: number + isFirst: boolean + isLast: boolean +} + +export interface ApiLogsResponse { + content: ApiLogsListData[] + totalElements: number + totalPages: number + pageNumber: number + pageSize: number + isFirst: boolean + isLast: boolean +} diff --git a/src/types/common.ts b/src/types/common.ts index 9a179847..350ec3e7 100644 --- a/src/types/common.ts +++ b/src/types/common.ts @@ -54,7 +54,7 @@ export type Status = 'REQUESTED' | 'IN_PROGRESS' | 'PENDING_COMPLETED' | 'COMPLE export type SortDirection = 'DESC' | 'ASC' -export type Role = 'USER' | 'MANAGER' | 'ADMIN' +export type Role = 'ROLE_USER' | 'ROLE_MANAGER' | 'ROLE_ADMIN' export interface DueDateInputProps { modelValue: string diff --git a/src/types/stores.ts b/src/types/stores.ts index 2d3731a0..59cc4243 100644 --- a/src/types/stores.ts +++ b/src/types/stores.ts @@ -14,25 +14,23 @@ export interface RequestParams { } export interface MemberManagementParams { + page: number + pageSize: number name: string - nickName: string - department: string email: string + nickName: string + departmentName: string role: Role | '' - pageSize: number - page: number - sortBy: 'REGISTERED_AT' sortDirection: SortDirection } export interface LogsParams { + page: number + pageSize: number term: number | '' - division: string + logStatus: string[] nickName: string - ipAddress: string - pageSize: number - page: number - sortBy: 'CREATED_AT' + clientIp: string sortDirection: SortDirection }