File tree Expand file tree Collapse file tree 13 files changed +467
-600
lines changed
ticket-center/common/ticket-detail/components
flow-info/components/flow-type-inner-flow
mysql-import-sqlfile/components/render-sqlfile Expand file tree Collapse file tree 13 files changed +467
-600
lines changed Original file line number Diff line number Diff line change 3864
3864
"后端存储规格:" : " 后端存储规格:" ,
3865
3865
"SQLServer起始端口:" : " SQLServer起始端口:" ,
3866
3866
"高可用部署" : " 高可用部署" ,
3867
- "迁移提交成功" : " 迁移提交成功" ,
3868
- "集群架构:将集群的部分实例迁移到新机器,迁移保持规格、版本不变;主从架构:主从实例成对迁移到新机器上,可选择部分实例迁移,也可整机所有实例一起迁移。" : " 集群架构:将集群的部分实例迁移到新机器,迁移保持规格、版本不变;主从架构:主从实例成对迁移到新机器上,可选择部分实例迁移,也可整机所有实例一起迁移。" ,
3869
- "迁移" : " 迁移" ,
3870
- "实例迁移" : " 实例迁移" ,
3871
- "如 TendisCache 等,迁移过程保持规格、版本不变" : " 如 TendisCache 等,迁移过程保持规格、版本不变" ,
3872
- "支持部分或整机所有实例成对迁移至新主机,版本规格可变" : " 支持部分或整机所有实例成对迁移至新主机,版本规格可变" ,
3873
- "主从架构" : " 主从架构" ,
3874
- "只迁移目标实例" : " 只迁移目标实例" ,
3875
- "主机关联的所有实例一并迁移" : " 主机关联的所有实例一并迁移" ,
3876
- "整机迁移" : " 整机迁移" ,
3877
- "目标 Master 实例" : " 目标 Master 实例" ,
3878
- "实例选择" : " 实例选择" ,
3879
- "目标 Master 主机" : " 目标 Master 主机" ,
3880
- "关联的实例" : " 关联的实例" ,
3881
- "关联的主从实例" : " 关联的主从实例" ,
3882
- "目标实例输入格式有误" : " 目标实例输入格式有误" ,
3883
- "目标实例重复" : " 目标实例重复" ,
3884
- "Master 实例" : " Master 实例" ,
3885
- "请先选择主机" : " 请先选择主机" ,
3886
- "集群或实例状态异常,不可选择" : " 集群或实例状态异常,不可选择" ,
3867
+ "目标集群:" : " 目标集群:" ,
3868
+ "目标 DB:" : " 目标 DB:" ,
3869
+ "目标表名:" : " 目标表名:" ,
3870
+ "where 条件:" : " where 条件:" ,
3871
+ "导出数据:" : " 导出数据:" ,
3872
+ "脚本来源:" : " 脚本来源:" ,
3873
+ "脚本执行内容:" : " 脚本执行内容:" ,
3887
3874
"这行勿动!新增翻译请在上一行添加!" : " "
3888
3875
3889
3876
}
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ export const downloadUrl = (url: string) => {
17
17
const eleLink = document . createElement ( 'a' ) ;
18
18
eleLink . style . display = 'none' ;
19
19
eleLink . href = url ;
20
+ eleLink . target = '_blank' ;
20
21
21
22
// 触发点击
22
23
document . body . appendChild ( eleLink ) ;
Original file line number Diff line number Diff line change 60
60
:data =" state.data"
61
61
:height =" 460"
62
62
:is-anomalies =" isAnomalies"
63
- :row-height =" 56"
64
63
@refresh =" fetchKeyFiles"
65
64
@selection-change =" handleTableSelected" >
66
65
<BkTableColumn
Original file line number Diff line number Diff line change 19
19
keypath =" m_耗时_t"
20
20
scope =" global" >
21
21
<span style =" color : #ea3636 " >{{ t('执行失败') }}</span >
22
+
22
23
<CostTimer
23
24
:is-timing =" false"
24
25
:start-time =" utcTimeToSeconds(data.start_time)"
25
26
:value =" data.cost_time" />
26
27
</I18nT >
28
+ <template v-if =" ticketDetail .ticket_type === TicketTypes .MONGODB_EXEC_SCRIPT_APPLY " >
29
+ <span > ,</span >
30
+ <!-- prettier-ignore -->
31
+ <MongodbExecScriptDownloadFile :details =" (data.details as ComponentProps<typeof MongodbExecScriptDownloadFile>['details'])" />
32
+ </template >
27
33
<template v-if =" data .url " >
28
34
<span > ,</span >
29
35
<a
58
64
</StatusFailed >
59
65
</template >
60
66
<script setup lang="ts">
67
+ import type { ComponentProps } from ' vue-component-type-helpers' ;
61
68
import { useI18n } from ' vue-i18n' ;
62
69
63
70
import FlowMode from ' @services/model/ticket/flow' ;
64
71
import TicketModel from ' @services/model/ticket/ticket' ;
65
72
66
73
import { useUserProfile } from ' @stores' ;
67
74
75
+ import { TicketTypes } from ' @common/const' ;
76
+
68
77
import CostTimer from ' @components/cost-timer/CostTimer.vue' ;
69
78
70
79
import ProcessFailedTerminate from ' @views/ticket-center/common/action-confirm/ProcessFailedTerminate.vue' ;
74
83
75
84
import StatusFailed from ' ../flow-type-common/StatusFailed.vue' ;
76
85
86
+ import MongodbExecScriptDownloadFile from ' ./components/MongodbExecScriptDownloadFile.vue' ;
87
+
77
88
interface Props {
78
89
data: FlowMode ;
79
90
ticketDetail: TicketModel <unknown >;
Original file line number Diff line number Diff line change 14
14
:start-time =" utcTimeToSeconds(data.start_time)"
15
15
:value =" data.cost_time" />
16
16
</I18nT >
17
+ <template v-if =" ticketDetail .ticket_type === TicketTypes .MONGODB_EXEC_SCRIPT_APPLY " >
18
+ <span > ,</span >
19
+ <!-- prettier-ignore -->
20
+ <MongodbExecScriptDownloadFile :details =" (data.details as ComponentProps<typeof MongodbExecScriptDownloadFile>['details'])" />
21
+ </template >
17
22
<template v-if =" ticketDetail .ticket_type === TicketTypes .REDIS_KEYS_EXTRACT " >
18
23
<span > ,</span >
19
- <FlowRedisKeyExtract :id =" data.flow_obj_id" />
24
+ <RedisKeysExtractFile :id =" data.flow_obj_id" />
20
25
</template >
21
- <template v-if =" ticketDetail .ticket_type === TicketTypes .MYSQL_DUMP_DATA " >
26
+ <template
27
+ v-if =" [TicketTypes .MYSQL_DUMP_DATA , TicketTypes .TENDBCLUSTER_DUMP_DATA ].includes (ticketDetail .ticket_type ) " >
22
28
<span > ,</span >
23
29
<!-- prettier-ignore -->
24
30
<MysqlDumpDataDownload :details =" (data.details as ComponentProps<typeof MysqlDumpDataDownload>['details'])" />
48
54
49
55
import CostTimer from ' @components/cost-timer/CostTimer.vue' ;
50
56
51
- import FlowRedisKeyExtract from ' @views/db-manage/common/FlowRedisKeyExtract.vue' ;
52
-
53
57
import { utcTimeToSeconds } from ' @utils' ;
54
58
55
59
import DbTimeLineItem from ' ../time-line/TimeLineItem.vue' ;
56
60
61
+ import MongodbExecScriptDownloadFile from ' ./components/MongodbExecScriptDownloadFile.vue' ;
57
62
import MysqlDumpDataDownload from ' ./components/MysqlDumpDataDownload.vue' ;
63
+ import RedisKeysExtractFile from ' ./components/RedisKeysExtractFile.vue' ;
58
64
59
65
interface Props {
60
66
data: FlowMode <unknown >;
Original file line number Diff line number Diff line change 10
10
:start-time =" utcTimeToSeconds(data.start_time)"
11
11
:value =" data.cost_time" />
12
12
</I18nT >
13
+ <template v-if =" ticketDetail .ticket_type === TicketTypes .MONGODB_EXEC_SCRIPT_APPLY " >
14
+ <span > ,</span >
15
+ <!-- prettier-ignore -->
16
+ <MongodbExecScriptDownloadFile :details =" (data.details as ComponentProps<typeof MongodbExecScriptDownloadFile>['details'])" />
17
+ </template >
13
18
<template v-if =" data .url " >
14
19
<span > ,</span >
15
20
<a
22
27
</StatusTerminated >
23
28
</template >
24
29
<script setup lang="ts">
30
+ import type { ComponentProps } from ' vue-component-type-helpers' ;
25
31
import { useI18n } from ' vue-i18n' ;
26
32
27
33
import FlowMode from ' @services/model/ticket/flow' ;
34
+ import TicketModel from ' @services/model/ticket/ticket' ;
35
+
36
+ import { TicketTypes } from ' @common/const' ;
28
37
29
38
import CostTimer from ' @components/cost-timer/CostTimer.vue' ;
30
39
31
40
import { utcTimeToSeconds } from ' @utils' ;
32
41
33
42
import StatusTerminated from ' ../flow-type-common/StatusTerminated.vue' ;
34
43
44
+ import MongodbExecScriptDownloadFile from ' ./components/MongodbExecScriptDownloadFile.vue' ;
45
+
35
46
interface Props {
36
47
data: FlowMode ;
48
+ ticketDetail: TicketModel <unknown >;
37
49
}
38
50
39
51
defineProps <Props >();
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <BkButton
3
+ text
4
+ theme =" primary"
5
+ @click =" handleShowFile" >
6
+ {{ t('查看结果文件') }}
7
+ </BkButton >
8
+ <BkDialog
9
+ v-model:is-show =" isShow"
10
+ :title =" t('查看结果文件')"
11
+ :width =" 1140" >
12
+ <BkTable
13
+ :data =" details.ticket_data.rules"
14
+ :height =" 460" >
15
+ <BkTableColumn
16
+ field =" path"
17
+ :label =" t('路径')" />
18
+ <BkTableColumn
19
+ :label =" t('操作')"
20
+ :width =" 100" >
21
+ <template #default =" { data: rowData }: { data: Props [' details' ][' ticket_data' ][' rules' ][number ] } " >
22
+ <BkButton
23
+ text
24
+ theme =" primary"
25
+ @click =" handleDownloadFile(rowData.path)" >
26
+ {{ t('下载') }}
27
+ </BkButton >
28
+ </template >
29
+ </BkTableColumn >
30
+ </BkTable >
31
+ <template #footer >
32
+ <BkButton @click =" handleClose" >{{ t('关闭') }}</BkButton >
33
+ </template >
34
+ </BkDialog >
35
+ </template >
36
+ <script setup lang="ts">
37
+ import { useI18n } from ' vue-i18n' ;
38
+
39
+ import { createBkrepoAccessToken } from ' @services/source/storage' ;
40
+
41
+ import { downloadUrl , generateBkRepoDownloadUrl } from ' @utils' ;
42
+
43
+ interface Props {
44
+ details: {
45
+ ticket_data: {
46
+ rules: {
47
+ cluster_id: number ;
48
+ path: string ;
49
+ }[];
50
+ };
51
+ };
52
+ }
53
+
54
+ defineProps <Props >();
55
+
56
+ const { t } = useI18n ();
57
+
58
+ const isShow = ref (false );
59
+
60
+ const handleShowFile = () => {
61
+ isShow .value = true ;
62
+ };
63
+
64
+ const handleDownloadFile = (path : string ) => {
65
+ createBkrepoAccessToken ({ file_path: path }).then ((tokenResult ) => {
66
+ const url = generateBkRepoDownloadUrl (tokenResult );
67
+ downloadUrl (url );
68
+ });
69
+ };
70
+
71
+ const handleClose = () => {
72
+ isShow .value = false ;
73
+ };
74
+ </script >
You can’t perform that action at this time.
0 commit comments