[ONOS-6958] Add glyph registration java code
Change-Id: I954c790062f8ff5498c34c334827c4f695278a9e
diff --git a/web/gui/src/main/webapp/app/fw/remote/websocket.js b/web/gui/src/main/webapp/app/fw/remote/websocket.js
index ff6c063..bd3e9e1 100644
--- a/web/gui/src/main/webapp/app/fw/remote/websocket.js
+++ b/web/gui/src/main/webapp/app/fw/remote/websocket.js
@@ -21,7 +21,7 @@
'use strict';
// injected refs
- var $log, $loc, fs, ufs, wsock, vs, ls;
+ var $log, $loc, fs, gs, ufs, wsock, vs, ls;
// internal state
var webSockOpts, // web socket options
@@ -33,6 +33,7 @@
url, // web socket URL
clusterNodes = [], // ONOS instances data for failover
clusterIndex = -1, // the instance to which we are connected
+ glyphs = [],
connectRetries = 0, // limit our attempts at reconnecting
openListeners = {}, // registered listeners for websocket open()
nextListenerId = 1, // internal ID for open listeners
@@ -52,6 +53,13 @@
// TODO: add connect info to masthead somewhere
}
});
+ glyphs = data.glyphs;
+ glyphs.forEach(function (d, i) {
+ var gdata = {};
+ gdata['_' + d.id] = d.viewbox;
+ gdata[d.id] = d.path;
+ gs.registerGlyphs(gdata);
+ });
},
error: function (data) {
@@ -187,6 +195,7 @@
handlers = {};
clusterNodes = [];
clusterIndex = -1;
+ glyphs = [];
connectRetries = 0;
openListeners = {};
nextListenerId = 1;
@@ -324,12 +333,13 @@
// ===== Definition of module
angular.module('onosRemote')
.factory('WebSocketService',
- ['$log', '$location', 'FnService', 'UrlFnService', 'WSock',
+ ['$log', '$location', 'FnService', 'GlyphService', 'UrlFnService', 'WSock',
- function (_$log_, _$loc_, _fs_, _ufs_, _wsock_) {
+ function (_$log_, _$loc_, _fs_, _gs_, _ufs_, _wsock_) {
$log = _$log_;
$loc = _$loc_;
fs = _fs_;
+ gs = _gs_;
ufs = _ufs_;
wsock = _wsock_;