|
80 | 80 | :footer="null" |
81 | 81 | @cancel="closeModals"> |
82 | 82 | {{ $t('message.network.addvm.desc') }} |
83 | | - <a-form @finish="submitAddNetwork" v-ctrl-enter="submitAddNetwork"> |
84 | | - <div class="modal-form"> |
85 | | - <p class="modal-form__label">{{ $t('label.network') }}:</p> |
| 83 | + <a-form |
| 84 | + @finish="submitAddNetwork" |
| 85 | + v-ctrl-enter="submitAddNetwork" |
| 86 | + layout="vertical"> |
| 87 | + <a-form-item name="network" ref="network"> |
| 88 | + <template #label> |
| 89 | + <tooltip-label :title="$t('label.network')" :tooltip="addNetworkData.apiParams.networkid.description"/> |
| 90 | + </template> |
86 | 91 | <a-select |
| 92 | + :placeholder="addNetworkData.apiParams.networkid.description" |
87 | 93 | :value="addNetworkData.network" |
88 | 94 | @change="e => addNetworkData.network = e" |
89 | 95 | v-focus="true" |
|
104 | 110 | </span> |
105 | 111 | </a-select-option> |
106 | 112 | </a-select> |
107 | | - <p class="modal-form__label">{{ $t('label.publicip') }}:</p> |
108 | | - <a-input v-model:value="addNetworkData.ip"></a-input> |
109 | | - <br> |
| 113 | + </a-form-item> |
| 114 | + <a-form-item name="ip" ref="ip"> |
| 115 | + <template #label> |
| 116 | + <tooltip-label :title="$t('label.ipaddress')" :tooltip="addNetworkData.apiParams.ipaddress.description"/> |
| 117 | + </template> |
| 118 | + <a-input |
| 119 | + :placeholder="addNetworkData.apiParams.ipaddress.description" |
| 120 | + v-model:value="addNetworkData.ipaddress" /> |
| 121 | + </a-form-item> |
| 122 | + <a-form-item name="macaddress" ref="macaddress"> |
| 123 | + <template #label> |
| 124 | + <tooltip-label :title="$t('label.macaddress')" :tooltip="addNetworkData.apiParams.macaddress.description"/> |
| 125 | + </template> |
| 126 | + <a-input |
| 127 | + :placeholder="addNetworkData.apiParams.macaddress.description" |
| 128 | + v-model:value="addNetworkData.macaddress" /> |
| 129 | + </a-form-item> |
| 130 | + <a-form-item name="makedefault" ref="makedefault"> |
110 | 131 | <a-checkbox v-model:checked="addNetworkData.makedefault"> |
111 | 132 | {{ $t('label.make.default') }} |
112 | 133 | </a-checkbox> |
113 | | - <br> |
114 | | - </div> |
| 134 | + </a-form-item> |
115 | 135 |
|
116 | 136 | <div :span="24" class="action-button"> |
117 | 137 | <a-button @click="closeModals">{{ $t('label.cancel') }}</a-button> |
|
229 | 249 | <script> |
230 | 250 | import { api } from '@/api' |
231 | 251 | import NicsTable from '@/views/network/NicsTable' |
| 252 | +import TooltipLabel from '@/components/widgets/TooltipLabel' |
232 | 253 | import TooltipButton from '@/components/widgets/TooltipButton' |
233 | 254 | import ResourceIcon from '@/components/view/ResourceIcon' |
234 | 255 |
|
235 | 256 | export default { |
236 | 257 | name: 'NicsTab', |
237 | 258 | components: { |
238 | 259 | NicsTable, |
| 260 | + TooltipLabel, |
239 | 261 | TooltipButton, |
240 | 262 | ResourceIcon |
241 | 263 | }, |
@@ -279,6 +301,7 @@ export default { |
279 | 301 | }, |
280 | 302 | created () { |
281 | 303 | this.vm = this.resource |
| 304 | + this.addNetworkData.apiParams = this.$getApiParams('addNicToVirtualMachine') |
282 | 305 | }, |
283 | 306 | methods: { |
284 | 307 | listNetworks () { |
@@ -338,7 +361,8 @@ export default { |
338 | 361 | this.showUpdateIpModal = false |
339 | 362 | this.showSecondaryIpModal = false |
340 | 363 | this.addNetworkData.network = '' |
341 | | - this.addNetworkData.ip = '' |
| 364 | + this.addNetworkData.ipaddress = '' |
| 365 | + this.addNetworkData.macaddress = '' |
342 | 366 | this.addNetworkData.makedefault = false |
343 | 367 | this.editIpAddressValue = '' |
344 | 368 | this.newSecondaryIp = '' |
@@ -367,8 +391,11 @@ export default { |
367 | 391 | const params = {} |
368 | 392 | params.virtualmachineid = this.vm.id |
369 | 393 | params.networkid = this.addNetworkData.network |
370 | | - if (this.addNetworkData.ip) { |
371 | | - params.ipaddress = this.addNetworkData.ip |
| 394 | + if (this.addNetworkData.ipaddress) { |
| 395 | + params.ipaddress = this.addNetworkData.ipaddress |
| 396 | + } |
| 397 | + if (this.addNetworkData.macaddress) { |
| 398 | + params.macaddress = this.addNetworkData.macaddress |
372 | 399 | } |
373 | 400 | this.showAddNetworkModal = false |
374 | 401 | this.loadingNic = true |
@@ -603,22 +630,6 @@ export default { |
603 | 630 | } |
604 | 631 | } |
605 | 632 |
|
606 | | -.action-button { |
607 | | - display: flex; |
608 | | - flex-wrap: wrap; |
609 | | -
|
610 | | - button { |
611 | | - padding: 5px; |
612 | | - height: auto; |
613 | | - margin-bottom: 10px; |
614 | | - align-self: flex-start; |
615 | | -
|
616 | | - &:not(:last-child) { |
617 | | - margin-right: 10px; |
618 | | - } |
619 | | - } |
620 | | -} |
621 | | -
|
622 | 633 | .wide-modal { |
623 | 634 | min-width: 50vw; |
624 | 635 | } |
|
0 commit comments