|
@@ -1,15 +1,15 @@ |
|
|
|
|
|
|
|
|
var output = document.getElementById("newmessage"); |
|
|
|
|
|
var socket = new WebSocket("ws://" + document.location.host + "/action/notification"); |
|
|
|
|
|
|
|
|
var output = document.getElementById("newmessage"); |
|
|
|
|
|
var socket = new WebSocket("ws://" + document.location.host + "/action/notification"); |
|
|
|
|
|
|
|
|
socket.onopen = function () { |
|
|
|
|
|
|
|
|
socket.onopen = function () { |
|
|
console.log("message has connected."); |
|
|
console.log("message has connected."); |
|
|
}; |
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
var messageQueue = []; |
|
|
|
|
|
var maxSize = 10; |
|
|
|
|
|
|
|
|
var messageQueue = []; |
|
|
|
|
|
var maxSize = 10; |
|
|
|
|
|
|
|
|
socket.onmessage = function (e) { |
|
|
|
|
|
|
|
|
socket.onmessage = function (e) { |
|
|
console.log("data=" + e.data) |
|
|
console.log("data=" + e.data) |
|
|
var data =JSON.parse(e.data) |
|
|
var data =JSON.parse(e.data) |
|
|
var html = ""; |
|
|
var html = ""; |
|
@@ -40,5 +40,43 @@ |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
output.innerHTML = html |
|
|
output.innerHTML = html |
|
|
}; |
|
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
queryRecommendData(); |
|
|
|
|
|
|
|
|
|
|
|
function queryRecommendData(){ |
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
type:"GET", |
|
|
|
|
|
url:"/recommend/org", |
|
|
|
|
|
headers: { |
|
|
|
|
|
authorization:token, |
|
|
|
|
|
}, |
|
|
|
|
|
dataType:"json", |
|
|
|
|
|
async:false, |
|
|
|
|
|
success:function(json){ |
|
|
|
|
|
console.log(json); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
error:function(response) { |
|
|
|
|
|
console.log(response); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
$.ajax({ |
|
|
|
|
|
type:"GET", |
|
|
|
|
|
url:"/recommend/repo", |
|
|
|
|
|
headers: { |
|
|
|
|
|
authorization:token, |
|
|
|
|
|
}, |
|
|
|
|
|
dataType:"json", |
|
|
|
|
|
async:false, |
|
|
|
|
|
success:function(json){ |
|
|
|
|
|
console.log(json); |
|
|
|
|
|
|
|
|
|
|
|
}, |
|
|
|
|
|
error:function(response) { |
|
|
|
|
|
console.log(response); |
|
|
|
|
|
} |
|
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
|
|
} |