Modernize login and admin pages

This commit is contained in:
jholdstock 2020-06-17 16:14:12 +01:00 committed by David Hill
parent 03a5ef4fd1
commit 892e6c5716
3 changed files with 152 additions and 80 deletions

View File

@ -67,3 +67,51 @@ footer .code {
text-align: center;
}
}
.btn {
outline: 0;
-webkit-box-shadow: 1px 3px 14px 0px rgba(0,0,0,0.19);
box-shadow: 1px 3px 14px 0px rgba(0,0,0,0.19);
}
.btn:focus, .btn:active,
.btn-primary:not(:disabled):not(.disabled):active:focus,
.btn-primary:not(:disabled):not(.disabled).active:focus {
-webkit-box-shadow: none;
box-shadow: none;
border-color: transparent;
}
.btn-small {
padding: 6px 10px;
font-size: 13px;
}
.block__content h1 {
color: #091440;
font-size: 24px;
padding-bottom: 10px;
}
.block__content {
background-color: #ffffff;
padding: 20px 30px;
color: #3D5873;
line-height: 1.4;
}
.block__content th {
font-weight: normal;
padding-right: 15px;
text-align: right;
}
.block__content table td {
word-break: break-word;
font-family: "vspd-code";
}
.block__content table th {
vertical-align: top;
white-space: nowrap;
}

View File

@ -1,86 +1,110 @@
{{ template "header" . }}
{{ template "vsp-stats" .VspStats }}
<div class="vsp-overview pt-4 pb-3 mb-3">
<div class="container">
<section>
<h3>Admin</h3>
<div class="d-flex flex-wrap">
<h1 class="mr-auto text-nowrap">Admin Panel</h1>
<a class="btn btn-primary" href="/admin/backup" download>Backup Database</a>
<div class="row">
<a class="m-2 btn btn-primary btn-small" href="/admin/backup" download>Backup</a>
<form class="my-2" action="/admin/logout" method="post">
<button class="btn btn-primary" type="submit">Logout</button>
</form>
<form class="p-2" action="/admin/logout" method="post">
<button type="submit" class="btn btn-primary btn-small">Logout</button>
</form>
</div>
</div>
<form class="my-2" action="/admin/ticket" method="post">
<input type="text" name="hash" size="64" minlength="64" maxlength="64" required placeholder="Ticket hash">
<button class="btn btn-primary" type="submit">Search</button>
</form>
{{ with .SearchResult }}
{{ if .Found }}
{{ with .Ticket }}
<table class="table table-dark my-2 ticket-table">
<tr>
<th>Hash</th>
<td>{{ .Hash }}</td>
</tr>
<tr>
<th>Commitment Address</th>
<td>{{ .CommitmentAddress }}</td>
</tr>
<tr>
<th>Fee Address Index</th>
<td>{{ .FeeAddressIndex }}</td>
</tr>
<tr>
<th>Fee Address</th>
<td>{{ .FeeAddress }}</td>
</tr>
<tr>
<th>Fee Amount</th>
<td>{{ .FeeAmount }} atoms</td>
</tr>
<tr>
<th>Fee Expiration</th>
<td>{{ .FeeExpiration }}</td>
</tr>
<tr>
<th>Confirmed</th>
<td>{{ .Confirmed }}</td>
</tr>
<tr>
<th>Vote Choices</th>
<td>
{{ range $key, $value := .VoteChoices }}
{{ $key }}: {{ $value }} <br />
{{ end }}
</td>
</tr>
<tr>
<th>Voting WIF</th>
<td>{{ .VotingWIF }}</td>
</tr>
<tr>
<th>Fee Tx</th>
<td>{{ .FeeTxHex }}</td>
</tr>
<tr>
<th>Fee Tx Hash</th>
<td>{{ .FeeTxHash }}</td>
</tr>
<tr>
<th>Fee Tx Status</th>
<td>{{ .FeeTxStatus }}</td>
</tr>
<tr>
</tr>
</table>
{{ end }}
{{ else }}
<p>No ticket with hash <span class="code">"{{ .Hash }}"</span></p>
{{ end }}
{{ end }}
{{ template "vsp-stats" .VspStats }}
</section>
</div>
</div>
<div class="container">
<div class="row">
<div class="col-12 p-3">
<div class="block__content">
<h1>Ticket Search</h1>
<form class="my-2" action="/admin/ticket" method="post">
<input type="text" name="hash" size="64" minlength="64" maxlength="64" required placeholder="Ticket hash">
<button class="ml-3 btn btn-primary" type="submit">Search</button>
</form>
{{ with .SearchResult }}
{{ if .Found }}
{{ with .Ticket }}
<table class="table mt-4 mb-0">
<tr>
<th>Hash</th>
<td>{{ .Hash }}</td>
</tr>
<tr>
<th>Commitment Address</th>
<td>{{ .CommitmentAddress }}</td>
</tr>
<tr>
<th>Fee Address Index</th>
<td>{{ .FeeAddressIndex }}</td>
</tr>
<tr>
<th>Fee Address</th>
<td>{{ .FeeAddress }}</td>
</tr>
<tr>
<th>Fee Amount</th>
<td>{{ .FeeAmount }} atoms</td>
</tr>
<tr>
<th>Fee Expiration</th>
<td>{{ .FeeExpiration }}</td>
</tr>
<tr>
<th>Confirmed</th>
<td>{{ .Confirmed }}</td>
</tr>
<tr>
<th>Vote Choices</th>
<td>
{{ range $key, $value := .VoteChoices }}
{{ $key }}: {{ $value }} <br />
{{ end }}
</td>
</tr>
<tr>
<th>Voting WIF</th>
<td>{{ .VotingWIF }}</td>
</tr>
<tr>
<th>Fee Tx</th>
<td>{{ .FeeTxHex }}</td>
</tr>
<tr>
<th>Fee Tx Hash</th>
<td>{{ .FeeTxHash }}</td>
</tr>
<tr>
<th>Fee Tx Status</th>
<td>{{ .FeeTxStatus }}</td>
</tr>
<tr>
</tr>
</table>
{{ end }}
{{ else }}
<p>No ticket found with hash <span class="code">{{ .Hash }}</span></p>
{{ end }}
{{ end }}
</div>
</div>
</div>
</div>
{{ template "footer" . }}

View File

@ -1,15 +1,15 @@
{{ template "header" . }}
<section>
<h3>Login</h3>
<div class="py-4 container">
<h1>Login</h1>
<form action="/admin" method="post">
<input type="password" name="password" required placeholder="Enter password">
<button class="btn btn-primary" type="submit">Login</button>
<button class="ml-3 btn btn-primary" type="submit">Login</button>
</form>
{{ if .IncorrectPassword }}
<p>Incorrect password</p>
{{ end }}
</section>
</div>
{{ template "footer" . }}