Skip to content

Instantly share code, notes, and snippets.

@y-lan
Last active April 18, 2016 04:21
Show Gist options
  • Save y-lan/6613ec07a5fa6439b447 to your computer and use it in GitHub Desktop.
Save y-lan/6613ec07a5fa6439b447 to your computer and use it in GitHub Desktop.
Presto UI js
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