finish change ssh password

This commit is contained in:
Yudong
2014-05-18 00:42:14 +08:00
parent a965ca31dd
commit 011282ffeb
2 changed files with 23 additions and 2 deletions

View File

@@ -7,4 +7,25 @@ $ ->
prehead = if button.hasClass 'btn-success' then '' else 'un'
$.post "/plan/#{prehead}subscribe/", {
plan: button.parent().data 'type'
}
}
.success ->
location.reload()
.fail (reply) ->
if reply.status is 400
error = reply.responseJSON.error
ErrorHandle.flushInfo 'alert', error
ssh = $ '#ssh-input'
ssh.find 'button'
.on 'click', (e) ->
e.preventDefault()
$.post '/plugin/ssh/update_passwd/', {
passwd: ssh.find('input').val()
}
.success ->
ErrorHandle.flushInfo 'success', '修改成功', ->
location.reload t_resources
.fail (reply) ->
if reply.status is 400
error = reply.responseJSON.error
ErrorHandle.flushInfo 'alert', error

View File

@@ -4,7 +4,7 @@ header SSH
.panel-heading
h3.panel-title 设置 SSH 密码
.panel-body
.input-group
.input-group#ssh-input
input.form-control(type='password')
span.input-group-btn
button.btn.btn-default(type='button') 提交