Skip to content

Commit

Permalink
feat(ui): topology logos if possible (#2521)
Browse files Browse the repository at this point in the history
  • Loading branch information
talboren authored Nov 18, 2024
1 parent 0445e57 commit ddcf62d
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 0 deletions.
1 change: 1 addition & 0 deletions keep-ui/app/topology/model/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ export interface TopologyService {
ip_address?: string;
mac_address?: string;
manufacturer?: string;
category?: string;
application_ids: string[];
// Added on client to optimize rendering
applications: TopologyApplicationMinimal[];
Expand Down
13 changes: 13 additions & 0 deletions keep-ui/app/topology/ui/map/service-node.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { ServiceNodeType, TopologyService } from "../../model/models";
import { Badge } from "@tremor/react";
import { getColorForUUID } from "@/app/topology/lib/badge-colors";
import { clsx } from "clsx";
import Image from "next/image";

const THRESHOLD = 5;

Expand Down Expand Up @@ -107,6 +108,18 @@ export function ServiceNode({ data, selected }: NodeProps<ServiceNodeType>) {
onMouseEnter={() => setShowDetails(true)}
onMouseLeave={() => setShowDetails(false)}
>
{data.category && (
<div className="absolute top-2 right-2 text-gray-400">
<Image
className="inline-block"
alt={data.category}
height={24}
width={24}
title={data.category}
src={`/icons/${data.category.toLowerCase()}-icon.png`}
/>
</div>
)}
<strong className="text-lg">{data.display_name || data.service}</strong>
{alertCount > 0 && (
<span
Expand Down
Binary file added keep-ui/public/icons/go-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added keep-ui/public/icons/nextjs-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions keep/api/utils/tenant_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

from sqlmodel import Session, select

from keep.api.core.config import config
from keep.api.models.db.tenant import TenantApiKey
from keep.contextmanager.contextmanager import ContextManager
from keep.identitymanager.rbac import Admin as AdminRole
Expand Down Expand Up @@ -218,6 +219,11 @@ def get_api_keys_secret(
f"{api_key.tenant_id}-{api_key.reference_id}"
)

read_only_bypass_key = config("KEEP_READ_ONLY_BYPASS_KEY", default="")
if read_only_bypass_key and read_only_bypass_key == secret:
# Do not return the bypass key if set.
continue

api_keys_with_secret.append(
{
"reference_id": api_key.reference_id,
Expand Down

0 comments on commit ddcf62d

Please sign in to comment.