Skip to content

Latest commit

 

History

History
57 lines (47 loc) · 1.3 KB

adding-tab-pods-page.adoc

File metadata and controls

57 lines (47 loc) · 1.3 KB

Adding a tab to the pods page

Procedure
  1. Add the following to the console-extensions.json file:

    {
        "type": "console.page/resource/tab",
        "properties": {
            "name": "Example Tab",
            "href": "example",
            "model": {
                "group": "core",
                "version": "v1",
                "kind": "Pod"
            },
            "component": { "$codeRef": "ExampleTab" }
    }
  2. Edit the package.json file to include the following changes:

            "exposedModules": {
                "ExamplePage": "./components/ExamplePage",
                "ExampleTab": "./components/ExampleTab"
            }
  3. Write a message to display on a new custom tab on the Pods page by creating a new file src/components/ExampleTab.tsx and adding the following script:

    import * as React from 'react';
    
    export default function ExampleTab() {
        return (
            <p>This is a custom tab added to a resource using a dynamic plug-in.</p>
        );
    }
Verification
  • Visit a Pod page to view the added tab.