Skip to content

Commit ac598e8

Browse files
nicoschmdtWilliangalvani
authored andcommitted
frontend: system-information: update temperature information periodically on the store
1 parent d0f262e commit ac598e8

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

core/frontend/src/components/system-information/SystemCondition.vue

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,6 @@ export default Vue.extend({
135135
system_information.fetchSystemInformation(FetchType.SystemCpuType)
136136
system_information.fetchSystemInformation(FetchType.SystemDiskType)
137137
system_information.fetchSystemInformation(FetchType.SystemMemoryType)
138-
system_information.fetchSystemInformation(FetchType.SystemTemperatureType)
139138
}, 2000)
140139
},
141140
beforeDestroy() {

core/frontend/src/store/system-information.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@ class SystemInformationStore extends VuexModule {
6969
{ delay: 1000 },
7070
)
7171

72+
fetchTemperatureTask = new OneMoreTime(
73+
{ delay: 2000 },
74+
)
75+
7276
@Mutation
7377
appendKernelMessage(kernel_message: [KernelMessage]): void {
7478
this.kernel_message = this.kernel_message.concat(kernel_message)
@@ -206,6 +210,11 @@ class SystemInformationStore extends VuexModule {
206210
await this.fetchSystemInformation(FetchType.SystemNetworkType)
207211
}
208212

213+
@Action
214+
async fetchTemperatureInformation(): Promise<void> {
215+
await this.fetchSystemInformation(FetchType.SystemTemperatureType)
216+
}
217+
209218
@Action
210219
async fetchSystemInformation(type: FetchType): Promise<void> {
211220
// Do not fetch system specific information if system is not populate yet
@@ -297,6 +306,7 @@ const system_information: SystemInformationStore = getModule(SystemInformationSt
297306
system_information.fetchSystem()
298307
system_information.fetchPlatformTask.setAction(system_information.fetchPlatform)
299308
system_information.fetchSystemNetworkTask.setAction(system_information.fetchNetworkInformation)
309+
system_information.fetchTemperatureTask.setAction(system_information.fetchTemperatureInformation)
300310

301311
// It appears that the store is incompatible with websockets or callbacks.
302312
// Right now the only way to have it working is to have the websocket definition outside the store

0 commit comments

Comments
 (0)