2017-03-21 15:43:32 +03:00
# Mibew Operator Status plugin
2016-10-16 06:21:04 +03:00
Plugin for Mibew, get statement based on the availability of operators.
2016-10-16 11:10:06 +03:00
2018-09-24 15:08:31 +03:00
# Usage
2016-10-16 11:10:06 +03:00
2017-03-18 16:56:45 +03:00
1. Get any operators online status:
2017-03-25 15:40:30 +03:00
* request URL: `<MIBEW-BASE-URL>/opstatus` .
2017-03-18 16:56:45 +03:00
* return `true` when any operators is online and `false` when not.
2017-03-25 15:40:30 +03:00
2. Get any operators online status in specificed group:
* request URL: `<MIBEW-BASE-URL>/opstatus/group/<GROUP-ID>` .
* return `true` when any operators in this group is online and `false` when not.
3. Get an operator online status by operator code:
2017-03-18 16:56:45 +03:00
* Request URL: `<MIBEW-BASE-URL>/opstatus/<OPERATOR-CODE>` .
* return `true` when operator is online or `false` when not.
2017-03-25 15:40:30 +03:00
4. Use callback parameter:
2017-03-18 16:56:45 +03:00
2018-09-24 15:09:32 +03:00
Just insert `<script>` tag and set `src` to URL above and add `callback` parameter
2017-03-18 16:56:45 +03:00
* `<MIBEW-BASE-URL>/opstatus?callback=<CALLBACK_FUNCTION>`
* `<MIBEW-BASE-URL>/opstatus/<OPERATOR-CODE>?callback=<CALLBACK_FUNCTION>`
will return bellow and run `CALLBACK_FUNCTION` automatically.
```javascript
/**/CALLBACK_FUNCTION(status);
```
2016-10-16 11:10:06 +03:00
# Install
2017-03-21 15:41:39 +03:00
1. Get the archive with the plugin sources. You can download it from the [official site ](https://mibew.org/plugins#mibew-operator-status ) or build the plugin from sources.
2016-10-16 11:10:06 +03:00
2. Untar/unzip the plugin's archive.
3. Put files of the plugins to the `<MIBEW-ROOT>/plugins` folder.
4. Navigate to `<MIBEW-BASE-URL>/operator/plugin` page and enable the plugin.
**Tips**: if you plugin state is "not initialized", please check `<MIBEW-ROOT>/configs/config.yml` file is not:
```yml
...
plugins: []
...
```
and should be like this:
```yml
...
plugins:
"SomePlugin":
key: value
...
```
2017-03-20 18:30:39 +03:00
# Build from sources
1. Obtain a copy of the repository using `git clone` , download button, or another way.
2. Install [node.js ](http://nodejs.org/ ) and [npm ](https://www.npmjs.org/ ).
3. Install [Gulp ](http://gulpjs.com/ ).
4. Install npm dependencies using `npm install` .
5. Run Gulp to build the sources using `gulp default` .
Finally `.tar.gz` and `.zip` archives of the ready-to-use Plugin will be available in release directory.
2016-10-16 11:10:06 +03:00
# License
[MIT ](LICENSE )