-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
adding browserscript for jobs command
- Loading branch information
1 parent
4b710fd
commit a9c59e7
Showing
4 changed files
with
58 additions
and
18 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
function(task, response){ | ||
let headers = [ | ||
{"plaintext": "kill", "type": "button", "width": 70, "disableSort": true}, | ||
{"plaintext": "command", "type": "string", "width": 200}, | ||
{"plaintext": "params", "type": "string", "fillWidth": true}, | ||
|
||
]; | ||
if(response.length === 0){ | ||
return {"plaintext": "No response yet from agent..."}; | ||
} | ||
try{ | ||
let data = JSON.parse(response[0]); | ||
let rows = []; | ||
for(let j = 0; j < data.length; j++) { | ||
rows.push({ | ||
"kill": {"button": { | ||
"name": "", | ||
"type": "task", | ||
"ui_feature": "jobs:kill", | ||
"parameters": data[j]["id"], | ||
"hoverText": "Kill this job", | ||
"startIcon": "kill", | ||
} | ||
}, | ||
"command": {"plaintext": data[j]["command"]}, | ||
"params": {"plaintext": data[j]["params"]}, | ||
}); | ||
} | ||
return {"table": [{ | ||
"headers": headers, | ||
"rows": rows | ||
}]} | ||
}catch(error){ | ||
//console.log("error trying to handle list_entitlements browser script", error, response); | ||
return {"plaintext": response[0]} | ||
} | ||
} |