Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: duplicate checkbox for pwm fan (fixes #799) #802

Merged
merged 4 commits into from
May 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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