mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 15:29:42 +02:00
feat(k8s/resources-list-view): add advanced deployment panel to resources list view (#4516)
* feat(k8s/resources-list-view): add advanced deployment panel to applications view, configurations view and volumes view * feat(k8s/resources-list-view): move advanced deployment into a template and use it everywhere
This commit is contained in:
parent
b924347c5b
commit
7848bcf2f4
9 changed files with 46 additions and 15 deletions
11
app/kubernetes/templates/advancedDeploymentPanel.html
Normal file
11
app/kubernetes/templates/advancedDeploymentPanel.html
Normal file
|
@ -0,0 +1,11 @@
|
||||||
|
<information-panel title-text="Advanced deployment">
|
||||||
|
<span class="small">
|
||||||
|
<p class="text-muted">
|
||||||
|
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px;"></i>
|
||||||
|
As an administrator user, you have access to the advanced deployment feature allowing you to deploy any Kubernetes manifest inside your cluster.
|
||||||
|
</p>
|
||||||
|
<p>
|
||||||
|
<button type="button" class="btn btn-sm btn-primary" ui-sref="kubernetes.deploy"> <i class="fa fa-file-code space-right" aria-hidden="true"></i>Advanced deployment </button>
|
||||||
|
</p>
|
||||||
|
</span>
|
||||||
|
</information-panel>
|
|
@ -5,19 +5,7 @@
|
||||||
<kubernetes-view-loading view-ready="ctrl.state.viewReady"></kubernetes-view-loading>
|
<kubernetes-view-loading view-ready="ctrl.state.viewReady"></kubernetes-view-loading>
|
||||||
|
|
||||||
<div ng-if="ctrl.state.viewReady">
|
<div ng-if="ctrl.state.viewReady">
|
||||||
<information-panel title-text="Advanced deployment" ng-if="ctrl.state.isAdmin">
|
<div ng-if="ctrl.state.isAdmin" ng-include="'app/kubernetes/templates/advancedDeploymentPanel.html'"></div>
|
||||||
<span class="small">
|
|
||||||
<p class="text-muted">
|
|
||||||
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px;"></i>
|
|
||||||
As an administrator user, you have access to the advanced deployment feature allowing you to deploy any Kubernetes manifest inside your cluster.
|
|
||||||
</p>
|
|
||||||
<p>
|
|
||||||
<button type="button" class="btn btn-sm btn-primary" ui-sref="kubernetes.deploy">
|
|
||||||
<i class="fa fa-file-code space-right" aria-hidden="true"></i>Advanced deployment
|
|
||||||
</button>
|
|
||||||
</p>
|
|
||||||
</span>
|
|
||||||
</information-panel>
|
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
require('../../templates/advancedDeploymentPanel.html');
|
||||||
|
|
||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
import * as _ from 'lodash-es';
|
import * as _ from 'lodash-es';
|
||||||
import KubernetesStackHelper from 'Kubernetes/helpers/stackHelper';
|
import KubernetesStackHelper from 'Kubernetes/helpers/stackHelper';
|
||||||
|
|
|
@ -7,6 +7,8 @@
|
||||||
<kubernetes-view-loading view-ready="ctrl.state.viewReady"></kubernetes-view-loading>
|
<kubernetes-view-loading view-ready="ctrl.state.viewReady"></kubernetes-view-loading>
|
||||||
|
|
||||||
<div ng-if="ctrl.state.viewReady">
|
<div ng-if="ctrl.state.viewReady">
|
||||||
|
<div ng-if="ctrl.state.isAdmin" ng-include="'app/kubernetes/templates/advancedDeploymentPanel.html'"></div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<rd-widget>
|
<rd-widget>
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
require('../../../templates/advancedDeploymentPanel.html');
|
||||||
|
|
||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
import * as _ from 'lodash-es';
|
import * as _ from 'lodash-es';
|
||||||
import * as JsonPatch from 'fast-json-patch';
|
import * as JsonPatch from 'fast-json-patch';
|
||||||
|
@ -101,6 +103,7 @@ class KubernetesApplicationController {
|
||||||
Notifications,
|
Notifications,
|
||||||
LocalStorage,
|
LocalStorage,
|
||||||
ModalService,
|
ModalService,
|
||||||
|
Authentication,
|
||||||
KubernetesApplicationService,
|
KubernetesApplicationService,
|
||||||
KubernetesEventService,
|
KubernetesEventService,
|
||||||
KubernetesStackService,
|
KubernetesStackService,
|
||||||
|
@ -114,6 +117,7 @@ class KubernetesApplicationController {
|
||||||
this.Notifications = Notifications;
|
this.Notifications = Notifications;
|
||||||
this.LocalStorage = LocalStorage;
|
this.LocalStorage = LocalStorage;
|
||||||
this.ModalService = ModalService;
|
this.ModalService = ModalService;
|
||||||
|
this.Authentication = Authentication;
|
||||||
|
|
||||||
this.KubernetesApplicationService = KubernetesApplicationService;
|
this.KubernetesApplicationService = KubernetesApplicationService;
|
||||||
this.KubernetesEventService = KubernetesEventService;
|
this.KubernetesEventService = KubernetesEventService;
|
||||||
|
@ -333,6 +337,7 @@ class KubernetesApplicationController {
|
||||||
eventWarningCount: 0,
|
eventWarningCount: 0,
|
||||||
expandedNote: false,
|
expandedNote: false,
|
||||||
useIngress: false,
|
useIngress: false,
|
||||||
|
isAdmin: this.Authentication.isAdmin(),
|
||||||
};
|
};
|
||||||
|
|
||||||
this.state.activeTab = this.LocalStorage.getActiveTab('application');
|
this.state.activeTab = this.LocalStorage.getActiveTab('application');
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
<kubernetes-view-loading view-ready="ctrl.state.viewReady"></kubernetes-view-loading>
|
<kubernetes-view-loading view-ready="ctrl.state.viewReady"></kubernetes-view-loading>
|
||||||
|
|
||||||
<div ng-if="ctrl.state.viewReady">
|
<div ng-if="ctrl.state.viewReady">
|
||||||
|
<div ng-if="ctrl.state.isAdmin" ng-include="'app/kubernetes/templates/advancedDeploymentPanel.html'"></div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<kubernetes-configurations-datatable
|
<kubernetes-configurations-datatable
|
||||||
|
|
|
@ -1,12 +1,15 @@
|
||||||
|
require('../../templates/advancedDeploymentPanel.html');
|
||||||
|
|
||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
import KubernetesConfigurationHelper from 'Kubernetes/helpers/configurationHelper';
|
import KubernetesConfigurationHelper from 'Kubernetes/helpers/configurationHelper';
|
||||||
|
|
||||||
class KubernetesConfigurationsController {
|
class KubernetesConfigurationsController {
|
||||||
/* @ngInject */
|
/* @ngInject */
|
||||||
constructor($async, $state, Notifications, KubernetesConfigurationService, KubernetesApplicationService, ModalService) {
|
constructor($async, $state, Notifications, Authentication, KubernetesConfigurationService, KubernetesApplicationService, ModalService) {
|
||||||
this.$async = $async;
|
this.$async = $async;
|
||||||
this.$state = $state;
|
this.$state = $state;
|
||||||
this.Notifications = Notifications;
|
this.Notifications = Notifications;
|
||||||
|
this.Authentication = Authentication;
|
||||||
this.KubernetesConfigurationService = KubernetesConfigurationService;
|
this.KubernetesConfigurationService = KubernetesConfigurationService;
|
||||||
this.KubernetesApplicationService = KubernetesApplicationService;
|
this.KubernetesApplicationService = KubernetesApplicationService;
|
||||||
this.ModalService = ModalService;
|
this.ModalService = ModalService;
|
||||||
|
@ -93,6 +96,7 @@ class KubernetesConfigurationsController {
|
||||||
configurationsLoading: true,
|
configurationsLoading: true,
|
||||||
applicationsLoading: true,
|
applicationsLoading: true,
|
||||||
viewReady: false,
|
viewReady: false,
|
||||||
|
isAdmin: this.Authentication.isAdmin(),
|
||||||
};
|
};
|
||||||
|
|
||||||
await this.getApplications();
|
await this.getApplications();
|
||||||
|
|
|
@ -5,6 +5,8 @@
|
||||||
<kubernetes-view-loading view-ready="ctrl.state.viewReady"></kubernetes-view-loading>
|
<kubernetes-view-loading view-ready="ctrl.state.viewReady"></kubernetes-view-loading>
|
||||||
|
|
||||||
<div ng-if="ctrl.state.viewReady">
|
<div ng-if="ctrl.state.viewReady">
|
||||||
|
<div ng-if="ctrl.state.isAdmin" ng-include="'app/kubernetes/templates/advancedDeploymentPanel.html'"></div>
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<rd-widget>
|
<rd-widget>
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
require('../../templates/advancedDeploymentPanel.html');
|
||||||
|
|
||||||
import * as _ from 'lodash-es';
|
import * as _ from 'lodash-es';
|
||||||
import filesizeParser from 'filesize-parser';
|
import filesizeParser from 'filesize-parser';
|
||||||
import angular from 'angular';
|
import angular from 'angular';
|
||||||
|
@ -39,10 +41,22 @@ function computeSize(volumes) {
|
||||||
|
|
||||||
class KubernetesVolumesController {
|
class KubernetesVolumesController {
|
||||||
/* @ngInject */
|
/* @ngInject */
|
||||||
constructor($async, $state, Notifications, ModalService, LocalStorage, EndpointProvider, KubernetesStorageService, KubernetesVolumeService, KubernetesApplicationService) {
|
constructor(
|
||||||
|
$async,
|
||||||
|
$state,
|
||||||
|
Notifications,
|
||||||
|
Authentication,
|
||||||
|
ModalService,
|
||||||
|
LocalStorage,
|
||||||
|
EndpointProvider,
|
||||||
|
KubernetesStorageService,
|
||||||
|
KubernetesVolumeService,
|
||||||
|
KubernetesApplicationService
|
||||||
|
) {
|
||||||
this.$async = $async;
|
this.$async = $async;
|
||||||
this.$state = $state;
|
this.$state = $state;
|
||||||
this.Notifications = Notifications;
|
this.Notifications = Notifications;
|
||||||
|
this.Authentication = Authentication;
|
||||||
this.ModalService = ModalService;
|
this.ModalService = ModalService;
|
||||||
this.LocalStorage = LocalStorage;
|
this.LocalStorage = LocalStorage;
|
||||||
this.EndpointProvider = EndpointProvider;
|
this.EndpointProvider = EndpointProvider;
|
||||||
|
@ -117,6 +131,7 @@ class KubernetesVolumesController {
|
||||||
currentName: this.$state.$current.name,
|
currentName: this.$state.$current.name,
|
||||||
endpointId: this.EndpointProvider.endpointID(),
|
endpointId: this.EndpointProvider.endpointID(),
|
||||||
activeTab: this.LocalStorage.getActiveTab('volumes'),
|
activeTab: this.LocalStorage.getActiveTab('volumes'),
|
||||||
|
isAdmin: this.Authentication.isAdmin(),
|
||||||
};
|
};
|
||||||
|
|
||||||
await this.getVolumes();
|
await this.getVolumes();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue