From 72ad9fcb627d0817111a97971b2dcdca4c56c098 Mon Sep 17 00:00:00 2001 From: Casey Rodarmor Date: Tue, 26 Dec 2023 05:43:12 +0800 Subject: [PATCH] Show if transaction index is enabled on /status (#2910) --- src/index.rs | 1 + src/subcommand/server.rs | 4 +++- src/templates/status.rs | 1 + templates/status.html | 6 ++++-- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/src/index.rs b/src/index.rs index 7ce1a314a5..9b5a6f88b8 100644 --- a/src/index.rs +++ b/src/index.rs @@ -489,6 +489,7 @@ impl Index { runes: statistic(Statistic::Runes)?, sat_index: statistic(Statistic::IndexSats)? != 0, started: self.started, + transaction_index: statistic(Statistic::IndexTransactions)? != 0, unrecoverably_reorged: self.unrecoverably_reorged.load(atomic::Ordering::Relaxed), uptime: (Utc::now() - self.started).to_std()?, }) diff --git a/src/subcommand/server.rs b/src/subcommand/server.rs index d2cf5e17fe..51f797c85d 100644 --- a/src/subcommand/server.rs +++ b/src/subcommand/server.rs @@ -2560,9 +2560,11 @@ mod tests {
.*
unrecoverably reorged
false
+
rune index
+
false
sat index
false
-
rune index
+
transaction index
false
git branch
.*
diff --git a/src/templates/status.rs b/src/templates/status.rs index b02f8c3ec6..a90b2047a3 100644 --- a/src/templates/status.rs +++ b/src/templates/status.rs @@ -12,6 +12,7 @@ pub(crate) struct StatusHtml { pub(crate) runes: u64, pub(crate) sat_index: bool, pub(crate) started: DateTime, + pub(crate) transaction_index: bool, pub(crate) unrecoverably_reorged: bool, pub(crate) uptime: Duration, } diff --git a/templates/status.html b/templates/status.html index d94660b045..7f9569b9be 100644 --- a/templates/status.html +++ b/templates/status.html @@ -24,10 +24,12 @@

Status

{{ env!("CARGO_PKG_VERSION") }}
unrecoverably reorged
{{ self.unrecoverably_reorged }}
-
sat index
-
{{ self.sat_index }}
rune index
{{ self.rune_index }}
+
sat index
+
{{ self.sat_index }}
+
transaction index
+
{{ self.transaction_index }}
%% if !env!("GIT_BRANCH").is_empty() {
git branch
{{ env!("GIT_BRANCH") }}