|
114 | 114 | buildPack: application.buildPack,
|
115 | 115 | deploymentType: application.deploymentType
|
116 | 116 | });
|
117 |
| - application = { |
118 |
| - ...application, |
119 |
| - ...data |
120 |
| - }; |
| 117 | + const baseImageCorrect = data.baseImages.filter( |
| 118 | + (image: any) => image.value === application.baseImage |
| 119 | + ); |
| 120 | + if (baseImageCorrect.length === 0) { |
| 121 | + application.baseImage = data.baseImage; |
| 122 | + } |
| 123 | + application.baseImages = data.baseImages; |
| 124 | +
|
| 125 | + const baseBuildImageCorrect = data.baseBuildImages.filter( |
| 126 | + (image: any) => image.value === application.baseBuildImage |
| 127 | + ); |
| 128 | + if (baseBuildImageCorrect.length === 0) { |
| 129 | + application.baseBuildImage = data.baseBuildImage; |
| 130 | + } |
| 131 | + application.baseBuildImages = data.baseBuildImages; |
| 132 | + if (application.deploymentType === 'static' && application.port !== '80') { |
| 133 | + application.port = data.port; |
| 134 | + } |
| 135 | + if (application.deploymentType === 'node' && application.port === '80') { |
| 136 | + application.port = data.port; |
| 137 | + } |
| 138 | + if (application.deploymentType === 'static' && !application.publishDirectory) { |
| 139 | + application.publishDirectory = data.publishDirectory; |
| 140 | + } |
| 141 | + if (application.deploymentType === 'node' && application.publishDirectory === 'out') { |
| 142 | + application.publishDirectory = data.publishDirectory; |
| 143 | + } |
121 | 144 | }
|
122 | 145 | async function changeSettings(name: any) {
|
123 | 146 | if (name === 'debug') {
|
|
631 | 654 | bind:value={application.port}
|
632 | 655 | placeholder="{$t('forms.default')}: 'python' ? '8000' : '3000'"
|
633 | 656 | />
|
634 |
| - <Explainer |
635 |
| - text={'The port your application listens on.'} |
636 |
| - /> |
| 657 | + <Explainer text={'The port your application listens on.'} /> |
637 | 658 | </div>
|
638 | 659 | {/if}
|
639 | 660 | <div class="grid grid-cols-2 items-center">
|
|
0 commit comments