+
%radarIp%
@@ -97,7 +97,7 @@
$.table.init(options);
});
- var socket = new WebSocket("ws://localhost/websocket");
+ var socket = new WebSocket("ws://192.168.120.15/websocket");
socket.onopen = function(event) {
console.log("WebSocket连接已打开");
@@ -116,14 +116,21 @@
var template = $('#profileTemplate').html()
var view = ''
$.each(data, function (i, row) {
- view += template.replace('%userCode%', row.userCode)
- .replace('%IMAGE%', "https://xjl559.oss-cn-shanghai.aliyuncs.com/2023/12/11/%E6%88%AA%E5%B1%8F2024-01-08%2013.57.36.png")
+ view += template
+ .replace('%IMAGE%', getImageUrl(row.radarIp))
.replace('%radarIp%', row.radarIp)
.replace('%radarLocation%', row.radarLocation)
})
return `
${view}
`
}
+ function getImageUrl(radarIp) {
+ if (radarIp === '192.168.0.7') {
+ return "https://xjl559.oss-cn-shanghai.aliyuncs.com/2023/12/11/%E6%88%AA%E5%B1%8F2024-01-08%2013.57.36.png";
+ } else if (radarIp === '192.168.0.8') {
+ return "https://xjl559.oss-cn-shanghai.aliyuncs.com/2023/12/11/%E6%88%AA%E5%B1%8F2024-01-09%2016.59.50.png";
+ }
+ }