Skip to content

Commit

Permalink
fix: duplicate checkbox for pwm fan (fixes #799) (#802)
Browse files Browse the repository at this point in the history
Co-authored-by: Stefan Dej <[email protected]>
  • Loading branch information
dw-0 and meteyou authored May 15, 2022
1 parent 087d9b7 commit 9791202
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 15 deletions.
16 changes: 6 additions & 10 deletions src/components/charts/TempChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ export default class TempChart extends Mixins(BaseMixin) {
fontSize: '14px',
},
padding: 15,
formatter: this.tooltipFormater,
formatter: this.tooltipFormatter,
confine: true,
className: 'echarts-tooltip',
position: function (pos: any, params: any, dom: any, rect: any, size: any) {
Expand Down Expand Up @@ -297,21 +297,17 @@ export default class TempChart extends Mixins(BaseMixin) {
}
}
tooltipFormater(datasets: any) {
tooltipFormatter(datasets: any) {
let output = ''
const mainDatasets = datasets.filter((dataset: any) => {
if (dataset.seriesName === 'date') return false
if (dataset.seriesName.includes('-')) {
if (dataset.seriesName.lastIndexOf('-') > -1) {
const suffix = dataset.seriesName.slice(dataset.seriesName.lastIndexOf('-') + 1)
return !['target', 'power'].includes(suffix)
}
return true
}
const lastIndex = dataset.seriesName.lastIndexOf('-')
if (lastIndex === -1) return true
return true
const suffix = dataset.seriesName.slice(lastIndex + 1)
return !['target', 'power', 'speed'].includes(suffix)
})
if (datasets.length) {
let outputTime = datasets[0]['axisValueLabel']
Expand Down
10 changes: 5 additions & 5 deletions src/store/printer/tempHistory/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,12 @@ export const actions: ActionTree<PrinterTempHistoryState, RootState> = {
const masterDatasetKeys = tempDatasetKeys
.filter((tmp) => {
if (tmp.startsWith('_')) return false
if (tmp.lastIndexOf('-') > -1) {
const suffix = tmp.slice(tmp.lastIndexOf('-') + 1)
return !['target', 'power'].includes(suffix)
}

return true
const lastIndex = tmp.lastIndexOf('-')
if (lastIndex === -1) return true

const suffix = tmp.slice(lastIndex + 1)
return !['target', 'power', 'speed'].includes(suffix)
})
.sort()
const series: PrinterTempHistoryStateSerie[] = []
Expand Down

0 comments on commit 9791202

Please sign in to comment.