Authored by skinny.wu

dns monitor 在页面中添加数据更新时间

@@ -70,7 +70,7 @@ @@ -70,7 +70,7 @@
70 70
71 <div class="widget-box" style="background: white"> 71 <div class="widget-box" style="background: white">
72 <div class="widget-title" style="background: white"> 72 <div class="widget-title" style="background: white">
73 - <h5>DNS Monitor状态 (最近5分钟)</h5> 73 + <h5>DNS Monitor状态 (<span id="updateTime"></span> 前更新)</h5>
74 </div> 74 </div>
75 </div> 75 </div>
76 76
@@ -10,6 +10,7 @@ function queryCurrentInfo() { @@ -10,6 +10,7 @@ function queryCurrentInfo() {
10 dataType: "json", 10 dataType: "json",
11 success : function(data) { 11 success : function(data) {
12 updateDNSView(eval(data)); 12 updateDNSView(eval(data));
  13 + updateTimePanel();
13 $(function () { 14 $(function () {
14 $("[data-toggle='popover']").popover(); 15 $("[data-toggle='popover']").popover();
15 }); 16 });
@@ -39,6 +40,7 @@ function buildIpsTablesHTML(ips) { @@ -39,6 +40,7 @@ function buildIpsTablesHTML(ips) {
39 40
40 for(var uid in ips ) { 41 for(var uid in ips ) {
41 42
  43 + //uid为1的用户 解析到qcloud的域名, uid为1000的用户,解析到aws的域名
42 if(uid == 1) { 44 if(uid == 1) {
43 html += "<tr><td width='10%'><span style='color: darkgray'><strong>QCloud</strong></span></td>"; 45 html += "<tr><td width='10%'><span style='color: darkgray'><strong>QCloud</strong></span></td>";
44 }else { 46 }else {
@@ -65,6 +67,8 @@ function buildIpsTablesHTML(ips) { @@ -65,6 +67,8 @@ function buildIpsTablesHTML(ips) {
65 html +="</div></td>"; 67 html +="</div></td>";
66 } 68 }
67 69
  70 + //TODO 超链接到function
  71 + //html += "<td><a href='javasrcipt'><span style='font-size: large'>history</span></a></td></tr>";
68 html += "</tr>"; 72 html += "</tr>";
69 } 73 }
70 74
@@ -101,4 +105,12 @@ function getClass(tagName,className) @@ -101,4 +105,12 @@ function getClass(tagName,className)
101 } 105 }
102 return tagArr; 106 return tagArr;
103 } 107 }
  108 +}
  109 +
  110 +function updateTimePanel() {
  111 + var date = new Date();
  112 + var min = date.getMinutes();
  113 + var hour = date.getHours();
  114 +
  115 + document.getElementById("updateTime").innerHTML = hour + ":" + min;
104 } 116 }