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

feat: Reminders panel on the History page #1274

Merged
merged 77 commits into from
Apr 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
159663c
Store for reminders
jeremiahvpratt Feb 18, 2023
45b02f4
Add reminders panel
jeremiahvpratt Feb 18, 2023
e1083af
Fix store and visual errors
jeremiahvpratt Feb 18, 2023
2079b9b
Add validation and todos
jeremiahvpratt Feb 18, 2023
29e5838
Notifications, and fix validation
jeremiahvpratt Feb 18, 2023
76efd43
Add repeating to reminder - notifications TBD
jeremiahvpratt Feb 20, 2023
e1a46f1
Add print time and epoch timestamp recording
jeremiahvpratt Mar 4, 2023
63f2862
Repeat action for reminders
jeremiahvpratt Mar 4, 2023
382360e
Remove logging
jeremiahvpratt Mar 4, 2023
0f7be22
Merge branch 'develop' into reminder-panel
meteyou Apr 4, 2023
4851c3b
refactor: move HistoryListPanelDetailsDialog to a own component
meteyou May 1, 2023
6cf542b
refactor: finish history details dialog
meteyou May 5, 2023
3fe7e4c
refactor: HistoryListPanel
meteyou May 6, 2023
beb346a
refactor: move style at the end of the file
meteyou May 6, 2023
c08541d
refactor: WIP
meteyou May 8, 2023
e7ff4be
Merge branch 'develop' into feat/reminder-panel-pr
meteyou May 18, 2023
c394713
style: order imports after update branch
meteyou May 18, 2023
fca24a8
refactor: split and cleanup HistoryListPanel
meteyou May 18, 2023
f46c603
refactor: add TranslateResult type to Panel & SettingsRow title
meteyou May 21, 2023
8c2013c
feat: add Maintenance store
meteyou May 21, 2023
a03c5d8
feat: add Maintenance add dialog
meteyou May 21, 2023
1721995
feat: add Maintenance store
meteyou May 22, 2023
28633fa
feat: add Maintenance entry in history list panel
meteyou May 22, 2023
66e409a
refactor: remove unused icon
meteyou May 22, 2023
10250be
Merge branch 'develop' into feat/reminder-panel-pr
meteyou Oct 1, 2023
1c5d738
refactor: fix merging issue
meteyou Oct 1, 2023
9aa813f
Merge branch 'develop' into reminder-panel
meteyou Feb 11, 2024
494e425
refactor: refactor history list panel
meteyou Feb 12, 2024
38b6611
Merge branch 'develop' into feat/reminder-panel-pr
meteyou Mar 3, 2024
5071f61
refactor: update branch and add "add to queue" function from develop
meteyou Mar 3, 2024
9063f51
refactor: remove reminder panel
meteyou Mar 4, 2024
d5953d6
refactor: refactor addMaintenance dialog
meteyou Mar 4, 2024
48bf08d
refactor: rename getFilteredJobList getter
meteyou Mar 4, 2024
78f481b
refactor: remove HistoryRemindersPanel.vue
meteyou Mar 4, 2024
b6c42f0
refactor: separate HistoryListPanelDeleteSelectedDialog.vue from Hist…
meteyou Mar 4, 2024
daa4337
Merge branch 'develop' into feat/reminder-panel-pr
meteyou Mar 7, 2024
19c0386
refactor: simplify HistoryStatisticsPanel
meteyou Mar 8, 2024
11ec2f0
refactor: refactor formatPrintTime function and add function to disab…
meteyou Mar 8, 2024
cbfe94a
fix: fix issue in formatPrintTime helper
meteyou Mar 8, 2024
1841a68
WIP
meteyou Mar 8, 2024
ffb2c4d
WIP
meteyou Mar 13, 2024
3247892
fix: fix some outputs in the maintenance dialog
meteyou Mar 16, 2024
dad79c0
fix: fix overflow wrap in notifications entries
meteyou Mar 16, 2024
5e86793
WIP
meteyou Mar 17, 2024
70551a3
Merge branch 'feat/reminder-panel-pr' into reminder-panel
meteyou Mar 17, 2024
c80251b
feat: add perform function for maintenance
meteyou Mar 17, 2024
9f563ba
fix: fix perform and reschedule function
meteyou Mar 18, 2024
183e769
fix: fix filter for notifications
meteyou Mar 18, 2024
7ba4e3d
refactor: fix type from HistoryList col
meteyou Mar 19, 2024
9297819
feat: add option to show only maintenance entries or print jobs in hi…
meteyou Mar 19, 2024
49e9721
refactor: move HistoryListEntry files to components/panels/History
meteyou Mar 19, 2024
8fedaa4
refactor: change icons in HistoryListEntryMaintenance
meteyou Mar 19, 2024
3a636f8
WIP
meteyou Mar 21, 2024
6e8231d
Merge branch 'develop' into reminder-panel
meteyou Mar 21, 2024
51944f5
refactor: restyle maintenance history entries in detail dialog
meteyou Mar 24, 2024
780e391
refactor: remove double import in HistoryStatisticsPanel.vue
meteyou Mar 24, 2024
5d9a8d2
feat: add a tooltip to the create Maintenance button
meteyou Mar 27, 2024
cabfd0f
feat: add a option to add a note during the perform action
meteyou Mar 27, 2024
eafca4b
feat: add function to edit maintenance entry
meteyou Mar 27, 2024
d05227a
refactor: fix type in HistoryListPanelExportCsv
meteyou Mar 27, 2024
582b8ed
refactor: fix linter issues
meteyou Mar 27, 2024
d5cbf1b
fix: dont hide the add maintenance button, when you load all history …
meteyou Mar 27, 2024
4fb24a8
refactor: refactor output of filamentUsed in HistoryStatisticsPanel.vue
meteyou Apr 2, 2024
fd70533
fix: fix job/maintenance selection in HistoryList and HistoryStats
meteyou Apr 2, 2024
e03a984
feat: add maintenance entries to CSV export
meteyou Apr 2, 2024
3c0a0be
fix: fix select and delete maintenance entries
meteyou Apr 2, 2024
4536900
Merge branch 'refs/heads/develop' into reminder-panel
meteyou Apr 13, 2024
1d54cfa
feat: add option for vendors to fill maintenance entries per default
meteyou Apr 27, 2024
a29fe5b
fix: fix output for single point entries
meteyou Apr 27, 2024
05dafca
refactor: simplify question output of delete selected jobs dialog
meteyou Apr 27, 2024
9ee61d8
refactor: refactor HistoryListPanelNoteDialog
meteyou Apr 27, 2024
141442c
Merge branch 'refs/heads/develop' into reminder-panel
meteyou Apr 27, 2024
b61804e
locale(en): remove unused key
meteyou Apr 27, 2024
352515f
fix: change icons for history job notes
meteyou Apr 28, 2024
1ae443f
fix: fix validation from new maintenance entry
meteyou Apr 28, 2024
7966f7e
fix: fix validation from edit maintenance entry
meteyou Apr 28, 2024
1a0c7c7
fix: fix close maintenance after performing
meteyou Apr 28, 2024
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
2 changes: 1 addition & 1 deletion src/components/charts/HistoryAllPrintStatusChart.vue
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export default class HistoryAllPrintStatusChart extends Mixins(BaseMixin, ThemeM
}

get selectedJobs() {
return this.$store.state.gui.view.history.selectedJobs ?? []
return this.$store.getters['server/history/getSelectedJobs']
}

get allPrintStatusArray() {
Expand Down
2 changes: 1 addition & 1 deletion src/components/charts/HistoryAllPrintStatusTable.vue
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import { ServerHistoryStateAllPrintStatusEntry } from '@/store/server/history/ty
})
export default class HistoryAllPrintStatusTable extends Mixins(BaseMixin) {
get selectedJobs() {
return this.$store.state.gui.view.history.selectedJobs ?? []
return this.$store.getters['server/history/getSelectedJobs']
}

get allPrintStatusArray() {
Expand Down
49 changes: 49 additions & 0 deletions src/components/dialogs/HistoryDeleteJobDialog.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
<template>
<v-dialog :value="show" max-width="400" @keydown.esc="close">
<panel :title="$t('History.Delete')" card-class="history-delete-dialog" :margin-bottom="false">
<template #buttons>
<v-btn icon tile @click="close">
<v-icon>{{ mdiCloseThick }}</v-icon>
</v-btn>
</template>
<v-card-text>
<p class="mb-0">
{{ $t('History.DeleteSingleJobQuestion') }}
</p>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn color="" text @click="close">{{ $t('History.Cancel') }}</v-btn>
<v-btn color="error" text @click="deleteJob">{{ $t('History.Delete') }}</v-btn>
</v-card-actions>
</panel>
</v-dialog>
</template>
<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { ServerHistoryStateJob } from '@/store/server/history/types'
import { mdiCloseThick } from '@mdi/js'

@Component
export default class HistoryDeleteJobDialog extends Mixins(BaseMixin) {
mdiCloseThick = mdiCloseThick

@Prop({ type: Boolean, required: true }) show!: boolean
@Prop({ type: Object, required: true }) job!: ServerHistoryStateJob

deleteJob() {
this.$socket.emit(
'server.history.delete_job',
{ uid: this.job.job_id },
{ action: 'server/history/getDeletedJobs' }
)

this.close()
}

close() {
this.$emit('close')
}
}
</script>
58 changes: 58 additions & 0 deletions src/components/dialogs/HistoryDeleteSelectedJobsDialog.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
<template>
<v-dialog :value="show" max-width="400" @keydown.esc="close">
<panel :title="$t('History.Delete')" card-class="history-delete-selected-dialog" :margin-bottom="false">
<template #buttons>
<v-btn icon tile @click="close">
<v-icon>{{ mdiCloseThick }}</v-icon>
</v-btn>
</template>
<v-card-text>
<p class="mb-0">
{{ text }}
</p>
</v-card-text>
<v-card-actions>
<v-spacer />
<v-btn color="" text @click="close">{{ $t('History.Cancel') }}</v-btn>
<v-btn color="error" text @click="deleteSelectedJobs">{{ $t('History.Delete') }}</v-btn>
</v-card-actions>
</panel>
</v-dialog>
</template>
<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { ServerHistoryStateJob } from '@/store/server/history/types'
import { mdiCloseThick } from '@mdi/js'

@Component
export default class HistoryDeleteJobDialog extends Mixins(BaseMixin) {
mdiCloseThick = mdiCloseThick

@Prop({ type: Boolean, required: true }) show!: boolean
@Prop({ type: Array, required: true }) selectedJobs!: ServerHistoryStateJob[]

get text() {
if (this.selectedJobs.length === 1) return this.$t('History.DeleteSingleJobQuestion')

return this.$t('History.DeleteSelectedQuestion', { count: this.selectedJobs.length })
}

deleteSelectedJobs() {
this.selectedJobs.forEach((item: ServerHistoryStateJob) => {
this.$socket.emit(
'server.history.delete_job',
{ uid: item.job_id },
{ action: 'server/history/getDeletedJobs' }
)
})

this.$emit('clear-selected-jobs')
this.close()
}

close() {
this.$emit('close')
}
}
</script>
170 changes: 170 additions & 0 deletions src/components/dialogs/HistoryDetailsDialog.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,170 @@
<template>
<v-dialog :value="show" :max-width="600" persistent @keydown.esc="close">
<panel
:title="$t('History.JobDetails')"
:icon="mdiUpdate"
card-class="history-detail-dialog"
:margin-bottom="false">
<template #buttons>
<v-btn icon tile @click="close">
<v-icon>{{ mdiCloseThick }}</v-icon>
</v-btn>
</template>
<v-card-text class="px-0">
<overlay-scrollbars style="height: 350px" class="px-6">
<history-details-dialog-entry v-for="field in fields" :key="field.key" :job="job" :field="field" />
</overlay-scrollbars>
</v-card-text>
</panel>
</v-dialog>
</template>
<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { ServerHistoryStateJob } from '@/store/server/history/types'
import { mdiCloseThick, mdiUpdate } from '@mdi/js'
import { formatFilesize, formatPrintTime } from '@/plugins/helpers'
import { TranslateResult } from 'vue-i18n'

export interface HistoryDetailsField {
key: string
label: string | TranslateResult
metadata?: boolean
unit?: string
format?: (value: any) => string | TranslateResult
}

@Component
export default class HistoryDetailsDialog extends Mixins(BaseMixin) {
mdiCloseThick = mdiCloseThick
mdiUpdate = mdiUpdate

@Prop({ type: Boolean, required: true }) show!: boolean
@Prop({ type: Object, required: true }) job!: ServerHistoryStateJob

get fields(): HistoryDetailsField[] {
return [
{
key: 'filename',
label: this.$t('History.Filename'),
},
{
key: 'size',
label: this.$t('History.Filesize'),
metadata: true,
format: (value: number) => formatFilesize(value),
},
{
key: 'modified',
label: this.$t('History.LastModified'),
metadata: true,
format: (value: number) => this.formatDateTime(value * 1000),
},
{
key: 'status',
label: this.$t('History.Status'),
format: (value: string) =>
this.$te(`History.StatusValues.${value}`, 'en') ? this.$t(`History.StatusValues.${value}`) : value,
},
{
key: 'end_time',
label: this.$t('History.EndTime'),
format: (value: number) => this.formatDateTime(value * 1000),
},
{
key: 'estimated_time',
label: this.$t('History.EstimatedTime'),
metadata: true,
format: (value: number) => formatPrintTime(value),
},
{
key: 'print_duration',
label: this.$t('History.PrintDuration'),
metadata: true,
format: (value: number) => formatPrintTime(value),
},
{
key: 'total_duration',
label: this.$t('History.TotalDuration'),
metadata: true,
format: (value: number) => formatPrintTime(value),
},
{
key: 'filament_weight_total',
label: this.$t('History.EstimatedFilamentWeight'),
metadata: true,
unit: 'g',
format: (value: number) => value?.toFixed(2),
},
{
key: 'filament_total',
label: this.$t('History.EstimatedFilament'),
metadata: true,
unit: 'mm',
format: (value: number) => value?.toFixed(0),
},
{
key: 'filament_used',
label: this.$t('History.FilamentUsed'),
metadata: true,
unit: 'mm',
format: (value: number) => value?.toFixed(0),
},
{
key: 'first_layer_extr_temp',
label: this.$t('History.FirstLayerExtTemp'),
metadata: true,
unit: '°C',
},
{
key: 'first_layer_bed_temp',
label: this.$t('History.FirstLayerBedTemp'),
metadata: true,
unit: '°C',
},
{
key: 'first_layer_height',
label: this.$t('History.FirstLayerHeight'),
metadata: true,
unit: 'mm',
},
{
key: 'layer_height',
label: this.$t('History.LayerHeight'),
metadata: true,
unit: 'mm',
},
{
key: 'object_height',
label: this.$t('History.ObjectHeight'),
metadata: true,
unit: 'mm',
},
{
key: 'slicer',
label: this.$t('History.Slicer'),
metadata: true,
},
{
key: 'slicer_version',
label: this.$t('History.SlicerVersion'),
metadata: true,
},
]
}

close() {
this.$emit('close')
}
}
</script>
<style scoped>
::v-deep .history-details-dialog-entry + .history-details-dialog-entry {
margin-top: 1em;
border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.theme--light ::v-deep .history-details-dialog-entry {
border-top-color: rgba(0, 0, 0, 0.12);
}
</style>
41 changes: 41 additions & 0 deletions src/components/dialogs/HistoryDetailsDialogEntry.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
<template>
<v-row v-if="show" class="history-details-dialog-entry">
<v-col>{{ field.label }}</v-col>
<v-col class="text-right">{{ output }}</v-col>
</v-row>
</template>
<script lang="ts">
import { Component, Mixins, Prop } from 'vue-property-decorator'
import BaseMixin from '@/components/mixins/base'
import { ServerHistoryStateJob } from '@/store/server/history/types'
import { HistoryDetailsField } from '@/components/dialogs/HistoryDetailsDialog.vue'

@Component
export default class HistoryDetailsDialogEntry extends Mixins(BaseMixin) {
@Prop({ type: Object, required: true }) job!: ServerHistoryStateJob
@Prop({ type: Object, required: true }) field!: HistoryDetailsField

get show() {
return this.value ?? false
}

get value() {
const boolMetadata = this.field.metadata ?? false
if (!boolMetadata) return this.job[this.field.key]

const metadata = this.job.metadata ?? null
if (metadata === null) return null

return metadata[this.field.key]
}

get output() {
let output = this.value
if (this.field.format) output = this.field.format(this.value)

if (this.field.unit) return `${output} ${this.field.unit}`

return output
}
}
</script>
Loading
Loading