Show onion hosts instead of url (can't know about ports)

This commit is contained in:
nicolas.dorier 2019-03-17 13:42:54 +09:00
parent 4769b1d452
commit 4f582a6712
2 changed files with 15 additions and 7 deletions

View File

@ -29,8 +29,11 @@ namespace BTCPayServer.Services
{
try
{
var onionUrl = (await service.ReadingLines)[0].Trim();
result.Add(new TorService() { Name = service.ServiceName, OnionUrl = onionUrl });
var onionHost = (await service.ReadingLines)[0].Trim();
var torService = new TorService() { Name = service.ServiceName, OnionHost = onionHost };
if (service.ServiceName.Equals("BTCPayServer", StringComparison.OrdinalIgnoreCase))
torService.ServiceType = TorServiceType.BTCPayServer;
result.Add(torService);
}
catch
{
@ -43,7 +46,14 @@ namespace BTCPayServer.Services
public class TorService
{
public TorServiceType ServiceType { get; set; } = TorServiceType.Other;
public string Name { get; set; }
public string OnionUrl { get; set; }
public string OnionHost { get; set; }
}
public enum TorServiceType
{
BTCPayServer,
Other
}
}

View File

@ -85,7 +85,7 @@
<div class="col-md-8">
<h4>TOR hidden services</h4>
<div class="form-group">
<span>TOR services hosted on this server</span>
<span>TOR services hosted on this server, services using auto service registration (like lightning services) will not appear here.</span>
</div>
<div class="form-group">
<table class="table table-sm table-responsive-md">
@ -100,9 +100,7 @@
{
<tr>
<td>@s.Name</td>
<td style="text-align:right">
<a href="@s.OnionUrl" target="_blank">See information</a>
</td>
<td style="text-align:right">@s.OnionHost</td>
</tr>
}
</tbody>