Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,10 @@ public void createApplyLoadBalancingRulesCommands(final List<LoadBalancingRule>
final List<LbDestination> destinations = rule.getDestinations();
final List<LbStickinessPolicy> stickinessPolicies = rule.getStickinessPolicies();
final LoadBalancerTO lb = new LoadBalancerTO(uuid, srcIp, srcPort, protocol, algorithm, revoked, false, inline, destinations, stickinessPolicies);
lb.setCidrList(rule.getCidrList());
String cidrList = rule.getCidrList();
if (cidrList != null && !cidrList.isEmpty()) {
lb.setCidrList(String.join(" ", cidrList.split(",")));
}
lb.setLbProtocol(lb_protocol);
lb.setLbSslCert(rule.getLbSslCert());
lbs[i++] = lb;
Expand Down
35 changes: 33 additions & 2 deletions ui/src/views/network/LoadBalancing.vue
Original file line number Diff line number Diff line change
Expand Up @@ -451,6 +451,22 @@
<a-select-option value="ssl" :label="$t('label.ssl')">{{ $t('label.ssl') }}</a-select-option>
</a-select>
</div>
<div v-if="lbProvider !== 'Netris'" class="edit-rule__item">
<p class="edit-rule__label">
{{ $t('label.sourcecidrlist') }}
<tooltip-label
:title="''"
bold
:tooltip="createLoadBalancerRuleParams.cidrlist.description || 'Enter a comma-separated list of CIDR blocks.'"
:tooltip-placement="'right'"
style="display: inline; margin-left: 5px;"
/>
</p>
<a-input
v-model:value="editRuleDetails.cidrlist"
:placeholder="$t('label.sourcecidrlist')"
/>
</div>
<div :span="24" class="action-button">
<a-button @click="() => editRuleModalVisible = false">{{ $t('label.cancel') }}</a-button>
<a-button type="primary" @click="handleSubmitEditForm">{{ $t('label.ok') }}</a-button>
Expand Down Expand Up @@ -837,7 +853,8 @@ export default {
editRuleDetails: {
name: '',
algorithm: '',
protocol: ''
protocol: '',
cidrlist: ''
},
newRule: {
algorithm: 'roundrobin',
Expand Down Expand Up @@ -1625,14 +1642,28 @@ export default {
this.editRuleDetails.name = this.selectedRule.name
this.editRuleDetails.algorithm = this.lbProvider !== 'Netris' ? this.selectedRule.algorithm : undefined
this.editRuleDetails.protocol = this.selectedRule.protocol
// Normalize cidrlist: replace spaces with commas and clean up
this.editRuleDetails.cidrlist = (this.selectedRule.cidrlist || '')
.split(/[\s,]+/) // Split on spaces or commas
.map(c => c.trim())
.filter(c => c)
.join(',') || ''
},
handleSubmitEditForm () {
if (this.editRuleModalLoading) return
this.loading = true
this.editRuleModalLoading = true
const payload = {
...this.editRuleDetails,
id: this.selectedRule.id,
...(this.editRuleDetails.cidrlist && {
cidrList: (this.editRuleDetails.cidrlist || '').split(',').map(c => c.trim()).filter(c => c)
})
}
postAPI('updateLoadBalancerRule', {
...this.editRuleDetails,
id: this.selectedRule.id
id: this.selectedRule.id,
...payload
}).then(response => {
this.$pollJob({
jobId: response.updateloadbalancerruleresponse.jobid,
Expand Down
Loading