fix some frontend

This commit is contained in:
jysperm
2014-11-10 18:25:02 +08:00
parent 933b82245f
commit dde2361e99
15 changed files with 187 additions and 147 deletions

View File

@@ -1,23 +1,13 @@
$ ->
$('#widget-ssh .btn-kill').click ->
$('.widget-ssh .action-kill').click ->
if window.confirm 'Are you sure?'
$.post '/plugin/ssh/kill/', JSON.stringify
request '/plugin/ssh/kill',
pid: $(@).parents('tr').data 'id'
.fail (jqXHR) ->
if jqXHR.responseJSON?.error
alert jqXHR.responseJSON.error
else
alert jqXHR.statusText
.success ->
, ->
location.reload()
$('#widget-ssh .update-password button').click ->
$.post '/plugin/ssh/update_password/', JSON.stringify
password: $('#widget-ssh .update-password input').val()
.fail (jqXHR) ->
if jqXHR.responseJSON?.error
alert jqXHR.responseJSON.error
else
alert jqXHR.statusText
.success ->
$('.widget-ssh .action-update-password').click ->
request '/plugin/ssh/update_password',
password: $('.widget-ssh .input-password').val()
, ->
location.reload()