Skip to content

Commit

Permalink
(feat) add dashboard view
Browse files Browse the repository at this point in the history
  • Loading branch information
leonjza committed Jun 7, 2022
1 parent f79a191 commit 00f9394
Show file tree
Hide file tree
Showing 3 changed files with 172 additions and 10 deletions.
25 changes: 21 additions & 4 deletions web/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,23 @@ <h1 class="navbar-brand navbar-brand-autodark d-none-navbar-horizontal pe-0 pe-m

<li class="nav-item">
<a class="nav-link" href="/">
<span class="nav-link-icon d-md-none d-lg-inline-block">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24"
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<polyline points="5 12 3 12 12 3 21 12 19 12"></polyline>
<path d="M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7"></path>
<path d="M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6"></path>
</svg>
</span>
<span class="nav-link-title">
Home
</span>
</a>
</li>

<li class="nav-item">
<a class="nav-link" href="/gallery">
<span class="nav-link-icon d-md-none d-lg-inline-block">
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24"
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
Expand Down Expand Up @@ -155,11 +172,11 @@ <h1 class="navbar-brand navbar-brand-autodark d-none-navbar-horizontal pe-0 pe-m
</div>
</div>
<div class="page-wrapper">
{{ end }}
{{ end }}

<!-- main content in child templates here -->
<!-- main content in child templates here -->

{{ define "footer" }}
{{ define "footer" }}
<footer class="footer footer-transparent d-print-none">
<div class="container-xl">
<div class="row text-center align-items-center flex-row-reverse">
Expand Down Expand Up @@ -191,4 +208,4 @@ <h1 class="navbar-brand navbar-brand-autodark d-none-navbar-horizontal pe-0 pe-m
</body>

</html>
{{ end }}
{{ end }}
145 changes: 145 additions & 0 deletions web/templates/dashboard.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,145 @@
{{ template "header" . }}

<!-- content header bar -->
<div class="container-xl">
<!-- Page title -->
<div class="page-header d-print-none">
<div class="row g-2 align-items-center">
<div class="col">
<!-- Page pre-title -->
<div class="page-pretitle">
Home
</div>
<h2 class="page-title">
Statistics Dashboard
</h2>
</div>
</div>
</div>
</div>

<div class="page-body">
<div class="container-xl">
<div class="row row-deck row-cards">

<div class="col-12">
<div class="row row-cards">
<div class="col-sm-6 col-lg-3">
<div class="card card-sm">
<div class="card-body">
<div class="row align-items-center">
<div class="col-auto">
<span class="bg-blue text-white avatar">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-viewport-wide"
width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M10 12h-7l3 -3m0 6l-3 -3"></path>
<path d="M14 12h7l-3 -3m0 6l3 -3"></path>
<path d="M3 6v-3h18v3"></path>
<path d="M3 18v3h18v-3"></path>
</svg>
</span>
</div>
<div class="col">
<div class="font-weight-medium">
{{ .URLCount }} Processed URLs
</div>
<div class="text-muted">
{{ .DBSzie }} MB SQLite Database Size
</div>
</div>
</div>
</div>
</div>
</div>

<div class="col-sm-6 col-lg-3">
<div class="card card-sm">
<div class="card-body">
<div class="row align-items-center">
<div class="col-auto">
<span class="bg-green text-white avatar">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-file-certificate"
width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M14 3v4a1 1 0 0 0 1 1h4"></path>
<path d="M5 8v-3a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2h-5"></path>
<circle cx="6" cy="14" r="3"></circle>
<path d="M4.5 17l-1.5 5l3 -1.5l3 1.5l-1.5 -5"></path>
</svg>
</span>
</div>
<div class="col">
<div class="font-weight-medium">
{{ .CertCount }} Certificates
</div>
<div class="text-muted">
{{ .DNSNameCount }} DNS Names
</div>
</div>
</div>
</div>
</div>
</div>

<div class="col-sm-6 col-lg-3">
<div class="card card-sm">
<div class="card-body">
<div class="row align-items-center">
<div class="col-auto">
<span class="bg-twitter text-white avatar">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-layout-navbar"
width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<rect x="4" y="4" width="16" height="16" rx="2"></rect>
<line x1="4" y1="9" x2="20" y2="9"></line>
</svg>
</span>
</div>
<div class="col">
<div class="font-weight-medium">
{{ .HeaderCount }} Headers
</div>
</div>
</div>
</div>
</div>
</div>

<div class="col-sm-6 col-lg-3">
<div class="card card-sm">
<div class="card-body">
<div class="row align-items-center">
<div class="col-auto">
<span class="bg-facebook text-white avatar">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-file-code-2"
width="24" height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none"
stroke-linecap="round" stroke-linejoin="round">
<path stroke="none" d="M0 0h24v24H0z" fill="none"></path>
<path d="M10 12h-1v5h1"></path>
<path d="M14 12h1v5h-1"></path>
<path d="M14 3v4a1 1 0 0 0 1 1h4"></path>
<path d="M17 21h-10a2 2 0 0 1 -2 -2v-14a2 2 0 0 1 2 -2h7l5 5v11a2 2 0 0 1 -2 2z"></path>
</svg>
</span>
</div>
<div class="col">
<div class="font-weight-medium">
{{ .TechCount }} Unique Technologies
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

</div>
</div>
</div>

{{ template "footer" . }}
12 changes: 6 additions & 6 deletions web/templates/gallery.html
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ <h2 class="page-title">
<div class="col-12 col-md-auto ms-auto d-print-none">
<div class="btn-list">
{{ if .Data.Ordered }}
<a href="/?perception_sort=false&limit={{ .Data.Limit }}&page={{ .Data.Page }}"
<a href="/gallery?perception_sort=false&limit={{ .Data.Limit }}&page={{ .Data.Page }}"
class="btn btn-primary d-none d-sm-inline-block">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-sort-ascending-2" width="24"
height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
Expand All @@ -33,7 +33,7 @@ <h2 class="page-title">
Disable Perception Sort
</a>
{{ else }}
<a href="/?perception_sort=true&limit={{ .Data.Limit }}&page={{ .Data.Page }}"
<a href="/gallery?perception_sort=true&limit={{ .Data.Limit }}&page={{ .Data.Page }}"
class="btn btn-primary d-none d-sm-inline-block">
<svg xmlns="http://www.w3.org/2000/svg" class="icon icon-tabler icon-tabler-sort-descending-2" width="24"
height="24" viewBox="0 0 24 24" stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round"
Expand Down Expand Up @@ -126,7 +126,7 @@ <h2 class="page-title">
<!-- first page -->
<li class="page-item {{ if le .Data.Page 1 }}disabled{{ end }}">
<a class="page-link"
href="/?{{ if .Data.Ordered }}perception_sort=true&{{ end }}limit={{ .Data.Limit }}&page={{ .Data.PrevPage }}"
href="/gallery?{{ if .Data.Ordered }}perception_sort=true&{{ end }}limit={{ .Data.Limit }}&page={{ .Data.PrevPage }}"
tabindex="-1" {{ if le .Data.Page 1 }}aria-disabled="true" {{ end }}>
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24"
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
Expand All @@ -141,7 +141,7 @@ <h2 class="page-title">
{{ range $p := .Data.PrevPageRange }}
<li class="page-item">
<a class="page-link"
href="/?{{ if $.Data.Ordered }}perception_sort=true&{{ end }}limit={{ $.Data.Limit }}&page={{ $p }}">
href="/gallery?{{ if $.Data.Ordered }}perception_sort=true&{{ end }}limit={{ $.Data.Limit }}&page={{ $p }}">
{{ $p }}
</a>
</li>
Expand All @@ -156,7 +156,7 @@ <h2 class="page-title">
{{ range $p := .Data.NextPageRange }}
<li class="page-item">
<a class="page-link"
href="/?{{ if $.Data.Ordered }}perception_sort=true&{{ end }}limit={{ $.Data.Limit }}&page={{ $p }}">
href="/gallery?{{ if $.Data.Ordered }}perception_sort=true&{{ end }}limit={{ $.Data.Limit }}&page={{ $p }}">
{{ $p }}
</a>
</li>
Expand All @@ -165,7 +165,7 @@ <h2 class="page-title">
<!-- next -->
<li class="page-item {{ if eq .Data.Page .Data.NextPage }}disabled{{ end }}">
<a class="page-link"
href="/?{{ if $.Data.Ordered }}perception_sort=true&{{ end }}limit={{ $.Data.Limit }}&page={{ .Data.NextPage }}">
href="/gallery?{{ if $.Data.Ordered }}perception_sort=true&{{ end }}limit={{ $.Data.Limit }}&page={{ .Data.NextPage }}">
next
<svg xmlns="http://www.w3.org/2000/svg" class="icon" width="24" height="24" viewBox="0 0 24 24"
stroke-width="2" stroke="currentColor" fill="none" stroke-linecap="round" stroke-linejoin="round">
Expand Down

0 comments on commit 00f9394

Please sign in to comment.