Disable verbose logging
- Disable log console output in file to prevent logs from being printed to the console.
This commit is contained in:
@@ -114,7 +114,7 @@ export const AddRegionalAgentDialog: React.FC<AddRegionalAgentDialogProps> = ({
|
|||||||
textarea.setSelectionRange(0, 99999); // For mobile devices
|
textarea.setSelectionRange(0, 99999); // For mobile devices
|
||||||
}
|
}
|
||||||
} catch (selectError) {
|
} catch (selectError) {
|
||||||
console.error('Failed to select text:', selectError);
|
// console.error('Failed to select text:', selectError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -64,18 +64,18 @@ sudo -E bash ./server-docker-agent.sh`;
|
|||||||
const handleCopyOneClickCommand = async (e: React.MouseEvent) => {
|
const handleCopyOneClickCommand = async (e: React.MouseEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
console.log('Copy one-click command button clicked');
|
// console.log('Copy one-click command button clicked');
|
||||||
const command = getDockerOneClickCommand();
|
const command = getDockerOneClickCommand();
|
||||||
console.log('Copying one-click command:', command);
|
// console.log('Copying one-click command:', command);
|
||||||
await copyToClipboard(command);
|
await copyToClipboard(command);
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleCopyDockerCommand = async (e: React.MouseEvent) => {
|
const handleCopyDockerCommand = async (e: React.MouseEvent) => {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
||||||
e.stopPropagation();
|
e.stopPropagation();
|
||||||
console.log('Copy docker command button clicked');
|
// console.log('Copy docker command button clicked');
|
||||||
const command = getDirectDockerCommand();
|
const command = getDirectDockerCommand();
|
||||||
console.log('Copying docker command:', command);
|
// console.log('Copying docker command:', command);
|
||||||
await copyToClipboard(command);
|
await copyToClipboard(command);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ export const useServiceData = (serviceId: string | undefined, startDate: Date, e
|
|||||||
} else {
|
} else {
|
||||||
// Fetch regional agent specific data
|
// Fetch regional agent specific data
|
||||||
const [regionName, agentId] = currentAgent.split("|");
|
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);
|
history = await uptimeService.getUptimeHistoryByRegionalAgent(serviceId, limit, start, end, service.type, regionName, agentId);
|
||||||
// console.log(`Retrieved ${history.length} regional monitoring records`);
|
// console.log(`Retrieved ${history.length} regional monitoring records`);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,7 +38,7 @@ export const addSSLCertificate = async (
|
|||||||
|
|
||||||
return record as unknown as SSLCertificate;
|
return record as unknown as SSLCertificate;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error adding SSL certificate:", error);
|
// console.error("Error adding SSL certificate:", error);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -67,7 +67,7 @@ export const checkAndUpdateCertificate = async (
|
|||||||
// Return the current certificate data
|
// Return the current certificate data
|
||||||
return typedCertificate;
|
return typedCertificate;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error updating SSL certificate:", error);
|
// console.error("Error updating SSL certificate:", error);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -84,10 +84,10 @@ export const triggerImmediateCheck = async (certificateId: string): Promise<void
|
|||||||
check_at: currentTime
|
check_at: currentTime
|
||||||
});
|
});
|
||||||
|
|
||||||
console.log(`Triggered immediate check for certificate ${certificateId} at ${currentTime}`);
|
// console.log(`Triggered immediate check for certificate ${certificateId} at ${currentTime}`);
|
||||||
toast.success("SSL check scheduled - certificate will be checked shortly");
|
toast.success("SSL check scheduled - certificate will be checked shortly");
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error triggering immediate SSL check:", error);
|
// console.error("Error triggering immediate SSL check:", error);
|
||||||
toast.error("Failed to schedule SSL check");
|
toast.error("Failed to schedule SSL check");
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
@@ -101,7 +101,7 @@ export const deleteSSLCertificate = async (id: string): Promise<boolean> => {
|
|||||||
await pb.collection("ssl_certificates").delete(id);
|
await pb.collection("ssl_certificates").delete(id);
|
||||||
return true;
|
return true;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error("Error deleting SSL certificate:", error);
|
// console.error("Error deleting SSL certificate:", error);
|
||||||
throw error;
|
throw error;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -2,12 +2,12 @@
|
|||||||
import { toast } from "@/hooks/use-toast";
|
import { toast } from "@/hooks/use-toast";
|
||||||
|
|
||||||
export const copyToClipboard = async (text: string) => {
|
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 {
|
||||||
// Try modern clipboard API first
|
// Try modern clipboard API first
|
||||||
if (navigator.clipboard && window.isSecureContext) {
|
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);
|
await navigator.clipboard.writeText(text);
|
||||||
toast({
|
toast({
|
||||||
title: "Copied!",
|
title: "Copied!",
|
||||||
@@ -16,7 +16,7 @@ export const copyToClipboard = async (text: string) => {
|
|||||||
return;
|
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
|
// Fallback for older browsers or non-secure contexts
|
||||||
const textArea = document.createElement("textarea");
|
const textArea = document.createElement("textarea");
|
||||||
@@ -39,7 +39,7 @@ export const copyToClipboard = async (text: string) => {
|
|||||||
document.body.removeChild(textArea);
|
document.body.removeChild(textArea);
|
||||||
|
|
||||||
if (successful) {
|
if (successful) {
|
||||||
console.log('Copy successful with execCommand'); // Debug log
|
// console.log('Copy successful with execCommand'); // Debug log
|
||||||
toast({
|
toast({
|
||||||
title: "Copied!",
|
title: "Copied!",
|
||||||
description: "Content copied to clipboard successfully.",
|
description: "Content copied to clipboard successfully.",
|
||||||
@@ -48,7 +48,7 @@ export const copyToClipboard = async (text: string) => {
|
|||||||
throw new Error('Copy command failed');
|
throw new Error('Copy command failed');
|
||||||
}
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Failed to copy to clipboard:', error);
|
// console.error('Failed to copy to clipboard:', error);
|
||||||
|
|
||||||
// Show error toast
|
// Show error toast
|
||||||
toast({
|
toast({
|
||||||
|
|||||||
Reference in New Issue
Block a user