Skip to content

Commit

Permalink
fix new environment param create (#204)
Browse files Browse the repository at this point in the history
Co-authored-by: Maksym Veres <[email protected]>
  • Loading branch information
maxsva and Maksym Veres authored Mar 12, 2024
1 parent e0586ad commit 5518bd5
Showing 1 changed file with 96 additions and 35 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -346,38 +346,58 @@ <h4>Basic Information</h4>
</tr>
</thead>
<tbody>
<tr>
<td>Display Name</td>
<td *ngIf="env.display_name == uneditedEnv.display_name">{{ env.display_name }}</td>
<td *ngIf="env.display_name != uneditedEnv.display_name">
<span class="del-elem arrow-after">{{ uneditedEnv.display_name }}</span >
<span class="add-elem">{{ env.display_name }}</span >
</td>
</tr>
<tr>
<td>DNS Suffix</td>
<td *ngIf="env.dnssuffix == uneditedEnv.dnssuffix">{{ env.dnssuffix }}</td>
<td *ngIf="env.dnssuffix != uneditedEnv.dnssuffix">
<span class="del-elem arrow-after">{{ uneditedEnv.dnssuffix }}</span >
<span class="add-elem">{{ env.dnssuffix }}</span >
</td>
</tr>
<tr>
<td>Provider</td>
<td *ngIf="env.provider == uneditedEnv.provider">{{ env.provider }}</td>
<td *ngIf="env.provider != uneditedEnv.provider">
<span class="del-elem arrow-after">{{ uneditedEnv.provider }}</span >
<span class="add-elem">{{ env.provider }}</span >
</td>
</tr>
<tr>
<td>Websocket Endpoint</td>
<td *ngIf="env.ws_endpoint == uneditedEnv.ws_endpoint">{{ env.ws_endpoint }}</td>
<td *ngIf="env.ws_endpoint != uneditedEnv.ws_endpoint">
<span class="del-elem arrow-after">{{ uneditedEnv.ws_endpoint }}</span >
<span class="add-elem">{{ env.ws_endpoint }}</span >
</td>
</tr>
<ng-container *ngIf="!!updateEnv; else newTemplate">
<tr>
<td>Display Name</td>
<td *ngIf="env.display_name == uneditedEnv.display_name">{{ env.display_name }}</td>
<td *ngIf="env.display_name != uneditedEnv.display_name">
<span class="del-elem arrow-after">{{ uneditedEnv.display_name }}</span >
<span class="add-elem">{{ env.display_name }}</span >
</td>
</tr>
<tr>
<td>DNS Suffix</td>
<td *ngIf="env.dnssuffix == uneditedEnv.dnssuffix">{{ env.dnssuffix }}</td>
<td *ngIf="env.dnssuffix != uneditedEnv.dnssuffix">
<span class="del-elem arrow-after">{{ uneditedEnv.dnssuffix }}</span >
<span class="add-elem">{{ env.dnssuffix }}</span >
</td>
</tr>
<tr>
<td>Provider</td>
<td *ngIf="env.provider == uneditedEnv.provider">{{ env.provider }}</td>
<td *ngIf="env.provider != uneditedEnv.provider">
<span class="del-elem arrow-after">{{ uneditedEnv.provider }}</span >
<span class="add-elem">{{ env.provider }}</span >
</td>
</tr>
<tr>
<td>Websocket Endpoint</td>
<td *ngIf="env.ws_endpoint == uneditedEnv.ws_endpoint">{{ env.ws_endpoint }}</td>
<td *ngIf="env.ws_endpoint != uneditedEnv.ws_endpoint">
<span class="del-elem arrow-after">{{ uneditedEnv.ws_endpoint }}</span >
<span class="add-elem">{{ env.ws_endpoint }}</span >
</td>
</tr>
</ng-container>
<ng-template #newTemplate>
<tr>
<td>Display Name</td>
<td>{{ env.display_name }}</td>
</tr>
<tr>
<td>DNS Suffix</td>
<td>{{ env.dnssuffix }}</td>
</tr>
<tr>
<td>Provider</td>
<td>{{ env.provider }}</td>
</tr>
<tr>
<td>Websocket Endpoint</td>
<td>{{ env.ws_endpoint }}</td>
</tr>
</ng-template>
</tbody>
</table>

Expand All @@ -390,6 +410,7 @@ <h4>Environment Specifics</h4>
</tr>
</thead>
<tbody>
<ng-container *ngIf="!!updateEnv; else newTemplate">
<tr *ngFor="let item of env.environment_specifics | keyvalue">
<!-- view of unedit value -->
<td *ngIf="uneditedEnv.environment_specifics.hasOwnProperty(item.key)">{{ item.key }}</td>
Expand All @@ -411,7 +432,14 @@ <h4>Environment Specifics</h4>
<td class="del-elem">{{ item.key }}</td>
<td class="del-elem">{{ item.value }}</td >
</ng-container>
</tr>
</tr></ng-container>
<ng-template #newTemplate>
<tr *ngFor="let item of env.environment_specifics | keyvalue">
<td>{{ item.key }}</td>
<td>{{ item.value }}</td>
</tr>
</ng-template>

</tbody>
</table>

Expand All @@ -425,7 +453,8 @@ <h4>Template Mappings</h4>
</tr>
</thead>
<tbody>
<tr *ngFor="let template of env.template_mapping | keyvalue">
<ng-container *ngIf="!!updateEnv; else newTemplate">
<tr *ngFor="let template of env.template_mapping | keyvalue">
<ng-container *ngIf="!isVMTemplateInUneditedEnv(template.key); else templateCountInUneditedEnv">
<td class="add-elem">{{ getVirtualMachineTemplateName(template.key) }}</td>
<td class="add-elem">{{ getTemplateCount(template.key) }}</td>
Expand Down Expand Up @@ -481,6 +510,30 @@ <h4>Template Mappings</h4>
</table>
</td>
</tr>
</ng-container>
<ng-template #newTemplate>
<tr *ngFor="let template of env.template_mapping | keyvalue">
<td>{{ template.key }}</td>
<td>{{ getTemplateCount(template.key) }}</td>
<td>
<table class="table table-compact">
<thead>
<tr>
<th>Key</th>
<th>Value</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of template.value | keyvalue">
<td>{{ item.key }}</td>
<td>{{ item.value }}</td>
</tr>
</tbody>
</table>
</td>
</tr>
</ng-template>

</tbody>
</table>

Expand All @@ -493,7 +546,8 @@ <h4>IP Mappings</h4>
</tr>
</thead>
<tbody>
<tr *ngFor="let item of env.ip_translation_map | keyvalue">
<ng-container *ngIf="!!updateEnv; else newTemplate">
<tr *ngFor="let item of env.ip_translation_map | keyvalue">
<!-- view of unedit value -->
<td *ngIf="uneditedEnv.ip_translation_map.hasOwnProperty(item.key)">{{ item.key }}</td>
<td *ngIf="item.value == uneditedEnv.ip_translation_map[item.key]">{{ item.value }}</td>
Expand All @@ -515,6 +569,13 @@ <h4>IP Mappings</h4>
<td class="del-elem">{{ item.value }}</td >
</ng-container>
</tr>
</ng-container>
<ng-template #newTemplate>
<tr *ngFor="let item of env.ip_translation_map | keyvalue">
<td>{{ item.key }}</td>
<td>{{ item.value }}</td>
</tr>
</ng-template>
</tbody>
</table>
</clr-wizard-page>
Expand Down

0 comments on commit 5518bd5

Please sign in to comment.