GUI -- Implemented sendEvent() in WsEventService.
Change-Id: Iac4833e66e7688e490b24b4cbaca3514a59ce618
diff --git a/web/gui/src/main/webapp/app/fw/remote/wsevent.js b/web/gui/src/main/webapp/app/fw/remote/wsevent.js
index c410592..bf04b86 100644
--- a/web/gui/src/main/webapp/app/fw/remote/wsevent.js
+++ b/web/gui/src/main/webapp/app/fw/remote/wsevent.js
@@ -20,11 +20,28 @@
(function () {
'use strict';
+ var sid = 0;
+
angular.module('onosRemote')
- .factory('WsEventService', ['$location', function ($loc) {
-
+ .factory('WsEventService', [function () {
+
+ function sendEvent(ws, evType, payload) {
+ var p = payload || {};
+
+ ws.send({
+ event: evType,
+ sid: ++sid,
+ payload: p
+ });
+ }
+
+ function resetSid() {
+ sid = 0;
+ }
+
return {
- tbd: function () {}
+ sendEvent: sendEvent,
+ resetSid: resetSid
};
}]);