`

页面的查找脚本

 
阅读更多
var list = new Array();
list.push("11.3.54.168");
list.push("11.3.54.173");
list.push("11.3.54.164");
list.push("11.3.54.171");
list.push("11.3.54.170");
list.push("11.3.54.162");
list.push("11.3.54.165");
list.push("11.3.54.172");
list.push("11.3.54.163");
var num = 0
$(".instance").each(function(num,ex){
    num++;
    var item = $(ex).find("p[class='ng-binding']");
    var master = item[0].innerText.substring(0,item[0].innerText.indexOf(":"));
    var salve = item[2].innerText.substring(0,item[2].innerText.indexOf(":"));
    //console.log(list.indexOf(master).toString()+" "+list.indexOf(salve).toString());
    var flag = false;
    if(list.indexOf(master)>0){
        console.log("--warn master" + master);
        flag=true;
    }
    if(list.indexOf(salve) >0){
        console.log("--warn salve" + salve);
        flag=true;
    }
    if(flag){
       console.log("xuhao:"+num);
     }
});

 

var orderIds = [];$("[ng-if='showFiledLog']").each(function() {
    var txt = $(this).text();
    var dest = txt.split("入参=").pop();
    var json = {};
    if( dest.indexOf("{") != -1 ) {   json = JSON.parse(dest);
orderIds.push(json.orderId);
    }
});
console.log(orderIds.join(","));

 

 

 var ips = [];  
      $('table tr td:nth-child(4)').each (function ()    
        {    
            ips.push($.trim(this.innerHTML));    
      });  
     console.log(ips.join(","))

 

var ips = [];    
     $('#serverTable tr td:nth-child(2)').each (function ()      
       {      
           ips.push($(this.innerHTML).text());    //jsf版本  
               
     });    
    console.log(ips.join(",")) 

 

 

$('#serverTable tr td:nth-child(1)').each (function ()        
       {        
          //
 var ip = $(this).next().text();
var index = $.inArray(ip, ips);
 if (index>-1){
        $(this).find('input').prop("checked",true);
 }
                 
     });

jsf选中

 

 

 var GM_JQ = document.createElement('script');

GM_JQ.src = '//ajax.aspnetcdn.com/ajax/jQuery/jQuery-1.7.2.js';

GM_JQ.type = 'text/JavaScript';

document.getElementsByTagName('head')[0].appendChild(GM_JQ); 

 

    var ips = [];      
     $('table tr ').each (function(){     
            var _this = $(this);
            var len = _this.children("td").length;
           ips.push(len);      
            if (len == 10) {
               _this.children("td:nth-child(8)").html("√");
            } 
            else if (len == 9) {
               _this.children("td:nth-child(7)").html("√");
            } 
            else if (len==8) {
               _this.children("td:nth-child(6)").html("√");
            }
            else if (len==7) {
               _this.children("td:nth-child(5)").html("√");
            }
            else if (len==6) {
               _this.children("td:nth-child(4)").html("√");
            }
            else if (len==5){
               _this.children("td:nth-child(3)").html("√");
            }
            else if (len==4){
               _this.children("td:nth-child(2)").html("√");
            }
            else {
                console.log(_this.children("td:nth-child(1)").html());
            }                 
     });  
    console.log(ips.join(","))

 

 

var ips = [];    
     $('table tr td:nth-child(4)').each (function ()      
       {      
           ips.push("<string>"+$.trim(this.innerHTML)+":1601</string>");      
     });    
    console.log(ips.join("\n")) 

 

 

 

mdc检查

var ips =[];
 $('#table tr td:nth-child(2) a:nth-child(1)').each((i, el)=>ips.push(el.innerHTML))

  

var ips =[];
 $('#table tr td:nth-child(2) a:nth-child(1)').each((i, el)=>ips.push(el.innerText));
 console.table(ips)

 

 

 

## jsf Batch jiaoben

 

var ids = [103866918405,103818250245,103708293127];
for (var ORDERID of ids) {
  var tpl = `{"@type":"java.util.HashMap", "orderId": ${ORDERID}L,"id": ${ORDERID}L,"ztDate": "2019-09-27 23:00:00"}`;
  
  $('#methodParam').val(tpl);
  $('#invoke3').click();
}

 

##

var ips = [];      
     $('#DataTables_Table_22 tr td:nth-child(3)').each (function ()        
       {        
           ips.push(""+$.trim(this.innerText)+"");        
     });      
    console.log(ips.join("\n"))  
// jdos

 

var ips = [];      
     $('#DataTables_Table_22 tr td:nth-child(3)').each (function ()        
       {        
           ips.push("<string>"+$.trim(this.innerText)+":1601</string>");        
     });      
    console.log(ips.join("\n"))  

 

 

四、

npm install -g http-server
http-server


npm install -g live-server
live-server

开发的时候推荐后者

 

五、selector

 

$ == document.getElementById 

$$ == document.querySelectorAll //$$如图

$(selector) returns the reference to the first DOM element with the specified CSS selector. This function is an alias for the document.querySelector() function.

$$(selector) returns an array of elements that match the given CSS selector. This command is equivalent to calling document.querySelectorAll().

 

 

刘、

 

var bodyf= {"operation":"clear","paths":["/export/Logs/mysql.peking.async.client.jd.local/processor-info.2019-12-05.log","/export/Logs/mysql.peking.async.client.jd.local/processor-info.2019-12-06.log","/export/Logs/mysql.peking.async.client.jd.local/binlakeclient-info.2019-12-05.log","/export/Logs/mysql.peking.async.client.jd.local/binlakeclient-info.2019-12-06.log","/export/Logs/mysql.peking.async.client.jd.local/processor-info.2019-12-07.log","/export/Logs/mysql.peking.async.client.jd.local/binlakeclient-info.2019-12-07.log","/export/Logs/mysql.peking.async.client.jd.local/processor-error.2019-12-05.log","/export/Logs/mysql.peking.async.client.jd.local/processor-error.2019-12-06.log","/export/Logs/mysql.peking.async.client.jd.local/processor-error.2019-12-07.log","/export/Logs/mysql.peking.async.client.jd.local/processor-info.log","/export/Logs/mysql.peking.async.client.jd.local/binlakeclient-info.log","/export/Logs/mysql.peking.async.client.jd.local/processor-error.log","/export/Logs/mysql.peking.async.client.jd.local/purchaseconfig-info.2019-12-07.log","/export/Logs/mysql.peking.async.client.jd.local/purchaseconfig-info.2019-12-06.log","/export/Logs/mysql.peking.async.client.jd.local/purchaseconfig-info.2019-12-05.log","/export/Logs/mysql.peking.async.client.jd.local/purchaseconfig-info.log","/export/Logs/servers/nginx/logs/mysql.peking.async.client.jd.local/mysql.peking.async.client.jd.local_access.log","/export/Logs/jdos/pid_monitor.log","/export/Logs/mysql.peking.async.client.jd.local/canal/canal.log","/export/Logs/mysql.peking.async.client.jd.local/canal/2019-12-03/canal-2019-12-03-0.log.gz","/export/Logs/jst_home/logs/other/jst-self.log","/export/Logs/Domains/mysql.peking.async.client.jd.local/server1/logs/catalina.out","/export/Logs/jst_home/logs/other/biz_jst.log"],"name":"mysqlpekingasyncclient-8c4b8004","ip":"11.24.96.68"};
​
fetch(new Request('http://console.jdos.jd.com/api/system/ordermiddle/app/mysqlpekingasyncclient/group/binlake2/pod/clean/operatelogfile',{
    method:'POST', 
    headers: {'Content-Type': 'application/x-www-form-urlencoded', 'Cookie':'__jdu=15738921620961474689145; shshshfpa=695f5ca5-75c7-cdf2-20f0-c12cf62fedc2-1573900080; shshshfpb=nKlboxtQLg8kgPzEhxAzg0g%3D%3D; ipLoc-djd=1-72-2799-0; unpl=V2_ZzNtbRZVS0B9DRRQchldB2ILEVgRX0RGdVpAV3sQWwY0BRJUclRCFX0URlRnGlkUZAEZWEFcQhVFCEdkeB5fA2AFEFlBZxBFLV0CFi9JH1c%2bbRFbRFREE3ELRlNzKWwGZzMSXHJXRxN3AU5Xex5fBG8EElhEUkQcfQhDUEspWzVXMxpVRl5AFkUJdlVLWwhZbgIQWkFTDhVxDkRdcxpcAmQCGlpCUkUQcgFOVH4dbARXAA%3d%3d; __jdv=122270672|baidu-search|t_262767352_baidusearch|cpc|27726752169_0_e39d94c581034924b96b1c721862b718|1574610162572; mt_xid=V2_52007VwMWVF9RWlkfThpdDWADF1RYX1tSH0wdbFYyAxJWDVhbRkhMS1gZYgsbW0FRAAhLVRwPUG5UGgVYXgJeSnkaXQVvHxJSQVtXSxxLElkGbAIVYl9oUWocSB9UAGIzEVVdXg%3D%3D; __jda=76161171.15738921620961474689145.1573892162.1575099700.1575793782.14; __jdb=76161171.1.15738921620961474689145|14.1575793782; __jdc=76161171; PCSYCityID=CN_110000_110100_0; shshshfp=8f118d093b553ff9cadbe18d9559b93a; shshshsID=912f12bcc27875b9f67adea19c6aa0b7_1_1575793784310; jd.erp.lang=zh_CN; 3AB9D23F7A4B3C9B=JZTUZRJV76NL6RWD6IMD2ULQP7WOUEYQ6FF4TIGNXZ2H7USWHQM6CBLV6MHV44GBEQXLJXPDMUQINRMNQZLBHHFDWM; erp1.jd.com=F8F7F0026F3104CC32DE8CF58E5FD71A67FBA0A72D94F4C758159C92695485EADFAC34F61546346D253E2ED3C08B8A4DD6A060A0F5AB6AFA660A98A3A868BBF4328AA0784FB22C5383A03EA329C92E50; sso.jd.com=BJ.8c78c5b1bf09426181b01f376e38307d; JSESSIONID=DBB354779B973B53E73E6E908A16FF5E.s1', 'Content-Type':'application/json;charset=UTF-8'
},
    body:JSON.stringify(bodyf)
})).then((resp)=>{console.log(resp)})

 

 

 

sendpay

var all = [];    
var flag = false;   
var firstAtFirst = true;
var  rowspanCount = 0;
var firstCont = "";
var sndAtSnd = true;
var  rowspanCount2 = 0;
var sndCont = "";
 $('table tr ').each (function(){       
        var _this = $(this);  
        var tds = _this.children("td");
         let  tmp_rowspanCount=$(tds[0]).attr("rowspan")
         let  tmp_rowspanCount2=$(tds[1]).attr("rowspan")
if (tmp_rowspanCount  != undefined && tmp_rowspanCount > 0  ) {
 // console.log(rowspanCount);
rowspanCount = tmp_rowspanCount;
flag = true;
firstAtFirst = true;
firstCont = $(tds[0]).text();
} else {firstAtFirst = false;}
  
if (tmp_rowspanCount2  != undefined && tmp_rowspanCount2>0) {
rowspanCount2 = tmp_rowspanCount2;
sndAtSnd = true;
sndCont = $(tds[1]).text();
} else {sndAtSnd = false;}

rowspanCount--;
        let items = [];
       for (let i=0; i<tds.length; i++ )  {
             items.push($(tds[i]).text()); 
       }   
       if (sndAtSnd == false && rowspanCount> -1) { 
            items.unshift(sndCont)
       }
       if (firstAtFirst == false && rowspanCount> -1) {
            items.unshift(firstCont)

       }
all.push(items.join("|")); 
 });    
console.log(all.join("\n"));

 

(async () => {
   try {
    let res = await fetch('./info.json')
    let data =await res.json()
    console.log('data is:',data);
   } catch (error) {
    console.log(error)   
   }
})()

// 简介

 

分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics