From 70f583c3e1d7c4bc1cca6b9c1cec6ca2e1f9e7b3 Mon Sep 17 00:00:00 2001 From: Bastien Wirtz Date: Sun, 27 Nov 2022 18:41:12 +0100 Subject: Octoprint service (#324) (#560) Add Octoprint service. --- src/assets/app.scss | 2 +- src/assets/components/status.scss | 48 +++++++++++++++ src/components/services/OctoPrint.vue | 108 ++++++++++++++++++++++++++++++++++ 3 files changed, 157 insertions(+), 1 deletion(-) create mode 100644 src/assets/components/status.scss create mode 100644 src/components/services/OctoPrint.vue (limited to 'src') diff --git a/src/assets/app.scss b/src/assets/app.scss index d112482..4ce417a 100644 --- a/src/assets/app.scss +++ b/src/assets/app.scss @@ -1,8 +1,8 @@ @charset "utf-8"; @import "./webfonts/webfonts.scss"; - @import "../../node_modules/bulma/bulma"; +@import "./components/status.scss"; // Themes import @import "./themes/sui.scss"; diff --git a/src/assets/components/status.scss b/src/assets/components/status.scss new file mode 100644 index 0000000..b5fd20b --- /dev/null +++ b/src/assets/components/status.scss @@ -0,0 +1,48 @@ +.status { + font-size: 0.8rem; + color: var(--text-title); + + &.offline:before, &.error:before { + background-color: #d65c68; + box-shadow: 0 0 5px 1px #d65c68; + color: #d65c68; + } + + &.pending:before { + background-color: #e8bb7d; + box-shadow: 0 0 5px 1px #e8bb7d; + } + + &.online:before, &.ready:before { + background-color: #94e185; + box-shadow: 0 0 5px 1px #94e185; + } + + &.in-progress:before { + background-color: #8fe87d; + box-shadow: 0 0 5px 1px #8fe87d; + animation: pulse 1s alternate infinite; + } + + @keyframes pulse { + 0% { + background: rgba(255, 255, 255, 0.2); + box-shadow: inset 0px 0px 10px 2px rgba(0, 255, 182, 0.3), + 0px 0px 5px 2px rgba(0, 255, 135, 0.2); + } + 100% { + background: rgba(255, 255, 255, 1); + box-shadow: inset 0px 0px 10px 2px rgba(0, 255, 182, 0.5), + 0px 0px 15px 2px rgba(0, 255, 135, 1); + } + } + + &:before { + content: " "; + display: inline-block; + width: 8px; + height: 8px; + margin-right: 10px; + border-radius: 8px; + } + } \ No newline at end of file diff --git a/src/components/services/OctoPrint.vue b/src/components/services/OctoPrint.vue new file mode 100644 index 0000000..c5da8d9 --- /dev/null +++ b/src/components/services/OctoPrint.vue @@ -0,0 +1,108 @@ + + + + + -- cgit v1.2.3