diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000..cb763e0 Binary files /dev/null and b/.DS_Store differ diff --git a/auto-bid-admin/package-lock.json b/auto-bid-admin/package-lock.json index 07348d1..a428dbb 100644 --- a/auto-bid-admin/package-lock.json +++ b/auto-bid-admin/package-lock.json @@ -38,6 +38,7 @@ "tailwind-merge": "^3.0.1", "tailwindcss": "^4.0.6", "uuid": "^11.0.5", + "yet-another-react-lightbox": "^3.22.0", "zod": "^3.24.1", "zustand": "^5.0.3" }, @@ -1422,7 +1423,7 @@ "version": "19.0.3", "resolved": "https://registry.npmjs.org/@types/react-dom/-/react-dom-19.0.3.tgz", "integrity": "sha512-0Knk+HJiMP/qOZgMyNFamlIjw9OFCsyC2ZbigmEEyXXixgre6IQpm/4V+r3qH4GC1JPvRJKInw+on2rV6YZLeA==", - "dev": true, + "devOptional": true, "license": "MIT", "peerDependencies": { "@types/react": "^19.0.0" @@ -7541,6 +7542,29 @@ "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==", "license": "ISC" }, + "node_modules/yet-another-react-lightbox": { + "version": "3.22.0", + "resolved": "https://registry.npmjs.org/yet-another-react-lightbox/-/yet-another-react-lightbox-3.22.0.tgz", + "integrity": "sha512-yaXmzUraH/Ftsp7eG/E2leQgXhtrG8c1t+jImlSjC2XtZ7XkvjIV2vP/1kl5kxmsBHjck/98W/9Xxempry+2QQ==", + "license": "MIT", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "@types/react": "^16 || ^17 || ^18 || ^19", + "@types/react-dom": "^16 || ^17 || ^18 || ^19", + "react": "^16.8.0 || ^17 || ^18 || ^19", + "react-dom": "^16.8.0 || ^17 || ^18 || ^19" + }, + "peerDependenciesMeta": { + "@types/react": { + "optional": true + }, + "@types/react-dom": { + "optional": true + } + } + }, "node_modules/zod": { "version": "3.24.1", "resolved": "https://registry.npmjs.org/zod/-/zod-3.24.1.tgz", diff --git a/auto-bid-admin/package.json b/auto-bid-admin/package.json index 9dc3311..9a4930c 100644 --- a/auto-bid-admin/package.json +++ b/auto-bid-admin/package.json @@ -40,6 +40,7 @@ "tailwind-merge": "^3.0.1", "tailwindcss": "^4.0.6", "uuid": "^11.0.5", + "yet-another-react-lightbox": "^3.22.0", "zod": "^3.24.1", "zustand": "^5.0.3" }, diff --git a/auto-bid-admin/src/apis/admin.ts b/auto-bid-admin/src/apis/admin.ts index d438bea..4299caa 100644 --- a/auto-bid-admin/src/apis/admin.ts +++ b/auto-bid-admin/src/apis/admin.ts @@ -1,3 +1,4 @@ +/* eslint-disable @typescript-eslint/no-unused-vars */ import { generateNestParams, handleError, handleSuccess } from '.'; import axios from '../lib/axios'; import { IAdmin } from '../system/type'; @@ -51,7 +52,8 @@ export const grantNewPasswordAdmin = async (admin: Partial) => { }; export const createAdmin = async (admin: Omit) => { - const newData = removeFalsyValues(admin); + const {permissions , ...newData} = removeFalsyValues(admin); + try { const { data } = await axios({ diff --git a/auto-bid-admin/src/apis/dashboard.ts b/auto-bid-admin/src/apis/dashboard.ts index 98fab82..47d8d7a 100644 --- a/auto-bid-admin/src/apis/dashboard.ts +++ b/auto-bid-admin/src/apis/dashboard.ts @@ -34,3 +34,18 @@ export const shutdownTool = async () => { handleError(error); } }; + + +export const getStatusTool = async () => { + try { + const { data } = await axios({ + url: `${BASE_URL}/status-tool`, + withCredentials: true, + method: 'GET', + }); + + return data; + } catch (error) { + handleError(error); + } +}; \ No newline at end of file diff --git a/auto-bid-admin/src/apis/index.ts b/auto-bid-admin/src/apis/index.ts index 41c44ce..b8b10e0 100644 --- a/auto-bid-admin/src/apis/index.ts +++ b/auto-bid-admin/src/apis/index.ts @@ -9,7 +9,7 @@ export const handleError = (error: unknown) => { // eslint-disable-next-line @typescript-eslint/no-explicit-any const response = (error as AxiosError).response as Record; - const data = response.data; + const data = response?.data; if (response.status === HttpStatusCode.Forbidden) return; diff --git a/auto-bid-admin/src/components/admin/admin-modal.tsx b/auto-bid-admin/src/components/admin/admin-modal.tsx index c65a52f..341b106 100644 --- a/auto-bid-admin/src/components/admin/admin-modal.tsx +++ b/auto-bid-admin/src/components/admin/admin-modal.tsx @@ -127,14 +127,14 @@ export default function AdminModal({ data, onUpdated, ...props }: IAdminModelPro centered >
- - - + + + {!data && ( <> - - + + )} diff --git a/auto-bid-admin/src/components/admin/grant-new-password-modal.tsx b/auto-bid-admin/src/components/admin/grant-new-password-modal.tsx index 20cd805..1940e82 100644 --- a/auto-bid-admin/src/components/admin/grant-new-password-modal.tsx +++ b/auto-bid-admin/src/components/admin/grant-new-password-modal.tsx @@ -87,8 +87,8 @@ export default function GrantNewPasswordModal({ data, onUpdated, ...props }: IAd centered > - - + + - - - - + + + {isIBid(data) ? data.name : "Tracking page"} + + {isIBid(data) && ( + {`Max price: $${data.max_price}`} + )} + {isIBid(data) && ( + {`Current price: $${data.current_price}`} + )} + + {moment(lastUpdate).format("HH:mm:ss DD/MM/YYYY")} + + + + + + - - - ); + + + {statusLabel()} + + + + {isIBid(data) ? data.web_bid.origin_url : data.origin_url} + + + + + + + ); } diff --git a/auto-bid-admin/src/components/web-bid/web-bid-modal.tsx b/auto-bid-admin/src/components/web-bid/web-bid-modal.tsx index a9eee58..fa072fd 100644 --- a/auto-bid-admin/src/components/web-bid/web-bid-modal.tsx +++ b/auto-bid-admin/src/components/web-bid/web-bid-modal.tsx @@ -104,8 +104,8 @@ export default function WebBidModal({ data, onUpdated, ...props }: IWebBidModelP centered > - - + +