fix(ui): recomputing fetch interval before reloading to handle base interval case and have a live data reload

closes #2207
This commit is contained in:
brian.mulier
2023-09-28 11:19:43 +02:00
committed by brian-mulier-p
parent 3dcd480218
commit 44a8da8a41
2 changed files with 22 additions and 4 deletions

View File

@@ -33,7 +33,7 @@
/>
</el-form-item>
<el-form-item>
<refresh-button class="float-right" @refresh="load" />
<refresh-button class="float-right" @refresh="refresh" />
</el-form-item>
</template>
@@ -269,7 +269,8 @@
isDefaultNamespaceAllow: true,
dailyReady: false,
dblClickRouteName: "executions/update",
flowTriggerDetails: undefined
flowTriggerDetails: undefined,
recomputeInterval: false
};
},
computed: {
@@ -283,9 +284,13 @@
};
},
endDate() {
// used to be able to force refresh the base interval when auto-reloading
this.recomputeInterval;
return this.$route.query.endDate ? this.$route.query.endDate : this.$moment().toISOString(true);
},
startDate() {
// used to be able to force refresh the base interval when auto-reloading
this.recomputeInterval;
return this.$route.query.startDate ? this.$route.query.startDate : this.$moment(this.endDate)
.add(-30, "days").toISOString(true);
},
@@ -306,6 +311,10 @@
}
},
methods: {
refresh() {
this.recomputeInterval = !this.recomputeInterval;
this.load();
},
selectionMapper(execution) {
return execution.id
},

View File

@@ -28,7 +28,7 @@
/>
</el-form-item>
<el-form-item>
<refresh-button class="float-right" @refresh="load" />
<refresh-button class="float-right" @refresh="refresh" />
</el-form-item>
</template>
@@ -87,7 +87,8 @@
return {
isDefaultNamespaceAllow: true,
task: undefined,
isLoading: false
isLoading: false,
recomputeInterval: false
};
},
computed: {
@@ -104,14 +105,22 @@
return this.logLevel || this.$route.query.level || localStorage.getItem("defaultLogLevel") || "INFO";
},
endDate() {
// used to be able to force refresh the base interval when auto-reloading
this.recomputeInterval;
return this.$route.query.endDate ? this.$route.query.endDate : this.$moment().toISOString(true);
},
startDate() {
// used to be able to force refresh the base interval when auto-reloading
this.recomputeInterval;
return this.$route.query.startDate ? this.$route.query.startDate : this.$moment(this.endDate)
.add(-7, "days").toISOString(true);
}
},
methods: {
refresh() {
this.recomputeInterval = !this.recomputeInterval;
this.load();
},
loadQuery(base) {
let queryFilter = this.queryWithFilter();