Skip to content

Commit 71d4231

Browse files
committed
Polish contribution
1 parent 86c7d77 commit 71d4231

File tree

3 files changed

+63
-45
lines changed

3 files changed

+63
-45
lines changed

spring-boot-admin-server-ui/package-lock.json

Lines changed: 10 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

spring-boot-admin-server-ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
"d3-array": "^2.3.3",
2323
"d3-axis": "^1.0.12",
2424
"d3-brush": "^1.1.3",
25-
"d3-scale": "^3.1.0",
25+
"d3-scale": "^3.2.0",
2626
"d3-selection": "^1.4.0",
2727
"d3-shape": "^1.3.5",
2828
"d3-time": "^1.1.0",
@@ -55,7 +55,7 @@
5555
"eslint-plugin-vue": "^5.2.3",
5656
"html-loader": "^0.5.5",
5757
"jest": "^24.9.0",
58-
"node-sass": "^4.12.0",
58+
"node-sass": "^4.13.0",
5959
"sass-loader": "^7.3.1",
6060
"vue-template-compiler": "^2.6.10",
6161
"webpack-bundle-analyzer": "^3.6.0"

spring-boot-admin-server-ui/src/main/frontend/views/instances/threaddump/threads-list.vue

Lines changed: 51 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
- Copyright 2014-2018 the original author or authors.
2+
- Copyright 2014-2019 the original author or authors.
33
-
44
- Licensed under the Apache License, Version 2.0 (the "License");
55
- you may not use this file except in compliance with the License.
@@ -32,7 +32,7 @@
3232
<span v-text="thread.threadName" />
3333
</td>
3434
<td class="threads__timeline">
35-
<svg :id="`thread-${thread.threadId}`" height="26px" />
35+
<svg :id="`thread-${thread.threadId}`" height="32px" />
3636
</td>
3737
</tr>
3838
<tr :key="`${thread.threadId}-detail`"
@@ -49,10 +49,10 @@
4949
<td v-text="thread.threadName" />
5050
</tr>
5151
<template v-if="getThreadDetails(thread) !== null">
52-
<tr>
53-
<td v-text="$t('instances.threaddump.thread_state')" />
54-
<td v-text="getThreadDetails(thread).threadState" />
55-
</tr>
52+
<tr>
53+
<td v-text="$t('instances.threaddump.thread_state')" />
54+
<td v-text="getThreadDetails(thread).threadState" />
55+
</tr>
5656
<tr>
5757
<td v-text="$t('instances.threaddump.thread_details_blocked_count')" />
5858
<td v-text="getThreadDetails(thread).blockedCount" />
@@ -105,11 +105,11 @@
105105
</table>
106106
</template>
107107
<script>
108-
import d3 from '@/utils/d3';
109-
import moment from 'moment';
110-
import threadTag from './thread-tag';
108+
import d3 from '@/utils/d3';
109+
import moment from 'moment';
110+
import threadTag from './thread-tag';
111111
112-
const maxPixelsPerSeconds = 15;
112+
const maxPixelsPerSeconds = 15;
113113
114114
export default {
115115
props: {
@@ -132,7 +132,7 @@
132132
},
133133
methods: {
134134
getThreadDetails(thread) {
135-
return thread.timeline.find(entry => entry.start === this.showDetails[thread.threadId + '-start']).details
135+
return thread.timeline.find(entry => entry.start === this.showDetails[thread.threadId]).details
136136
},
137137
getTimeExtent(timelines) {
138138
return Object.entries(timelines).map(([, value]) => value.timeline)
@@ -146,18 +146,19 @@
146146
}), {start: Number.MAX_SAFE_INTEGER, end: Number.MIN_SAFE_INTEGER});
147147
},
148148
showThreadDetails({threadId, start}) {
149-
if (this.showDetails[threadId + '-start']) {
150-
d3.selectAll('#rect-threadid-' + threadId + '-start-' + this.showDetails[threadId + '-start'])
151-
.attr('class', d => `thread--${d.threadState.toLowerCase()}`)
149+
const previousSelectedStart = this.showDetails[threadId];
150+
if (previousSelectedStart) {
151+
d3.selectAll('#rect-threadid-' + threadId + '-start-' + previousSelectedStart)
152+
.attr('class', d => `thread thread--${d.threadState.toLowerCase()}`);
152153
}
153154
154-
this.showDetails[threadId + '-start'] ?
155-
this.$delete(this.showDetails, threadId + '-start') : this.$set(this.showDetails, threadId + '-start', start);
156-
this.showDetails[threadId] ? this.$delete(this.showDetails, threadId) :
157-
this.$set(this.showDetails, threadId, true);
158-
159-
d3.selectAll('#rect-threadid-' + threadId + '-start-' + start)
160-
.attr('class', d => `thread--${d.threadState.toLowerCase()}${this.showDetails[threadId + '-start'] ? '_clicked' : ''}`)
155+
if (previousSelectedStart === start) {
156+
this.$delete(this.showDetails, threadId)
157+
} else {
158+
this.$set(this.showDetails, threadId, start);
159+
d3.selectAll('#rect-threadid-' + threadId + '-start-' + start)
160+
.attr('class', d => `thread thread--${d.threadState.toLowerCase()} thread--clicked`)
161+
}
161162
},
162163
async drawTimelines(timelines) {
163164
if (timelines) {
@@ -185,15 +186,15 @@
185186
d.enter()
186187
.append('rect')
187188
.attr('id', 'rect-threadid-' + threadId + '-start-' + value.timeline[value.timeline.length - 1].start)
188-
.attr('class', d => `thread--${d.threadState.toLowerCase()}`)
189+
.attr('class', d => `thread thread--${d.threadState.toLowerCase()}`)
189190
.merge(d)
190191
.attr('height', '2em')
191192
.attr('x', d => x(d.start))
192193
.transition(150)
193-
.attr('width', d => Math.max(x(d.end) - x(d.start), x(d.start + 500) - x(d.start)))
194+
.attr('width', d => Math.max(x(d.end) - x(d.start), x(d.start + 500) - x(d.start)));
194195
195196
d3.selectAll('#rect-threadid-' + threadId + '-start-' + value.timeline[value.timeline.length - 1].start)
196-
.on("click", d => this.showThreadDetails({threadId: threadId, start: d.start}))
197+
.on('click', d => this.showThreadDetails({threadId: threadId, start: d.start}))
197198
});
198199
199200
this.lastEndPosition = x(end);
@@ -255,27 +256,44 @@
255256
}
256257
257258
.thread {
259+
stroke: $black;
260+
stroke-width: 1px;
261+
stroke-opacity: .1;
262+
258263
&--runnable {
259264
fill: $success;
260-
}
261265
262-
&--runnable_clicked {
263-
fill: #157d39;
266+
&:hover,
267+
&.thread--clicked {
268+
fill: darken($success, 20%)
269+
}
264270
}
265271
266-
&--timed_waiting,
267272
&--waiting {
268273
fill: $warning;
274+
275+
&:hover,
276+
&.thread--clicked {
277+
fill: darken($warning, 20%)
278+
}
269279
}
270280
271-
&--timed_waiting_clicked,
272-
&--waiting_clicked {
273-
fill: #e5c64e;
281+
&--timed_waiting {
282+
fill: $warning;
283+
284+
&:hover,
285+
&.thread--clicked {
286+
fill: darken($warning, 20%)
287+
}
274288
}
275289
276-
&--blocked,
277-
&--blocked_clicked {
290+
&--blocked {
278291
fill: $danger;
292+
293+
&:hover,
294+
&.thread--clicked {
295+
fill: darken($warning, 20%)
296+
}
279297
}
280298
}
281299
</style>

0 commit comments

Comments
 (0)