Skip to content

Commit

Permalink
Add chain to status page (ordinals#2953)
Browse files Browse the repository at this point in the history
  • Loading branch information
raphjaph authored Jan 3, 2024
1 parent 8d2e41c commit 45072c9
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/index.rs
Original file line number Diff line number Diff line change
Expand Up @@ -431,6 +431,7 @@ impl Index {

Ok(StatusHtml {
blessed_inscriptions,
chain: self.options.chain(),
cursed_inscriptions,
height,
inscriptions: blessed_inscriptions + cursed_inscriptions,
Expand Down
2 changes: 2 additions & 0 deletions src/subcommand/server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2552,6 +2552,8 @@ mod tests {
StatusCode::OK,
".*<h1>Status</h1>
<dl>
<dt>chain</dt>
<dd>mainnet</dd>
<dt>height</dt>
<dd>0</dd>
<dt>inscriptions</dt>
Expand Down
1 change: 1 addition & 0 deletions src/templates/status.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ use super::*;
pub(crate) struct StatusHtml {
pub(crate) blessed_inscriptions: u64,
pub(crate) cursed_inscriptions: u64,
pub(crate) chain: Chain,
pub(crate) height: Option<u32>,
pub(crate) inscriptions: u64,
pub(crate) lost_sats: u64,
Expand Down
2 changes: 2 additions & 0 deletions templates/status.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
<h1>Status</h1>
<dl>
<dt>chain</dt>
<dd>{{ self.chain }}</dd>
%% if let Some(height) = self.height {
<dt>height</dt>
<dd>{{ height }}</dd>
Expand Down

0 comments on commit 45072c9

Please sign in to comment.