Skip to content

Commit

Permalink
Fixes #35346 - change only the corresponding network (#9342)
Browse files Browse the repository at this point in the history
  • Loading branch information
sbernhard committed Aug 11, 2022
1 parent f2b8409 commit 9b31c9d
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion webpack/assets/javascripts/compute_resource/ovirt.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,6 +236,10 @@ export function datacenterSelected(item) {
export function vnicSelected(item) {
const selectedVnicProfile = $(item).val();
if (selectedVnicProfile) {
const itemId = $(item).attr('id');
const nicId = itemId.match(/_([0-9]*)_vnic_profile/)[1];
const idNetwork = `id$=_${nicId}_network`;

const vnicOptions = JSON.parse(
$('select[id$=_vnic_profile]')[1].getAttribute('data-profiles')
);
Expand All @@ -249,7 +253,7 @@ export function vnicSelected(item) {
const networkObj = networkOptions.filter(
network => network.id === vnicNetwork.id
)[0];
const networkSelect = $('select[id$=_network]');
const networkSelect = $(`select[${idNetwork}]`);
networkSelect.empty();
networkSelect.append(
$('<option />')
Expand Down

0 comments on commit 9b31c9d

Please sign in to comment.