Skip to content
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
2 changes: 1 addition & 1 deletion app/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
# 0.5.x -> beta
# 1.0.0 -> first stable release
# Bump this on every customer-visible release.
__version__ = '0.2.0'
__version__ = '0.2.1'


def create_app(test_config=None):
Expand Down
17 changes: 17 additions & 0 deletions app/static/css/dashboard.css
Original file line number Diff line number Diff line change
Expand Up @@ -283,6 +283,12 @@ summary {
gap: var(--space-2);
}

.form-grid .form-submit {
margin-top: var(--space-4);
justify-self: center;
min-width: 10rem;
}

label {
display: grid;
gap: var(--space-1);
Expand Down Expand Up @@ -609,6 +615,12 @@ button:active {
cursor: pointer;
}

.modal-backdrop:hover,
.modal-backdrop:active {
background: rgba(15, 23, 42, 0.55);
transform: none;
}

.modal-panel {
position: relative;
z-index: 1;
Expand Down Expand Up @@ -653,6 +665,11 @@ button:active {
background: rgba(0, 0, 0, 0.65);
}

:root[data-theme="dark"] .modal-backdrop:hover,
:root[data-theme="dark"] .modal-backdrop:active {
background: rgba(0, 0, 0, 0.65);
}

:root[data-theme="dark"] .modal-close {
border-color: rgba(255, 255, 255, 0.25);
color: hsl(220, 18%, 82%);
Expand Down
13 changes: 8 additions & 5 deletions app/static/js/dashboard-app.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
import './components/device-card.js';
import { formatRelativeTime } from './lib/strings.js';

const ADD_DEVICE_TOGGLE_LABEL = 'Add a device';
const ADD_DEVICE_MODAL_LABEL = 'Add a TinyPilot device';
const ADD_DEVICE_SUBMIT_LABEL = 'Add device';
const DEVICES_PER_PAGE = 4;
const CONNECTED_STATUS_REFRESH_INTERVAL_MS = 30_000;

Expand All @@ -26,7 +29,7 @@ class DashboardApp extends HTMLElement {
${dashboardVersion ? `<span class="topbar-version" title="Dashboard version">v${dashboardVersion}</span>` : ''}
</div>
<div class="topbar-actions">
<button id="add-device-toggle" type="button" class="theme-toggle">Add a device</button>
<button id="add-device-toggle" type="button" class="theme-toggle">${ADD_DEVICE_TOGGLE_LABEL}</button>
<button id="theme-toggle" type="button" class="theme-toggle">Dark mode</button>
</div>
</header>
Expand All @@ -38,7 +41,7 @@ class DashboardApp extends HTMLElement {
<button type="button" class="modal-backdrop" id="add-device-modal-backdrop" tabindex="-1" aria-label="Close dialog"></button>
<section class="modal-panel panel">
<header class="modal-header">
<h2 id="add-device-heading">Add a device</h2>
<h2 id="add-device-heading">${ADD_DEVICE_MODAL_LABEL}</h2>
<button type="button" class="modal-close" id="add-device-modal-close" aria-label="Close">&times;</button>
</header>
<form id="add-device-form" class="form-grid">
Expand All @@ -54,7 +57,7 @@ class DashboardApp extends HTMLElement {
API key
<input name="api_key" type="password" required autocomplete="off" spellcheck="false">
</label>
<button type="submit">Add a device</button>
<button type="submit" class="form-submit">${ADD_DEVICE_SUBMIT_LABEL}</button>
</form>
<p id="add-device-status" class="subtitle"></p>
</section>
Expand All @@ -81,7 +84,7 @@ class DashboardApp extends HTMLElement {

_bind() {
const e = this._elements;
e.addDeviceToggle.textContent = 'Add a device';
e.addDeviceToggle.textContent = ADD_DEVICE_TOGGLE_LABEL;
e.addDeviceToggle.addEventListener('click', () => {
if (e.addDeviceModal.hasAttribute('hidden')) {
this._openAddDeviceModal();
Expand Down Expand Up @@ -133,7 +136,7 @@ class DashboardApp extends HTMLElement {
}

_addDeviceModalHeadingText() {
return this._allDevices.length === 0 ? 'Add your first device' : 'Add a device';
return ADD_DEVICE_MODAL_LABEL;
}

_syncAddDeviceModalState() {
Expand Down
Loading