From a21b83290bc10fb862d0616e6ec3a2ca1ea8240f Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Fri, 26 Feb 2021 13:35:33 +0100 Subject: [PATCH 1/2] store indexer type --- static/admin/dmt/status/status.js | 4 +++- static/admin/lib/auth-utils.js | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/static/admin/dmt/status/status.js b/static/admin/dmt/status/status.js index f427e6c..1075172 100644 --- a/static/admin/dmt/status/status.js +++ b/static/admin/dmt/status/status.js @@ -55,8 +55,10 @@ const statusScript = { this.setStatusIndicator('#indexer-status-ind', 'ko') } const indexerType = apiStatus['indexer']['type'] - if (indexerType) + if (indexerType) { + sessionStorage.setItem('indexerType', indexerType) $('#indexer-type').text(indexerType.replace(/_/g, ' ')) + } const indexerUrl = apiStatus['indexer']['url'] if (indexerUrl) $('#indexer-url').text(indexerUrl) diff --git a/static/admin/lib/auth-utils.js b/static/admin/lib/auth-utils.js index 656a3d7..e17557b 100644 --- a/static/admin/lib/auth-utils.js +++ b/static/admin/lib/auth-utils.js @@ -139,6 +139,7 @@ const lib_auth = { this.setRefreshToken(null) this.setAccessToken(null) sessionStorage.setItem('activeTab', '') + sessionStorage.setItem('indexerType', '') lib_cmn.goToHomePage() } From 8cdb887d115021bc9248e959e06e802401b77c50 Mon Sep 17 00:00:00 2001 From: kenshin-samourai Date: Fri, 26 Feb 2021 14:01:11 +0100 Subject: [PATCH 2/2] disable rescan-lookahead field if data source is third_party_explorer --- static/admin/css/style.css | 6 ++++++ static/admin/dmt/xpubs-tools/xpubs-tools.js | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/static/admin/css/style.css b/static/admin/css/style.css index a1da6e6..536c8c0 100644 --- a/static/admin/css/style.css +++ b/static/admin/css/style.css @@ -27,6 +27,12 @@ input[type="checkbox"]{ -webkit-transform: scale(1.3); } +input:disabled, select:disabled { + border: 1px solid #8f8f8f; + color: #8f8f8f; + background-color: #3a3d3f; +} + a, a:visited { color: #a1a1a1; } diff --git a/static/admin/dmt/xpubs-tools/xpubs-tools.js b/static/admin/dmt/xpubs-tools/xpubs-tools.js index 2ada7e5..014c4cd 100644 --- a/static/admin/dmt/xpubs-tools/xpubs-tools.js +++ b/static/admin/dmt/xpubs-tools/xpubs-tools.js @@ -27,6 +27,10 @@ const screenXpubsToolsScript = { }, preparePage: function() { + // Disable custom lookahead if data source is a third party explorer + const disableLookahead = sessionStorage.getItem('indexerType') == 'third_party_explorer' + $('#rescan-lookahead').prop('disabled', disableLookahead) + this.hideRescanForm() this.hideDeletionForm() this.showSearchForm()