diff --git a/src/static/app/src/components/clientComponents/availablePeersGroup.vue b/src/static/app/src/components/clientComponents/availablePeersGroup.vue index 3a725b8..5ad7cec 100644 --- a/src/static/app/src/components/clientComponents/availablePeersGroup.vue +++ b/src/static/app/src/components/clientComponents/availablePeersGroup.vue @@ -3,23 +3,27 @@ import {computed, ref} from "vue"; import {DashboardClientAssignmentStore} from "@/stores/DashboardClientAssignmentStore.js"; import LocaleText from "@/components/text/localeText.vue"; -const props = defineProps(['configuration', 'peers', 'clientAssignedPeers']) +const props = defineProps(['configuration', 'peers', 'clientAssignedPeers', 'availablePeerSearchString']) const emits = defineEmits(['assign', 'unassign']) const assignmentStore = DashboardClientAssignmentStore() const available = computed(() => { if (props.clientAssignedPeers){ if (Object.keys(props.clientAssignedPeers).includes(props.configuration)){ return props.peers.filter( - x => !props.clientAssignedPeers[props.configuration].map( - x => x.id - ).includes(x.id) + x => { + return !props.clientAssignedPeers[props.configuration].map( + x => x.id + ).includes(x.id) && + (!props.availablePeerSearchString || + (props.availablePeerSearchString && + (x.id.includes(props.availablePeerSearchString) || x.name.includes(props.availablePeerSearchString)))) + } ) } } return props.peers }) const confirmDelete = ref(false) - const collapse = ref(false) @@ -28,8 +32,8 @@ const collapse = ref(false)