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

plugins/examples: Add platformeng example #2575

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
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
29 changes: 29 additions & 0 deletions plugins/examples/platformeng/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# The output for npm run storybook-book, static html built storybook for the plugin
storybook-static

.eslintcache

5 changes: 5 additions & 0 deletions plugins/examples/platformeng/.vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
// See http://go.microsoft.com/fwlink/?LinkId=827846
// for the documentation about the extensions.json format
"recommendations": ["dbaeumer.vscode-eslint", "esbenp.prettier-vscode"]
}
17 changes: 17 additions & 0 deletions plugins/examples/platformeng/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
// Place your settings in this file to overwrite default and user settings.
{
"editor.formatOnSave": true,
"editor.defaultFormatter": "esbenp.prettier-vscode",
"[javascript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[javascriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescript]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"[typescriptreact]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
}
}
33 changes: 33 additions & 0 deletions plugins/examples/platformeng/.vscode/tasks.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
// See https://go.microsoft.com/fwlink/?LinkId=733558
// for the documentation about the tasks.json format
{
"version": "2.0.0",
"tasks": [
{
"type": "npm",
"script": "start",
"problemMatcher": ["$tsc-watch", "$eslint-compact"],
"isBackground": true,
"presentation": {
"reveal": "never"
},
"group": {
"kind": "build",
"isDefault": true
}
},
{
"type": "npm",
"script": "test",
"problemMatcher": ["$tsc-watch", "$eslint-compact"],
"isBackground": true,
"presentation": {
"reveal": "always"
},
"group": {
"kind": "test",
"isDefault": true
}
}
]
}
21 changes: 21 additions & 0 deletions plugins/examples/platformeng/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Example Plugin: Pod Counter

This example plugin shows how to put something in the appbar at the top of Headlamp. Also how to
use the K8s API to count the number of pods in the cluster.

![screenshot of the logo being changed](../../../docs/development/plugins/images/podcounter_screenshot.png)

To run the plugin:

```bash
cd plugins/examples/pod-counter
npm install
npm start
# See the app bar at the top of Headlamp has changed to show the number of Pods.
```

The main code for the plugin is in [src/index.tsx](src/index.tsx).

See the API documentation for:

- [registerAppBarAction](https://headlamp.dev/docs/latest/development/api/modules/plugin_registry/#registerappbaraction)
Loading
Loading