From 892032acae4b2f93e2523afe89d3725310d3755b Mon Sep 17 00:00:00 2001 From: John Cowen Date: Mon, 4 Jul 2022 18:49:41 +0100 Subject: [PATCH] ui: Slight update to peering mocks to more properly match actual (#13664) --- ui/packages/consul-ui/mock-api/v1/peering/_ | 2 ++ ui/packages/consul-ui/mock-api/v1/peerings | 18 +++++++++++++++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/ui/packages/consul-ui/mock-api/v1/peering/_ b/ui/packages/consul-ui/mock-api/v1/peering/_ index 85f779d540..46c1a1af2a 100644 --- a/ui/packages/consul-ui/mock-api/v1/peering/_ +++ b/ui/packages/consul-ui/mock-api/v1/peering/_ @@ -1,5 +1,7 @@ { "ID": "${fake.random.uuid()}", + "ImportedServiceCount": ${fake.random.number({min: 0, max: 4000})}, + "ExportedServiceCount": ${fake.random.number({min: 0, max: 4000})}, "Name": "${location.pathname.get(2)}", "State": "${fake.helpers.randomize([ 'ACTIVE', diff --git a/ui/packages/consul-ui/mock-api/v1/peerings b/ui/packages/consul-ui/mock-api/v1/peerings index 10cbdd5246..a579a06ddd 100644 --- a/ui/packages/consul-ui/mock-api/v1/peerings +++ b/ui/packages/consul-ui/mock-api/v1/peerings @@ -2,10 +2,12 @@ ${ range( env('CONSUL_PEER_COUNT', Math.floor((Math.random() * 10) + 1)) - ).map(i => ` + ).map(i => { + const id = `${fake.random.uuid()}-${i}`; + return ` { - "ID": "${fake.random.uuid()}-${i}", + "ID": "${id}", "Name": "${fake.hacker.noun()}-peer-${i}", "State": "${fake.helpers.randomize([ 'ACTIVE', @@ -18,9 +20,19 @@ ])}", "ImportedServiceCount": ${fake.random.number({min: 0, max: 4000})}, "ExportedServiceCount": ${fake.random.number({min: 0, max: 4000})}, + "PeerID": "${id}", + "PeerServerName": "${fake.internet.domainName()}", + "PeerServerAddresses": [ +${ + range( + env('CONSUL_PEER_ADDRESS_COUNT', Math.floor((Math.random() * 10) + 1)) + ).map(i => ` + "${fake.internet.ip()}:${fake.random.number({min: 0, max: 65535})}" +`)} + ], "CreateIndex": 16, "ModifyIndex": 16 } -`)} +`})} ]