{"id":22546565,"url":"https://github.com/deephaven/js-plugin-template","last_synced_at":"2025-04-09T16:43:36.812Z","repository":{"id":39789728,"uuid":"332823636","full_name":"deephaven/js-plugin-template","owner":"deephaven","description":"A Template and Example Files for creating a Javascript Plugin","archived":false,"fork":false,"pushed_at":"2024-05-15T16:17:06.000Z","size":168,"stargazers_count":2,"open_issues_count":0,"forks_count":2,"subscribers_count":14,"default_branch":"main","last_synced_at":"2025-03-23T18:54:12.520Z","etag":null,"topics":["deephaven","javascript","plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":false,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/deephaven.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-01-25T17:15:10.000Z","updated_at":"2024-05-15T16:17:11.000Z","dependencies_parsed_at":"2025-02-02T09:28:26.822Z","dependency_job_id":"52b7a628-e470-46cf-8825-e74aa7f363dc","html_url":"https://github.com/deephaven/js-plugin-template","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deephaven%2Fjs-plugin-template","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deephaven%2Fjs-plugin-template/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deephaven%2Fjs-plugin-template/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deephaven%2Fjs-plugin-template/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deephaven","download_url":"https://codeload.github.com/deephaven/js-plugin-template/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248069565,"owners_count":21042665,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deephaven","javascript","plugin"],"created_at":"2024-12-07T15:08:13.919Z","updated_at":"2025-04-09T16:43:36.793Z","avatar_url":"https://github.com/deephaven.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# DEPRECATED\n\nPlease use the [cookiecutter templates](https://github.com/deephaven/deephaven-plugins/tree/main/templates) instead.\n\nUse this Template to create a Javascript Plugin\n\n## Initial Setup\n\nAfter checking out this template for the first time:\n\n1. Do an `npm install`\n\n## Source Files\n\n1. Your main source file is `src/index.js`\n\nIt is defaulted to ExamplePlugin.jsx from the examples directory which is a Table Plugin. You may want to overwrite with ExampleAppPlugin.jsx\nif you are writing an App Plugin.\n\n2. Copy any included source files into `src` maintaining their directory structure (none are needed for the examples).\n\n## Build the Plugin\n\n```\nnpm run build\n```\n\nYour output will be in `dist/main.js`\n\n## Uploading the Plugin\n\n1.  Create a directory on the Server to place the plugins.\n    ```\n    sudo -u irisadmin mkdir /etc/sysconfig/deephaven/plugins/javascript-plugins\n    ```\n\n2.  Set the config value for `Webapi.plugins` to point to the plugins directory.\n\n    - Export props:\n\n        ```\n        sudo -u dbquery /usr/illumon/latest/bin/etcd_prop_file --export iris-environment.prop /tmp\n        ```\n    \n    - Edit `/tmp/iris-environment.prop` and add the following line:\n\n        ```\n        Webapi.plugins=/etc/sysconfig/deephaven/plugins/javascript-plugins\n        ```\n    \n    - Import the updated props:\n        ```\n        sudo -u irisadmin /usr/illumon/latest/bin/etcd_prop_file --import /tmp/iris-environment.prop\n        ```\n\n3.  Copy the output file `main.js` to that directory on the server and rename it (e.g. `ExamplePlugin.js`).\n    ```\n    scp ./main.js username@host:/tmp\n    ssh username@host\n    sudo -u irisadmin cp /tmp/main.js /etc/sysconfig/deephaven/plugins/javascript-plugins/ExamplePlugin.js\n    ```\n\n4.  The file name is used as the name of the plugin. \u003cbr\u003e\n    e.g. `ExamplePlugin.js` will be named `ExamplePlugin`\n\n## Attach a Plugin in a Query\n\nSimply set the PLUGIN_NAME attribute on the Table with the name of the plugin \u003cbr\u003e\nFor a plugin located at https://host/url/iriside/plugins/ExamplePlugin.js \u003cbr\u003e\nThe name will ExamplePlugin\n\n```\nt=db.t(\"LearnDeephaven\", \"StockTrades\").where(\"Date=`2017-08-21`\")\nt.setAttribute(\"PluginName\", \"ExamplePlugin\")\n```\n\n## Setting an Application Level Plugin\n\nIn the config set `Webapi.app.plugins` to your plugin name. This can be a comma separated list to support multiple plugins.\n\n## Login Plugin\n\nA Login Plugin loads before the user logs in to the Web Client, and it allows UI permissions to be set. See `ExampleLoginPlugin.jsx` for an example.\nThe current supported permissions are:\n\n- canUsePanels - Allows the user access to the `Panels` button in the UI.\n- canCreateDashboard - Allows the user to create a new Dashboard.\n- canCreateCodeStudio - Allows the user to create a new Code Studio.\n- canCreateQueryMonitor - Allows the user to create a new Query Monitor.\n- canCopy - Allows the user to copy cells and rows from a table.\n- canDownloadCsv - Allows the user to download a table to CSV.\n\nAll permissions default to `true` but can be set to `false` for certain users or groups to disable functionality.\nThis is done by calling the `onPermissionOverrides` function in `componentDidMount`. Return an object with only\nthe permissions that need to be changed. If a user should have the default permissions, return an empty object.\n\n## Setting a Login Plugin\n\nAs with other plugin types, you must have a plugin directory configured and copy the Login Plugin to that directory.\n\nThen in the config set `Webapi.login.plugins` to your plugin name. This can be a comma separated list to support multiple login plugins.\n\nFinally, you must add this to the Auth Config, e.g.\n\n```\nauthentication.client.configuration.list=Webapi.login.plugins\n```\n\nThis last step allows the login plugin to load prior to the user logging in.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeephaven%2Fjs-plugin-template","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeephaven%2Fjs-plugin-template","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeephaven%2Fjs-plugin-template/lists"}