|
452 | 452 | <a-select-option value="ssl" :label="$t('label.ssl')">{{ $t('label.ssl') }}</a-select-option> |
453 | 453 | </a-select> |
454 | 454 | </div> |
| 455 | + <div v-if="lbProvider !== 'Netris'" class="edit-rule__item"> |
| 456 | + <p class="edit-rule__label"> |
| 457 | + {{ $t('label.sourcecidrlist') }} |
| 458 | + <tooltip-label |
| 459 | + :title="''" |
| 460 | + bold |
| 461 | + :tooltip="createLoadBalancerRuleParams.cidrlist.description || 'Enter a comma-separated list of CIDR blocks.'" |
| 462 | + :tooltip-placement="'right'" |
| 463 | + style="display: inline; margin-left: 5px;" |
| 464 | + /> |
| 465 | + </p> |
| 466 | + <a-input |
| 467 | + v-model:value="editRuleDetails.cidrlist" |
| 468 | + :placeholder="$t('label.sourcecidrlist')" |
| 469 | + /> |
| 470 | + </div> |
455 | 471 | <div :span="24" class="action-button"> |
456 | 472 | <a-button @click="() => editRuleModalVisible = false">{{ $t('label.cancel') }}</a-button> |
457 | 473 | <a-button type="primary" @click="handleSubmitEditForm">{{ $t('label.ok') }}</a-button> |
@@ -838,7 +854,8 @@ export default { |
838 | 854 | editRuleDetails: { |
839 | 855 | name: '', |
840 | 856 | algorithm: '', |
841 | | - protocol: '' |
| 857 | + protocol: '', |
| 858 | + cidrlist: '' |
842 | 859 | }, |
843 | 860 | newRule: { |
844 | 861 | algorithm: 'roundrobin', |
@@ -1626,14 +1643,28 @@ export default { |
1626 | 1643 | this.editRuleDetails.name = this.selectedRule.name |
1627 | 1644 | this.editRuleDetails.algorithm = this.lbProvider !== 'Netris' ? this.selectedRule.algorithm : undefined |
1628 | 1645 | this.editRuleDetails.protocol = this.selectedRule.protocol |
| 1646 | + // Normalize cidrlist: replace spaces with commas and clean up |
| 1647 | + this.editRuleDetails.cidrlist = (this.selectedRule.cidrlist || '') |
| 1648 | + .split(/[\s,]+/) // Split on spaces or commas |
| 1649 | + .map(c => c.trim()) |
| 1650 | + .filter(c => c) |
| 1651 | + .join(',') || '' |
1629 | 1652 | }, |
1630 | 1653 | handleSubmitEditForm () { |
1631 | 1654 | if (this.editRuleModalLoading) return |
1632 | 1655 | this.loading = true |
1633 | 1656 | this.editRuleModalLoading = true |
| 1657 | + const payload = { |
| 1658 | + ...this.editRuleDetails, |
| 1659 | + id: this.selectedRule.id, |
| 1660 | + ...(this.editRuleDetails.cidrlist && { |
| 1661 | + cidrList: (this.editRuleDetails.cidrlist || '').split(',').map(c => c.trim()).filter(c => c) |
| 1662 | + }) |
| 1663 | + } |
1634 | 1664 | postAPI('updateLoadBalancerRule', { |
1635 | 1665 | ...this.editRuleDetails, |
1636 | | - id: this.selectedRule.id |
| 1666 | + id: this.selectedRule.id, |
| 1667 | + ...payload |
1637 | 1668 | }).then(response => { |
1638 | 1669 | this.$pollJob({ |
1639 | 1670 | jobId: response.updateloadbalancerruleresponse.jobid, |
|
0 commit comments