Skip to content

Commit

Permalink
feat(ui): make executions view more compact (#4728)
Browse files Browse the repository at this point in the history
  • Loading branch information
yuri1969 committed Sep 2, 2024
1 parent 6a6b441 commit 8b7f533
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 15 deletions.
51 changes: 36 additions & 15 deletions ui/src/components/executions/Executions.vue
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,13 @@
/>
</el-select>
</el-form-item>
<el-form-item>
<el-switch
:model-value="showChart"
@update:model-value="onShowChartChange"
:active-text="$t('show chart')"
/>
</el-form-item>
<el-form-item>
<filters :storage-key="filterStorageKey" />
</el-form-item>
Expand All @@ -118,7 +125,7 @@
</el-form-item>
</template>

<template #top v-if="isDisplayedTop">
<template #top v-if="showStatChart()">
<state-global-chart
v-if="daily"
class="mb-4"
Expand Down Expand Up @@ -479,6 +486,7 @@
dblClickRouteName: "executions/update",
flowTriggerDetails: undefined,
recomputeInterval: false,
showChart: ["true", null].includes(localStorage.getItem(storageKeys.SHOW_CHART)),
optionalColumns: [
{
label: "start date",
Expand Down Expand Up @@ -554,7 +562,6 @@
}
this.displayColumns = localStorage.getItem(this.storageKey)?.split(",")
|| this.optionalColumns.filter(col => col.default).map(col => col.prop);
},
computed: {
...mapState("execution", ["executions", "total"]),
Expand Down Expand Up @@ -627,6 +634,17 @@
displayColumn(column) {
return this.hidden ? !this.hidden.includes(column) : this.displayColumns.includes(column);
},
onShowChartChange(value) {
this.showChart = value;
localStorage.setItem(storageKeys.SHOW_CHART, value);
if (this.showChart) {
this.loadStats();
}
},
showStatChart() {
return this.isDisplayedTop && this.showChart;
},
refresh() {
this.recomputeInterval = !this.recomputeInterval;
this.load();
Expand Down Expand Up @@ -662,19 +680,22 @@
return _merge(base, queryFilter)
},
loadStats() {
this.dailyReady = false;
this.$store
.dispatch("stat/daily", this.loadQuery({
startDate: this.$moment(this.startDate).toISOString(true),
endDate: this.$moment(this.endDate).toISOString(true)
}, true))
.then(() => {
this.dailyReady = true;
});
},
loadData(callback) {
this.refreshDates = !this.refreshDates;
if (this.isDisplayedTop) {
this.dailyReady = false;
this.$store
.dispatch("stat/daily", this.loadQuery({
startDate: this.$moment(this.startDate).toISOString(true),
endDate: this.$moment(this.endDate).toISOString(true)
}, true))
.then(() => {
this.dailyReady = true;
});
if (this.showStatChart()) {
this.loadStats();
}
this.$store.dispatch("execution/findExecutions", this.loadQuery({
Expand Down Expand Up @@ -751,7 +772,7 @@
},
deleteExecutions() {
const includeNonTerminated = ref(false);

const deleteLogs = ref(true);
const deleteMetrics = ref(true);
const deleteStorage = ref(true);
Expand All @@ -770,7 +791,7 @@
"onUpdate:modelValue": (val) => {
includeNonTerminated.value = val
},
}),
}),
]),
h(ElAlert, {
title: this.$t("execution-warn-deleting-still-running"),
Expand Down
1 change: 1 addition & 0 deletions ui/src/translations/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,7 @@
"MAIN": "Parent Executions"
}
},
"show chart": "Show Chart",
"namespace files": {
"toggle": {
"show": "Show namespace files",
Expand Down
1 change: 1 addition & 0 deletions ui/src/utils/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ export const storageKeys = {
DISPLAY_FLOW_EXECUTIONS_COLUMNS: "displayFlowExecutionsColumns",
SELECTED_TENANT: "selectedTenant",
EXECUTE_FLOW_BEHAVIOUR: "executeFlowBehaviour",
SHOW_CHART: "showChart",
DEFAULT_NAMESPACE: "defaultNamespace",
LATEST_NAMESPACE: "latestNamespace",
PAGINATION_SIZE: "paginationSize",
Expand Down

0 comments on commit 8b7f533

Please sign in to comment.