From a77e9fbc9928cd28a712b48578c93f37fb8c0dcf Mon Sep 17 00:00:00 2001 From: Jeffrey Date: Thu, 17 Aug 2023 09:11:01 +0800 Subject: [PATCH] (chores)(ui) download profile filename add profile_id (#23065) --- ui/src/pages/query-profile/index.tsx | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/ui/src/pages/query-profile/index.tsx b/ui/src/pages/query-profile/index.tsx index a5bb13b204..a71698cec4 100644 --- a/ui/src/pages/query-profile/index.tsx +++ b/ui/src/pages/query-profile/index.tsx @@ -83,7 +83,8 @@ export default function QueryProfile(params: any) { .column_names ) { download( - profileDetailRes.data + profileDetailRes.data, + row['Profile ID'] ); } } @@ -125,13 +126,13 @@ export default function QueryProfile(params: any) { history.push('/QueryProfile/'); } - function download(profile: string) { + function download(profile: string, profileId: string) { const profileTxt = replaceToTxt(profile); const blob = new Blob([profileTxt], { type: 'text/plain', }); const tagA = document.createElement('a'); - tagA.download = `profile_${new Date().valueOf()}.txt`; + tagA.download = `profile_${profileId}.txt`; tagA.style.display = 'none'; tagA.href = URL.createObjectURL(blob); document.body.appendChild(tagA); @@ -167,7 +168,8 @@ export default function QueryProfile(params: any) {