Skip to content

Commit

Permalink
chore(logview): triple-clicking to highlight url
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinzZH committed Jun 21, 2018
1 parent e5c4618 commit 0daa459
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 3 deletions.
10 changes: 9 additions & 1 deletion bin/tsw/util/auto-report/src/view.tmpl.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,15 @@
<span style="display:none">&nbsp;<span class="log_pass_time"></span></span>
<p style="display: none;" class="firstReq">
<label class="button label expand" style="cursor:pointer;" data-j="expand<%=i%>"><input type="checkbox" class="expandChk">展开</label>
<%=XSS.htmlEncode(reqUrl.replace(/\[.*?\]/g, '').replace(/\s+/, ' '))%>
<%
var titleText = XSS.htmlEncode(reqUrl.replace(/\[.*?\]/g, '').replace(/\s+/, ' '))
var matchHttp = titleText.indexOf('http');
%>
<% if(matchHttp>0) { %>
<%=titleText.substring(0,matchHttp)%><label title="点击三次选中URL"><%=titleText.substring(matchHttp)%></label>
<% } else { %>
<label><%=titleText%></label>
<% } %>
</p>
</div>
<pre class="view-logText-log expand<%=i%>_code"><code class="tswlog hljs"><%=(logText)%></code></pre>
Expand Down
17 changes: 15 additions & 2 deletions bin/tsw/util/auto-report/tmpl.js
Original file line number Diff line number Diff line change
Expand Up @@ -384,8 +384,21 @@ define(function(require, exports, module) {
__p.push('&fileFormat=har"\n target="_blank" title="99%的人都点了这个按钮!">点击下载 云抓包&#8482;.har</a>\n\n <span style="display:none">&nbsp;<span class="log_pass_time"></span>前</span>\n <p style="display: none;" class="firstReq">\n <label class="button label expand" style="cursor:pointer;" data-j="expand');
_p(i);
__p.push('"><input type="checkbox" class="expandChk">展开</label>');
_p(XSS.htmlEncode(reqUrl.replace(/\[.*?\]/g, '').replace(/\s+/, ' ')));
__p.push(' </p>\n </div>\n <pre class="view-logText-log expand');

var titleText = XSS.htmlEncode(reqUrl.replace(/\[.*?\]/g, '').replace(/\s+/, ' '));
var matchHttp = titleText.indexOf('http');
__p.push(' ');
if (matchHttp > 0) {
__p.push(' ');
_p(titleText.substring(0, matchHttp));
__p.push('<label title="点击三次选中URL">');
_p(titleText.substring(matchHttp));
__p.push('</label>');
} else {
__p.push(' <label>');
_p(titleText);
__p.push('</label>');
} __p.push(' </p>\n </div>\n <pre class="view-logText-log expand');
_p(i);
__p.push('_code"><code class="tswlog hljs">');
_p((logText));
Expand Down

0 comments on commit 0daa459

Please sign in to comment.