mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-03-27 22:44:32 +08:00
ssh kill 前端
This commit is contained in:
@@ -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) ->
|
||||
|
||||
@@ -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 {}
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user