From 726cd6fd49aab22ceb7127e00c08c71eb38a7455 Mon Sep 17 00:00:00 2001 From: "nicolas.dorier" Date: Wed, 17 Jan 2018 16:34:01 +0900 Subject: [PATCH] Add badge if not on mainnet in the top bar --- .../Services/BTCPayServerEnvironment.cs | 5 ++- BTCPayServer/Views/Shared/_Layout.cshtml | 44 +++++++++++-------- 2 files changed, 29 insertions(+), 20 deletions(-) diff --git a/BTCPayServer/Services/BTCPayServerEnvironment.cs b/BTCPayServer/Services/BTCPayServerEnvironment.cs index 33793c9dc..2e83ed348 100644 --- a/BTCPayServer/Services/BTCPayServerEnvironment.cs +++ b/BTCPayServer/Services/BTCPayServerEnvironment.cs @@ -5,12 +5,13 @@ using System.Linq; using System.Reflection; using System.Threading.Tasks; using System.Text; +using NBXplorer; namespace BTCPayServer.Services { public class BTCPayServerEnvironment { - public BTCPayServerEnvironment(IHostingEnvironment env) + public BTCPayServerEnvironment(IHostingEnvironment env, BTCPayNetworkProvider provider) { Version = typeof(BTCPayServerEnvironment).GetTypeInfo().Assembly.GetCustomAttribute().Version; #if DEBUG @@ -19,11 +20,13 @@ namespace BTCPayServer.Services Build = "Release"; #endif Environment = env; + ChainType = provider.NBXplorerNetworkProvider.ChainType; } public IHostingEnvironment Environment { get; set; } + public ChainType ChainType { get; set; } public string Version { get; set; diff --git a/BTCPayServer/Views/Shared/_Layout.cshtml b/BTCPayServer/Views/Shared/_Layout.cshtml index 7350986bf..01cbc2a6d 100644 --- a/BTCPayServer/Views/Shared/_Layout.cshtml +++ b/BTCPayServer/Views/Shared/_Layout.cshtml @@ -48,30 +48,36 @@