mirror of
https://github.com/portainer/portainer.git
synced 2025-07-25 08:19:40 +02:00
feat(kubeconfig): kubeconfig download functionality EE-1202 (#5386)
* backend migration/backport * Feat(kubeconfig): kubeconfig download button frontend EE-1202 (#5385) * kubeconfig download button frontend * fix kubeconfig download button * backend migration/backport * moved ng-if up one level Co-authored-by: zees-dev <dev.786zshan@gmail.com> * resolved conflicts, updated code * - kube-config -> kube-config-download-button - fixed kubeconfig file name (bug) Co-authored-by: Richard Wei <54336863+WaysonWei@users.noreply.github.com>
This commit is contained in:
parent
e8a6f15210
commit
b4f4ef701a
8 changed files with 40 additions and 16 deletions
|
@ -0,0 +1,15 @@
|
|||
export default class KubeConfigController {
|
||||
/* @ngInject */
|
||||
constructor($window, KubernetesConfigService) {
|
||||
this.$window = $window;
|
||||
this.KubernetesConfigService = KubernetesConfigService;
|
||||
}
|
||||
|
||||
async downloadKubeconfig() {
|
||||
await this.KubernetesConfigService.downloadConfig();
|
||||
}
|
||||
|
||||
$onInit() {
|
||||
this.state = { isHTTPS: this.$window.location.protocol === 'https:' };
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
<button
|
||||
ng-if="$ctrl.state.isHTTPS"
|
||||
type="button"
|
||||
class="btn btn-xs btn-primary"
|
||||
ng-click="$ctrl.downloadKubeconfig()"
|
||||
analytics-on
|
||||
analytics-category="kubernetes"
|
||||
analytics-event="kubernetes-kubectl-kubeconfig"
|
||||
>
|
||||
Kubeconfig <i class="fas fa-download space-right"></i>
|
||||
</button>
|
|
@ -0,0 +1,7 @@
|
|||
import angular from 'angular';
|
||||
import controller from './kube-config-download-button.controller';
|
||||
|
||||
angular.module('portainer.kubernetes').component('kubeConfigDownloadButton', {
|
||||
templateUrl: './kube-config-download-button.html',
|
||||
controller,
|
||||
});
|
Loading…
Add table
Add a link
Reference in a new issue