Skip to content

Commit

Permalink
Feature/UI (#51)
Browse files Browse the repository at this point in the history
* feat(ui): fix first column

* feat(ui): css fixes, dark mode, show env name

* feat(ui): open pubkey in nostr.at
  • Loading branch information
bezysoftware authored Sep 27, 2024
1 parent b0965ef commit 4059ec4
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 6 deletions.
Binary file modified art/transparent.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 4 additions & 2 deletions src/Netstr/Controllers/HomeController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,12 @@ namespace Netstr.Controllers
public class HomeController : Controller
{
private readonly IRelayInformationService service;
private readonly IHostEnvironment environment;

public HomeController(IRelayInformationService service)
public HomeController(IRelayInformationService service, IHostEnvironment environment)
{
this.service = service;
this.environment = environment;
}

[HttpGet]
Expand All @@ -23,7 +25,7 @@ public IActionResult Index()
}
else
{
var vm = new HomeViewModel(this.service.GetDocument(), $"wss://{Request.Host}");
var vm = new HomeViewModel(this.service.GetDocument(), $"wss://{Request.Host}", this.environment.EnvironmentName);
return View(vm);
}
}
Expand Down
5 changes: 4 additions & 1 deletion src/Netstr/ViewModels/HomeViewModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@

namespace Netstr.ViewModels
{
public record HomeViewModel(RelayInformationModel RelayInformation, string ConnectionLink)
public record HomeViewModel(
RelayInformationModel RelayInformation,
string ConnectionLink,
string Environment)
{
}
}
8 changes: 6 additions & 2 deletions src/Netstr/Views/Home/Index.cshtml
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
}
<tr>
<td>Pubkey</td>
<td>@Model.RelayInformation.PublicKey</td>
<td><a href="https://nostr.at/@(Model.RelayInformation.PublicKey)" target="_blank">@Model.RelayInformation.PublicKey</a></td>
</tr>
<tr>
<td>Supported NIPs</td>
<td>
@foreach (var nip in @Model.RelayInformation.SupportedNips)
{
<a href="https://github.com/nostr-protocol/nips/blob/master/@(nip).md" target="_blank">@nip</a>
<a href="https://github.com/nostr-protocol/nips/blob/master/@(nip.ToString("D2")).md" target="_blank">@nip</a>
}
</td>
</tr>
Expand All @@ -41,6 +41,10 @@
<td>Software</td>
<td><a href="@Model.RelayInformation.Software" target="_blank">@Model.RelayInformation.Software</a></td>
</tr>
<tr>
<td>Environment</td>
<td>@Model.Environment</td>
</tr>
</table>

<div class="connect-box">
Expand Down
11 changes: 10 additions & 1 deletion src/Netstr/Views/Home/Index.cshtml.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ table {
}

tr:hover td:nth-child(2) {
opacity: 0.5;
opacity: 0.8;
}

td {
Expand All @@ -46,6 +46,7 @@ td a {
td:first-child {
background-color: #6A1B9A;
font-weight: bold;
white-space: nowrap;
}

.connect-box {
Expand All @@ -57,4 +58,12 @@ td:first-child {

.connect-box strong {
font-weight: bold;
}

/*Dark mode*/
@media (prefers-color-scheme: dark) {
.container {
background: linear-gradient(313deg, #2e2e2e 0%, #5e5e5e 100%);
color: white;
}
}

0 comments on commit 4059ec4

Please sign in to comment.