mirror of
https://github.com/status-im/consul.git
synced 2025-02-20 01:18:49 +00:00
ui: Adds the ability to frontend search instances by address (ip:port) (#5993)
This commit is contained in:
parent
01d1b3c139
commit
6d8a706b4d
@ -8,7 +8,8 @@ export default function(filterable) {
|
|||||||
.indexOf(term) !== -1 ||
|
.indexOf(term) !== -1 ||
|
||||||
get(item, 'Service.ID')
|
get(item, 'Service.ID')
|
||||||
.toLowerCase()
|
.toLowerCase()
|
||||||
.indexOf(term) !== -1
|
.indexOf(term) !== -1 ||
|
||||||
|
`${get(item, 'Service.Address')}:${get(item, 'Service.Port')}`.indexOf(term) !== -1
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
@ -29,6 +29,24 @@ test('items are found by properties', function(assert) {
|
|||||||
assert.ok(actual);
|
assert.ok(actual);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
test('items are found by address:port', function(assert) {
|
||||||
|
const instance = {
|
||||||
|
Service: {
|
||||||
|
ID: 'id',
|
||||||
|
Address: '0.0.0.0',
|
||||||
|
Port: 8000,
|
||||||
|
},
|
||||||
|
Node: {
|
||||||
|
Node: 'node-0',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
['0.0.0.0', '8000', '0:8000', '0.0.0.0:8000'].forEach(function(item) {
|
||||||
|
let actual = filter(instance, {
|
||||||
|
s: item,
|
||||||
|
});
|
||||||
|
assert.ok(actual);
|
||||||
|
});
|
||||||
|
});
|
||||||
test('items are not found', function(assert) {
|
test('items are not found', function(assert) {
|
||||||
[
|
[
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user