Add access log widget
This commit is contained in:
parent
bc9a8283c6
commit
0a994e5b98
12 changed files with 181 additions and 0 deletions
|
|
@ -3,6 +3,7 @@ import * as riot from 'riot';
|
|||
import activateMe from './i';
|
||||
import activateApi from './api';
|
||||
import ServerStreamManager from '../scripts/server-stream-manager';
|
||||
import RequestsStreamManager from '../scripts/requests-stream-manager';
|
||||
|
||||
export default (me, stream) => {
|
||||
activateMe(me);
|
||||
|
|
@ -11,4 +12,5 @@ export default (me, stream) => {
|
|||
(riot as any).mixin('stream', { stream });
|
||||
|
||||
(riot as any).mixin('server-stream', { serverStream: new ServerStreamManager() });
|
||||
(riot as any).mixin('requests-stream', { requestsStream: new RequestsStreamManager() });
|
||||
};
|
||||
|
|
|
|||
12
src/web/app/common/scripts/requests-stream-manager.ts
Normal file
12
src/web/app/common/scripts/requests-stream-manager.ts
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
import StreamManager from './stream-manager';
|
||||
import Connection from './requests-stream';
|
||||
|
||||
export default class RequestsStreamManager extends StreamManager<Connection> {
|
||||
public getConnection() {
|
||||
if (this.connection == null) {
|
||||
this.connection = new Connection();
|
||||
}
|
||||
|
||||
return this.connection;
|
||||
}
|
||||
}
|
||||
14
src/web/app/common/scripts/requests-stream.ts
Normal file
14
src/web/app/common/scripts/requests-stream.ts
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
'use strict';
|
||||
|
||||
import Stream from './stream';
|
||||
|
||||
/**
|
||||
* Requests stream connection
|
||||
*/
|
||||
class Connection extends Stream {
|
||||
constructor() {
|
||||
super('requests');
|
||||
}
|
||||
}
|
||||
|
||||
export default Connection;
|
||||
Loading…
Add table
Add a link
Reference in a new issue