-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(frontend): mongo这里的变更脚本执行提供下载地址 #8771
Showing
13 changed files
with
467 additions
and
600 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
74 changes: 74 additions & 0 deletions
74
...ts/flow-info/components/flow-type-inner-flow/components/MongodbExecScriptDownloadFile.vue
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,74 @@ | ||
<template> | ||
<BkButton | ||
text | ||
theme="primary" | ||
@click="handleShowFile"> | ||
{{ t('查看结果文件') }} | ||
</BkButton> | ||
<BkDialog | ||
v-model:is-show="isShow" | ||
:title="t('查看结果文件')" | ||
:width="1140"> | ||
<BkTable | ||
:data="details.ticket_data.rules" | ||
:height="460"> | ||
<BkTableColumn | ||
field="path" | ||
:label="t('路径')" /> | ||
<BkTableColumn | ||
:label="t('操作')" | ||
:width="100"> | ||
<template #default="{ data: rowData }: { data: Props['details']['ticket_data']['rules'][number] }"> | ||
<BkButton | ||
text | ||
theme="primary" | ||
@click="handleDownloadFile(rowData.path)"> | ||
{{ t('下载') }} | ||
</BkButton> | ||
</template> | ||
</BkTableColumn> | ||
</BkTable> | ||
<template #footer> | ||
<BkButton @click="handleClose">{{ t('关闭') }}</BkButton> | ||
</template> | ||
</BkDialog> | ||
</template> | ||
<script setup lang="ts"> | ||
import { useI18n } from 'vue-i18n'; | ||
import { createBkrepoAccessToken } from '@services/source/storage'; | ||
import { downloadUrl, generateBkRepoDownloadUrl } from '@utils'; | ||
interface Props { | ||
details: { | ||
ticket_data: { | ||
rules: { | ||
cluster_id: number; | ||
path: string; | ||
}[]; | ||
}; | ||
}; | ||
} | ||
defineProps<Props>(); | ||
const { t } = useI18n(); | ||
const isShow = ref(false); | ||
const handleShowFile = () => { | ||
isShow.value = true; | ||
}; | ||
const handleDownloadFile = (path: string) => { | ||
createBkrepoAccessToken({ file_path: path }).then((tokenResult) => { | ||
const url = generateBkRepoDownloadUrl(tokenResult); | ||
downloadUrl(url); | ||
}); | ||
}; | ||
const handleClose = () => { | ||
isShow.value = false; | ||
}; | ||
</script> |
Oops, something went wrong.