ssh kill 前端

This commit is contained in:
jysperm
2014-07-21 10:41:26 +08:00
parent 7bfd74a175
commit d9aeb400e7
3 changed files with 9 additions and 2 deletions

View File

@@ -6,6 +6,12 @@ $ ->
.success ->
location.reload()
$('.btn-kill').click ->
$.post '/plugin/ssh/kill/', JSON.stringify
pid: $(@).parents('tr').data 'id'
.success ->
location.reload()
service = $ '#service'
service.find 'button'
.on 'click', (e) ->

View File

@@ -19,4 +19,5 @@ exports.post '/kill', (req, res) ->
pid = parseInt req.body.pid
child_process.exec "sudo su #{req.account.username} -c 'kill #{pid}'", (err, stdout, stderr) ->
throw err if err
res.json {}
app.redis.del 'rp:process_list', ->
res.json {}

View File

@@ -23,4 +23,4 @@ header SSH
td #{(process.rss / 1024).toFixed(1)}M
td #{process.cpu_per}%
td
button.btn.btn-danger.btn-xs Kill
button.btn-kill.btn.btn-danger.btn-xs Kill