swarm-ui: test which entries the egress card lists and the swarm-wide add body
This commit is contained in:
parent
ad76e7e937
commit
7122a3a36d
1 changed files with 30 additions and 3 deletions
|
|
@ -83,3 +83,12 @@ export function entryBody(
|
|||
const name = domain.trim();
|
||||
return forSwarm ? { domain: name } : { domain: name, agent };
|
||||
}
|
||||
|
||||
/**
|
||||
* The entries that hold for every agent, which the swarm page's egress card
|
||||
* lists: not an agent's own, and not an automatic one (kept by the controller
|
||||
* from an environment or account, so nothing to remove).
|
||||
*/
|
||||
export function swarmWideEntries(entries: AllowedDomain[]): AllowedDomain[] {
|
||||
return entries.filter((e) => e.agent === undefined && e.derived !== true);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue