Skip to content

Commit

Permalink
feat: export only selected jobs from print history (#1055)
Browse files Browse the repository at this point in the history
  • Loading branch information
meteyou authored Sep 3, 2022
1 parent 6387431 commit 28e1ec3
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/components/panels/HistoryListPanel.vue
Original file line number Diff line number Diff line change
Expand Up @@ -959,8 +959,13 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
content.push(row)
if (this.jobs.length) {
this.jobs.forEach((job: ServerHistoryStateJob) => {
let jobs = [...this.jobs]
if (this.selectedJobs.length) {
jobs = [...this.selectedJobs]
}
if (jobs.length) {
jobs.forEach((job: ServerHistoryStateJob) => {
const row: string[] = []
let filename = job.filename
Expand Down Expand Up @@ -1011,12 +1016,12 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
return this.formatDate(value)
case 'time':
return value.toFixed()
return value?.toFixed() ?? ''
default:
switch (typeof value) {
case 'number':
return value.toLocaleString(undefined, { useGrouping: false })
return value?.toLocaleString(undefined, { useGrouping: false }) ?? 0
case 'string':
if (escapeChar !== null && value.includes(escapeChar)) value = '"' + value + '"'
Expand All @@ -1039,12 +1044,12 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
return this.formatPrintTime(value)
case 'temp':
return value.toFixed() + ' °C'
return value?.toFixed() + ' °C'
case 'length':
if (value > 1000) return (value / 1000).toFixed(2) + ' m'
return value.toFixed(2) + ' mm'
return value?.toFixed(2) + ' mm'
default:
return value
Expand Down

0 comments on commit 28e1ec3

Please sign in to comment.