perf(logs): remove console.log
This commit is contained in:
@@ -8,7 +8,7 @@ export default function useAlarmModel() {
|
||||
setLoading(true);
|
||||
try {
|
||||
const res = await queryAlarms(); // đổi URL cho phù hợp
|
||||
console.log('Alarm Data fetched:', res);
|
||||
// console.log('Alarm Data fetched:', res);
|
||||
|
||||
setAlarmData(res || []);
|
||||
} catch (err) {
|
||||
|
||||
@@ -163,10 +163,10 @@ class MapManager {
|
||||
this.initZoomListener();
|
||||
this.isInitialized = true;
|
||||
|
||||
console.log(
|
||||
'Map initialized successfully at',
|
||||
new Date().toLocaleTimeString(),
|
||||
);
|
||||
// console.log(
|
||||
// 'Map initialized successfully at',
|
||||
// new Date().toLocaleTimeString(),
|
||||
// );
|
||||
|
||||
this.map.on('singleclick', (evt: any) => {
|
||||
const featuresAtPixel: {
|
||||
@@ -188,12 +188,12 @@ class MapManager {
|
||||
if (this.features.includes(feature)) {
|
||||
this.onFeatureClick(feature);
|
||||
this.onFeatureSelect(feature, evt.pixel);
|
||||
console.log(
|
||||
'Feature clicked at',
|
||||
new Date().toLocaleTimeString(),
|
||||
':',
|
||||
feature.getProperties(),
|
||||
);
|
||||
// console.log(
|
||||
// 'Feature clicked at',
|
||||
// new Date().toLocaleTimeString(),
|
||||
// ':',
|
||||
// feature.getProperties(),
|
||||
// );
|
||||
}
|
||||
} else {
|
||||
this.onFeaturesClick(featuresAtPixel.map((f) => f.feature));
|
||||
@@ -366,7 +366,7 @@ class MapManager {
|
||||
strokeColor = 'rgba(255, 0, 0, 0.8)',
|
||||
strokeWidthBase = 0.25,
|
||||
} = config;
|
||||
console.log('Starting animatedMarker with config:', config);
|
||||
// console.log('Starting animatedMarker with config:', config);
|
||||
|
||||
const flashGeom = feature.getGeometry()?.clone() as Point | undefined;
|
||||
if (!flashGeom || !this.featureLayer) {
|
||||
|
||||
@@ -36,7 +36,7 @@ const ShipInfo: React.FC<ShipInfoProps> = ({ isOpen, setIsOpen }) => {
|
||||
const fetchShipData = async () => {
|
||||
try {
|
||||
const resp = await getShipInfo();
|
||||
console.log('Ship Info Response:', resp);
|
||||
// console.log('Ship Info Response:', resp);
|
||||
return resp;
|
||||
} catch (error) {
|
||||
console.error('Error fetching ship data:', error);
|
||||
|
||||
@@ -67,7 +67,7 @@ const SosButton: React.FC<SosButtonProps> = ({ onRefresh }) => {
|
||||
console.error('Failed to delete SOS:', error);
|
||||
message.error(t('sos.cancelError'));
|
||||
}
|
||||
console.log('Sending SOS without message');
|
||||
// console.log('Sending SOS without message');
|
||||
}
|
||||
};
|
||||
|
||||
@@ -116,7 +116,7 @@ const SosButton: React.FC<SosButtonProps> = ({ onRefresh }) => {
|
||||
</Button>
|
||||
}
|
||||
onFinish={async (values) => {
|
||||
console.log('Form Values: ', values);
|
||||
// console.log('Form Values: ', values);
|
||||
|
||||
// Nếu chọn "Khác" thì lấy messageOther, ngược lại lấy message
|
||||
const finalMessage =
|
||||
|
||||
@@ -22,7 +22,7 @@ const VietNamMap: React.FC<VietNamMapProps> = React.memo(
|
||||
const mapRef = useRef<HTMLDivElement>(null);
|
||||
|
||||
useEffect(() => {
|
||||
console.log('useEffect in VietNamMap triggered');
|
||||
// console.log('useEffect in VietNamMap triggered');
|
||||
let manager = mapManager;
|
||||
|
||||
if (!manager) {
|
||||
@@ -38,10 +38,10 @@ const VietNamMap: React.FC<VietNamMapProps> = React.memo(
|
||||
manager!.mapRef = mapRef;
|
||||
if (!manager!.map) {
|
||||
manager!.initializeMap();
|
||||
console.log(
|
||||
'Initialized new MapManager instance at',
|
||||
new Date().toLocaleTimeString(),
|
||||
);
|
||||
// console.log(
|
||||
// 'Initialized new MapManager instance at',
|
||||
// new Date().toLocaleTimeString(),
|
||||
// );
|
||||
}
|
||||
} else if (retryCount < maxRetries) {
|
||||
console.error('mapRef.current is not ready, retrying...');
|
||||
@@ -55,7 +55,7 @@ const VietNamMap: React.FC<VietNamMapProps> = React.memo(
|
||||
initialize();
|
||||
|
||||
return () => {
|
||||
console.log('Cleanup in VietNamMap triggered');
|
||||
// console.log('Cleanup in VietNamMap triggered');
|
||||
// Không gọi destroy ở đây để tránh phá hủy bản đồ không cần thiết
|
||||
};
|
||||
}, [mapManager, onFeatureClick, onFeatureSelect, onFeaturesClick, onError]);
|
||||
|
||||
@@ -63,12 +63,12 @@ const HomePage: React.FC = () => {
|
||||
const hasCenteredRef = useRef(false);
|
||||
const onFeatureClick = useCallback((feature: any) => {
|
||||
console.log('OnClick Feature: ', feature);
|
||||
console.log(
|
||||
'Clicked ship at',
|
||||
new Date().toLocaleTimeString(),
|
||||
'Properties:',
|
||||
feature.getProperties(),
|
||||
);
|
||||
// console.log(
|
||||
// 'Clicked ship at',
|
||||
// new Date().toLocaleTimeString(),
|
||||
// 'Properties:',
|
||||
// feature.getProperties(),
|
||||
// );
|
||||
}, []);
|
||||
const intl = useIntl();
|
||||
const onFeaturesClick = useCallback((features: any[]) => {
|
||||
|
||||
@@ -38,7 +38,7 @@ const CreateNewHaulOrTrip: React.FC<CreateNewHaulOrTripProps> = ({
|
||||
|
||||
try {
|
||||
const gpsData = await getGPS();
|
||||
console.log('GPS Data:', gpsData);
|
||||
// console.log('GPS Data:', gpsData);
|
||||
|
||||
const body: API.NewFishingLogRequest = {
|
||||
trip_id: trips?.id || '',
|
||||
|
||||
@@ -40,7 +40,7 @@ const CreateOrUpdateFishingLog: React.FC<CreateOrUpdateFishingLogProps> = ({
|
||||
try {
|
||||
const resp = await getFishSpecies();
|
||||
setFishDatas(resp);
|
||||
console.log('Fetched fish species:', resp);
|
||||
// console.log('Fetched fish species:', resp);
|
||||
} catch (error) {
|
||||
console.error('Error fetching fish species:', error);
|
||||
}
|
||||
@@ -48,7 +48,7 @@ const CreateOrUpdateFishingLog: React.FC<CreateOrUpdateFishingLogProps> = ({
|
||||
useEffect(() => {
|
||||
getAllFish();
|
||||
if (isOpen) {
|
||||
console.log('Modal opened with fishingLogs:', fishingLogs);
|
||||
// console.log('Modal opened with fishingLogs:', fishingLogs);
|
||||
|
||||
if (fishingLogs?.info && fishingLogs.info.length > 0) {
|
||||
const dataWithKeys: FishingLogInfoWithKey[] = fishingLogs.info.map(
|
||||
@@ -158,8 +158,8 @@ const CreateOrUpdateFishingLog: React.FC<CreateOrUpdateFishingLogProps> = ({
|
||||
async function createOrCreateOrUpdateFishingLog(
|
||||
fishingLog: FishingLogInfoWithKey[],
|
||||
) {
|
||||
console.log('Is finished:', isFinished);
|
||||
console.log('Trip:', trip);
|
||||
// console.log('Is finished:', isFinished);
|
||||
// console.log('Trip:', trip);
|
||||
|
||||
try {
|
||||
const gpsData = await getGPS();
|
||||
@@ -167,8 +167,8 @@ const CreateOrUpdateFishingLog: React.FC<CreateOrUpdateFishingLogProps> = ({
|
||||
if (isFinished === false) {
|
||||
// Tạo mẻ mới
|
||||
const logStatus0 = trip.fishing_logs?.find((log) => log.status === 0);
|
||||
console.log('ok', logStatus0);
|
||||
console.log('ok', fishingLog);
|
||||
// console.log('ok', logStatus0);
|
||||
// console.log('ok', fishingLog);
|
||||
const body: API.FishingLog = {
|
||||
fishing_log_id: logStatus0?.fishing_log_id || '',
|
||||
trip_id: trip.id,
|
||||
@@ -192,8 +192,8 @@ const CreateOrUpdateFishingLog: React.FC<CreateOrUpdateFishingLogProps> = ({
|
||||
})),
|
||||
sync: true,
|
||||
};
|
||||
const resp = await updateFishingLogs(body);
|
||||
console.log('Resp', resp);
|
||||
await updateFishingLogs(body);
|
||||
// console.log('Resp', resp);
|
||||
|
||||
onFinished?.(true);
|
||||
onOpenChange(false);
|
||||
@@ -223,8 +223,8 @@ const CreateOrUpdateFishingLog: React.FC<CreateOrUpdateFishingLogProps> = ({
|
||||
};
|
||||
// console.log('Update body:', body);
|
||||
|
||||
const resp = await updateFishingLogs(body);
|
||||
console.log('Resp', resp);
|
||||
await updateFishingLogs(body);
|
||||
// console.log('Resp', resp);
|
||||
|
||||
onFinished?.(true);
|
||||
onOpenChange(false);
|
||||
|
||||
@@ -122,7 +122,7 @@ const HaulTable: React.FC<HaulTableProps> = ({ hauls, trip }) => {
|
||||
align: 'center',
|
||||
hideInSearch: true,
|
||||
render: (_, record) => {
|
||||
console.log('Rendering action column for record:', record);
|
||||
// console.log('Rendering action column for record:', record);
|
||||
return (
|
||||
<Flex align="center" justify="center" gap={5}>
|
||||
{/* Nút Edit */}
|
||||
|
||||
@@ -15,6 +15,7 @@ const TripCostTable: React.FC<TripCostTableProps> = ({ tripCosts }) => {
|
||||
);
|
||||
const trip_cost_columns: ProColumns<API.TripCost>[] = [
|
||||
{
|
||||
key: 'type',
|
||||
title: (
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
{intl.formatMessage({ id: 'trip.cost.type' })}
|
||||
@@ -34,6 +35,7 @@ const TripCostTable: React.FC<TripCostTableProps> = ({ tripCosts }) => {
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
key: 'amount',
|
||||
title: (
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
{intl.formatMessage({ id: 'trip.cost.amount' })}
|
||||
@@ -43,6 +45,7 @@ const TripCostTable: React.FC<TripCostTableProps> = ({ tripCosts }) => {
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
key: 'unit',
|
||||
title: (
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
{intl.formatMessage({ id: 'trip.cost.unit' })}
|
||||
@@ -52,6 +55,7 @@ const TripCostTable: React.FC<TripCostTableProps> = ({ tripCosts }) => {
|
||||
align: 'center',
|
||||
},
|
||||
{
|
||||
key: 'cost_per_unit',
|
||||
title: (
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
{intl.formatMessage({ id: 'trip.cost.price' })}
|
||||
@@ -62,6 +66,7 @@ const TripCostTable: React.FC<TripCostTableProps> = ({ tripCosts }) => {
|
||||
render: (val: any) => (val ? Number(val).toLocaleString() : ''),
|
||||
},
|
||||
{
|
||||
key: 'total_cost',
|
||||
title: (
|
||||
<div style={{ textAlign: 'center' }}>
|
||||
{intl.formatMessage({ id: 'trip.cost.total' })}
|
||||
@@ -79,6 +84,7 @@ const TripCostTable: React.FC<TripCostTableProps> = ({ tripCosts }) => {
|
||||
];
|
||||
return (
|
||||
<ProTable<API.TripCost>
|
||||
rowKey="trip-cost-table"
|
||||
columns={trip_cost_columns}
|
||||
dataSource={tripCosts}
|
||||
search={false}
|
||||
|
||||
@@ -44,7 +44,7 @@ const DetailTrip = () => {
|
||||
}, []);
|
||||
|
||||
return (
|
||||
console.log('Rendering with tripInfo:', data),
|
||||
// console.log('Rendering with tripInfo:', data),
|
||||
(
|
||||
<PageContainer
|
||||
header={{
|
||||
@@ -140,13 +140,6 @@ const DetailTrip = () => {
|
||||
<MainTripBody
|
||||
trip_id={data?.id}
|
||||
tripInfo={data || null}
|
||||
onReload={(isReload) => {
|
||||
console.log('Nhanaj dduowcj hàm, onReload:', isReload);
|
||||
|
||||
// if (isReload) {
|
||||
// fetchTrip();
|
||||
// }
|
||||
}}
|
||||
/>
|
||||
</ProCard>
|
||||
</ProCard>
|
||||
|
||||
@@ -2,7 +2,7 @@ import { API_PATH_LOGIN } from '@/constants';
|
||||
import { request } from '@umijs/max';
|
||||
|
||||
export async function login(body: API.LoginRequestBody) {
|
||||
console.log('Login request body:', body);
|
||||
// console.log('Login request body:', body);
|
||||
|
||||
return request<API.LoginResponse>(API_PATH_LOGIN, {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user