File tree Expand file tree Collapse file tree 13 files changed +467
-580
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
-580
lines changed Original file line number Diff line number Diff line change 38783878 "Mongo分片集群" : " Mongo 分片集群" ,
38793879 "sqlserver单节点版" : " sqlserver 单节点版" ,
38803880 "sqlserver主从版" : " sqlserver 主从版" ,
3881+ "目标集群:" : " 目标集群:" ,
3882+ "目标 DB:" : " 目标 DB:" ,
3883+ "目标表名:" : " 目标表名:" ,
3884+ "where 条件:" : " where 条件:" ,
3885+ "导出数据:" : " 导出数据:" ,
3886+ "脚本来源:" : " 脚本来源:" ,
3887+ "脚本执行内容:" : " 脚本执行内容:" ,
38813888 "这行勿动!新增翻译请在上一行添加!" : " "
38823889}
Original file line number Diff line number Diff line change @@ -17,6 +17,7 @@ export const downloadUrl = (url: string) => {
1717 const eleLink = document . createElement ( 'a' ) ;
1818 eleLink . style . display = 'none' ;
1919 eleLink . href = url ;
20+ eleLink . target = '_blank' ;
2021
2122 // 触发点击
2223 document . body . appendChild ( eleLink ) ;
Original file line number Diff line number Diff line change 6060 :data =" state.data"
6161 :height =" 460"
6262 :is-anomalies =" isAnomalies"
63- :row-height =" 56"
6463 @refresh =" fetchKeyFiles"
6564 @selection-change =" handleTableSelected" >
6665 <BkTableColumn
Original file line number Diff line number Diff line change 1919 keypath =" m_耗时_t"
2020 scope =" global" >
2121 <span style =" color : #ea3636 " >{{ t('执行失败') }}</span >
22+
2223 <CostTimer
2324 :is-timing =" false"
2425 :start-time =" utcTimeToSeconds(data.start_time)"
2526 :value =" data.cost_time" />
2627 </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 >
2733 <template v-if =" data .url " >
2834 <span > ,</span >
2935 <a
5864 </StatusFailed >
5965</template >
6066<script setup lang="ts">
67+ import type { ComponentProps } from ' vue-component-type-helpers' ;
6168 import { useI18n } from ' vue-i18n' ;
6269
6370 import FlowMode from ' @services/model/ticket/flow' ;
6471 import TicketModel from ' @services/model/ticket/ticket' ;
6572
6673 import { useUserProfile } from ' @stores' ;
6774
75+ import { TicketTypes } from ' @common/const' ;
76+
6877 import CostTimer from ' @components/cost-timer/CostTimer.vue' ;
6978
7079 import ProcessFailedTerminate from ' @views/ticket-center/common/action-confirm/ProcessFailedTerminate.vue' ;
7483
7584 import StatusFailed from ' ../flow-type-common/StatusFailed.vue' ;
7685
86+ import MongodbExecScriptDownloadFile from ' ./components/MongodbExecScriptDownloadFile.vue' ;
87+
7788 interface Props {
7889 data: FlowMode ;
7990 ticketDetail: TicketModel <unknown >;
Original file line number Diff line number Diff line change 1414 :start-time =" utcTimeToSeconds(data.start_time)"
1515 :value =" data.cost_time" />
1616 </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 >
1722 <template v-if =" ticketDetail .ticket_type === TicketTypes .REDIS_KEYS_EXTRACT " >
1823 <span > ,</span >
19- <FlowRedisKeyExtract :id =" data.flow_obj_id" />
24+ <RedisKeysExtractFile :id =" data.flow_obj_id" />
2025 </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 ) " >
2228 <span > ,</span >
2329 <!-- prettier-ignore -->
2430 <MysqlDumpDataDownload :details =" (data.details as ComponentProps<typeof MysqlDumpDataDownload>['details'])" />
4854
4955 import CostTimer from ' @components/cost-timer/CostTimer.vue' ;
5056
51- import FlowRedisKeyExtract from ' @views/db-manage/common/FlowRedisKeyExtract.vue' ;
52-
5357 import { utcTimeToSeconds } from ' @utils' ;
5458
5559 import DbTimeLineItem from ' ../time-line/TimeLineItem.vue' ;
5660
61+ import MongodbExecScriptDownloadFile from ' ./components/MongodbExecScriptDownloadFile.vue' ;
5762 import MysqlDumpDataDownload from ' ./components/MysqlDumpDataDownload.vue' ;
63+ import RedisKeysExtractFile from ' ./components/RedisKeysExtractFile.vue' ;
5864
5965 interface Props {
6066 data: FlowMode <unknown >;
Original file line number Diff line number Diff line change 1010 :start-time =" utcTimeToSeconds(data.start_time)"
1111 :value =" data.cost_time" />
1212 </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 >
1318 <template v-if =" data .url " >
1419 <span > ,</span >
1520 <a
2227 </StatusTerminated >
2328</template >
2429<script setup lang="ts">
30+ import type { ComponentProps } from ' vue-component-type-helpers' ;
2531 import { useI18n } from ' vue-i18n' ;
2632
2733 import FlowMode from ' @services/model/ticket/flow' ;
34+ import TicketModel from ' @services/model/ticket/ticket' ;
35+
36+ import { TicketTypes } from ' @common/const' ;
2837
2938 import CostTimer from ' @components/cost-timer/CostTimer.vue' ;
3039
3140 import { utcTimeToSeconds } from ' @utils' ;
3241
3342 import StatusTerminated from ' ../flow-type-common/StatusTerminated.vue' ;
3443
44+ import MongodbExecScriptDownloadFile from ' ./components/MongodbExecScriptDownloadFile.vue' ;
45+
3546 interface Props {
3647 data: FlowMode ;
48+ ticketDetail: TicketModel <unknown >;
3749 }
3850
3951 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