Skip to content

Commit

Permalink
fix vlan id should be integer type
Browse files Browse the repository at this point in the history
Signed-off-by: andy.lee <[email protected]>
(cherry picked from commit 79bd332)
  • Loading branch information
a110605 committed Aug 13, 2024
1 parent 22d4248 commit 2294e06
Showing 1 changed file with 13 additions and 6 deletions.
19 changes: 13 additions & 6 deletions pkg/harvester/edit/harvesterhci.io.networkattachmentdefinition.vue
Original file line number Diff line number Diff line change
Expand Up @@ -143,12 +143,19 @@ export default {
},
input(neu) {
if (!isNaN(neu)) {
if (neu > 0 && neu < 4095) {
this.config.vlan = neu;
} else {
this.config.vlan = neu > 4094 ? 4094 : 1;
}
if (neu === '') {
this.config.vlan = '';
return;
}
const newValue = Number(neu);
if (newValue > 4094) {
this.config.vlan = 4094;
} else if (newValue < 1) {
this.config.vlan = 1;
} else {
this.config.vlan = newValue;
}
},
Expand Down

0 comments on commit 2294e06

Please sign in to comment.