derive an agent's backend hosts into the egress allow list at the controller
This commit is contained in:
parent
4f32948a97
commit
c5a876b845
1 changed files with 950 additions and 25 deletions
|
|
@ -16,6 +16,9 @@
|
|||
// internet flag reaches any name the proxy's private-range rules leave, so an
|
||||
// entry matters only to a restricted one.
|
||||
//
|
||||
// An entry the controller keeps from the agent's backend environment (`derived`)
|
||||
// shows as automatic with no remove control; the route refuses to remove it.
|
||||
//
|
||||
// Its state belongs to one agent: callers key it by agent name.
|
||||
import { useEffect, useState } from "preact/hooks";
|
||||
import { ApiErrorPanel } from "@hive/shared/api-error-panel.js";
|
||||
|
|
@ -117,19 +120,32 @@ export function AllowedDomains({ agent }: { agent: string }) {
|
|||
{shown.length > 0 ? (
|
||||
<ul class="ui-agent-limits-list">
|
||||
{shown.map((e) => (
|
||||
<li key={`${e.agent ?? "*"}/${e.domain}`}>
|
||||
<li key={`${e.agent ?? "*"}/${e.domain}/${e.derived === true}`}>
|
||||
<Badge
|
||||
label={e.agent === undefined ? "swarm-wide" : agent}
|
||||
label={
|
||||
e.derived === true
|
||||
? "automatic"
|
||||
: e.agent === undefined
|
||||
? "swarm-wide"
|
||||
: agent
|
||||
}
|
||||
value={e.domain}
|
||||
title={
|
||||
e.derived === true
|
||||
? "kept from this agent's backend environment; change that variable to change it"
|
||||
: undefined
|
||||
}
|
||||
/>{" "}
|
||||
<Badge
|
||||
variant="quiet"
|
||||
value="remove"
|
||||
title={`stop allowing ${e.domain} for ${
|
||||
e.agent === undefined ? "every agent" : agent
|
||||
}`}
|
||||
onClick={() => void remove(e)}
|
||||
/>
|
||||
{e.derived === true ? null : (
|
||||
<Badge
|
||||
variant="quiet"
|
||||
value="remove"
|
||||
title={`stop allowing ${e.domain} for ${
|
||||
e.agent === undefined ? "every agent" : agent
|
||||
}`}
|
||||
onClick={() => void remove(e)}
|
||||
/>
|
||||
)}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
|
|
|
|||
Loading…
Reference in a new issue