Revert "Merge pull request #293 from pgreyson/master"
This reverts commit 7171a069fe3ee98e924e0e05ff1ae779d1de8e18, reversing
changes made to e7f2283c2117adfcc64e10cb402179746fd88322.
diff --git a/web/ons-demo/RELEASE_NOTES.txt b/web/ons-demo/RELEASE_NOTES.txt
index af084a2..17e70fe 100644
--- a/web/ons-demo/RELEASE_NOTES.txt
+++ b/web/ons-demo/RELEASE_NOTES.txt
@@ -17,8 +17,3 @@
2) if only the clicked controller is selected, selects all controllers again
- Update configuration files to match test bed
- Update sample JSON files from test bed
-
-** March 22, 2013 **
-- Workarounds for Chrome v25 rendering bugs
-- Fixed broken proxy functionality in restapi2.py
-- webui should now work when hosted from a different server than the controller (where it uses gui3.onlab.us:8080) and also when run from the same server (where it uses localhost:8080)
diff --git a/web/ons-demo/css/skin.default.css b/web/ons-demo/css/skin.default.css
index 6ff36ab..a04b0e0 100644
--- a/web/ons-demo/css/skin.default.css
+++ b/web/ons-demo/css/skin.default.css
@@ -118,12 +118,10 @@
.color11-selected .color11,
.color12-selected .color12 {
opacity: 1;
- pointer-events: auto;
}
.color0 {
opacity: .2;
- pointer-events: none;
fill: #222;
background-color: #222;
color: #444;
@@ -131,7 +129,6 @@
.color1 {
opacity: .2;
- pointer-events: none;
fill: #EC0033;
background-color: #EC0033;
}
@@ -144,42 +141,36 @@
.color3 {
opacity: .2;
- pointer-events: none;
fill: #3714B0;
background-color: #3714B0;
}
.color4 {
opacity: .2;
- pointer-events: none;
fill: #B12C49;
background-color: #B12C49;
}
.color5 {
opacity: .2;
- pointer-events: none;
fill: #402C84;
background-color: #402C84;
}
.color6 {
opacity: .2;
- pointer-events: none;
fill: #990021;
background-color: #990021;
}
.color7 {
opacity: .2;
- pointer-events: none;
fill: #990021;
background-color: ;
}
.color8 {
opacity: .2;
- pointer-events: none;
fill: #A67900;
background-color: #A67900;
}
@@ -192,21 +183,18 @@
.color10 {
opacity: .2;
- pointer-events: none;
fill: #1F0772;
background-color: #1F0772;
}
.color11 {
opacity: .2;
- pointer-events: none;
fill: #F56E8B;
background-color: #F56E8B;
}
.color12 {
opacity: .2;
- pointer-events: none;
fill: #6949D7;
background-color: #6949D7;
}
diff --git a/web/ons-demo/js/app.js b/web/ons-demo/js/app.js
index 9c58b45..8980d02 100644
--- a/web/ons-demo/js/app.js
+++ b/web/ons-demo/js/app.js
@@ -93,31 +93,10 @@
rings[1].angles[i] = (range.min + range.max)/2;
});
- // find the association between core switches and aggregation switches
- var aggregationSwitchMap = {};
- model.aggregationSwitches.forEach(function (s, i) {
- aggregationSwitchMap[s.dpid] = i + 1;
- });
-
- var coreSwitchMap = {};
- model.coreSwitches.forEach(function (s, i) {
- coreSwitchMap[s.dpid] = i + 1;
- });
-
- var coreLinks = {};
- model.links.forEach(function (l) {
- if (aggregationSwitchMap[l['src-switch']] && coreSwitchMap[l['dst-switch']]) {
- coreLinks[l['dst-switch']] = aggregationSwitchMap[l['src-switch']] - 1;
- }
- });
-
-
-
- // put core switches next to linked aggregation switches
+ // arrange core switches at equal increments
k = 360 / rings[2].switches.length;
rings[2].switches.forEach(function (s, i) {
-// rings[2].angles[i] = k * i;
- rings[2].angles[i] = rings[1].angles[coreLinks[s.dpid]];
+ rings[2].angles[i] = k * i;
});
function ringEnter(data, i) {
@@ -297,18 +276,9 @@
// do it again in 1s
setTimeout(function () {
-// sync(svg)
+ sync(svg)
}, 1000);
});
}
-svg = createTopologyView();
-// workaround for Chrome v25 bug
-// if executed immediately, the view box transform logic doesn't work properly
-// fixed in Chrome v27
-setTimeout(function () {
- // workaround for another Chrome v25 bug
- // viewbox transform stuff doesn't work in combination with browser zoom
- d3.select('#svg-container').style('zoom', window.document.body.clientWidth/window.document.width);
- sync(svg);
-}, 100);
+sync(createTopologyView());
\ No newline at end of file
diff --git a/web/ons-demo/js/model.js b/web/ons-demo/js/model.js
index 1f90362..6577fea 100644
--- a/web/ons-demo/js/model.js
+++ b/web/ons-demo/js/model.js
@@ -70,12 +70,12 @@
}
var proxyURLs = {
- links: '/wm/core/topology/links/json?proxy',
- switches: '/wm/core/topology/switches/all/json?proxy',
- flows: '/wm/flow/getall/json?proxy',
- activeControllers: '/wm/registry/controllers/json?proxy',
+ links: '/proxy/wm/core/topology/links/json',
+ switches: '/proxy/wm/core/topology/switches/all/json',
+ flows: '/proxy/wm/flow/getall/json',
+ activeControllers: '/proxy/wm/registry/controllers/json',
controllers: 'data/controllers.json',
- mapping: '/wm/registry/switches/json?proxy',
+ mapping: '/proxy/wm/registry/switches/json',
configuration: 'data/configuration.json'
}
diff --git a/web/restapi2.py b/web/restapi2.py
index c9952ac..ca6ad5c 100755
--- a/web/restapi2.py
+++ b/web/restapi2.py
@@ -53,19 +53,15 @@
return response
-## PROXY API (allows development where the webui is served from someplace other than the controller)##
-ONOS_GUI3_HOST="http://gui3.onlab.us:8080"
-ONOS_LOCAL_HOST="http://localhost:8080" ;# for Amazon EC2
+## PROXY API (allows development where the webui is served from someplace other than the ONOS_HOST)##
+#ONOS_HOST="http://gui3.onlab.us:8080"
+ONOS_HOST="http://localhost:8080" ;# for Amazon EC2
@app.route("/wm/core/topology/switches/all/json")
+@app.route("/proxy/wm/core/topology/switches/all/json")
def switches():
- if request.args.get('proxy') == None:
- host = ONOS_LOCAL_HOST
- else:
- host = ONOS_GUI3_HOST
-
try:
- command = "curl -s %s/wm/core/topology/switches/all/json" % (host)
+ command = "curl -s %s/wm/core/topology/switches/all/json" % (ONOS_HOST)
print command
result = os.popen(command).read()
except:
@@ -76,14 +72,10 @@
return resp
@app.route("/wm/core/topology/links/json")
+@app.route("/proxy/wm/core/topology/links/json")
def links():
- if request.args.get('proxy') == None:
- host = ONOS_LOCAL_HOST
- else:
- host = ONOS_GUI3_HOST
-
try:
- command = "curl -s %s/wm/core/topology/links/json" % (host)
+ command = "curl -s %s/wm/core/topology/links/json" % (ONOS_HOST)
print command
result = os.popen(command).read()
except:
@@ -94,14 +86,10 @@
return resp
@app.route("/wm/flow/getall/json")
+@app.route("/proxy/wm/flow/getall/json")
def flows():
- if request.args.get('proxy') == None:
- host = ONOS_LOCAL_HOST
- else:
- host = ONOS_GUI3_HOST
-
try:
- command = "curl -s %s/wm/flow/getall/json" % (host)
+ command = "curl -s %s/wm/flow/getall/json" % (ONOS_HOST)
print command
result = os.popen(command).read()
except:
@@ -112,14 +100,10 @@
return resp
@app.route("/wm/registry/controllers/json")
+@app.route("/proxy/wm/registry/controllers/json")
def registry_controllers():
- if request.args.get('proxy') == None:
- host = ONOS_LOCAL_HOST
- else:
- host = ONOS_GUI3_HOST
-
try:
- command = "curl -s %s/wm/registry/controllers/json" % (host)
+ command = "curl -s %s/wm/registry/controllers/json" % (ONOS_HOST)
print command
result = os.popen(command).read()
except:
@@ -130,14 +114,10 @@
return resp
@app.route("/wm/registry/switches/json")
+@app.route("/proxy/wm/registry/switches/json")
def registry_switches():
- if request.args.get('proxy') == None:
- host = ONOS_LOCAL_HOST
- else:
- host = ONOS_GUI3_HOST
-
try:
- command = "curl -s %s/wm/registry/switches/json" % (host)
+ command = "curl -s %s/wm/registry/switches/json" % (ONOS_HOST)
print command
result = os.popen(command).read()
except: