+ @click.stop="select(!isSelected)" />
@@ -131,10 +136,7 @@
height="32"
v-bind="attrs"
v-on="on" />
-
+
{{ mdiFile }}
@@ -144,10 +146,7 @@
-
+
{{ mdiFile }}
@@ -164,7 +163,7 @@
{{ mdiNotebook }}
-
+
@@ -252,14 +251,14 @@
{{ detailsDialog.item.filename }}
-
+
{{ $t('History.Filesize') }}
{{ formatFilesize(detailsDialog.item.metadata.size) }}
-
+
{{ $t('History.LastModified') }}
@@ -267,7 +266,7 @@
-
+
{{ $t('History.Status') }}
@@ -278,13 +277,13 @@
}}
-
+
{{ $t('History.StartTime') }}
{{ formatDateTime(detailsDialog.item.start_time * 1000) }}
-
+
{{ $t('History.EndTime') }}
@@ -294,7 +293,7 @@
-
+
{{ $t('History.EstimatedTime') }}
@@ -303,7 +302,7 @@
-
+
{{ $t('History.PrintDuration') }}
@@ -312,7 +311,7 @@
-
+
{{ $t('History.TotalDuration') }}
@@ -322,7 +321,7 @@
-
+
{{ $t('History.EstimatedFilamentWeight') }}
@@ -332,7 +331,7 @@
-
+
{{ $t('History.EstimatedFilament') }}
@@ -341,7 +340,7 @@
-
+
{{ $t('History.FilamentUsed') }}
{{ Math.round(detailsDialog.item.filament_used) }} mm
@@ -352,7 +351,7 @@
'metadata' in detailsDialog.item &&
'first_layer_extr_temp' in detailsDialog.item.metadata
">
-
+
{{ $t('History.FirstLayerExtTemp') }}
@@ -365,7 +364,7 @@
'metadata' in detailsDialog.item &&
'first_layer_bed_temp' in detailsDialog.item.metadata
">
-
+
{{ $t('History.FirstLayerBedTemp') }}
@@ -377,7 +376,7 @@
v-if="
'metadata' in detailsDialog.item && 'first_layer_height' in detailsDialog.item.metadata
">
-
+
{{ $t('History.FirstLayerHeight') }}
@@ -387,7 +386,7 @@
-
+
{{ $t('History.LayerHeight') }}
{{ detailsDialog.item.metadata.layer_height }} mm
@@ -395,14 +394,14 @@
-
+
{{ $t('History.ObjectHeight') }}
{{ detailsDialog.item.metadata.object_height }} mm
-
+
{{ $t('History.Slicer') }}
{{ detailsDialog.item.metadata.slicer }}
@@ -410,7 +409,7 @@
-
+
{{ $t('History.SlicerVersion') }}
{{ detailsDialog.item.metadata.slicer_version }}
@@ -435,7 +434,7 @@
-
+
{{ $t('History.Cancel') }}
@@ -463,7 +462,7 @@
-
+
{{ $t('History.Cancel') }}
{{ $t('History.Delete') }}
@@ -483,16 +482,12 @@
-
+
-
+
{{ $t('History.Cancel') }}
{{ $t('History.Save') }}
@@ -511,7 +506,7 @@ import { thumbnailBigMin, thumbnailSmallMax, thumbnailSmallMin } from '@/store/v
import {
mdiDatabaseExportOutline,
mdiDelete,
- mdiRefresh,
+ mdiDatabaseArrowDownOutline,
mdiCog,
mdiPrinter,
mdiTextBoxSearch,
@@ -531,7 +526,7 @@ import {
export default class HistoryListPanel extends Mixins(BaseMixin) {
mdiDatabaseExportOutline = mdiDatabaseExportOutline
mdiDelete = mdiDelete
- mdiRefresh = mdiRefresh
+ mdiDatabaseArrowDownOutline = mdiDatabaseArrowDownOutline
mdiCog = mdiCog
mdiPrinter = mdiPrinter
mdiFileDocumentMultipleOutline = mdiFileDocumentMultipleOutline
@@ -579,6 +574,10 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
private deleteDialog = false
private deleteSelectedDialog = false
+ get allLoaded() {
+ return this.$store.state.server.history.all_loaded ?? false
+ }
+
get jobs() {
return this.$store.getters['server/history/getFilterdJobList'] ?? []
}
@@ -787,6 +786,8 @@ export default class HistoryListPanel extends Mixins(BaseMixin) {
}
refreshHistory() {
+ this.$store.dispatch('socket/addLoading', { name: 'historyLoadAll' })
+
this.$socket.emit('server.history.list', { start: 0, limit: 50 }, { action: 'server/history/getHistory' })
}
diff --git a/src/components/panels/HistoryStatisticsPanel.vue b/src/components/panels/HistoryStatisticsPanel.vue
index 8e9261c6a..a282fe979 100644
--- a/src/components/panels/HistoryStatisticsPanel.vue
+++ b/src/components/panels/HistoryStatisticsPanel.vue
@@ -69,6 +69,22 @@
{{ $t('History.Table') }}
+
+
+
+ {{ mdiDatabaseArrowDownOutline }}
+
+
+ {{ $t('History.LoadCompleteHistory') }}
+
@@ -98,12 +114,13 @@ import HistoryFilamentUsage from '@/components/charts/HistoryFilamentUsage.vue'
import HistoryPrinttimeAvg from '@/components/charts/HistoryPrinttimeAvg.vue'
import HistoryAllPrintStatusChart from '@/components/charts/HistoryAllPrintStatusChart.vue'
import { ServerHistoryStateJob } from '@/store/server/history/types'
-import { mdiChartAreaspline } from '@mdi/js'
+import { mdiChartAreaspline, mdiDatabaseArrowDownOutline } from '@mdi/js'
@Component({
components: { Panel, HistoryFilamentUsage, HistoryPrinttimeAvg, HistoryAllPrintStatusChart },
})
export default class HistoryStatisticsPanel extends Mixins(BaseMixin) {
mdiChartAreaspline = mdiChartAreaspline
+ mdiDatabaseArrowDownOutline = mdiDatabaseArrowDownOutline
get selectedJobs() {
return this.$store.state.gui.view.history.selectedJobs ?? []
@@ -197,6 +214,16 @@ export default class HistoryStatisticsPanel extends Mixins(BaseMixin) {
this.$store.dispatch('gui/saveSetting', { name: 'view.history.toggleChartCol2', value: newVal })
}
+ get allLoaded() {
+ return this.$store.state.server.history.all_loaded ?? false
+ }
+
+ refreshHistory() {
+ this.$store.dispatch('socket/addLoading', { name: 'historyLoadAll' })
+
+ this.$socket.emit('server.history.list', { start: 0, limit: 50 }, { action: 'server/history/getHistory' })
+ }
+
formatPrintTime(totalSeconds: number) {
if (totalSeconds) {
let output = ''
diff --git a/src/locales/de.json b/src/locales/de.json
index 56a3df8d8..5794525fe 100644
--- a/src/locales/de.json
+++ b/src/locales/de.json
@@ -351,6 +351,7 @@
"Jobs": "Drucke",
"LastModified": "Zuletzt geändert",
"LayerHeight": "Schichthöhe",
+ "LoadCompleteHistory": "Lade vollständige Historie",
"LongestPrinttime": "Druckzeit - längste",
"Note": "Notiz",
"ObjectHeight": "Objekthöhe",
@@ -381,8 +382,6 @@
},
"Table": "Tabelle",
"TitleExportHistory": "Historie exportieren",
- "TitleRefreshHistory": "Historie aktualisieren",
- "TitleSettings": "Einstellungen",
"TotalDuration": "Gesamtdauer",
"TotalFilamentUsed": "Filament verwendet - gesamt",
"TotalJobs": "Druckvorgänge - gesamt",
diff --git a/src/locales/en.json b/src/locales/en.json
index 643ccf94a..8cb6bda38 100644
--- a/src/locales/en.json
+++ b/src/locales/en.json
@@ -351,6 +351,7 @@
"Jobs": "Jobs",
"LastModified": "Last Modified",
"LayerHeight": "Layer Height",
+ "LoadCompleteHistory": "Load complete history",
"LongestPrinttime": "Longest Print Time",
"Note": "Note",
"ObjectHeight": "Object Height",
@@ -381,8 +382,6 @@
},
"Table": "Table",
"TitleExportHistory": "Export History",
- "TitleRefreshHistory": "Refresh History",
- "TitleSettings": "Settings",
"TotalDuration": "Total Time",
"TotalFilamentUsed": "Total Filament Used",
"TotalJobs": "Total Jobs",
diff --git a/src/pages/History.vue b/src/pages/History.vue
index 372b780d3..84ef0fd35 100644
--- a/src/pages/History.vue
+++ b/src/pages/History.vue
@@ -1,15 +1,13 @@
-
-
-
+
-
+
diff --git a/src/store/server/history/actions.ts b/src/store/server/history/actions.ts
index 6f23255de..455fc8c4c 100644
--- a/src/store/server/history/actions.ts
+++ b/src/store/server/history/actions.ts
@@ -9,7 +9,11 @@ export const actions: ActionTree = {
},
init() {
- Vue.$socket.emit('server.history.list', { start: 0, limit: 50 }, { action: 'server/history/getHistory' })
+ Vue.$socket.emit(
+ 'server.history.list',
+ { start: 0, limit: 50, max: 100 },
+ { action: 'server/history/getHistory' }
+ )
Vue.$socket.emit('server.history.totals', {}, { action: 'server/history/getTotals' })
},
@@ -18,23 +22,37 @@ export const actions: ActionTree = {
},
async getHistory({ commit, dispatch, state }, payload) {
- if ('requestParams' in payload && 'start' in payload.requestParams && payload.requestParams.start === 0)
- await commit('resetJobs')
+ if ('requestParams' in payload && (payload.requestParams?.start ?? 0) === 0) commit('resetJobs')
payload.jobs?.forEach((job: ServerHistoryStateJob) => {
if (state.jobs.findIndex((stateJob) => stateJob.job_id === job.job_id) === -1) commit('addJob', job)
})
- if (payload.requestParams?.limit > 0 && payload.jobs?.length === payload.requestParams.limit)
+ const start = payload.requestParams?.start ?? 0
+ const limit = payload.requestParams?.limit ?? 50
+ const max = payload.requestParams?.max ?? null
+
+ if (limit > 0 && (max === null || max > start + limit) && payload.jobs?.length === limit) {
Vue.$socket.emit(
'server.history.list',
{
- start: payload.requestParams.start + payload.requestParams.limit,
- limit: payload.requestParams.limit,
+ start: start + limit,
+ limit: limit,
+ max: max,
},
{ action: 'server/history/getHistory' }
)
- else await dispatch('loadHistoryNotes')
+
+ // stop here until all pulls are done
+ return
+ }
+
+ if (payload.jobs?.length < limit) {
+ dispatch('socket/removeLoading', { name: 'historyLoadAll' }, { root: true })
+ commit('setAllLoaded')
+ }
+
+ dispatch('loadHistoryNotes')
},
loadHistoryNotes({ dispatch, rootState }) {
diff --git a/src/store/server/history/index.ts b/src/store/server/history/index.ts
index ca245f4f2..8e1acead3 100644
--- a/src/store/server/history/index.ts
+++ b/src/store/server/history/index.ts
@@ -15,6 +15,7 @@ export const getDefaultState = (): ServerHistoryState => {
longest_job: 0,
longest_print: 0,
},
+ all_loaded: false,
}
}
diff --git a/src/store/server/history/mutations.ts b/src/store/server/history/mutations.ts
index 188c2fab0..9ee7a3129 100644
--- a/src/store/server/history/mutations.ts
+++ b/src/store/server/history/mutations.ts
@@ -37,4 +37,8 @@ export const mutations: MutationTree = {
const index = state.jobs.findIndex((job) => job.job_id === payload)
if (index !== -1) state.jobs.splice(index, 1)
},
+
+ setAllLoaded(state) {
+ Vue.set(state, 'all_loaded', true)
+ },
}
diff --git a/src/store/server/history/types.ts b/src/store/server/history/types.ts
index 2c36f048c..90b5ce7e8 100644
--- a/src/store/server/history/types.ts
+++ b/src/store/server/history/types.ts
@@ -8,6 +8,7 @@ export interface ServerHistoryState {
longest_job: number
longest_print: number
}
+ all_loaded: boolean
}
export interface ServerHistoryStateJob {
|