Skip to content

Commit a2ace6f

Browse files
committed
Prevent accidental heap dump download.
Add a page with extra button to trigger a heap dump. closes codecentric#734
1 parent 86e2178 commit a2ace6f

File tree

8 files changed

+85
-15
lines changed

8 files changed

+85
-15
lines changed

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

Lines changed: 7 additions & 7 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
@@ -39,8 +39,8 @@
3939
"yamljs": "^0.3.0"
4040
},
4141
"devDependencies": {
42-
"@vue/test-utils": "^1.0.0-beta.16",
43-
"autoprefixer": "^8.6.1",
42+
"@vue/test-utils": "^1.0.0-beta.18",
43+
"autoprefixer": "^8.6.2",
4444
"babel-core": "^6.26.3",
4545
"babel-eslint": "^8.2.3",
4646
"babel-jest": "^23.0.1",

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</div>
2929
<div v-if="isOldAuditevents" class="message is-warning">
3030
<div class="message-body">
31-
<p>Audit Log is not supported for Spring Boot 1.x applications.</p>
31+
Audit Log is not supported for Spring Boot 1.x applications.
3232
</div>
3333
</div>
3434
<auditevents-list v-if="events" :instance="instance" :events="events"/>
Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<!--
2+
- Copyright 2014-2018 the original author or authors.
3+
-
4+
- Licensed under the Apache License, Version 2.0 (the "License");
5+
- you may not use this file except in compliance with the License.
6+
- You may obtain a copy of the License at
7+
-
8+
- http://www.apache.org/licenses/LICENSE-2.0
9+
-
10+
- Unless required by applicable law or agreed to in writing, software
11+
- distributed under the License is distributed on an "AS IS" BASIS,
12+
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
- See the License for the specific language governing permissions and
14+
- limitations under the License.
15+
-->
16+
17+
<template>
18+
<section class="section heapdump">
19+
<div>
20+
<div class="message is-warning">
21+
<div class="message-body">
22+
A heap dump may contain <strong>sensitive data</strong>.<br>Please handle with care.
23+
</div>
24+
</div>
25+
<div class="message is-warning">
26+
<div class="message-body">
27+
Dumping the heap may be expensive in terms of cpu and disk space.
28+
</div>
29+
</div>
30+
<a class="button is-primary" :href="`instances/${instance.id}/actuator/heapdump`" target="_blank">
31+
<font-awesome-icon icon="download"/>&nbsp;Download Heap Dump
32+
</a>
33+
</div>
34+
</section>
35+
</template>
36+
37+
<script>
38+
import Instance from '@/services/instance';
39+
40+
export default {
41+
props: {
42+
instance: {
43+
type: Instance,
44+
required: true
45+
}
46+
}
47+
}
48+
</script>
49+
50+
<style lang="scss">
51+
.heapdump {
52+
display: flex;
53+
justify-content: space-around;
54+
55+
& > div {
56+
display: flex;
57+
flex-direction: column;
58+
}
59+
}
60+
</style>

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

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ import sbaInstancesAuditevents from './auditevents';
1818
import sbaInstancesDetails from './details';
1919
import sbaInstancesEnv from './env';
2020
import sbaInstancesFlyway from './flyway';
21+
import sbaInstancesHeapdump from './heapdump';
2122
import sbaInstancesTrace from './httptrace';
2223
import sbaInstancesJolokia from './jolokia';
2324
import sbaInstancesLiquibase from './liquibase';
@@ -54,6 +55,8 @@ export default [{
5455
path: 'flyway', component: sbaInstancesFlyway, props: true, name: 'instance/flyway'
5556
}, {
5657
path: 'threaddump', component: sbaInstancesThreaddump, props: true, name: 'instance/threaddump'
58+
}, {
59+
path: 'heapdump', component: sbaInstancesHeapdump, props: true, name: 'instance/heapdump'
5760
}]
5861
}, {
5962
name: 'instance/details',
@@ -106,8 +109,7 @@ export default [{
106109
isActive: ({instance}) => instance.hasEndpoint('sessions')
107110
}, {
108111
name: 'instance/heapdump',
109-
href: params => `instances/${params.instanceId}/actuator/heapdump`,
110-
handle: 'Heapdump',
112+
handle: 'Heap Dump',
111113
order: 800,
112114
isActive: ({instance}) => instance.hasEndpoint('heapdump')
113115
}, {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
<sba-icon-button :disabled="atBottom" @click="scrollToBottom" icon="step-forward" size="lg"
3333
icon-class="rotated"/>
3434
</div>
35-
<a class="button" v-if="instance" :href="`instances/${instance.id}/logfile`" target="_blank">
35+
<a class="button" :href="`instances/${instance.id}/logfile`" target="_blank">
3636
<font-awesome-icon icon="download"/>&nbsp;Download
3737
</a>
3838
</div>

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
</div>
2929
<div v-if="isOldMetrics" class="message is-warning">
3030
<div class="message-body">
31-
<p>Metrics are not supported for Spring Boot 1.x applications.</p>
31+
Metrics are not supported for Spring Boot 1.x applications.
3232
</div>
3333
</div>
3434
<form @submit.prevent="handleSubmit" class="field" v-else-if="availableMetrics.length > 0">

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

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
-->
1616

1717
<template>
18-
<div>
18+
<div class="instances">
1919
<sba-instance-header :instance="instance" :application="application" :class="headerClass"/>
2020
<sba-instance-tabs :views="instanceViews" :instance="instance" :application="application" :class="headerClass"/>
2121
<router-view v-if="instance" :instance="instance"/>
@@ -76,3 +76,11 @@
7676
}
7777
}
7878
</script>
79+
80+
<style lang="scss">
81+
.instances {
82+
flex-grow: 1;
83+
display: flex;
84+
flex-direction: column;
85+
}
86+
</style>

0 commit comments

Comments
 (0)