diff --git a/src/App.jsx b/src/App.jsx index 498ca76..7be1e99 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -32,9 +32,6 @@ import IndexEventAlarm from './pages/eventAlarm/IndexEventAlarm'; import IndexRole from './pages/role/IndexRole'; import IndexUser from './pages/user/IndexUser'; -// Shift Management -import IndexMember from './pages/shiftManagement/member/IndexMember'; - import SvgTest from './pages/home/SvgTest'; import SvgOverview from './pages/home/SvgOverview'; import SvgCompressorA from './pages/home/SvgCompressorA'; @@ -81,21 +78,18 @@ const App = () => { } /> - }> - } /> - - - }> + }> } /> } /> - }> - } /> + }> + } /> + } /> - }> - } /> + }> + } /> }> @@ -106,8 +100,8 @@ const App = () => { } /> - }> - } /> + }> + } /> {/* Catch-all */} diff --git a/src/layout/LayoutMenu.jsx b/src/layout/LayoutMenu.jsx index e3c9d62..f52b424 100644 --- a/src/layout/LayoutMenu.jsx +++ b/src/layout/LayoutMenu.jsx @@ -29,6 +29,8 @@ import { DesktopOutlined, NodeExpandOutlined, GroupOutlined, + SlidersOutlined, + SnippetsOutlined, } from '@ant-design/icons'; const { Text } = Typography; @@ -93,7 +95,7 @@ const allItems = [ { key: 'master-plant-section', icon: , - label: Plant Section, + label: Plant Sub Section, }, { key: 'master-brand-device', @@ -127,20 +129,37 @@ const allItems = [ }, ], }, + { + key: 'report', + icon: , + label: 'Report', + children: [ + { + key: 'report-trending', + icon: , + label: Trending, + }, + { + key: 'report-report', + icon: , + label: Report, + }, + ], + }, { key: 'history', icon: , label: 'History', children: [ { - key: 'history-trending', - icon: , - label: Trending, + key: 'history-alarm', + icon: , + label: Alarm, }, { - key: 'history-report', - icon: , - label: Report, + key: 'history-event', + icon: , + label: Event, }, ], }, @@ -149,16 +168,7 @@ const allItems = [ icon: , label: ( - Notifikasi - - ), - }, - { - key: 'event-alarm', - icon: , - label: ( - - Event Alarm + Notification ), }, @@ -206,9 +216,7 @@ const LayoutMenu = () => { if (pathname === '/user') return 'user'; if (pathname === '/role') return 'role'; if (pathname === '/notification') return 'notification'; - if (pathname === '/event-alarm') return 'event-alarm'; if (pathname === '/jadwal-shift') return 'jadwal-shift'; - if (pathname === '/dashboard-svg') return 'dashboard-svg'; // Handle master routes if (pathname.startsWith('/master/')) { @@ -216,24 +224,24 @@ const LayoutMenu = () => { return `master-${subPath}`; } - // Handle master routes + // Handle dashboard svg routes if (pathname.startsWith('/dashboard-svg/')) { const subPath = pathParts[1]; return `dashboard-svg-${subPath}`; } + // Handle report routes + if (pathname.startsWith('/report/')) { + const subPath = pathParts[1]; + return `report-${subPath}`; + } + // Handle history routes if (pathname.startsWith('/history/')) { const subPath = pathParts[1]; return `history-${subPath}`; } - // Handle shift management routes - if (pathname.startsWith('/shift-management/')) { - const subPath = pathParts[1]; - return `shift-${subPath}`; - } - return 'home'; // default }; @@ -241,8 +249,8 @@ const LayoutMenu = () => { const getParentKey = (key) => { if (key.startsWith('master-')) return 'master'; if (key.startsWith('dashboard-svg-')) return 'dashboard-svg'; + if (key.startsWith('report-')) return 'report'; if (key.startsWith('history-')) return 'history'; - if (key.startsWith('shift-')) return 'shift-management'; return null; }; diff --git a/src/pages/eventAlarm/component/ListEventAlarm.jsx b/src/pages/eventAlarm/component/ListEventAlarm.jsx index d313c3e..394ca63 100644 --- a/src/pages/eventAlarm/component/ListEventAlarm.jsx +++ b/src/pages/eventAlarm/component/ListEventAlarm.jsx @@ -104,8 +104,8 @@ const ListEventAlarm = memo(function ListEventAlarm(props) { width: '15%', }, ]; + const [trigerFilter, setTrigerFilter] = useState(false); - const [alarmsData] = useState(initialAlarmsData); const defaultFilter = { search: '' }; const [formDataFilter, setFormDataFilter] = useState(defaultFilter); @@ -115,50 +115,8 @@ const ListEventAlarm = memo(function ListEventAlarm(props) { // Dummy data function to simulate API call const getAllEventAlarm = async (params) => { - // Simulate API delay - await new Promise((resolve) => setTimeout(resolve, 300)); - - // Extract URLSearchParams - const searchParam = params.get('search') || ''; - const page = parseInt(params.get('page')) || 1; - const limit = parseInt(params.get('limit')) || 10; - - console.log('getAllEventAlarm called with:', { searchParam, page, limit }); - - // Filter by search - let filteredAlarms = alarmsData; - if (searchParam) { - const searchLower = searchParam.toLowerCase(); - filteredAlarms = alarmsData.filter( - (alarm) => - alarm.tanggal.toLowerCase().includes(searchLower) || - alarm.plant_sub_section.toLowerCase().includes(searchLower) || - alarm.device.toLowerCase().includes(searchLower) || - alarm.tag.toLowerCase().includes(searchLower) || - alarm.engineer.toLowerCase().includes(searchLower) - ); - } - - // Pagination logic - const totalData = filteredAlarms.length; - const totalPages = Math.ceil(totalData / limit); - const startIndex = (page - 1) * limit; - const endIndex = startIndex + limit; - const paginatedData = filteredAlarms.slice(startIndex, endIndex); - return { - status: 200, - statusCode: 200, - data: { - data: paginatedData, - total: totalData, - paging: { - page: page, - limit: limit, - total: totalData, - page_total: totalPages, - }, - }, + data: initialAlarmsData, }; }; @@ -172,7 +130,7 @@ const ListEventAlarm = memo(function ListEventAlarm(props) { } else { navigate('/signin'); } - }, [props.actionMode, alarmsData]); + }, [props.actionMode]); const doFilter = () => { setTrigerFilter((prev) => !prev); diff --git a/src/pages/home/SvgAirDryerA.jsx b/src/pages/home/SvgAirDryerA.jsx index 2fd263b..5c42bd0 100644 --- a/src/pages/home/SvgAirDryerA.jsx +++ b/src/pages/home/SvgAirDryerA.jsx @@ -3,10 +3,11 @@ import { Card, Typography, Flex } from 'antd'; import { setValSvg } from '../../components/Global/MqttConnection'; import SvgTemplate from './SvgTemplate'; import SvgViewer from './SvgViewer'; +import filePathSvg from '../../assets/svg/air_dryer_A_rev.svg'; const { Text } = Typography; -const filePathSvg = '/src/assets/svg/air_dryer_A_rev.svg'; +// const filePathSvg = '/src/assets/svg/air_dryer_A_rev.svg'; const topicMqtt = 'PIU_GGCP/Devices/PB'; const SvgAirDryerA = () => { diff --git a/src/pages/home/SvgAirDryerB.jsx b/src/pages/home/SvgAirDryerB.jsx index 540f7d8..aa12b2c 100644 --- a/src/pages/home/SvgAirDryerB.jsx +++ b/src/pages/home/SvgAirDryerB.jsx @@ -3,10 +3,11 @@ import { Card, Typography, Flex } from 'antd'; import { setValSvg } from '../../components/Global/MqttConnection'; import SvgTemplate from './SvgTemplate'; import SvgViewer from './SvgViewer'; +import filePathSvg from '../../assets/svg/air_dryer_B_rev.svg'; const { Text } = Typography; -const filePathSvg = '/src/assets/svg/air_dryer_B_rev.svg'; +// const filePathSvg = '/src/assets/svg/air_dryer_B_rev.svg'; const topicMqtt = 'PIU_GGCP/Devices/PB'; const SvgAirDryerB = () => { diff --git a/src/pages/home/SvgAirDryerC.jsx b/src/pages/home/SvgAirDryerC.jsx index a06abc9..f1ad6d0 100644 --- a/src/pages/home/SvgAirDryerC.jsx +++ b/src/pages/home/SvgAirDryerC.jsx @@ -3,10 +3,11 @@ import { Card, Typography, Flex } from 'antd'; import { setValSvg } from '../../components/Global/MqttConnection'; import SvgTemplate from './SvgTemplate'; import SvgViewer from './SvgViewer'; +import filePathSvg from '../../assets/svg/air_dryer_C_rev.svg'; const { Text } = Typography; -const filePathSvg = '/src/assets/svg/air_dryer_C_rev.svg'; +// const filePathSvg = '/src/assets/svg/air_dryer_C_rev.svg'; const topicMqtt = 'PIU_GGCP/Devices/PB'; const SvgAirDryerC = () => { diff --git a/src/pages/home/SvgCompressorA.jsx b/src/pages/home/SvgCompressorA.jsx index 5509de6..b38ad63 100644 --- a/src/pages/home/SvgCompressorA.jsx +++ b/src/pages/home/SvgCompressorA.jsx @@ -3,10 +3,11 @@ import { Card, Typography, Flex } from 'antd'; import { setValSvg } from '../../components/Global/MqttConnection'; import SvgTemplate from './SvgTemplate'; import SvgViewer from './SvgViewer'; +import filePathSvg from '../../assets/svg/test-new.svg'; const { Text } = Typography; -const filePathSvg = '/src/assets/svg/test-new.svg'; +// const filePathSvg = '/src/assets/svg/test-new.svg'; const topicMqtt = 'PIU_GGCP/Devices/PB'; const SvgCompressorA = () => { diff --git a/src/pages/home/SvgCompressorB.jsx b/src/pages/home/SvgCompressorB.jsx index dd084ef..dcfc2eb 100644 --- a/src/pages/home/SvgCompressorB.jsx +++ b/src/pages/home/SvgCompressorB.jsx @@ -3,10 +3,11 @@ import { Card, Typography, Flex } from 'antd'; import { setValSvg } from '../../components/Global/MqttConnection'; import SvgTemplate from './SvgTemplate'; import SvgViewer from './SvgViewer'; +import filePathSvg from '../../assets/svg/test-new.svg'; const { Text } = Typography; -const filePathSvg = '/src/assets/svg/test-new.svg'; +// const filePathSvg = '/src/assets/svg/test-new.svg'; const topicMqtt = 'PIU_GGCP/Devices/PB'; const SvgCompressorB = () => { diff --git a/src/pages/home/SvgCompressorC.jsx b/src/pages/home/SvgCompressorC.jsx index 27c2d5a..cac1a04 100644 --- a/src/pages/home/SvgCompressorC.jsx +++ b/src/pages/home/SvgCompressorC.jsx @@ -3,10 +3,11 @@ import { Card, Typography, Flex } from 'antd'; import { setValSvg } from '../../components/Global/MqttConnection'; import SvgTemplate from './SvgTemplate'; import SvgViewer from './SvgViewer'; +import filePathSvg from '../../assets/svg/test-new.svg'; const { Text } = Typography; -const filePathSvg = '/src/assets/svg/test-new.svg'; +// const filePathSvg = '/src/assets/svg/test-new.svg'; const topicMqtt = 'PIU_GGCP/Devices/PB'; const SvgCompressorC = () => { diff --git a/src/pages/home/SvgOverview.jsx b/src/pages/home/SvgOverview.jsx index 7f7b988..5c7bf83 100644 --- a/src/pages/home/SvgOverview.jsx +++ b/src/pages/home/SvgOverview.jsx @@ -3,10 +3,11 @@ import { Card, Typography, Flex } from 'antd'; import { setValSvg } from '../../components/Global/MqttConnection'; import SvgTemplate from './SvgTemplate'; import SvgViewer from './SvgViewer'; +import filePathSvg from '../../assets/svg/test-new.svg'; const { Text } = Typography; -const filePathSvg = '/src/assets/svg/test-new.svg'; +// const filePathSvg = '/src/assets/svg/test-new.svg'; const topicMqtt = 'PIU_GGCP/Devices/PB'; const SvgOverview = () => { diff --git a/src/pages/home/SvgTest.jsx b/src/pages/home/SvgTest.jsx index ceb2133..4e6fcf4 100644 --- a/src/pages/home/SvgTest.jsx +++ b/src/pages/home/SvgTest.jsx @@ -3,10 +3,11 @@ import { Card, Typography, Flex } from 'antd'; // import { ReactSVG } from 'react-svg'; import { setValSvg } from '../../components/Global/MqttConnection'; import { ReactSVG } from 'react-svg'; +import filePathSvg from '../../assets/svg/test-new.svg'; const { Text } = Typography; -const filePathSvg = '/src/assets/svg/test-new.svg'; +// const filePathSvg = '/src/assets/svg/test-new.svg'; const topicMqtt = 'PIU_GGCP/Devices/PB'; const SvgTest = () => { diff --git a/src/pages/master/status/IndexStatus.jsx b/src/pages/master/status/IndexStatus.jsx index 4542207..76636d3 100644 --- a/src/pages/master/status/IndexStatus.jsx +++ b/src/pages/master/status/IndexStatus.jsx @@ -64,15 +64,14 @@ const IndexStatus = memo(function IndexStatus() { return ( - {actionMode === 'list' && ( - - )} + + { unit_id: '', unit_code: '', unit_name: '', - description: '', + unit_description: '', is_active: true, }; @@ -46,7 +46,7 @@ const DetailUnit = (props) => { const payload = { is_active: formData.is_active, unit_name: formData.unit_name, - description: formData.description, + unit_description: formData.unit_description, }; const response = @@ -206,8 +206,8 @@ const DetailUnit = (props) => {
Description [ }, { title: 'Description', - dataIndex: 'description', - key: 'description', + dataIndex: 'unit_description', + key: 'unit_description', width: '25%', render: (text) => text || '-', },