From b13712a31730d084e734f35e14462b3d24ef780d Mon Sep 17 00:00:00 2001 From: Admin Date: Mon, 28 Apr 2025 16:30:24 +0700 Subject: [PATCH] pickcels --- .DS_Store | Bin 0 -> 6148 bytes auto-bid-admin/package-lock.json | 26 +- auto-bid-admin/package.json | 1 + auto-bid-admin/src/apis/admin.ts | 4 +- auto-bid-admin/src/apis/dashboard.ts | 15 + auto-bid-admin/src/apis/index.ts | 2 +- .../src/components/admin/admin-modal.tsx | 10 +- .../admin/grant-new-password-modal.tsx | 4 +- auto-bid-admin/src/components/bid/index.ts | 1 + .../show-histories-bid-grays-api-modal.tsx | 4 +- .../show-histories-bid-pickles-api-modal.tsx | 74 ++ .../components/dashboard/show-image-modal.tsx | 25 +- .../src/components/dashboard/working-page.tsx | 252 +++-- .../src/components/web-bid/web-bid-modal.tsx | 4 +- auto-bid-admin/src/constant/index.ts | 8 + .../src/lib/zustand/use-status-tool-store.ts | 13 + auto-bid-admin/src/pages/bids.tsx | 706 +++++++------- auto-bid-admin/src/pages/dashboard.tsx | 272 +++--- auto-bid-admin/src/utils/index.ts | 195 ++-- auto-bid-server/bot-data/metadata.json | 2 +- .../src/modules/bids/apis/grays.api.ts | 49 +- .../admin/admin-dashboard.controller.ts | 7 +- .../controllers/client/bids.controller.ts | 16 +- .../dto/bid/client-update-login-status.dto.ts | 12 + .../modules/bids/getways/admin-bid-getway.ts | 11 + .../src/modules/bids/services/bids.service.ts | 11 +- .../bids/services/dashboard.service.ts | 47 +- .../src/modules/bids/utils/events.ts | 5 + .../src/modules/databases/databases.module.ts | 27 +- auto-bid-server/src/ultils/index.ts | 4 + auto-bid-tool/ecosystem.config.cjs | 16 + auto-bid-tool/index.js | 495 +++++----- auto-bid-tool/models/bid.js | 62 +- .../models/grays.com/grays-api-bid.js | 456 +++++---- .../models/grays.com/grays-product-bid.js | 479 ++++++---- .../langtons.com.au/langtons-api-bid.js | 457 +++++---- .../langtons.com.au/langtons-product-bid.js | 867 ++++++++++-------- .../lawsons.com.au/lawsons-product-bid.js | 739 ++++++++------- .../models/pickles.com.au/pickles-api-bid.js | 151 +++ .../pickles.com.au/pickles-product-bid.js | 479 ++++++++++ auto-bid-tool/models/product-bid.js | 278 +++--- auto-bid-tool/service/app-service.js | 106 ++- auto-bid-tool/system/apis/bid.js | 212 +++-- auto-bid-tool/system/apis/notification.js | 32 +- auto-bid-tool/system/config.js | 67 +- 45 files changed, 4190 insertions(+), 2513 deletions(-) create mode 100644 .DS_Store create mode 100644 auto-bid-admin/src/components/bid/show-histories-bid-pickles-api-modal.tsx create mode 100644 auto-bid-admin/src/constant/index.ts create mode 100644 auto-bid-admin/src/lib/zustand/use-status-tool-store.ts create mode 100644 auto-bid-server/src/modules/bids/dto/bid/client-update-login-status.dto.ts create mode 100644 auto-bid-tool/ecosystem.config.cjs create mode 100644 auto-bid-tool/models/pickles.com.au/pickles-api-bid.js create mode 100644 auto-bid-tool/models/pickles.com.au/pickles-product-bid.js diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..cb763e0f78ac2f94794a85c27c16bba086f6bf36 GIT binary patch literal 6148 zcmeHK!A{#i5S@jzI3U^_TD6x-mbel~5Q0{{m_QG`)(8%5mD+VgEgWwYJLC{W^0oX- zkNgS0L*MK!YLl4cR-tr9ntkKhd28*Hch^fqqBV$`L^UFE;Ea`ZG$qFU>@&7vGF6~Z zW7H|6m?ElEFjH+4RspNPV^e_F?lY{`0p%pIZvU*`h`LzI>BmHV4-*-pjyH)T_|Ba& zL<_j#FzXraP1sA~EN?V!#mZ{s$;Dy+9q0@w`OJj5^e(D{iO6 z`~}9}VlH4Whnx#0IVI?3iJ<(YN=hch6mO=)oWooWA?HkRN<=7AX6B=JHp)6}&MIIP z_^%b<{lSGZdIk%PYU@Cwt^mLa(#jC?Zvt~%gPy@cBYI#$Q-PW)%oRguI`Xcm^9&Xm zHJyaHd=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 > - - + +