From 34beee4975215fcccd8bc728793f18f92666a730 Mon Sep 17 00:00:00 2001 From: zain94rif Date: Thu, 2 Apr 2026 14:03:17 +0700 Subject: [PATCH] fix(name): change name from Web Control to WhatsApp Control --- package.json | 92 +++++++++---------- src/App.jsx | 6 +- .../{web-control.jsx => whatsapp-control.jsx} | 4 +- src/layout/LayoutMenu.jsx | 8 +- .../IndexWhatsAppControl.jsx} | 17 ++-- .../WebControlBackup.jsx | 38 ++++---- 6 files changed, 83 insertions(+), 82 deletions(-) rename src/api/{web-control.jsx => whatsapp-control.jsx} (90%) rename src/pages/{webControl/IndexWebControl.jsx => whatsAppControl/IndexWhatsAppControl.jsx} (84%) rename src/pages/{webControl => whatsAppControl}/WebControlBackup.jsx (87%) diff --git a/package.json b/package.json index f1f39f0..4882112 100644 --- a/package.json +++ b/package.json @@ -1,48 +1,48 @@ { - "name": "antd-vite-react-call-of-duty", - "homepage": "/dashboard/home", - "private": true, - "version": "1.0.0", - "type": "module", - "scripts": { - "dev": "vite", - "build": "vite build", - "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", - "preview": "vite preview" - }, - "dependencies": { - "@ant-design/icons": "^6.0.0", - "@nivo/line": "^0.88.0", - "@nivo/pie": "^0.88.0", - "antd": "^5.15.2", - "axios": "^1.8.4", - "browser-image-compression": "^2.0.2", - "crypto-js": "^4.2.0", - "dayjs": "^1.11.13", - "exceljs": "^4.4.0", - "file-saver": "^2.0.5", - "html2canvas": "^1.4.1", - "jspdf": "^3.0.4", - "jspdf-autotable": "^5.0.2", - "mqtt": "^5.14.0", - "qrcode": "^1.5.4", - "react": "^18.2.0", - "react-dom": "^18.2.0", - "react-icons": "^4.11.0", - "react-router-dom": "^6.22.3", - "react-svg": "^16.3.0", - "recharts": "^3.6.0", - "sweetalert2": "^11.17.2" - }, - "devDependencies": { - "@types/react": "^18.2.64", - "@types/react-dom": "^18.2.21", - "@vitejs/plugin-react": "^4.2.1", - "eslint": "^8.57.0", - "eslint-plugin-react": "^7.34.0", - "eslint-plugin-react-hooks": "^4.6.0", - "eslint-plugin-react-refresh": "^0.4.5", - "vite": "^5.1.6" - }, - "packageManager": "pnpm@10.2.1+sha512.398035c7bd696d0ba0b10a688ed558285329d27ea994804a52bad9167d8e3a72bcb993f9699585d3ca25779ac64949ef422757a6c31102c12ab932e5cbe5cc92" + "name": "antd-vite-react-call-of-duty", + "homepage": "/dashboard/home", + "private": true, + "version": "1.0.0", + "type": "module", + "scripts": { + "dev": "vite --host 0.0.0.0 --port 8592", + "build": "vite build", + "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", + "preview": "vite preview" + }, + "dependencies": { + "@ant-design/icons": "^6.0.0", + "@nivo/line": "^0.88.0", + "@nivo/pie": "^0.88.0", + "antd": "^5.15.2", + "axios": "^1.8.4", + "browser-image-compression": "^2.0.2", + "crypto-js": "^4.2.0", + "dayjs": "^1.11.13", + "exceljs": "^4.4.0", + "file-saver": "^2.0.5", + "html2canvas": "^1.4.1", + "jspdf": "^3.0.4", + "jspdf-autotable": "^5.0.2", + "mqtt": "^5.14.0", + "qrcode": "^1.5.4", + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-icons": "^4.11.0", + "react-router-dom": "^6.22.3", + "react-svg": "^16.3.0", + "recharts": "^3.6.0", + "sweetalert2": "^11.17.2" + }, + "devDependencies": { + "@types/react": "^18.2.64", + "@types/react-dom": "^18.2.21", + "@vitejs/plugin-react": "^4.2.1", + "eslint": "^8.57.0", + "eslint-plugin-react": "^7.34.0", + "eslint-plugin-react-hooks": "^4.6.0", + "eslint-plugin-react-refresh": "^0.4.5", + "vite": "^5.1.6" + }, + "packageManager": "pnpm@10.2.1+sha512.398035c7bd696d0ba0b10a688ed558285329d27ea994804a52bad9167d8e3a72bcb993f9699585d3ca25779ac64949ef422757a6c31102c12ab932e5cbe5cc92" } diff --git a/src/App.jsx b/src/App.jsx index 1cbda33..8ffcfc9 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -36,7 +36,7 @@ import IndexNotification from './pages/notification/IndexNotification'; import IndexRole from './pages/role/IndexRole'; import IndexUser from './pages/user/IndexUser'; import IndexContact from './pages/contact/IndexContact'; -import IndexWebControl from './pages/webControl/IndexWebControl'; +import IndexWhatsAppControl from './pages/whatsAppControl/IndexWhatsAppControl'; import DetailNotificationTab from './pages/notificationDetail/IndexNotificationDetail'; import IndexVerificationSparepart from './pages/verificationSparepart/IndexVerificationSparepart'; @@ -145,8 +145,8 @@ const App = () => { } /> - }> - } /> + }> + } /> }> diff --git a/src/api/web-control.jsx b/src/api/whatsapp-control.jsx similarity index 90% rename from src/api/web-control.jsx rename to src/api/whatsapp-control.jsx index 4162c6a..ae72673 100644 --- a/src/api/web-control.jsx +++ b/src/api/whatsapp-control.jsx @@ -9,6 +9,4 @@ const resetWA = async () => { return response.data; }; -export { - resetWA, -}; +export { resetWA }; diff --git a/src/layout/LayoutMenu.jsx b/src/layout/LayoutMenu.jsx index bfbc70d..9693e60 100644 --- a/src/layout/LayoutMenu.jsx +++ b/src/layout/LayoutMenu.jsx @@ -227,11 +227,11 @@ const allItems = [ ), }, { - key: 'web-control', + key: 'whatsapp-control', icon: , label: ( - - Web Control + + WhatsApp Control ), }, @@ -260,7 +260,7 @@ const LayoutMenu = () => { if (pathname === '/dashboard/home') return 'home'; if (pathname === '/user') return 'user'; if (pathname === '/role') return 'role'; - if (pathname === '/web-control') return 'web-control'; + if (pathname === '/whatsapp-control') return 'whatsapp-control'; if (pathname === '/notification') return 'notification'; if (pathname === '/jadwal-shift') return 'jadwal-shift'; if (pathname === '/contact') return 'contact'; diff --git a/src/pages/webControl/IndexWebControl.jsx b/src/pages/whatsAppControl/IndexWhatsAppControl.jsx similarity index 84% rename from src/pages/webControl/IndexWebControl.jsx rename to src/pages/whatsAppControl/IndexWhatsAppControl.jsx index f48d3ab..69657f7 100644 --- a/src/pages/webControl/IndexWebControl.jsx +++ b/src/pages/whatsAppControl/IndexWhatsAppControl.jsx @@ -1,21 +1,21 @@ import React, { useState, useEffect, memo } from 'react'; import { useNavigate } from 'react-router-dom'; import { Button, Typography } from 'antd'; -import { resetWA } from '../../api/web-control'; +import { resetWA } from '../../api/whatsapp-control'; import { useBreadcrumb } from '../../layout/LayoutBreadcrumb'; import { ReloadOutlined } from '@ant-design/icons'; const { Text } = Typography; -const IndexWebControl = memo(function IndexWebControl() { +const IndexWhatsAppControl = memo(function IndexWhatsAppControl() { const navigate = useNavigate(); const { setBreadcrumbItems } = useBreadcrumb(); const [isPlaying, setIsPlaying] = useState(true); - const url = "http://localhost:9531/qrview"; + const url = import.meta.env.VITE_WHATSAPP_URL; - const handleReset = async() => { + const handleReset = async () => { setIsPlaying(false); await resetWA(); setIsPlaying(true); @@ -29,7 +29,7 @@ const IndexWebControl = memo(function IndexWebControl() { { title: ( - • Web Control Panel + • WhatsApp Control Panel ), }, @@ -41,10 +41,9 @@ const IndexWebControl = memo(function IndexWebControl() { return (
-
@@ -58,7 +57,7 @@ const IndexWebControl = memo(function IndexWebControl() { {isPlaying ? (