Louis 7812bf64d5
chore: #371 - reference to plugin name and module path as variables (#372)
* chore: #371 - plugin developer can reference to plugin name and module path as variables

* chore: display origin plugin name

* Switch from plugin-core to core

* Remove un-used command in ci test

---------

Co-authored-by: Hien To <tominhhien97@gmail.com>
2023-10-17 15:41:35 +07:00

13 lines
623 B
TypeScript

import { core, SystemMonitoringService } from "@janhq/core";
// Provide an async method to manipulate the price provided by the extension point
const getResourcesInfo = () => core.invokePluginFunc(MODULE_PATH, "getResourcesInfo");
const getCurrentLoad = () => core.invokePluginFunc(MODULE_PATH, "getCurrentLoad");
// Register all the above functions and objects with the relevant extension points
export function init({ register }) {
register(SystemMonitoringService.GetResourcesInfo, getResourcesInfo.name, getResourcesInfo);
register(SystemMonitoringService.GetCurrentLoad, getCurrentLoad.name, getCurrentLoad);
}