Skip to content

Commit 471721b

Browse files
committed
fix: refactor accordion component to use watch for open state changes
1 parent f8ac137 commit 471721b

4 files changed

Lines changed: 21 additions & 20 deletions

File tree

spring-boot-admin-server-ui/src/main/frontend/views/instances/httpexchanges/exchanges-chart.vue

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,6 @@ import {
3232
} from 'chart.js';
3333
import 'chartjs-adapter-moment';
3434
import { parse } from 'iso8601-duration';
35-
import moment from 'moment';
3635
import { markRaw } from 'vue';
3736
3837
import { toMilliseconds } from '@/utils/iso8601-duration';
@@ -55,7 +54,6 @@ export default {
5554
default: () => [],
5655
},
5756
},
58-
emits: ['selected'],
5957
data: () => ({
6058
chart: null,
6159
cachedChartData: [],
@@ -66,14 +64,14 @@ export default {
6664
return [];
6765
}
6866
const chartData = [];
69-
const now = moment().valueOf();
7067
let idx = this.exchanges.length - 1;
7168
const oldest =
7269
this.exchanges[this.exchanges.length - 1].timestamp.valueOf();
70+
const newest = this.exchanges[0].timestamp.valueOf();
7371
7472
for (
7573
let time = Math.floor(oldest.valueOf() / interval) * interval;
76-
time < now;
74+
time <= newest;
7775
time += interval
7876
) {
7977
const bucket = {

spring-boot-admin-server-ui/src/main/frontend/views/instances/httpexchanges/i18n.de.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@
1313
"limit": "Limit",
1414
"filter": {
1515
"client_errors": "Client-Fehler",
16-
"exclude_actuator": "ignoriere {actuator}/**",
16+
"exclude_actuator": "Ignoriere {actuator}/**",
1717
"server_errors": "Server-Fehler",
18-
"success": "erfolgreich"
18+
"success": "Erfolgreich"
1919
},
2020
"method": "Methode",
2121
"no_data": "Keine Anzeigedaten vorhanden.",

spring-boot-admin-server-ui/src/main/frontend/views/instances/httpexchanges/i18n.en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"instances": {
33
"httpexchanges": {
4-
"auto_follow": "Follow tail",
4+
"auto_follow": "Auto update",
55
"label": "HTTP Exchanges",
66
"chart": {
77
"avg_time": "ø duration",

spring-boot-admin-server-ui/src/main/frontend/views/instances/httpexchanges/index.vue

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -51,10 +51,6 @@
5151
</sba-input>
5252

5353
<div class="grid grid-rows-2 grid-flow-col gap-x-2 text-sm">
54-
<sba-checkbox
55-
v-model="autoFollow"
56-
:label="$t('instances.httpexchanges.auto_follow')"
57-
/>
5854
<sba-checkbox
5955
v-model="filter.showSuccess"
6056
:label="$t('instances.httpexchanges.filter.success')"
@@ -76,16 +72,25 @@
7672
"
7773
/>
7874
</div>
75+
<div>
76+
<sba-button
77+
:title="$t('instances.httpexchanges.auto_follow')"
78+
:primary="autoFollow"
79+
@click="autoFollow = !autoFollow"
80+
>
81+
<font-awesome-icon :icon="faArrowsDownToLine" />
82+
<span
83+
class="sr-only"
84+
v-text="$t('instances.httpexchanges.auto_follow')"
85+
/>
86+
</sba-button>
87+
</div>
7988
</div>
8089
</sba-sticky-subnav>
8190
</template>
8291

8392
<sba-panel>
84-
<sba-exchanges-chart
85-
:exchanges="filteredExchanges"
86-
class="mb-6"
87-
@selected="updateSelection"
88-
/>
93+
<sba-exchanges-chart :exchanges="listedExchanges" class="mb-6" />
8994
</sba-panel>
9095

9196
<sba-panel seamless>
@@ -95,6 +100,7 @@
95100
</template>
96101

97102
<script>
103+
import { faArrowsDownToLine } from '@fortawesome/free-solid-svg-icons';
98104
import { debounce } from 'lodash-es';
99105
import moment from 'moment';
100106
import { take } from 'rxjs/operators';
@@ -134,6 +140,7 @@ export default {
134140
error: null,
135141
exchanges: [],
136142
listOffset: 0,
143+
faArrowsDownToLine,
137144
filter: {
138145
excludeActuator: true,
139146
showSuccess: true,
@@ -182,10 +189,6 @@ export default {
182189
},
183190
},
184191
methods: {
185-
updateSelection(selection) {
186-
this.selection = selection;
187-
this.showNewExchanges();
188-
},
189192
showNewExchanges() {
190193
this.listOffset = 0;
191194
},

0 commit comments

Comments
 (0)