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

docs:Remove weird template plugin example and add very basic hello world #25

Merged
merged 1 commit into from
Nov 5, 2021
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
3 changes: 3 additions & 0 deletions plugin-api/Examples/hello-world/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Hello world plugin

Minimal plugin example. To try this out with UI service, copy this folder and include MetaflowPluginAPI.js to it. Documentation on installing plugins [here](https://github.com/Netflix/metaflow-service/blob/master/services/ui_backend_service/docs/plugins.md).
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Template plugin",
"name": "Hello world",
"version": "0.0.1",
"entrypoint": "plugin.html"
}
34 changes: 34 additions & 0 deletions plugin-api/Examples/hello-world/plugin.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Hello world plugin</title>
</head>

<body>
<div class="container" id="container">
Hello world!
</div>
<!-- MetaflowPluginAPI.js Must be used to register plugin for the UI -->
<!-- REMEMBER TO UPDATE THIS LINK TO ACTUAL METAFLOW JS API FILE. Check README for more info -->
<script src="MetaflowPluginAPI.js"></script>
<script>
(function () {
// Call register function to tell UI where application should be rendered. Callback will be called after
// plugin is placed to correct spot in UI.
Metaflow.register({ slot: 'run-header', container: 'titled-container'}, () => {
// Set fixed height for plugin
Metaflow.setHeight(40);
// Subscribe to any update on run data and show run number in plugin.
Metaflow.subscribe(['run'], (event) => {
document.getElementById('container').innerHTML = `Hello World! Run number is ${event.data.run_number}`;
});
})
})();
</script>
</body>

</html>
3 changes: 3 additions & 0 deletions plugin-api/Examples/recent-runs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Recent runs plugin

Plugin that fetches most recent runs for current flow and shows up their durations.
13 changes: 10 additions & 3 deletions plugin-api/Examples/recent-runs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
body {
margin: 0;
padding: 0;
font-family: sans-serif;
}

.container {
Expand All @@ -21,27 +22,33 @@
padding: 0 15px;
}

#runs-list {
display: flex;
}

.run {
display: flex;
background: #f7f7f7;
padding: 1rem;
border-radius: 4px;
margin-right: 1rem;
}

.run a {
margin-right: 15px;
color: #000;
}
</style>
</head>

<body>
<div class="container" id="container">
<div class="column">
<div>Recent runs</div>
<div id="runs-list"></div>
</div>
</div>

<!-- REMEMBER TO UPDATE THIS LINK TO ACTUAL METAFLOW JS API FILE. Check README for more info -->
<script src="PATH_TO_METAFLOW_API/MetaflowPluginAPI.js"></script>
<script src="MetaflowPluginAPI.js"></script>
<script>
(function () {
// Register plugin to run header section
Expand Down
2 changes: 1 addition & 1 deletion plugin-api/Examples/recent-runs/manifest.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "recent-runs",
"name": "Recent runs",
"version": "0.0.1",
"entrypoint": "index.html"
}
40 changes: 0 additions & 40 deletions plugin-api/Examples/template-plugin/README.md

This file was deleted.

170 changes: 0 additions & 170 deletions plugin-api/Examples/template-plugin/plugin.html

This file was deleted.

21 changes: 0 additions & 21 deletions plugin-api/Examples/template-plugin/templates/print-array.html

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.