projects
/
VSoRC
/
.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Documentacion agregada - previo a la presentacion
[VSoRC/.git]
/
js
/
topology
/
topology.js
diff --git
a/js/topology/topology.js
b/js/topology/topology.js
index ebd33a0b841a27791cbfdef010b7ed8be29fdd29..7808f33e749c1669a366302c2c42f9b66bfb6e13 100644
(file)
--- a/
js/topology/topology.js
+++ b/
js/topology/topology.js
@@
-43,6
+43,14
@@
$(function () {
// "port": {"source": "00000003", "target": "00000002"}, "value": 4},
// ...
// ]}
// "port": {"source": "00000003", "target": "00000002"}, "value": 4},
// ...
// ]}
+function displayMessage(msg) {
+ var $x = $("#snackbar");
+ $x.text(msg)
+ $x.toggleClass("show");
+ setTimeout(function () { $x.toggleClass("show"); }, 3000);
+}
+
+
function toGraph(top) {
var nodes = [];
var links = [];
function toGraph(top) {
var nodes = [];
var links = [];
@@
-300,6
+308,9
@@
$(function () {
xhr.onload = function() {
if (xhr.status == 200) { //can use this.status instead
//console.log(xhr.responseText);// para ver en la consola
xhr.onload = function() {
if (xhr.status == 200) { //can use this.status instead
//console.log(xhr.responseText);// para ver en la consola
+ if(xhr.response === null || xhr.response === ""){
+ displayMessage("No response from controller")
+ }
plotGraph(toGraph(JSON.parse(xhr.responseText)));
}
}
plotGraph(toGraph(JSON.parse(xhr.responseText)));
}
}