Skip to content

Commit

Permalink
Hide the trashcan icon for DHCP address
Browse files Browse the repository at this point in the history
When the IPv4 address is in DHCP mode, hide the trashcan icon.
If the address is in static IPv4 mode, the trashcan icon will show
that the user can delete the IPv4 static address.

Change-Id: I27dc8dc64d93b1e2425de6143473a91f7bc0b104
Signed-off-by: Sivaprabu Ganesan <[email protected]>
  • Loading branch information
sivaprabug committed Sep 25, 2023
1 parent ebef6ee commit 2098359
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/views/Settings/Network/TableIpv4.vue
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
>
<template #cell(actions)="{ item, index }">
<table-row-action
v-for="(action, actionIndex) in item.actions"
v-for="(action, actionIndex) in filteredActions(item)"
:key="actionIndex"
:value="action.value"
:title="action.title"
Expand Down Expand Up @@ -139,6 +139,15 @@ export default {
return newValue;
},
},
filteredActions() {
return (item) => {
if (item.AddressOrigin === 'DHCP') {
return item.actions.filter((action) => action.value !== 'delete');
} else {
return item.actions;
}
};
},
},
watch: {
// Watch for change in tab index
Expand Down

0 comments on commit 2098359

Please sign in to comment.