Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ui): topology logos if possible #2521

Merged
merged 4 commits into from
Nov 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading