mirror of
https://github.com/portainer/portainer.git
synced 2025-08-02 20:35:25 +02:00
feat(oci): oci helm support [r8s-361] (#787)
This commit is contained in:
parent
b6a6ce9aaf
commit
2697d6c5d7
80 changed files with 4264 additions and 812 deletions
|
@ -92,6 +92,7 @@ export const ngModule = angular
|
|||
'onChange',
|
||||
'placeholder',
|
||||
'value',
|
||||
'allowSelectAll',
|
||||
])
|
||||
)
|
||||
.component(
|
||||
|
|
|
@ -19,6 +19,7 @@
|
|||
namespaces="$ctrl.resourcePools"
|
||||
placeholder="'Select one or more namespaces'"
|
||||
on-change="($ctrl.onChangeResourcePools)"
|
||||
allow-select-all="true"
|
||||
></namespaces-selector>
|
||||
</div>
|
||||
<div class="col-sm-12 small text-muted vertical-center">
|
||||
|
|
|
@ -40,17 +40,15 @@
|
|||
</div>
|
||||
|
||||
<div class="form-group" ng-if="ctrl.formValues.Namespace">
|
||||
<label for="target_node" class="col-lg-2 col-sm-3 control-label text-left">Namespace</label>
|
||||
<label for="target_namespace" class="col-lg-2 col-sm-3 control-label text-left">Namespace</label>
|
||||
<div class="col-sm-9 col-lg-10">
|
||||
<select
|
||||
<namespace-portainer-select
|
||||
ng-if="!ctrl.formValues.namespace_toggle || ctrl.state.BuildMethod === ctrl.BuildMethods.HELM"
|
||||
data-cy="namespace-select"
|
||||
ng-disabled="ctrl.formValues.namespace_toggle && ctrl.state.BuildMethod !== ctrl.BuildMethods.HELM"
|
||||
class="form-control"
|
||||
ng-model="ctrl.formValues.Namespace"
|
||||
ng-change="ctrl.onChangeNamespace()"
|
||||
ng-options="namespace.Name as namespace.Name for namespace in ctrl.namespaces"
|
||||
></select>
|
||||
is-disabled="ctrl.formValues.namespace_toggle && ctrl.state.BuildMethod !== ctrl.BuildMethods.HELM || ctrl.state.isNamespaceInputDisabled"
|
||||
value="ctrl.formValues.Namespace"
|
||||
on-change="(ctrl.onChangeNamespace)"
|
||||
options="ctrl.namespaceOptions"
|
||||
></namespace-portainer-select>
|
||||
<span ng-if="ctrl.formValues.namespace_toggle && ctrl.state.BuildMethod !== ctrl.BuildMethods.HELM" class="small text-muted pt-[7px]"
|
||||
>Namespaces specified in the manifest will be used</span
|
||||
>
|
||||
|
@ -186,7 +184,6 @@
|
|||
|
||||
<!-- Helm -->
|
||||
<div ng-show="ctrl.state.BuildMethod === ctrl.BuildMethods.HELM">
|
||||
<div class="col-sm-12 form-section-title" ng-if="ctrl.state.selectedHelmChart">Selected Helm chart</div>
|
||||
<helm-templates-view on-select-helm-chart="(ctrl.onSelectHelmChart)" namespace="ctrl.formValues.Namespace" name="ctrl.formValues.Name" />
|
||||
</div>
|
||||
<!-- !Helm -->
|
||||
|
|
|
@ -101,9 +101,10 @@ class KubernetesDeployController {
|
|||
this.onChangeNamespace = this.onChangeNamespace.bind(this);
|
||||
}
|
||||
|
||||
onChangeNamespace() {
|
||||
onChangeNamespace(namespaceName) {
|
||||
return this.$async(async () => {
|
||||
const applications = await this.KubernetesApplicationService.get(this.formValues.Namespace);
|
||||
this.formValues.Namespace = namespaceName;
|
||||
const applications = await this.KubernetesApplicationService.get(namespaceName);
|
||||
const stacks = _.map(applications, (item) => item.StackName).filter((item) => item !== '');
|
||||
this.stacks = _.uniq(stacks);
|
||||
});
|
||||
|
@ -371,6 +372,10 @@ class KubernetesDeployController {
|
|||
if (this.namespaces.length > 0) {
|
||||
this.formValues.Namespace = this.namespaces[0].Name;
|
||||
}
|
||||
this.namespaceOptions = _.map(namespaces, (namespace) => ({
|
||||
label: namespace.Name,
|
||||
value: namespace.Name,
|
||||
}));
|
||||
} catch (err) {
|
||||
this.Notifications.error('Failure', err, 'Unable to load namespaces data');
|
||||
}
|
||||
|
@ -404,7 +409,8 @@ class KubernetesDeployController {
|
|||
}
|
||||
}
|
||||
|
||||
this.onChangeNamespace();
|
||||
this.onChangeNamespace(this.formValues.Namespace);
|
||||
|
||||
this.state.viewReady = true;
|
||||
|
||||
this.$window.onbeforeunload = () => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue