Get_Credentials requirement in Advanced Cluster Managemnt
- Added get credentials button under k8s action to download the
get credentials .yaml file
Change-Id: I38f8017e5265e4e8abaf12340a1c85c98c08fc22
Signed-off-by: SANDHYA.JS <sandhya.j@tataelxsi.co.in>
diff --git a/src/services/SharedService.ts b/src/services/SharedService.ts
index 4b7bc76..2a87382 100644
--- a/src/services/SharedService.ts
+++ b/src/services/SharedService.ts
@@ -246,9 +246,17 @@
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const newVariable: any = window.navigator;
if (newVariable.msSaveOrOpenBlob) {
- newVariable.msSaveBlob(new Blob(binaryData, { type: filetype }), 'OSM_Export_' + name + '.tar.gz');
+ if (filetype === 'text/plain') {
+ newVariable.msSaveBlob(new Blob(binaryData, { type: 'text/yaml' }), 'OSM_Export_' + name + '.yaml');
+ } else {
+ newVariable.msSaveBlob(new Blob(binaryData, { type: filetype }), 'OSM_Export_' + name + '.tar.gz');
+ }
} else {
- downloadLink.setAttribute('download', 'OSM_Export_' + name + '.tar.gz');
+ if (filetype === 'text/plain') {
+ downloadLink.setAttribute('download', 'OSM_Export_' + name + '.yaml');
+ } else {
+ downloadLink.setAttribute('download', 'OSM_Export_' + name + '.tar.gz');
+ }
document.body.appendChild(downloadLink);
downloadLink.click();
}