Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
TheBestTvarynka committed Nov 26, 2023
1 parent dc66e37 commit f9912ad
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 1 deletion.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,6 @@
<!-- asn1 debugger styles -->
<link data-trunk rel="sass" href="public/styles/asn1/page.scss" />
<link data-trunk rel="sass" href="public/styles/asn1/node.scss" />
<link data-trunk rel="sass" href="public/styles/asn1/hex_viewer.scss" />
</head>
</html>
3 changes: 3 additions & 0 deletions public/styles/asn1/hex_viewer.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.asn1-hex-viewer {
background: #edd5ce;
}
7 changes: 7 additions & 0 deletions public/styles/asn1/page.scss
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,11 @@
margin-top: 1em;
width: 98%;
color: #403735;
}

.asn1-viewers {
display: grid;
grid-template-columns: 70% auto;
gap: 0.1em;
width: 100%;
}
7 changes: 6 additions & 1 deletion src/asn1.rs
Original file line number Diff line number Diff line change
@@ -1,12 +1,14 @@
mod asn1_viewer;
mod hex_buffer;
mod scheme;
mod hex_view;

use asn1_parser::Asn1;
use web_sys::KeyboardEvent;
use yew::{classes, function_component, html, use_state, Callback, Html};

use crate::asn1::asn1_viewer::Asn1Viewer;
use crate::asn1::hex_view::HexViewer;
use crate::common::{ByteInput, Checkbox};

pub const TEST_ASN1: &[u8] = &[
Expand Down Expand Up @@ -73,7 +75,10 @@ pub fn asn1_parser_page() -> Html {
<button class="action-button" {onclick}>{"Process"}</button>
<Checkbox id={"auto-decode-asn1".to_owned()} name={"auto-decode".to_owned()} checked={*auto_decode} {set_checked} />
</div>
<Asn1Viewer data={(*raw_asn1).clone()} structure={(*parsed_asn1).clone()} />
<div class="asn1-viewers">
<Asn1Viewer data={(*raw_asn1).clone()} structure={(*parsed_asn1).clone()} />
<HexViewer />
</div>
</div>
}
}
10 changes: 10 additions & 0 deletions src/asn1/hex_view.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
use yew::{function_component, html, Html, Properties};

#[function_component(HexViewer)]
pub fn hex_viewer() -> Html {
html! {
<div class="asn1-hex-viewer">
<span>{"HexView"}</span>
</div>
}
}

0 comments on commit f9912ad

Please sign in to comment.