Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor GUI improvements and bugfixes. #495

Merged
merged 17 commits into from
Nov 2, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions internal/webapi/public/css/vendor/bootstrap-4.5.0.min.css

This file was deleted.

This file was deleted.

7 changes: 7 additions & 0 deletions internal/webapi/public/css/vendor/bootstrap-4.6.2.min.css

Large diffs are not rendered by default.

Large diffs are not rendered by default.

340 changes: 200 additions & 140 deletions internal/webapi/public/css/vspd.css

Large diffs are not rendered by default.

382 changes: 208 additions & 174 deletions internal/webapi/templates/admin.html

Large diffs are not rendered by default.

27 changes: 19 additions & 8 deletions internal/webapi/templates/footer.html
Original file line number Diff line number Diff line change
@@ -1,25 +1,36 @@
{{ define "footer" }}

</div> <!-- page-content -->
</div> <!-- vsp-page-content -->

<footer class="row m-0">
<div class="col-md-8 col-12 d-flex justify-content-center align-items-center">
<footer class="vsp-footer flex-md-row flex-row-reverse">
<div class="vsp-footer-bg-left col-md-6 col-12"></div>
<div class="vsp-footer-bg-right col-md-6 col-12"></div>

<div class="container d-flex flex-wrap">

<div class="vsp-footer-left col-md-8 col-12 justify-content-center justify-content-md-start">
<div class="d-inline-block text-left">
<p class="py-4 m-0">
<strong>Stats&nbsp;updated:</strong>&nbsp;{{ timeAgo .WebApiCache.UpdateTime }}
<br />
<strong>Support:</strong>&nbsp;<a href="mailto:{{ .WebApiCfg.SupportEmail }}" rel="noopener noreferrer">{{ .WebApiCfg.SupportEmail }}</a>
<br />
<strong>VSP&nbsp;public&nbsp;key:</strong>&nbsp;<span class="code">{{ .WebApiCache.PubKey }}</span>
<strong>VSP&nbsp;public&nbsp;key:</strong>&nbsp;<span class="code text-break">{{ .WebApiCache.PubKey }}</span>
</p>
</div>
</div>

<div class="col-md-4 col-12 footer__credit d-flex justify-content-center align-items-center">
<div class="vsp-footer-right col-md-4 col-12 justify-content-center justify-content-md-end">
<div class="d-block text-center text-md-right">
<p class="py-4 m-0">
Decred Developers | 2020-2024
<br />
The source code is available on <a href="https://github.com/decred/vspd" target="_blank" rel="noopener noreferrer">GitHub</a>
Decred Developers | 2020-2024
<br />
The source code is available on <a href="https://github.com/decred/vspd" target="_blank" rel="noopener noreferrer">GitHub</a>
</p>
</div>
</div>

</div>
</footer>

</body>
Expand Down
12 changes: 6 additions & 6 deletions internal/webapi/templates/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<title>Decred VSP - {{ .WebApiCfg.Designation }}</title>

<link rel="stylesheet" href="/public/css/vendor/bootstrap-4.5.0.min.css" />
<link rel="stylesheet" href="/public/css/vendor/bootstrap-4.6.2.min.css" />
<link rel="stylesheet" href="/public/css/vspd.css?v={{ .WebApiCfg.VspdVersion }}" />
<!-- fonts.css should be last to ensure dcr fonts take precedence. -->
<link rel="stylesheet" href="/public/css/fonts.css?v={{ .WebApiCfg.VspdVersion }}" />
Expand Down Expand Up @@ -43,12 +43,12 @@
</head>

<body>
<div class="page-content">
<div class="vsp-page-content">

<nav class="py-sm-3 px-sm-5 navbar">
<nav class="py-sm-3 px-sm-5 navbar vsp-navbar">
<div class="container">
<a class="py-1 border-0 d-flex justify-content-start align-items-center" href="/">
<div class="logo--logo">
<a class="text-decoration-none py-1 border-0 d-flex justify-content-start align-items-center" href="/">
<div class="vsp-logo-logo">
<svg xmlns="http://www.w3.org/2000/svg" width="38" height="32" fill="none" viewBox="0 0 23 20">
<path fill="#000" fill-opacity="0" d="M0 0h23v19.167H0z" />
<path fill="#091440"
Expand All @@ -57,7 +57,7 @@
d="M18.208 14.375L23 19.167h-5.175L10.158 11.5h5.175a3.834 3.834 0 0 0 0-7.667h-1.917L9.583 0h5.75A7.667 7.667 0 0 1 23 7.667c0 3.109-1.533 5.615-4.792 6.708z" />
</svg>
</div>
<div class="logo--text">
<div class="vsp-logo-text">
VSP<br>
<b>{{ .WebApiCfg.Designation }}</b>
</div>
Expand Down
8 changes: 4 additions & 4 deletions internal/webapi/templates/login.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

<div class="py-4 container">
<h1>Login</h1>
<form class="py-3" action="/admin" method="post">
<form action="/admin" method="post">

<input type="password" name="password" autofocus required placeholder="Enter password">
<input class="form-control w-auto my-2" type="password" name="password" autofocus required placeholder="Enter password">

<p class="my-1 orange" style="visibility:{{ if .FailedLoginMsg }}visible{{ else }}hidden{{ end }};">{{ .FailedLoginMsg }}</p>
<p class="my-1 vsp-text-orange" style="visibility:{{ if .FailedLoginMsg }}visible{{ else }}hidden{{ end }};">{{ .FailedLoginMsg }}</p>

<button class="btn btn-primary" type="submit">Login</button>
<button class="btn btn-primary my-2" type="submit">Login</button>
</form>

</div>
Expand Down
12 changes: 7 additions & 5 deletions internal/webapi/templates/ticket-search-result.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,11 @@

{{ if .Found }}

<hr />

<h1>Ticket</h1>

<table id="ticket-table" class="mt-2 mb-4 w-100">
<table>
<tr>
<th>Hash</th>
<td>
Expand Down Expand Up @@ -44,7 +46,7 @@ <h1>Ticket</h1>

<h1>Fee</h1>

<table id="ticket-table" class="mt-2 mb-4 w-100">
<table>
<tr>
<th>Fee Address</th>
<td>
Expand Down Expand Up @@ -97,7 +99,7 @@ <h1>Fee</h1>

<h1>Vote Choices</h1>

<table id="ticket-table" class="mt-2 mb-4 w-100">
<table>
<tr>
<th>Consensus Vote Choices</th>
<td>
Expand Down Expand Up @@ -163,7 +165,7 @@ <h1>Vote Choices</h1>

<h1>Alternate Signing Address</h1>

<table id="ticket-table" class="mt-2 mb-4 w-100">
<table>
<tr>
<th>Alternate Signing Address</th>
<td>
Expand Down Expand Up @@ -206,6 +208,6 @@ <h1>Alternate Signing Address</h1>
</table>

{{ else }}
<p>No ticket found with hash <span class="code">{{ .Hash }}</span></p>
<p class="vsp-text-orange">No ticket found with hash <span class="code">{{ .Hash }}</span></p>
{{ end }}
{{ end }}
28 changes: 14 additions & 14 deletions internal/webapi/templates/vsp-stats.html
Original file line number Diff line number Diff line change
Expand Up @@ -3,39 +3,39 @@
<div class="row vsp-stats">

<div class="col-6 col-sm-4 col-lg-2 py-3">
<div class="stat-title">Live tickets</div>
<div class="stat-value">{{ comma .WebApiCache.Voting }}</div>
<div class="vsp-stat-title">Live tickets</div>
<div class="vsp-stat-value">{{ comma .WebApiCache.Voting }}</div>
</div>

<div class="col-6 col-sm-4 col-lg-2 py-3">
<div class="stat-title">Voted tickets</div>
<div class="stat-value">{{ comma .WebApiCache.Voted }}</div>
<div class="vsp-stat-title">Voted tickets</div>
<div class="vsp-stat-value">{{ comma .WebApiCache.Voted }}</div>
</div>

<div class="col-6 col-sm-4 col-lg-2 py-3">
<div class="stat-title">Expired tickets</div>
<div class="stat-value">
<div class="vsp-stat-title">Expired tickets</div>
<div class="vsp-stat-value">
{{ comma .WebApiCache.Expired }}
<span class="text-muted">({{ float32ToPercent .WebApiCache.ExpiredProportion }})</span>
<span class="vsp-stat-subtext">({{ float32ToPercent .WebApiCache.ExpiredProportion }})</span>
</div>
</div>

<div class="col-6 col-sm-4 col-lg-2 py-3">
<div class="stat-title">Missed tickets</div>
<div class="stat-value">
<div class="vsp-stat-title">Missed tickets</div>
<div class="vsp-stat-value">
{{ comma .WebApiCache.Missed }}
<span class="text-muted">({{ float32ToPercent .WebApiCache.MissedProportion }})</span>
<span class="vsp-stat-subtext">({{ float32ToPercent .WebApiCache.MissedProportion }})</span>
</div>
</div>

<div class="col-6 col-sm-4 col-lg-2 py-3">
<div class="stat-title">VSP Fee</div>
<div class="stat-value">{{ .WebApiCfg.VSPFee }}%</div>
<div class="vsp-stat-title">VSP Fee</div>
<div class="vsp-stat-value">{{ .WebApiCfg.VSPFee }}%</div>
</div>

<div class="col-6 col-sm-4 col-lg-2 py-3">
<div class="stat-title">Network Proportion</div>
<div class="stat-value">{{ float32ToPercent .WebApiCache.NetworkProportion }}</div>
<div class="vsp-stat-title">Network Proportion</div>
<div class="vsp-stat-value">{{ float32ToPercent .WebApiCache.NetworkProportion }}</div>
</div>

</div>
Expand Down
Loading