Skip to content

Commit

Permalink
(feat) add immediate mode probe
Browse files Browse the repository at this point in the history
  • Loading branch information
leonjza committed Sep 22, 2024
1 parent 1db81b3 commit bb5cf4f
Show file tree
Hide file tree
Showing 6 changed files with 356 additions and 130 deletions.
4 changes: 2 additions & 2 deletions web/ui/dist/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
<link rel="icon" type="image/svg+xml" href="/favico.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>gowitness - a golang screenshotting tool by @leonjza</title>
<script type="module" crossorigin src="/assets/index-1RGl8SFg.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-BctVAbJi.css">
<script type="module" crossorigin src="/assets/index-DVkfmUJF.js"></script>
<link rel="stylesheet" crossorigin href="/assets/index-iQg3vwxl.css">
</head>

<body>
Expand Down
4 changes: 4 additions & 0 deletions web/ui/src/lib/api/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ const endpoints = {
submit: {
path: `/submit`,
returnas: "" as string
},
submitsingle: {
path: `/submit/single`,
returnas: {} as detail
}
};

Expand Down
1 change: 1 addition & 0 deletions web/ui/src/lib/api/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ interface detail {
is_pdf: boolean;
failed: boolean;
failed_reason: string;
screenshot: string;
tls: tls;
technologies: technology[];
headers: header[];
Expand Down
17 changes: 15 additions & 2 deletions web/ui/src/main.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import JobSubmissionPage from '@/pages/submit/Submit';
import { searchAction } from '@/pages/search/action';
import { searchLoader } from '@/pages/search/loader';
import { deleteAction } from '@/pages/detail/actions';
import { submitAction } from '@/pages/submit/action';
import { submitImmediateAction, submitJobAction } from '@/pages/submit/action';

const router = createBrowserRouter([
{
Expand Down Expand Up @@ -50,7 +50,20 @@ const router = createBrowserRouter([
{
path: 'submit',
element: <JobSubmissionPage />,
action: submitAction,
action: async ({ request }) => {
const formData = await request.formData();
const action = formData.get('action');

switch (action) {
case 'job':
return submitJobAction({ formData });
case 'immediate':
return submitImmediateAction({ formData });

default:
throw new Error('unknown action for job submit route');
}
},
},
]
}
Expand Down
Loading

0 comments on commit bb5cf4f

Please sign in to comment.