You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
portainer/app/kubernetes/services/kubeconfigService.js

21 lines
689 B

import angular from 'angular';
class KubernetesConfigService {
/* @ngInject */
constructor(KubernetesConfig, FileSaver) {
this.KubernetesConfig = KubernetesConfig;
this.FileSaver = FileSaver;
}
async downloadConfig() {
const response = await this.KubernetesConfig.get();
const headers = response.headers();
const contentDispositionHeader = headers['content-disposition'];
const filename = contentDispositionHeader.replace('attachment;', '').trim();
return this.FileSaver.saveAs(response.data, filename);
}
}
export default KubernetesConfigService;
angular.module('portainer.kubernetes').service('KubernetesConfigService', KubernetesConfigService);