Skip to content

Commit b6f3eb0

Browse files
Backport changes from Pro (#1868)
Resolves tiny-pilot/tinypilot-pro#1467. This PR isn’t urgent. <a data-ca-tag href="https://codeapprove.com/pr/tiny-pilot/tinypilot/1868"><img src="https://codeapprove.com/external/github-tag-allbg.png" alt="Review on CodeApprove" /></a> Co-authored-by: Jan Heuermann <[email protected]>
1 parent 324392c commit b6f3eb0

File tree

6 files changed

+45
-1
lines changed

6 files changed

+45
-1
lines changed

app/static/css/style.css

+2
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
--brand-green: hsl(var(--brand-hue-green), 50%, 44%);
3838
--brand-green-dark: hsl(var(--brand-hue-green), 43%, 33%);
3939
--brand-green-light: hsl(var(--brand-hue-green), 34%, 70%);
40+
--brand-green-lighter: hsl(var(--brand-hue-green), 65%, 88%);
4041
--brand-green-bright: hsl(var(--brand-hue-green), 70%, 45%);
4142
--brand-green-background: hsl(var(--brand-hue-green), 54%, 95%);
4243

@@ -144,6 +145,7 @@ button,
144145
border: 1px solid var(--brand-metallic-medium);
145146
background: var(--brand-metallic-light)
146147
linear-gradient(0deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0) 60%);
148+
user-select: none;
147149
}
148150

149151
button:hover,

app/static/js/app.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,11 @@ const overlayTracker = new OverlayTracker();
2121
* @see `DialogFailedEvent` for parameter `errorInfo`
2222
*/
2323
function showError(errorInfo) {
24-
console.error(`${errorInfo.title}:\n${errorInfo.details}`);
24+
console.error(
25+
`Title: ${errorInfo.title}\nMessage: ${
26+
errorInfo.message || "-"
27+
}\nDetails: ${errorInfo.details || "-"}`
28+
);
2529
document.getElementById("error-dialog").setup(errorInfo);
2630
document.getElementById("error-overlay").show();
2731
}

app/templates/custom-elements/inline-message.html

+5
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@
1313
display: block;
1414
}
1515

16+
:host([variant="success"]) {
17+
background-color: var(--brand-green-lighter);
18+
border-color: var(--brand-green);
19+
}
20+
1621
:host([variant="info"]) {
1722
background-color: var(--brand-blue-lighter);
1823
border-color: var(--brand-blue);

app/templates/styleguide.html

+7
Original file line numberDiff line numberDiff line change
@@ -376,6 +376,13 @@ <h2 class="section">Inline Message</h2>
376376
prominent styling than just regular text. Info messages are mostly
377377
informative, and while they may prompt action, they never require it.
378378
</inline-message>
379+
<br />
380+
<inline-message variant="success" show>
381+
<strong>Success:</strong> We use success messages to reassure the user
382+
that things are functioning as expected. We only use this in specific
383+
contexts to highlight a valid and healthy system state. We don’t use
384+
this as a general pattern to indicate success of operations.
385+
</inline-message>
379386
<p>Some notes about usage:</p>
380387
<ul>
381388
<li>
+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#!/bin/bash
2+
3+
# Mock version of /opt/tinypilot-privileged/scripts/read-update-log
4+
5+
# Prepend random characters, to make the caller of the `read-update-log` script
6+
# believe new log output had been emitted on repetitive calls.
7+
echo "${RANDOM}: Update in progress..."

dev-scripts/mock-scripts/update

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
#!/bin/bash
2+
3+
# Mock version of /opt/tinypilot-privileged/scripts/update
4+
#
5+
# On device, the `tinypilot-updater` systemd service would facilitate invoking
6+
# the original script.
7+
8+
echo '======== update-opts ========'
9+
10+
# Output all update-opts for debugging purposes.
11+
if [[ -d /home/tinypilot/update-opts ]]; then
12+
for file in /home/tinypilot/update-opts/*; do
13+
echo "${file}: $(cat "${file}")"
14+
done
15+
else
16+
echo 'No update opts!'
17+
fi
18+
19+
echo '============================='

0 commit comments

Comments
 (0)