nav tabs on admin dashboard

This commit is contained in:
2019-03-07 00:20:34 -06:00
parent f73d6ae228
commit e4f473f376
11661 changed files with 216240 additions and 1544253 deletions
+43 -25
View File
@@ -1,34 +1,39 @@
# EventSource [![Build Status](https://secure.travis-ci.org/aslakhellesoy/eventsource-node.png)](http://travis-ci.org/aslakhellesoy/eventsource-node) [![Dependencies](https://david-dm.org/aslakhellesoy/eventsource-node.png)](https://david-dm.org/aslakhellesoy/eventsource-node) [![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/aslakhellesoy/eventsource-node/trend.png)](https://bitdeli.com/free "Bitdeli Badge")
# EventSource [![npm version](http://img.shields.io/npm/v/eventsource.svg?style=flat-square)](http://browsenpm.org/package/eventsource)[![Build Status](http://img.shields.io/travis/EventSource/eventsource/master.svg?style=flat-square)](https://travis-ci.org/EventSource/eventsource)[![NPM Downloads](https://img.shields.io/npm/dm/eventsource.svg?style=flat-square)](http://npm-stat.com/charts.html?package=eventsource&from=2015-09-01)[![Dependencies](https://img.shields.io/david/EventSource/eventsource.svg?style=flat-square)](https://david-dm.org/EventSource/eventsource)
This library is a pure JavaScript implementation of the [EventSource](https://html.spec.whatwg.org/multipage/server-sent-events.html#server-sent-events) client. The API aims to be W3C compatible.
[![NPM](https://nodei.co/npm/eventsource.png?stars&downloads)](https://nodei.co/npm/eventsource/)
[![NPM](https://nodei.co/npm-dl/eventsource.png)](https://nodei.co/npm/eventsource/)
This library implements the [EventSource](http://dev.w3.org/html5/eventsource/) client for Node.js. The API aims to be W3C compatible.
You can use it with Node.js or as a browser polyfill for
[browsers that don't have native `EventSource` support](http://caniuse.com/#feat=eventsource).
## Install
npm install eventsource
## Usage
```javascript
var EventSource = require('eventsource');
var es = new EventSource('http://demo-eventsource.rhcloud.com/');
es.onmessage = function(e) {
console.log(e.data);
};
es.onerror = function() {
console.log('ERROR!');
};
```
See the [spec](http://dev.w3.org/html5/eventsource/) for API docs.
## Example
See https://github.com/einaros/sse-example
npm install
node ./example/sse-server.js
node ./example/sse-client.js # Node.js client
open http://localhost:8080 # Browser client - both native and polyfill
curl http://localhost:8080/sse # Enjoy the simplicity of SSE
## Browser Polyfill
Just add `example/eventsource-polyfill.js` file to your web page:
```html
<script src=/eventsource-polyfill.js></script>
```
Now you will have two global constructors:
```javascript
window.EventSourcePolyfill
window.EventSource // Unchanged if browser has defined it. Otherwise, same as window.EventSourcePolyfill
```
If you're using [webpack](https://webpack.github.io/) or [browserify](http://browserify.org/)
you can of course build your own. (The `example/eventsource-polyfill.js` is built with webpack).
## Extensions to the W3C API
@@ -46,11 +51,11 @@ var es = new EventSource(url, eventSourceInitDict);
### Allow unauthorized HTTPS requests
By default, https requests that cannot be authorized will cause connection to fail and an exception
to be emitted. You can override this behaviour:
By default, https requests that cannot be authorized will cause the connection to fail and an exception
to be emitted. You can override this behaviour, along with other https options:
```javascript
var eventSourceInitDict = {rejectUnauthorized: false};
var eventSourceInitDict = {https: {rejectUnauthorized: false}};
var es = new EventSource(url, eventSourceInitDict);
```
@@ -69,3 +74,16 @@ es.onerror = function (err) {
}
};
```
### HTTP/HTTPS proxy
You can define a `proxy` option for the HTTP request to be used. This is typically useful if you are behind a corporate firewall.
```javascript
var es = new EventSource(url, {proxy: 'http://your.proxy.com'});
```
## License
MIT-licensed. See LICENSE