Last active
April 18, 2016 04:21
-
-
Save y-lan/6613ec07a5fa6439b447 to your computer and use it in GitHub Desktop.
Presto UI js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function kill(u) { | |
var rq = d3.selectAll('.query-row')[0].filter(function(d, i) { | |
var owner = d.querySelector('div.col-md-3.col-lg-3 div.row:nth-child(2)').textContent.trim(); | |
return (d.querySelector('div.col-md-4.col-lg-3 div.row:nth-child(2)').textContent === 'RUNNING') && | |
(u === undefined || owner == u); | |
}).map(function(d,i){ | |
return d.dataset['reactid'].split('$')[1]; }) | |
console.log(rq) | |
d3.set(rq).forEach(function(q){d3.xhr("/v1/query/" + q).send('DELETE');}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment