Skip to content

Commit 5cfbd1e

Browse files
committed
Merge branch 'markdownify' of https://github.com/getmaxun/maxun into markdownify
2 parents 25fd74e + 467ffe3 commit 5cfbd1e

File tree

5 files changed

+105
-51
lines changed

5 files changed

+105
-51
lines changed

server/src/api/record.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -761,6 +761,14 @@ async function executeRun(id: string, userId: string, requestedFormats?: string[
761761
);
762762
}
763763

764+
capture("maxun-oss-run-created-api", {
765+
runId: plainRun.runId,
766+
user_id: userId,
767+
status: "success",
768+
robot_type: "scrape",
769+
formats
770+
});
771+
764772
await destroyRemoteBrowser(plainRun.browserId, userId);
765773

766774
return {
@@ -800,6 +808,14 @@ async function executeRun(id: string, userId: string, requestedFormats?: string[
800808
);
801809
}
802810

811+
capture("maxun-oss-run-created-api", {
812+
runId: plainRun.runId,
813+
user_id: userId,
814+
status: "failed",
815+
robot_type: "scrape",
816+
formats
817+
});
818+
803819
await destroyRemoteBrowser(plainRun.browserId, userId);
804820

805821
throw error;

server/src/pgboss-worker.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,14 @@ async function processRunExecution(job: Job<ExecuteRunData>) {
268268
logger.log('warn', `Failed to send webhooks for markdown robot run ${data.runId}: ${webhookError.message}`);
269269
}
270270

271+
capture("maxun-oss-run-created-manual", {
272+
runId: data.runId,
273+
user_id: data.userId,
274+
status: "success",
275+
robot_type: "scrape",
276+
formats,
277+
});
278+
271279
await destroyRemoteBrowser(browserId, data.userId);
272280

273281
return { success: true };
@@ -296,6 +304,14 @@ async function processRunExecution(job: Job<ExecuteRunData>) {
296304
logger.log('warn', `Failed to send run-failed notification for markdown robot run ${data.runId}: ${socketError.message}`);
297305
}
298306

307+
capture("maxun-oss-run-created-manual", {
308+
runId: data.runId,
309+
user_id: data.userId,
310+
status: "failed",
311+
robot_type: "scrape",
312+
formats,
313+
});
314+
299315
await destroyRemoteBrowser(browserId, data.userId);
300316

301317
throw error;

server/src/routes/storage.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -500,12 +500,12 @@ router.post('/recordings/scrape', requireSignIn, async (req: AuthenticatedReques
500500

501501
logger.log('info', `Markdown robot created with id: ${newRobot.id}`);
502502
capture(
503-
'maxun-oss-markdown-robot-created',
503+
'maxun-oss-robot-created',
504504
{
505505
robot_meta: newRobot.recording_meta,
506-
url: url,
506+
recording: newRobot.recording,
507507
}
508-
);
508+
)
509509

510510
return res.status(201).json({
511511
message: 'Markdown robot created successfully.',

server/src/workflow-management/scheduler/index.ts

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -321,6 +321,14 @@ async function executeRun(id: string, userId: string) {
321321
);
322322
}
323323

324+
capture("maxun-oss-run-created-scheduled", {
325+
runId: plainRun.runId,
326+
user_id: userId,
327+
status: "success",
328+
robot_type: "scrape",
329+
formats
330+
});
331+
324332
await destroyRemoteBrowser(plainRun.browserId, userId);
325333

326334
return true;
@@ -352,6 +360,14 @@ async function executeRun(id: string, userId: string) {
352360
);
353361
}
354362

363+
capture("maxun-oss-run-created-scheduled", {
364+
runId: plainRun.runId,
365+
user_id: userId,
366+
status: "failed",
367+
robot_type: "scrape",
368+
formats
369+
});
370+
355371
await destroyRemoteBrowser(plainRun.browserId, userId);
356372

357373
throw error;

src/components/robot/pages/RobotIntegrationPage.tsx

Lines changed: 54 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -731,54 +731,60 @@ export const RobotIntegrationPage = ({
731731
width: "100%",
732732
}}
733733
>
734-
<Button
735-
variant="outlined"
736-
disabled={isScrapeRobot}
737-
onClick={() => {
738-
if (isScrapeRobot) return;
739-
if (!recordingId) return;
740-
setSelectedIntegrationType("googleSheets");
741-
setSettings({ ...settings, integrationType: "googleSheets" });
742-
const basePath = robotPath === "prebuilt-robots" ? "/prebuilt-robots" : "/robots";
743-
navigate(`${basePath}/${recordingId}/integrate/googleSheets`);
744-
}}
745-
style={{
746-
display: "flex",
747-
flexDirection: "column",
748-
alignItems: "center",
749-
background: 'white',
750-
color: isScrapeRobot ? "#aaa" : "#ff00c3",
751-
opacity: isScrapeRobot ? 0.5 : 1,
752-
cursor: isScrapeRobot ? "not-allowed" : "pointer",
753-
}}
754-
>
755-
<img src="https://ik.imagekit.io/ys1blv5kv/gsheet.svg" alt="Google Sheets" style={{ margin: "6px" }} />
756-
Google Sheets
757-
</Button>
758-
<Button
759-
variant="outlined"
760-
disabled={isScrapeRobot}
761-
onClick={() => {
762-
if (isScrapeRobot) return;
763-
if (!recordingId) return;
764-
setSelectedIntegrationType("airtable");
765-
setSettings({ ...settings, integrationType: "airtable" });
766-
const basePath = robotPath === "prebuilt-robots" ? "/prebuilt-robots" : "/robots";
767-
navigate(`${basePath}/${recordingId}/integrate/airtable`);
768-
}}
769-
style={{
770-
display: "flex",
771-
flexDirection: "column",
772-
alignItems: "center",
773-
background: 'white',
774-
color: isScrapeRobot ? "#aaa" : "#ff00c3",
775-
opacity: isScrapeRobot ? 0.5 : 1,
776-
cursor: isScrapeRobot ? "not-allowed" : "pointer",
777-
}}
778-
>
779-
<img src="https://ik.imagekit.io/ys1blv5kv/airtable.svg" alt="Airtable" style={{ margin: "6px" }} />
780-
Airtable
781-
</Button>
734+
{!isScrapeRobot && (
735+
<Button
736+
variant="outlined"
737+
onClick={() => {
738+
if (!recordingId) return;
739+
setSelectedIntegrationType("googleSheets");
740+
setSettings({ ...settings, integrationType: "googleSheets" });
741+
const basePath = robotPath === "prebuilt-robots" ? "/prebuilt-robots" : "/robots";
742+
navigate(`${basePath}/${recordingId}/integrate/googleSheets`);
743+
}}
744+
style={{
745+
display: "flex",
746+
flexDirection: "column",
747+
alignItems: "center",
748+
background: "white",
749+
color: "#ff00c3",
750+
}}
751+
>
752+
<img
753+
src="https://ik.imagekit.io/ys1blv5kv/gsheet.svg"
754+
alt="Google Sheets"
755+
style={{ margin: "6px" }}
756+
/>
757+
Google Sheets
758+
</Button>
759+
)}
760+
761+
{!isScrapeRobot && (
762+
<Button
763+
variant="outlined"
764+
onClick={() => {
765+
if (!recordingId) return;
766+
setSelectedIntegrationType("airtable");
767+
setSettings({ ...settings, integrationType: "airtable" });
768+
const basePath = robotPath === "prebuilt-robots" ? "/prebuilt-robots" : "/robots";
769+
navigate(`${basePath}/${recordingId}/integrate/airtable`);
770+
}}
771+
style={{
772+
display: "flex",
773+
flexDirection: "column",
774+
alignItems: "center",
775+
background: "white",
776+
color: "#ff00c3",
777+
}}
778+
>
779+
<img
780+
src="https://ik.imagekit.io/ys1blv5kv/airtable.svg"
781+
alt="Airtable"
782+
style={{ margin: "6px" }}
783+
/>
784+
Airtable
785+
</Button>
786+
)}
787+
782788

783789
<Button variant="outlined" onClick={() => {
784790
if (!recordingId) return;

0 commit comments

Comments
 (0)