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 authored and Skraye committed Sep 5, 2024
1 parent abe2086 commit 81d54ef
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 @@ -493,6 +500,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 @@ -568,7 +576,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 @@ -641,6 +648,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 @@ -676,19 +694,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 @@ -765,7 +786,7 @@
},
deleteExecutions() {
const includeNonTerminated = ref(false);

const deleteLogs = ref(true);
const deleteMetrics = ref(true);
const deleteStorage = ref(true);
Expand All @@ -784,7 +805,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 @@ -633,6 +633,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 81d54ef

Please sign in to comment.