From 8bb78e68eaf2dcc965ebf18b5a67cb161b1682d2 Mon Sep 17 00:00:00 2001 From: Tola Leng Date: Thu, 31 Jul 2025 14:57:16 +0700 Subject: [PATCH] Disable verbose logging - Disable log console output in file to prevent logs from being printed to the console. --- .../regional-monitoring/AddRegionalAgentDialog.tsx | 2 +- .../src/components/servers/DockerOneClickTab.tsx | 8 ++++---- .../ServiceDetailContainer/hooks/useServiceData.tsx | 2 +- .../src/services/ssl/sslCertificateOperations.ts | 10 +++++----- application/src/utils/copyUtils.ts | 10 +++++----- 5 files changed, 16 insertions(+), 16 deletions(-) diff --git a/application/src/components/regional-monitoring/AddRegionalAgentDialog.tsx b/application/src/components/regional-monitoring/AddRegionalAgentDialog.tsx index c18cd18..ebde414 100644 --- a/application/src/components/regional-monitoring/AddRegionalAgentDialog.tsx +++ b/application/src/components/regional-monitoring/AddRegionalAgentDialog.tsx @@ -114,7 +114,7 @@ export const AddRegionalAgentDialog: React.FC = ({ textarea.setSelectionRange(0, 99999); // For mobile devices } } catch (selectError) { - console.error('Failed to select text:', selectError); + // console.error('Failed to select text:', selectError); } } }; diff --git a/application/src/components/servers/DockerOneClickTab.tsx b/application/src/components/servers/DockerOneClickTab.tsx index 9c23228..33719a9 100644 --- a/application/src/components/servers/DockerOneClickTab.tsx +++ b/application/src/components/servers/DockerOneClickTab.tsx @@ -64,18 +64,18 @@ sudo -E bash ./server-docker-agent.sh`; const handleCopyOneClickCommand = async (e: React.MouseEvent) => { e.preventDefault(); e.stopPropagation(); - console.log('Copy one-click command button clicked'); + // console.log('Copy one-click command button clicked'); const command = getDockerOneClickCommand(); - console.log('Copying one-click command:', command); + // console.log('Copying one-click command:', command); await copyToClipboard(command); }; const handleCopyDockerCommand = async (e: React.MouseEvent) => { e.preventDefault(); e.stopPropagation(); - console.log('Copy docker command button clicked'); + // console.log('Copy docker command button clicked'); const command = getDirectDockerCommand(); - console.log('Copying docker command:', command); + // console.log('Copying docker command:', command); await copyToClipboard(command); }; diff --git a/application/src/components/services/ServiceDetailContainer/hooks/useServiceData.tsx b/application/src/components/services/ServiceDetailContainer/hooks/useServiceData.tsx index fa42951..0fbcb6b 100644 --- a/application/src/components/services/ServiceDetailContainer/hooks/useServiceData.tsx +++ b/application/src/components/services/ServiceDetailContainer/hooks/useServiceData.tsx @@ -125,7 +125,7 @@ export const useServiceData = (serviceId: string | undefined, startDate: Date, e } else { // Fetch regional agent specific data const [regionName, agentId] = currentAgent.split("|"); - console.log(`Fetching regional agent data for region: ${regionName}, agent: ${agentId} from ${service.type} collection`); + // console.log(`Fetching regional agent data for region: ${regionName}, agent: ${agentId} from ${service.type} collection`); history = await uptimeService.getUptimeHistoryByRegionalAgent(serviceId, limit, start, end, service.type, regionName, agentId); // console.log(`Retrieved ${history.length} regional monitoring records`); } diff --git a/application/src/services/ssl/sslCertificateOperations.ts b/application/src/services/ssl/sslCertificateOperations.ts index 88dc49f..d1e87a3 100644 --- a/application/src/services/ssl/sslCertificateOperations.ts +++ b/application/src/services/ssl/sslCertificateOperations.ts @@ -38,7 +38,7 @@ export const addSSLCertificate = async ( return record as unknown as SSLCertificate; } catch (error) { - console.error("Error adding SSL certificate:", error); + // console.error("Error adding SSL certificate:", error); throw error; } }; @@ -67,7 +67,7 @@ export const checkAndUpdateCertificate = async ( // Return the current certificate data return typedCertificate; } catch (error) { - console.error("Error updating SSL certificate:", error); + // console.error("Error updating SSL certificate:", error); throw error; } }; @@ -84,10 +84,10 @@ export const triggerImmediateCheck = async (certificateId: string): Promise => { await pb.collection("ssl_certificates").delete(id); return true; } catch (error) { - console.error("Error deleting SSL certificate:", error); + // console.error("Error deleting SSL certificate:", error); throw error; } }; diff --git a/application/src/utils/copyUtils.ts b/application/src/utils/copyUtils.ts index 24483d4..21f29ee 100644 --- a/application/src/utils/copyUtils.ts +++ b/application/src/utils/copyUtils.ts @@ -2,12 +2,12 @@ import { toast } from "@/hooks/use-toast"; export const copyToClipboard = async (text: string) => { - console.log('copyToClipboard called with text:', text); // Debug log + // console.log('copyToClipboard called with text:', text); // Debug log try { // Try modern clipboard API first if (navigator.clipboard && window.isSecureContext) { - console.log('Using modern clipboard API'); // Debug log + // console.log('Using modern clipboard API'); // Debug log await navigator.clipboard.writeText(text); toast({ title: "Copied!", @@ -16,7 +16,7 @@ export const copyToClipboard = async (text: string) => { return; } - console.log('Using fallback clipboard method'); // Debug log + // console.log('Using fallback clipboard method'); // Debug log // Fallback for older browsers or non-secure contexts const textArea = document.createElement("textarea"); @@ -39,7 +39,7 @@ export const copyToClipboard = async (text: string) => { document.body.removeChild(textArea); if (successful) { - console.log('Copy successful with execCommand'); // Debug log + // console.log('Copy successful with execCommand'); // Debug log toast({ title: "Copied!", description: "Content copied to clipboard successfully.", @@ -48,7 +48,7 @@ export const copyToClipboard = async (text: string) => { throw new Error('Copy command failed'); } } catch (error) { - console.error('Failed to copy to clipboard:', error); + // console.error('Failed to copy to clipboard:', error); // Show error toast toast({