From 4251bb4c1fcb32a1d228b72486168757bb2d2670 Mon Sep 17 00:00:00 2001 From: phfr24 <phfr24@inf.ufpr.br> Date: Mon, 7 Oct 2024 11:25:09 -0300 Subject: [PATCH 1/7] add /analysis/[id] page --- src/app/analysis/[id]/page.js | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 src/app/analysis/[id]/page.js diff --git a/src/app/analysis/[id]/page.js b/src/app/analysis/[id]/page.js new file mode 100644 index 0000000..ef5ff19 --- /dev/null +++ b/src/app/analysis/[id]/page.js @@ -0,0 +1,3 @@ +export default function Analysis({ params: { id } }) { + return <h1>{id}</h1>; +} -- GitLab From 3b33545f36494baf62bfef76848a67783d0a0bb6 Mon Sep 17 00:00:00 2001 From: phfr24 <phfr24@inf.ufpr.br> Date: Mon, 7 Oct 2024 11:56:53 -0300 Subject: [PATCH 2/7] add RedirectButton component --- src/components/redirect-button.js | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 src/components/redirect-button.js diff --git a/src/components/redirect-button.js b/src/components/redirect-button.js new file mode 100644 index 0000000..33ff664 --- /dev/null +++ b/src/components/redirect-button.js @@ -0,0 +1,7 @@ +'use client' + +export default function RedirectButton({ name, href }) { + const redirect = () => window.location.href = href; + + return <button onClick={redirect}>{name}</button>; +} -- GitLab From 15341a0dd195bcead13608bae0892415b946ba27 Mon Sep 17 00:00:00 2001 From: phfr24 <phfr24@inf.ufpr.br> Date: Mon, 7 Oct 2024 11:57:39 -0300 Subject: [PATCH 3/7] delete unneeded components/.gitkeep --- src/components/.gitkeep | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 src/components/.gitkeep diff --git a/src/components/.gitkeep b/src/components/.gitkeep deleted file mode 100644 index e69de29..0000000 -- GitLab From 42d9dd9d0c146d70ae571ef7315728f1927ec80f Mon Sep 17 00:00:00 2001 From: phfr24 <phfr24@inf.ufpr.br> Date: Tue, 8 Oct 2024 12:03:32 -0300 Subject: [PATCH 4/7] initial /analysis/[id] page prototype --- src/app/analysis/[id]/page.js | 33 +++++++- src/components/analysis/activity-timeline.js | 0 src/components/analysis/metadata.js | 87 ++++++++++++++++++++ src/styles/analysis/metadata.css | 33 ++++++++ src/styles/analysis/page.css | 13 +++ 5 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 src/components/analysis/activity-timeline.js create mode 100644 src/components/analysis/metadata.js create mode 100644 src/styles/analysis/metadata.css create mode 100644 src/styles/analysis/page.css diff --git a/src/app/analysis/[id]/page.js b/src/app/analysis/[id]/page.js index ef5ff19..beecd89 100644 --- a/src/app/analysis/[id]/page.js +++ b/src/app/analysis/[id]/page.js @@ -1,3 +1,34 @@ +import { AnalysisMetadata, SampleMetadata } from "@/components/analysis/metadata"; +import RedirectButton from "@/components/redirect-button"; +import "@/styles/analysis/page.css"; + export default function Analysis({ params: { id } }) { - return <h1>{id}</h1>; + return ( + <div> + <div className="pagerow"> + <AnalysisMetadata + status="running" + id="5e6c83bf-44b3-4f9e-bd45-683585439eed" + driver="1.3.8" + template="9011" + start="08/10/24 11:00:10 -03" + end="08/10/24 11:07:39 -03" + /> + <SampleMetadata + filename="MALWARE2.exe" + extension=".exe" + mimetype="application/octet-stream" + size="2.7 MiB" + lastmod="08/10/24 11:00:10 -03" + md5="6cb20b4c787c4ea918e301310b2667f5" + sha1="5b5d921d69336d06837422438cd0c5225fc78a74" + sha256="83121822f08691834102f7652c673133deb98a134110a0fea22a27b2ccd5d966" + /> + </div> + <div className="pagerow"> + <div className="log"></div> + </div> + <RedirectButton name="go back" href="/" /> + </div> + ); } diff --git a/src/components/analysis/activity-timeline.js b/src/components/analysis/activity-timeline.js new file mode 100644 index 0000000..e69de29 diff --git a/src/components/analysis/metadata.js b/src/components/analysis/metadata.js new file mode 100644 index 0000000..853ed4f --- /dev/null +++ b/src/components/analysis/metadata.js @@ -0,0 +1,87 @@ +import "@/styles/analysis/metadata.css" + +export function AnalysisMetadata(props) { + return ( + <table> + <thead> + <tr> + <th id="table-title" colSpan="2">ANALYSIS</th> + </tr> + </thead> + + <tbody> + <tr> + <th>Status</th> + <td>{props.status}</td> + </tr> + <tr> + <th>ID</th> + <td>{props.id}</td> + </tr> + <tr> + <th>Driver version</th> + <td>{props.driver}</td> + </tr> + <tr> + <th>Template ID</th> + <td>{props.template}</td> + </tr> + <tr> + <th>Start time</th> + <td>{props.start}</td> + </tr> + <tr> + <th>End time</th> + <td>{props.end}</td> + </tr> + </tbody> + </table> + ); +} + +export function SampleMetadata(props) { + return ( + <table> + <thead> + <tr> + <th id="table-title" colSpan="2">SAMPLE</th> + </tr> + </thead> + + <tbody> + <tr> + <th>Filename</th> + <td>{props.filename}</td> + </tr> + <tr> + <th>Extension</th> + <td>{props.extension}</td> + </tr> + <tr> + <th>MIME type</th> + <td>{props.mimetype}</td> + </tr> + <tr> + <th>Size</th> + <td>{props.size}</td> + </tr> + <tr> + <th>Last modified</th> + <td>{props.lastmod}</td> + </tr> + <tr> + <th>MD5 sum</th> + <td>{props.md5}</td> + </tr> + <tr> + <th>SHA1 sum</th> + <td>{props.sha1}</td> + </tr> + <tr> + <th>SHA256 sum</th> + <td>{props.sha256}</td> + </tr> + </tbody> + </table> + ); +} diff --git a/src/styles/analysis/metadata.css b/src/styles/analysis/metadata.css new file mode 100644 index 0000000..624bf33 --- /dev/null +++ b/src/styles/analysis/metadata.css @@ -0,0 +1,33 @@ +table { + border-collapse: collapse; + text-align: left; + box-shadow: 0 5px 10px rgba(0, 0, 0, 0.8); + margin: 1em; +} + +td, th { + border: 1px solid #1F1C1A; + padding: 8px; +} + +#table-title { + text-align: center; +} + +tr:nth-child(even) { + background-color: #221f1d; +} + +.log { + margin: 5px; + min-height: 6em; + font-family: monospace; + font-size: 1em; + flex: 1; + overflow: auto; + padding: 0.5em; + word-wrap: break-word; + white-space: pre-wrap; + border: 1px solid #1F1C1A; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.8); +} diff --git a/src/styles/analysis/page.css b/src/styles/analysis/page.css new file mode 100644 index 0000000..840fa9b --- /dev/null +++ b/src/styles/analysis/page.css @@ -0,0 +1,13 @@ +.pagerow { + display: flex; + justify-content: space-around; + width: 100%; + min-width: max-content; + margin-bottom: 1em; +} + +.log { + height: 100%; + max-width: 75%; + margin: 1em; +} -- GitLab From 1b8b9f16bd2d94efddac2e750c731a5a2bba9c4d Mon Sep 17 00:00:00 2001 From: phfr24 <phfr24@inf.ufpr.br> Date: Wed, 9 Oct 2024 10:44:39 -0300 Subject: [PATCH 5/7] add ActivityTimeline component --- src/app/analysis/[id]/page.js | 3 ++- src/components/analysis/activity-timeline.js | 9 ++++++++ src/styles/analysis/activity-timeline.css | 23 ++++++++++++++++++++ src/styles/analysis/metadata.css | 18 +++------------ src/styles/analysis/page.css | 6 ----- 5 files changed, 37 insertions(+), 22 deletions(-) create mode 100644 src/styles/analysis/activity-timeline.css diff --git a/src/app/analysis/[id]/page.js b/src/app/analysis/[id]/page.js index beecd89..7058e3f 100644 --- a/src/app/analysis/[id]/page.js +++ b/src/app/analysis/[id]/page.js @@ -1,4 +1,5 @@ import { AnalysisMetadata, SampleMetadata } from "@/components/analysis/metadata"; +import ActivityTimeline from "@/components/analysis/activity-timeline"; import RedirectButton from "@/components/redirect-button"; import "@/styles/analysis/page.css"; @@ -26,7 +27,7 @@ export default function Analysis({ params: { id } }) { /> </div> <div className="pagerow"> - <div className="log"></div> + <ActivityTimeline /> </div> <RedirectButton name="go back" href="/" /> </div> diff --git a/src/components/analysis/activity-timeline.js b/src/components/analysis/activity-timeline.js index e69de29..121ab05 100644 --- a/src/components/analysis/activity-timeline.js +++ b/src/components/analysis/activity-timeline.js @@ -0,0 +1,9 @@ +import "@/styles/analysis/activity-timeline.css"; + +export default function ActivityTimeline() { + return ( + <div className="activity-timeline"> + <div className="at-title">ACTIVITY TIMELINE</div> + </div> + ); +} diff --git a/src/styles/analysis/activity-timeline.css b/src/styles/analysis/activity-timeline.css new file mode 100644 index 0000000..6d481f7 --- /dev/null +++ b/src/styles/analysis/activity-timeline.css @@ -0,0 +1,23 @@ +.activity-timeline { + margin: 1em; + height: 100%; + min-width: 398.266px; + max-width: 75%; + font-family: monospace; + font-size: 1em; + flex: 1; + overflow: auto; + padding: 0.5em; + word-wrap: break-word; + white-space: pre-wrap; + border: 1px solid #1F1C1A; + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.8); +} + +.at-title { + padding: 8px; + font-family: Bitstream Vera Sans, Tahoma, sans-serif; + font-weight: bold; + text-align: center; + border-bottom: 1px solid #1F1C1A; +} diff --git a/src/styles/analysis/metadata.css b/src/styles/analysis/metadata.css index 624bf33..c20b202 100644 --- a/src/styles/analysis/metadata.css +++ b/src/styles/analysis/metadata.css @@ -1,7 +1,9 @@ table { + min-height: 348.484px; + min-width: 398.266px; border-collapse: collapse; text-align: left; - box-shadow: 0 5px 10px rgba(0, 0, 0, 0.8); + box-shadow: 0 4px 8px rgba(0, 0, 0, 0.8); margin: 1em; } @@ -17,17 +19,3 @@ td, th { tr:nth-child(even) { background-color: #221f1d; } - -.log { - margin: 5px; - min-height: 6em; - font-family: monospace; - font-size: 1em; - flex: 1; - overflow: auto; - padding: 0.5em; - word-wrap: break-word; - white-space: pre-wrap; - border: 1px solid #1F1C1A; - box-shadow: 0 4px 8px rgba(0, 0, 0, 0.8); -} diff --git a/src/styles/analysis/page.css b/src/styles/analysis/page.css index 840fa9b..01ade26 100644 --- a/src/styles/analysis/page.css +++ b/src/styles/analysis/page.css @@ -5,9 +5,3 @@ min-width: max-content; margin-bottom: 1em; } - -.log { - height: 100%; - max-width: 75%; - margin: 1em; -} -- GitLab From a67ece0da2ffd149b1bc85e9d5a131df4c1f6d3c Mon Sep 17 00:00:00 2001 From: phfr24 <phfr24@inf.ufpr.br> Date: Wed, 9 Oct 2024 10:49:39 -0300 Subject: [PATCH 6/7] use className instead of id --- src/components/analysis/metadata.js | 4 ++-- src/styles/analysis/metadata.css | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/components/analysis/metadata.js b/src/components/analysis/metadata.js index 853ed4f..4aacd34 100644 --- a/src/components/analysis/metadata.js +++ b/src/components/analysis/metadata.js @@ -5,7 +5,7 @@ export function AnalysisMetadata(props) { <table> <thead> <tr> - <th id="table-title" colSpan="2">ANALYSIS</th> + <th className="table-title" colSpan="2">ANALYSIS</th> </tr> </thead> @@ -44,7 +44,7 @@ export function SampleMetadata(props) { <table> <thead> <tr> - <th id="table-title" colSpan="2">SAMPLE</th> + <th className="table-title" colSpan="2">SAMPLE</th> </tr> </thead> diff --git a/src/styles/analysis/metadata.css b/src/styles/analysis/metadata.css index c20b202..8057d42 100644 --- a/src/styles/analysis/metadata.css +++ b/src/styles/analysis/metadata.css @@ -12,7 +12,7 @@ td, th { padding: 8px; } -#table-title { +.table-title { text-align: center; } -- GitLab From 0ac668256e779727d7b79365beae487d34db77fb Mon Sep 17 00:00:00 2001 From: phfr24 <phfr24@inf.ufpr.br> Date: Wed, 9 Oct 2024 11:17:01 -0300 Subject: [PATCH 7/7] style redirect button --- src/components/redirect-button.js | 3 ++- src/styles/redirect-button.css | 31 +++++++++++++++++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) create mode 100644 src/styles/redirect-button.css diff --git a/src/components/redirect-button.js b/src/components/redirect-button.js index 33ff664..8e7f327 100644 --- a/src/components/redirect-button.js +++ b/src/components/redirect-button.js @@ -1,7 +1,8 @@ 'use client' +import "@/styles/redirect-button.css" export default function RedirectButton({ name, href }) { const redirect = () => window.location.href = href; - return <button onClick={redirect}>{name}</button>; + return <button className="redirect-button" onClick={redirect}>{name}</button>; } diff --git a/src/styles/redirect-button.css b/src/styles/redirect-button.css new file mode 100644 index 0000000..163a521 --- /dev/null +++ b/src/styles/redirect-button.css @@ -0,0 +1,31 @@ +.redirect-button { + background-color: #434240; + border: 1px solid transparent; + border-radius: 3px; + box-shadow: rgba(255, 255, 255, .4) 0 1px 0 0 inset; + box-sizing: border-box; + display: inline-block; + font-size: 13px; + line-height: 1.15385; + margin: 0; + outline: none; + padding: 8px .8em; + position: relative; + text-align: center; + text-decoration: none; + user-select: none; + -webkit-user-select: none; + touch-action: manipulation; + vertical-align: baseline; + white-space: nowrap; +} + +.redirect-button:hover, +.redirect-button:focus { + background-color: #07c; +} + +.redirect-button:active { + background-color: #0064bd; + box-shadow: none; +} -- GitLab