diff --git a/src/main/process/runTaskOperationService.ts b/src/main/process/runTaskOperationService.ts index 63160d4..408b77e 100644 --- a/src/main/process/runTaskOperationService.ts +++ b/src/main/process/runTaskOperationService.ts @@ -42,13 +42,15 @@ export function runTaskOperationService() { }) const results: any[] = [] - for (const item of scriptPaths) { + for (let i = 0; i < scriptPaths.length; i++) { + const item = scriptPaths[i] log.info(`Launching script for channel ${item.channel}: ${item.scriptPath}`) const result = await executeScriptServiceInstance.executeScript(item.scriptPath, { roomType: roomType[item.channel], startTime: options.startTime, endTime: options.endTime, operation: options.operation, + tabIndex: i, }) results.push({ channel: item.channel, diff --git a/src/main/scripts/fg_trace.mjs b/src/main/scripts/fg_trace.mjs index f840390..630bc7d 100644 --- a/src/main/scripts/fg_trace.mjs +++ b/src/main/scripts/fg_trace.mjs @@ -91,10 +91,9 @@ const toggleRoomByDateIndex = async (page, container, { roomType, dateIndex, ope }; (async () => { - let browser; + const browser = await chromium.connectOverCDP('http://127.0.0.1:9222'); try { - browser = await chromium.connectOverCDP(`http://127.0.0.1:9222`); const context = browser.contexts()[0]; await context.addInitScript(() => { @@ -102,8 +101,8 @@ const toggleRoomByDateIndex = async (page, container, { roomType, dateIndex, ope }); const pages = await context.pages(); - - const page = pages.length ? pages[0] : await context.newPage(); + const tabIndex = Number(process.env.TAB_INDEX); + const page = pages.length ? pages[tabIndex] : await context.newPage(); await page.goto('https://hotel.fliggy.com/ebooking/hotelBaseInfoUv.htm#/ebk/homeV1'); diff --git a/src/main/scripts/mt.md b/src/main/scripts/mt.md new file mode 100644 index 0000000..103ba1f --- /dev/null +++ b/src/main/scripts/mt.md @@ -0,0 +1,3 @@ +```html +
周二 02.03 | 周三 02.04 | 周四 02.05 | 周五 02.06 | 周六 02.07 | 周日 02.08 | 周一 02.09 | 周二 02.10 | 周三 02.11 | 周四 02.12 | 周五 02.13 | 周六 02.14 班 |
|---|
尊享豪华大床房(私汤) | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | |
至尊养生汤屋(私汤) | 3/0/0 | 3/0/0 | 3/0/0 | 2/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 2/0/0 | |
亲子房 | 3/0/0 | 2/0/1 | 2/0/1 | 19/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 2/0/1 | 2/0/1 | 0/0/3 | 3/0/0 | 19/0/0 | |
榻榻米双床房 | 1/0/2 | 10/0/3 | 10/0/0 | 10/0/1 | 10/0/2 | 9/0/1 | 6/0/4 | 8/0/4 | 8/0/2 | 8/0/2 | 8/0/2 | 10/0/0 | |
豪华至尊养生汤屋(私汤) | 不限/0/1 | 不限/0/0 | 不限/0/0 | 3/0/1 | 不限/0/0 | 不限/0/0 | 不限/0/0 | 不限/0/0 | 不限/0/0 | 不限/0/0 | 不限/0/0 | 0/0/0 | |
亲子太空舱 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | 1/0/0 | |
行政套房A | 2/0/1 | 2/0/1 | 3/0/0 | 7/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 7/0/0 | |
汤墅会馆(私汤) | 3/0/0 | 3/0/0 | 3/0/0 | 1/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 1/0/0 | |
至尊大床房 | 3/0/0 | 3/0/0 | 3/0/0 | 1/0/0 | 2/0/1 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 1/0/0 | |
高级标准间 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | |
豪华特色房 | 3/0/0 | 3/0/0 | 3/0/0 | 21/0/0 | 2/0/1 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 20/0/0 | |
豪华套房(私汤) | 3/0/0 | 3/0/0 | 3/0/0 | 2/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 2/0/0 | |
太空舱(私汤) | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 3/0/0 | 1/0/2 | 2/0/1 | 3/0/0 |

