+
+
+
+
+
+
+
+ URL Information
+
+
+
+
+
+
-
-
-
-
-
-
-
-
+
+
+
+
+ Response Details
+
+
+
+
+ Response Code:
+ {probeResult.response_code}
+
+
+ Protocol:
+ {probeResult.protocol}
+
+
+ Content Length:
+ {probeResult.content_length} bytes
+
+
+
+
+
+
+
+
+ Page Information
+
+
+
+
+ Title:
+ {probeResult.title}
+
+
+ Failed:
+ {probeResult.failed ? 'Yes' : 'No'}
+
+ {probeResult.failed && (
+
+ Failed Reason:
+ {probeResult.failed_reason}
+ )}
+
+
+
+
+
+
+
+ Timing Information
+
+
+
+
+ Probed At:
+ {new Date(probeResult.probed_at).toLocaleString()}
-
- )}
+
+
-
-
-
-
- {/* add defaults as hidden inputs because the form will only subit the rendered dom */}
- {/* expanding the accordion will remove these */}
- {!advancedOptions && (
- <>
-
-
-
-
-
-
- >
- )}
-
-
-
+
+
+
Screenshot
+
+
+
+
+
-
-
-
+ )}
+
+
+
);
}
\ No newline at end of file
diff --git a/web/ui/src/pages/submit/action.ts b/web/ui/src/pages/submit/action.ts
index b1ec5eee..42ded87c 100644
--- a/web/ui/src/pages/submit/action.ts
+++ b/web/ui/src/pages/submit/action.ts
@@ -2,8 +2,7 @@ import { toast } from "@/hooks/use-toast";
import * as api from "@/lib/api/api";
import { redirect } from "react-router-dom";
-const submitAction = async ({ request }: { request: Request; }) => {
- const formData = await request.formData();
+const submitJobAction = async ({ formData }: { formData: FormData; }) => {
// grab submitted urls
const urls = Array.from(formData.entries())
@@ -18,6 +17,7 @@ const submitAction = async ({ request }: { request: Request; }) => {
const options = {
format: formData.get('format'),
timeout: parseInt(formData.get('timeout') as string),
+ delay: parseInt(formData.get('delay') as string),
user_agent: formData.get('user_agent'),
window_x: parseInt(formData.get('window_x') as string),
window_y: parseInt(formData.get('window_y') as string),
@@ -42,4 +42,27 @@ const submitAction = async ({ request }: { request: Request; }) => {
return redirect("/submit");
};
-export { submitAction };
\ No newline at end of file
+const submitImmediateAction = async ({ formData }: { formData: FormData; }) => {
+ const url = formData.get('immediate-url') as string;
+ const options = {
+ format: formData.get('format'),
+ timeout: parseInt(formData.get('timeout') as string),
+ delay: parseInt(formData.get('delay') as string),
+ user_agent: formData.get('user_agent'),
+ window_x: parseInt(formData.get('window_x') as string),
+ window_y: parseInt(formData.get('window_y') as string),
+ };
+
+ try {
+ return await api.post('submitsingle', { url, options });
+ } catch (err) {
+ toast({
+ title: "Error",
+ description: `Could not submit new probe: ${err}`,
+ variant: "destructive"
+ });
+ return null;
+ }
+};
+
+export { submitJobAction, submitImmediateAction };
\ No newline at end of file