diff --git a/admin/ui/manual.go b/admin/ui/manual.go index ec18fc0a2..d112bc6b5 100644 --- a/admin/ui/manual.go +++ b/admin/ui/manual.go @@ -119,7 +119,11 @@ $(function(){ if (val == "") { val = "default" } - d.append('
  • '+val+'
  • '); + d.append( + $('
  • ').append( + $('').attr('href', '/manual'+path).text(val) + ) + ); }); }); diff --git a/admin/ui/route.go b/admin/ui/route.go index fc3dcbf1a..1f4cfc8fc 100644 --- a/admin/ui/route.go +++ b/admin/ui/route.go @@ -74,30 +74,37 @@ $(function(){ var params={};window.location.search.replace(/[?&]+([^=&]+)=([^&]*)/gi,function(str,key,value){params[key] = value;}); function renderRoutes(routes) { - var $table = $("table.routes"); - - var tbl = ''; - tbl += '#'; - tbl += 'Service'; - tbl += 'Source'; - tbl += 'Dest'; - tbl += 'Options'; - tbl += 'Weight'; - tbl += '' - tbl += '' + var $table = $('table.routes'); + + var thead = ''; + thead += '#'; + thead += 'Service'; + thead += 'Source'; + thead += 'Dest'; + thead += 'Options'; + thead += 'Weight'; + thead += ''; + + var $tbody = $(''); + for (var i=0; i < routes.length; i++) { var r = routes[i]; - tbl += ''; - tbl += '' + (i+1) + ''; - tbl += '' + r.service + ''; - tbl += '' + r.src + ''; - tbl += '' + r.dst + ''; - tbl += '' + r.opts + ''; - tbl += '' + (r.weight * 100).toFixed(2) + '%'; - tbl += ''; + + var $tr = $('') + + $tr.append($('').text(i+1)); + $tr.append($('').text(r.service)); + $tr.append($('').text(r.src)); + $tr.append($('').text(r.dst)); + $tr.append($('').text(r.opts)); + $tr.append($('').text((r.weight * 100).toFixed(2) + '%')); + + $tr.appendTo($tbody); } - tbl += ''; - $table.html(tbl); + + $table.empty(). + append($(thead)). + append($tbody); } var $filter = $('#filter'); @@ -105,7 +112,6 @@ $(function(){ $("tr").show(); if (!v) return; var words = v.split(' '); - console.log('words: ', words); for (var i=0; i < words.length; i++) { var w = words[i].trim(); if (w == "") continue; @@ -135,11 +141,14 @@ $(function(){ if (val == "") { val = "default" } - d.append('
  • '+val+'
  • '); + d.append( + $('
  • ').append( + $('').attr('href', '/manual'+path).text(val) + ) + ); }); }); - -}) +});