ui: Slight update to peering mocks to more properly match actual (#13664)

This commit is contained in:
John Cowen 2022-07-04 18:49:41 +01:00 committed by GitHub
parent 9377ac7635
commit 756072898d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 17 additions and 3 deletions

View File

@ -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',

View File

@ -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
}
`)}
`})}
]