1
0
Fork 0
mirror of https://github.com/portainer/portainer.git synced 2025-07-31 03:09:44 +02:00

updated API response to get IsComposeFormat and show appropriate text.

This commit is contained in:
Felix Han 2021-08-31 15:39:44 +12:00
parent 47c32df77a
commit b5c59c8982
3 changed files with 24 additions and 11 deletions

View file

@ -72,14 +72,27 @@
on-change="(ctrl.onChangeFileContent)" on-change="(ctrl.onChangeFileContent)"
> >
<editor-description> <editor-description>
<p> <span class="text-muted small" ng-show="ctrl.stack.IsComposeFormat">
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px;"></i> <p>
This feature allows you to deploy any kind of Kubernetes resource in this environment (Deployment, Secret, ConfigMap...). <i class="fa fa-exclamation-circle orange-icon" aria-hidden="true" style="margin-right: 2px;"></i>
</p> Portainer uses <a href="https://kompose.io/" target="_blank">Kompose</a> to convert your Compose manifest to a Kubernetes compliant manifest. Be wary that not
<p> all the Compose format options are supported by Kompose at the moment.
You can get more information about Kubernetes file format in the </p>
<a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/" target="_blank">official documentation</a>. <p>
</p> You can get more information about Compose file format in the
<a href="https://docs.docker.com/compose/compose-file/" target="_blank">official documentation</a>.
</p>
</span>
<span class="text-muted small" ng-show="!ctrl.stack.IsComposeFormat">
<p>
<i class="fa fa-info-circle blue-icon" aria-hidden="true" style="margin-right: 2px;"></i>
This feature allows you to deploy any kind of Kubernetes resource in this environment (Deployment, Secret, ConfigMap...).
</p>
<p>
You can get more information about Kubernetes file format in the
<a href="https://kubernetes.io/docs/concepts/overview/working-with-objects/kubernetes-objects/" target="_blank">official documentation</a>.
</p>
</span>
</editor-description> </editor-description>
</web-editor-form> </web-editor-form>
<!-- #endregion --> <!-- #endregion -->

View file

@ -1024,9 +1024,8 @@ class KubernetesCreateApplicationController {
if (this.application.ApplicationKind) { if (this.application.ApplicationKind) {
this.state.appType = this.KubernetesDeploymentTypes[this.application.ApplicationKind.toUpperCase()]; this.state.appType = this.KubernetesDeploymentTypes[this.application.ApplicationKind.toUpperCase()];
if (this.application.StackId) { if (this.application.StackId) {
if (this.application.ApplicationKind === this.KubernetesDeploymentTypes.GIT) { this.stack = await this.StackService.stack(this.application.StackId);
this.stack = await this.StackService.stack(this.application.StackId); if (this.application.ApplicationKind === this.KubernetesDeploymentTypes.CONTENT) {
} else if (this.application.ApplicationKind === this.KubernetesDeploymentTypes.CONTENT) {
this.stackFileContent = await this.StackService.getStackFile(this.application.StackId); this.stackFileContent = await this.StackService.getStackFile(this.application.StackId);
} }
} }

View file

@ -7,6 +7,7 @@ export function StackViewModel(data) {
this.EndpointId = data.EndpointId; this.EndpointId = data.EndpointId;
this.SwarmId = data.SwarmId; this.SwarmId = data.SwarmId;
this.Env = data.Env ? data.Env : []; this.Env = data.Env ? data.Env : [];
this.IsComposeFormat = data.IsComposeFormat;
if (data.ResourceControl && data.ResourceControl.Id !== 0) { if (data.ResourceControl && data.ResourceControl.Id !== 0) {
this.ResourceControl = new ResourceControlViewModel(data.ResourceControl); this.ResourceControl = new ResourceControlViewModel(data.ResourceControl);
} }