Skip to content

Commit

Permalink
Complete makeover of the UI (#347)
Browse files Browse the repository at this point in the history
* Complete makeover of the UI

* Some minor UI tweaks for refresh and scroll to checks

* Change layout and UI for result details

* A few more minor style tweaks

* Switch to Preact

* Add dark mode support and JS/CSS concat step

* Vendor Preact and HTM

* Address feedback

* Some tweaks for scrolling to checks

* Remove concat of JS and CSS files

Co-authored-by: Mathieu Leplatre <[email protected]>
  • Loading branch information
rehandalal and leplatrem authored Feb 25, 2020
1 parent 224c5d6 commit 7afcc9d
Show file tree
Hide file tree
Showing 25 changed files with 5,609 additions and 326 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ COMMIT := $(shell git log --pretty=format:'%H' -n 1)
COMMIT_HOOK := .git/hooks/pre-commit
VENV := $(shell echo $${VIRTUAL_ENV-.venv})
PYTHON := $(VENV)/bin/python3
VIRTUALENV := virtualenv --python=python3
VIRTUALENV := virtualenv --python=python3.7
PIP_INSTALL := $(VENV)/bin/pip install --progress-bar=off
INSTALL_STAMP := $(VENV)/.install.stamp

Expand Down
2 changes: 1 addition & 1 deletion poucave/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
import toml


HOST = os.getenv("HOST", "localhost")
HOST = os.getenv("HOST", "0.0.0.0")
PORT = int(os.getenv("PORT", 8000))
CONFIG_FILE = os.getenv("CONFIG_FILE", "config.toml")
DIAGRAM_FILE = os.getenv("DIAGRAM_FILE", "diagram.svg")
Expand Down
5 changes: 5 additions & 0 deletions poucave/html/css/font-awesome.min.css

Large diffs are not rendered by default.

30 changes: 30 additions & 0 deletions poucave/html/css/main-dark.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
@media (prefers-color-scheme: dark) {
.auto-theme-dark .header {
background: var(--dark);
border-color: rgba(123, 126, 136, 0.24);
}

.auto-theme-dark .check-tags .badge {
background: var(--gray-dark);
}

.auto-theme-dark .card-footer.check-details {
color: var(--foreground-dark);
}

.auto-theme-dark .check-details dt,
.auto-theme-dark .check-details dd {
border-color: rgba(123, 126, 136, 0.24);
}

.auto-theme-dark .check-details pre {
background: rgba(123, 126, 136, 0.24);
color: var(--gray);
}

.auto-theme-dark code {
background: rgba(123, 126, 136, 0.24);
border-color: rgba(123, 126, 136, 0.24);
color: var(--gray);
}
}
136 changes: 136 additions & 0 deletions poucave/html/css/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,136 @@
@import "libs.css";
@import "main-dark.css";

:root {
--gray-medium: #7b7e88;
--foreground-dark: #afbdd1;
}

code {
padding: 0.2em 0.4em;
}

.header {
background: var(--white);
border-bottom: 1px solid rgba(0, 40, 100, 0.12);
}

section.project:not(:first-child) {
border-top: 1px solid rgba(0, 40, 100, 0.12);
}

.project-cards {
display: grid;
grid-gap: 0.5rem 0rem;
grid-template-columns: 100%;
}

.card-body p:last-child {
margin-bottom: 0;
}

.card-footer.check-details {
color: #303645;
font-size: 0.8rem;
}

.check-tags .badge {
background: var(--gray);
}

.check-details summary {
font-weight: bold;
outline: none;
text-transform: uppercase;
}

.check-details h4 {
text-transform: uppercase;
}

.check-details pre {
background: rgba(48, 54, 69, 0.032);
max-height: 10rem;
padding-bottom: 0;
padding-top: 0;
}

.check-details pre:before,
.check-details pre:after {
content: '';
display: block;
height: 0;
}

.check-details pre:before {
padding-top: 1rem;
}

.check-details pre:after {
padding-bottom: 1rem;
}

.check-details dt,
.check-details dd {
border-left: 2px solid rgba(0, 40, 100, 0.12);
padding-left: 0.5rem;
}

.check-details details > p:last-child {
margin-bottom: 0;
}

.check-details details[open] summary {
margin-bottom: 1rem;
}

@media screen and (min-width: 48rem) {
.project-cards {
grid-gap: 0.5rem 1.5rem;
grid-template-columns: 1fr 1fr;
}
}

@media screen and (min-width: 64rem) {
.project-cards {
grid-gap: 0.5rem 1.5rem;
grid-template-columns: 1fr 1fr 1fr;
}
}

.fs-1 {
font-size: 1rem;
}

.text-fine {
font-size: 0.8rem;
}

.text-gray-medium {
color: var(--gray-medium);
}

.bg-gray-medium {
background-color: var(--gray-medium);
}

.system-diagram {
max-height: 280px;
max-width: 100%;
}

@keyframes blinking {
0%, 50%, 100% {
transform: scale(1, 1);
opacity: 1;
}

25%, 75% {
transform: scale(0.9, 0.9);
opacity: 0.35;
}
}

.animate-blink {
animation: blinking 1.5s 1;
}
2 changes: 2 additions & 0 deletions poucave/html/css/tabler-dark.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 7 additions & 0 deletions poucave/html/css/tabler.min.css

Large diffs are not rendered by default.

Binary file removed poucave/html/failing.png
Binary file not shown.
Binary file added poucave/html/img/failure.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added poucave/html/img/loading.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added poucave/html/img/success.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
54 changes: 20 additions & 34 deletions poucave/html/index.html
Original file line number Diff line number Diff line change
@@ -1,39 +1,25 @@
<html>
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<link rel="stylesheet" href="style.css"></link>
<link rel="icon" href="" type="image/png" sizes="32x32"></link>
<title>Delivery System Status</title>
<link rel="stylesheet" href="css/font-awesome.min.css" />
<link rel="stylesheet" href="css/tabler.min.css" />
<link rel="stylesheet" href="css/tabler-dark.min.css" />
<link rel="stylesheet" href="css/main.css" />
<link rel="stylesheet" href="css/main-dark.css" />
<link rel="icon" href="img/loading.png" type="image/png" />
</head>

<body>
<object id="svg-diagram" data="/diagram.svg" type="image/svg+xml"></object>
<div id="main">Loading...</div>
<template id="check-tpl">
<section>
<a class="anchor">
<h1>
<span class="name"></span>
<a class="url">&#x1f517;</a>
</h1>
</a>
<p class="tags"></p>
<p class="description"></p>
<details>
<summary>
Result (<span class="datetime"></span>)
<button class="refresh" title="Refresh">&#x21bb;</button>
</summary>
<p class="documentation"></p>
<p class="parameters"></p>
<pre class="result"></pre>
<p>
Executed in <span class="duration"></span> msec.
<a class="troubleshooting" href="" target="_blank">🆘 Troubleshooting</a>
</p>
</details>
</section>
</template>
<script type="text/javascript" src="script.js"></script>
<script type="text/javascript" src="timeago.min.js"></script>
<script type="text/javascript" src="marked.min.js"></script>
<div id="app">
<div class="py-6">
<div class="loader mx-auto"></div>
<div class="text-center mt-3">Loading...</div>
</div>
</div>
<script type="text/javascript" src="js/marked.min.js"></script>
<script type="text/javascript" src="js/timeago.min.js"></script>
<script type="module" src="js/app.js"></script>
</body>
</html>
</html>
Loading

0 comments on commit 7afcc9d

Please sign in to comment.