zabbix-react-component
v2.0.1
Published
A package for Zabbix interaction by React components
Downloads
6
Readme
zabbix-react-component
Overview
React components for Zabbix-API interaction. Works with backend API - zabbix-reactor.
Usage
specUrl - path to zabbix-reactor spec-file
import { OpenApiSwagger, HostConfig, HostGraph } from 'zabbix-react-component'
window.localStorage.setItem('token', 'test')
const specUrl = 'http://localhost:8002/spec/swagger.json'
const swg = new OpenApiSwagger(specUrl)
swg.connect((client, err) => {
if (err) {
ReactDOM.render(
<div className='std-win'>no spec - <a href={specUrl}>{specUrl}</a> !</div>,
document.getElementById('root')
)
}
else {
ReactDOM.render(
<div>
<HostConfig swgClient={client} headerTxt='HostConfig component' />
<HostGraph swgClient={client} headerTxt='HostGraph component' />
</div>,
document.getElementById('root')
)
}
})
Dependencies
swagger-js: for backend API zabbix-reactor in OpenAPI-Spec format
d3: visual data manipulanion tools