pdate screenshot
This commit is contained in:
		
							parent
							
								
									ad1bc5300b
								
							
						
					
					
						commit
						d4ffdfd1b7
					
				| 
						 | 
				
			
			@ -178,7 +178,7 @@ export async function runtimeCheckLogs(folderPath) {
 | 
			
		|||
                  );
 | 
			
		||||
                    const timeImage = Date.now()
 | 
			
		||||
                  await screenShot(fileName, timeImage);
 | 
			
		||||
                  const uriImage = await uploadFileToZulip(fileName, timeImage);
 | 
			
		||||
                  const uriImage = await uploadFileToZulip(timeImage);
 | 
			
		||||
                  let listReport = await getListLineByItem(
 | 
			
		||||
                    logsDetect[0].filter((l) => l.line > lastLine)
 | 
			
		||||
                  );
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -15,7 +15,7 @@ export const screenShot = async (filename, time) => {
 | 
			
		|||
    await bodyHandle.dispose();
 | 
			
		||||
    await page.setViewport({ width: 1920, height: 500 });
 | 
			
		||||
    setTimeout(async () => {
 | 
			
		||||
      await page.screenshot({ path: "/home/screenshot/"+time+"_"+filename+".png" });
 | 
			
		||||
      await page.screenshot({ path: "/home/screenshot/"+time+".png" });
 | 
			
		||||
      browser.close();
 | 
			
		||||
    }, 5000);
 | 
			
		||||
  } catch (error) {
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -2,7 +2,7 @@ import { FormData } from "zulip-js/lib/helper";
 | 
			
		|||
import axios from "axios";
 | 
			
		||||
import fs from "fs";
 | 
			
		||||
 | 
			
		||||
export const uploadFileToZulip = async (filename, time) => {
 | 
			
		||||
export const uploadFileToZulip = async (filename) => {
 | 
			
		||||
  //   try {
 | 
			
		||||
  const ZULIP_API_URL = "https://zulip.ipsupply.com.au/api/v1";
 | 
			
		||||
  const ZULIP_API_KEY = "0jMAmOuhfLvBqKJikv5oAkyNM4RIEoAM";
 | 
			
		||||
| 
						 | 
				
			
			@ -13,7 +13,7 @@ export const uploadFileToZulip = async (filename, time) => {
 | 
			
		|||
  try {
 | 
			
		||||
    
 | 
			
		||||
      
 | 
			
		||||
      const fileStream = fs.createReadStream("/home/screenshot/"+time+"_"+filename+".png");
 | 
			
		||||
      const fileStream = fs.createReadStream("/home/screenshot/"+filename+".png");
 | 
			
		||||
      const formData = new FormData();
 | 
			
		||||
      formData.append("file", fileStream);
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
		Reference in New Issue