Skip to content

Commit

Permalink
Display print success (UnchartedBull#2084)
Browse files Browse the repository at this point in the history
  • Loading branch information
Seculo9112 committed Aug 29, 2021
1 parent 7c79a74 commit 7739806
Show file tree
Hide file tree
Showing 5 changed files with 63 additions and 3 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Manual Build with Artifacts

on:
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Cache node modules
uses: actions/cache@v2
env:
cache-name: octodash-node-modules
with:
path: ~/.npm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-build-${{ env.cache-name }}-
- name: Use Node.js
uses: actions/setup-node@v1
with:
node-version: '14'
- name: Installing Dependencies
run: npm ci
- name: Building Application
run: npm run ng:build
- name: Packaging Application
run: npm run electron:pack
- name: Upload Artifact
uses: actions/upload-artifact@v2
with:
path: package/octodash*.deb
3 changes: 2 additions & 1 deletion src/app/files/files.component.html
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,9 @@
matRipple
[matRippleUnbounded]="false"
class="files__object"
[ngClass]="[file.successful]"
>
<img src="assets/object.svg" class="files__icon" />
<img [src]="file.thumbnail" class="files__icon" />
<div class="files__info">
<span class="files__info-value">
{{ file.size }}<span class="files__info-unit" i18n="@@files-mb-2">mb</span>
Expand Down
18 changes: 16 additions & 2 deletions src/app/files/files.component.scss
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
height: 11vh;
line-height: 11vh;
margin-bottom: 2vh;
border-left: .2em solid transparent;

&:first-of-type {
margin-top: 3.5vh;
Expand All @@ -83,6 +84,18 @@
&:last-of-type {
margin-bottom: 5.5vh;
}

&--success {
border-left-color: #44bd32;
}

&--failed {
border-left-color: #e84118;
}

&--unknown {
border-left-color: #f5f6fa;
}
}

&__name {
Expand All @@ -93,11 +106,12 @@
white-space: nowrap;
text-overflow: ellipsis;
display: block;
margin-left: 9vw;
}

&__icon {
height: 8vh;
margin: 1.7vh 1vw 0;
height: 9vh;
margin: 1vh 1.2vw 0;
display: block;
float: left;
}
Expand Down
1 change: 1 addition & 0 deletions src/app/model/files.model.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,5 @@ export interface File {
printTime?: string;
filamentWeight?: number;
date?: string;
successful: 'files__object--success' | 'files__object--failed' | 'files__object--unknown';
}
9 changes: 9 additions & 0 deletions src/app/services/files/files.octoprint.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,15 @@ export class FilesOctoprintService implements FilesService {
size: this.conversionService.convertByteToMegabyte(fileOrFolder.size),
...(fileOrFolder.gcodeAnalysis
? {
successful:
fileOrFolder.prints != null
? fileOrFolder.prints.last.success
? 'files__object--success'
: 'files__object--failed'
: 'files__object--unknown',
thumbnail: fileOrFolder.thumbnail
? this.configService.getApiURL(fileOrFolder.thumbnail, false)
: 'assets/object.svg',
printTime: this.conversionService.convertSecondsToHours(
fileOrFolder.gcodeAnalysis.estimatedPrintTime,
),
Expand Down

0 comments on commit 7739806

Please sign in to comment.