Rework Graph page: node cards, key, toolbar bar and details card
- Custom graph nodes with identity kind tags and per-column colours; wider text, styled edge labels, "full access" for everything grants. - Filters, refresh and the key share one bar above the canvas. - Details card restructured into sections with capability chips, a collapsible policy HCL and a red Revoke button; shared CapabilityChips component. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
68e564eb6c
commit
d67a9c9b62
7 files changed
+441
-110
No files matched your search
@@ -2,6 +2,7 @@ import type { BaoClient } from '../../api/bao'
|
||||
import { dataPath } from '../../api/secrets'
|
||||
import { accessForPath } from '../../model/graph'
|
||||
import { pathMatches } from '../../model/policy'
|
||||
import { CapabilityChips } from '../shared/CapabilityChips'
|
||||
import { useAccessInputs } from '../shared/useAccessInputs'
|
||||
|
||||
interface Props {
|
||||
@@ -10,9 +11,6 @@ interface Props {
|
||||
secret: string
|
||||
}
|
||||
|
||||
// Capabilities that let someone change or remove the secret, or bypass policy checks.
|
||||
const RISKY = new Set(['delete', 'sudo'])
|
||||
|
||||
export function AccessPanel({ client, mount, secret }: Props) {
|
||||
const data = useAccessInputs(client)
|
||||
const path = dataPath(mount, secret)
|
||||
@@ -60,19 +58,7 @@ function Entries({ data, path }: { data: NonNullable<ReturnType<typeof useAccess
|
||||
<code>{e.policy}</code>
|
||||
</td>
|
||||
<td>
|
||||
{e.policy === 'root' ? (
|
||||
<ul className="chips">
|
||||
<li className="risky">full access</li>
|
||||
</ul>
|
||||
) : (
|
||||
<ul className="chips">
|
||||
{e.capabilities.map((c) => (
|
||||
<li key={c} className={RISKY.has(c) ? 'risky' : undefined}>
|
||||
{c}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
)}
|
||||
<CapabilityChips capabilities={e.capabilities} />
|
||||
</td>
|
||||
</tr>
|
||||
))}
|
||||
|
||||
Reference in new issue
Block a user