File tree Expand file tree Collapse file tree 6 files changed +54
-14
lines changed Expand file tree Collapse file tree 6 files changed +54
-14
lines changed Original file line number Diff line number Diff line change @@ -177,6 +177,13 @@ onUnmounted(() => {
177
177
<template >
178
178
<transition mode =" out-in" >
179
179
<div class =" ej-common-view-div" v-if =" analysis.phase == Phase.INIT" v-loading =" true" ></div >
180
+ <div
181
+ class =" ej-common-view-div"
182
+ style =" display : flex ; flex-direction : column ; justify-content : center ; align-items : center "
183
+ v-else-if =" analysis.phase === Phase.SETUP || analysis.showSetupPage === true"
184
+ >
185
+ <component :is =" setupComponent" @confirmAnalysisOptions =" analyze" ></component >
186
+ </div >
180
187
<div
181
188
class =" ej-common-view-div"
182
189
style =" display : flex ; flex-direction : column ; justify-content : start "
@@ -202,13 +209,6 @@ onUnmounted(() => {
202
209
<p v-if =" log" style =" white-space : pre-line " >{{ log }}</p >
203
210
</div >
204
211
</div >
205
- <div
206
- class =" ej-common-view-div"
207
- style =" display : flex ; flex-direction : column ; justify-content : center ; align-items : center "
208
- v-else-if =" analysis.phase === Phase.SETUP"
209
- >
210
- <component :is =" setupComponent" @confirmAnalysisOptions =" analyze" ></component >
211
- </div >
212
212
<component :is =" analysisComponent" v-else-if =" analysis.phase == Phase.SUCCESS" ></component >
213
213
</transition >
214
214
</template >
Original file line number Diff line number Diff line change 12
12
-->
13
13
<script setup lang="ts">
14
14
import { hdt } from ' @/components/heapdump/utils' ;
15
+ import { Phase , useAnalysisStore } from ' @/stores/analysis' ;
15
16
import { InfoFilled } from ' @element-plus/icons-vue' ;
16
17
import { t } from ' @/i18n/i18n' ;
17
18
19
+ import { useAnalysisApiRequester } from ' @/composables/analysis-api-requester' ;
20
+
21
+ const { request } = useAnalysisApiRequester ();
22
+ const analysis = useAnalysisStore ();
23
+
18
24
const emit = defineEmits ([' confirmAnalysisOptions' ]);
19
25
20
26
const options = reactive ({
@@ -27,7 +33,16 @@ const options = reactive({
27
33
});
28
34
29
35
function onConfirm() {
30
- emit (' confirmAnalysisOptions' , options );
36
+ request (' clean' ).then (() => {
37
+ analysis .leaveGuard = false ;
38
+ analysis .setPhase (Phase .INIT )
39
+ analysis .setShowSetupPage (false );
40
+ emit (' confirmAnalysisOptions' , options );
41
+ });
42
+ }
43
+
44
+ function onCancel() {
45
+ analysis .setShowSetupPage (false );
31
46
}
32
47
33
48
const enableDiscard = computed (() => options .discard_objects );
@@ -183,6 +198,9 @@ const enableDiscard = computed(() => options.discard_objects);
183
198
</el-form-item >
184
199
<el-form-item >
185
200
<el-button type =" primary" @click =" onConfirm" >{{ t('common.confirm') }}</el-button >
201
+ <el-button @click =" onCancel" v-if =" analysis.phase !== Phase.INIT && analysis.phase !== Phase.SETUP" >
202
+ {{ t('common.cancel') }}
203
+ </el-button >
186
204
</el-form-item >
187
205
</el-form >
188
206
</template >
Original file line number Diff line number Diff line change 12
12
-->
13
13
<script setup lang="ts">
14
14
import DownloadLink from ' @/components/common/DownloadLink.vue' ;
15
- import { SetUp } from ' @element-plus/icons-vue' ;
15
+ import { SetUp , Delete } from ' @element-plus/icons-vue' ;
16
16
import { t } from ' @/i18n/i18n' ;
17
17
import { useAnalysisApiRequester } from ' @/composables/analysis-api-requester' ;
18
18
import { Phase , useAnalysisStore } from ' @/stores/analysis' ;
19
19
20
20
const { request } = useAnalysisApiRequester ();
21
21
22
22
const analysis = useAnalysisStore ();
23
- function clean() {
23
+
24
+ function showSetup() {
25
+ analysis .setShowSetupPage (true )
26
+ }
27
+
28
+ function discard() {
24
29
request (' clean' ).then (() => {
25
30
useAnalysisStore ().leaveGuard = false ;
26
31
location .reload ();
27
32
});
28
33
}
34
+
29
35
</script >
30
36
<template >
31
37
<el-divider direction =" vertical" />
@@ -34,8 +40,14 @@ function clean() {
34
40
<template v-if =" analysis .phase === Phase .SUCCESS || analysis .phase === Phase .FAILURE " >
35
41
<el-divider direction =" vertical" />
36
42
37
- <el-button link class =" ej-header-button" :icon =" SetUp" @click =" clean " >
43
+ <el-button link class =" ej-header-button" :icon =" SetUp" @click =" showSetup " >
38
44
{{ t('analysis.setting') }}
39
45
</el-button >
40
46
</template >
47
+ <template v-if =" analysis .phase === Phase .SUCCESS " >
48
+ <el-divider direction =" vertical" />
49
+ <el-button link class =" ej-header-button" :icon =" Delete" @click =" discard" >
50
+ {{ t('analysis.discard') }}
51
+ </el-button >
52
+ </template >
41
53
</template >
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export default {
18
18
jifa : {
19
19
common : {
20
20
confirm : 'Confirm' ,
21
+ cancel : 'Cancel' ,
21
22
submit : 'Submit' ,
22
23
back : 'Back' ,
23
24
operations : 'Operations' ,
@@ -115,7 +116,8 @@ export default {
115
116
success : 'Analysis successful' ,
116
117
comparison : 'Comparison' ,
117
118
selectComparisonTargets : 'Select Targets' ,
118
- setting : 'Setting'
119
+ setting : 'Setting' ,
120
+ discard : 'Discard'
119
121
} ,
120
122
121
123
heapDump,
Original file line number Diff line number Diff line change @@ -18,6 +18,7 @@ export default {
18
18
jifa : {
19
19
common : {
20
20
confirm : '确定' ,
21
+ cancel : '取消' ,
21
22
submit : '提交' ,
22
23
back : '返回' ,
23
24
operations : '操作' ,
@@ -115,7 +116,8 @@ export default {
115
116
success : '分析成功' ,
116
117
comparison : '分析对比' ,
117
118
selectComparisonTargets : '选择对比目标' ,
118
- setting : '分析设置'
119
+ setting : '分析设置' ,
120
+ discard : '销毁分析结果'
119
121
} ,
120
122
121
123
heapDump,
Original file line number Diff line number Diff line change @@ -31,7 +31,9 @@ export const useAnalysisStore = defineStore('analysis', {
31
31
32
32
phase : null as Phase | null ,
33
33
34
- leaveGuard : true
34
+ leaveGuard : true ,
35
+
36
+ showSetupPage : false
35
37
} ) ,
36
38
37
39
actions : {
@@ -47,6 +49,10 @@ export const useAnalysisStore = defineStore('analysis', {
47
49
48
50
setPhase ( phase : Phase | null ) {
49
51
this . phase = phase ;
52
+ } ,
53
+
54
+ setShowSetupPage ( showSetupPage : boolean ) {
55
+ this . showSetupPage = showSetupPage
50
56
}
51
57
}
52
58
} ) ;
You can’t perform that action at this time.
0 commit comments