@lims.io/connector-control-panel
v0.3.0
Published
Connector for LIMS Control Panel
Maintainers
Readme
LIMS Connector for Control Panel
Injects Control Panel to the web page and allows communication with the related API.
Getting started
import ControlPanel from "lims-connector-control-panel";
// The name of the node that will hold the control panel
const node = '#container';
// Url to control panel api
const url = 'http://control-panel.lims.io';
// Permatoken
const permatoken = '... load from db ...';
const controlPanel = ControlPanel(node, url, {
permatoken,
onLoad() {
},
// Other API calls
});Drivers
The library can be also used as a part of the following frameworks.
React
import React from "react";
import ReactDOM from "react-dom";
import {createReactComponent} from "lims-connector-control-panel";
// Create panel component
const ControlPanel = createReactComponent(React, ReactDOM);
const View = ({url, permatoken, onLoad}) => (
<div>
<ControlPanel url={url} permatoken={permatoken} onLoad={onLoad}/>
</div>
);Scripts
yarn build- produces production version of your library under thedistfolderyarn test- runs the testsyarn test:watch- same as above but in a watch mode
