Skip to content

add shared MCP Apps viewers for core Kubernetes tools - #1480

Open
nader-ziada wants to merge 2 commits into
containers:mainfrom
nader-ziada:standard-mcp-apps
Open

nader-ziada wants to merge 2 commits into
containers:mainfrom
nader-ziada:standard-mcp-apps

Conversation

@nader-ziada

Copy link
Copy Markdown
Collaborator

Changes:

  • Introduce reusable table, metrics, and resource viewers with shared
    embedded HTML, JavaScript, and styling.
  • Attach viewers to namespace, project, pod, resource, event, and metrics
    tools. Preserve existing text output and resource payloads while adding
    structured data where needed.
  • Support column sorting, numeric metrics sorting, empty and error states,
    resource details, host themes, cancellation, ping, and resize reporting.
  • Expand Go and browser regression coverage, and isolate browser-host
    dependencies with a lockfile to eliminate npm audit findings.

Introduce reusable table, metrics, and resource viewers with shared
embedded HTML, JavaScript, and styling.

Attach viewers to namespace, project, pod, resource, event, and metrics
tools. Preserve existing text output and resource payloads while adding
structured data where needed.

Signed-off-by: Nader Ziada <nziada@redhat.com>
Comment thread pkg/mcpapps/standard.js
const a = quantity(left[sortColumn]), b = quantity(right[sortColumn]);
if (Number.isFinite(a) && Number.isFinite(b)) return a - b;
}
return text(left[sortColumn]).localeCompare(text(right[sortColumn]));

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

from my limited JS knowledge, I believe this is actually going to compare alphabetically (not chronologically)?

Wouldn't we want to compare Age chronologically?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, i'll change it to be by age similar to the standard kubectl’s chronological ordering

Comment thread pkg/mcpapps/styles.css Outdated
Comment thread pkg/toolsets/core/apps.go
Comment on lines +35 to +37
if phase, found, _ := unstructured.NestedString(item.Object, "status", "phase"); found {
row["Status"] = phase
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

wouldn't this miss important info on types like Deployment/Ingress?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this helper only handles Pods, Namespaces, and Projects. resources_list preserves the API server’s resource-specific columns. I’ve also added Deployment readiness/replica counts and Ingress routing fields to the YAML-mode viewer, with browser tests.

Signed-off-by: Nader Ziada <nziada@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants