show api preview
This commit is contained in:
@@ -128,7 +128,7 @@ def _mask_auth_key(value: str) -> str:
|
|||||||
return ""
|
return ""
|
||||||
if len(value) <= 10:
|
if len(value) <= 10:
|
||||||
return value
|
return value
|
||||||
return f"{value[:6]}...{value[-4:]}"
|
return f"{value[:5]}...{value[-5:]}"
|
||||||
|
|
||||||
def _prune_stopped_pipelines() -> None:
|
def _prune_stopped_pipelines() -> None:
|
||||||
stale_ids: List[str] = []
|
stale_ids: List[str] = []
|
||||||
|
|||||||
@@ -74,6 +74,17 @@ function parseToolCsv(value: string): string[] {
|
|||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function maskSecretPreview(value: string): string {
|
||||||
|
const trimmed = value.trim();
|
||||||
|
if (!trimmed) {
|
||||||
|
return "";
|
||||||
|
}
|
||||||
|
if (trimmed.length <= 10) {
|
||||||
|
return trimmed;
|
||||||
|
}
|
||||||
|
return `${trimmed.slice(0, 5)}...${trimmed.slice(-5)}`;
|
||||||
|
}
|
||||||
|
|
||||||
function getGraphArchImage(graphId: string): string | null {
|
function getGraphArchImage(graphId: string): string | null {
|
||||||
const normalizedGraphId = graphId.trim().toLowerCase();
|
const normalizedGraphId = graphId.trim().toLowerCase();
|
||||||
for (const [path, source] of Object.entries(GRAPH_ARCH_IMAGE_MODULES)) {
|
for (const [path, source] of Object.entries(GRAPH_ARCH_IMAGE_MODULES)) {
|
||||||
@@ -674,6 +685,9 @@ export default function App() {
|
|||||||
placeholder="Enter provider API key"
|
placeholder="Enter provider API key"
|
||||||
disabled={busy}
|
disabled={busy}
|
||||||
/>
|
/>
|
||||||
|
{editor.apiKey ? (
|
||||||
|
<small className="empty">Preview: {maskSecretPreview(editor.apiKey)}</small>
|
||||||
|
) : null}
|
||||||
</label>
|
</label>
|
||||||
|
|
||||||
<label>
|
<label>
|
||||||
|
|||||||
Reference in New Issue
Block a user