finish php-fpm change status

This commit is contained in:
Yudong
2014-05-26 01:24:45 +08:00
parent 3300c6c84d
commit 39ccb32c97
2 changed files with 16 additions and 2 deletions

View File

@@ -29,3 +29,17 @@ $ ->
if reply.status is 400
error = reply.responseJSON.error
ErrorHandle.flushInfo 'alert', error
fpm = $ '#php-fpm'
fpm.on 'click', (e) ->
e.preventDefault()
enable = if fpm.hasClass 'btn-success' then true else false
$.post '/plugin/phpfpm/switch/', {
enable: enable
}
.success ->
location.reload()
.fail (reply) ->
if reply.status is 400
error = reply.responseJSON.error
ErrorHandle.flushInfo 'alert', error

View File

@@ -1,5 +1,5 @@
header PHP-FPM
if isEnable
button.btn.btn-danger 关闭
button.btn.btn-danger#php-fpm 关闭
else
button.btn.btn-success 运行
button.btn.btn-success#php-fpm 运行