mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-04-28 19:45:45 +08:00
service-switch 前端
This commit is contained in:
@@ -1,4 +1,11 @@
|
||||
$ ->
|
||||
$('#service-switch button').click ->
|
||||
is_enable = if $(@).hasClass 'btn-success' then true else false
|
||||
$.post "/plugin/#{$(@).data('name')}/switch/", JSON.stringify
|
||||
enable: is_enable
|
||||
.success ->
|
||||
location.reload()
|
||||
|
||||
service = $ '#service'
|
||||
service.find 'button'
|
||||
.on 'click', (e) ->
|
||||
@@ -22,14 +29,6 @@ $ ->
|
||||
ErrorHandle.flushInfo 'success', '修改成功', ->
|
||||
location.reload()
|
||||
|
||||
fpm = $ '#phpfpm'
|
||||
fpm.on 'click', (e) ->
|
||||
e.preventDefault()
|
||||
enable = if fpm.hasClass 'btn-success' then true else false
|
||||
$.post '/plugin/phpfpm/switch/', JSON.stringify {enable: enable}
|
||||
.success ->
|
||||
location.reload()
|
||||
#nginx
|
||||
$ '.nginx-edit-btn'
|
||||
.on 'click', (e) ->
|
||||
e.preventDefault()
|
||||
@@ -70,9 +69,6 @@ $ ->
|
||||
catch e
|
||||
alert '配置文件格式不正确'
|
||||
|
||||
|
||||
|
||||
#mysql插件
|
||||
mysql = $ '#mysql-input'
|
||||
mysql.find 'button'
|
||||
.on 'click', (e) ->
|
||||
|
||||
@@ -48,13 +48,14 @@ block content
|
||||
else
|
||||
button.btn.btn-success.btn-sm= t('plan.subscribe')
|
||||
|
||||
#service-switch.row
|
||||
header 服务开关
|
||||
for name in switch_buttons
|
||||
if account.attribute.plugin[name].is_enable
|
||||
button(data-name= name).btn.btn-danger 关闭 #{t('plugins.' + name + '.name')}
|
||||
else
|
||||
button(data-name= name).btn.btn-success 开启 #{t('plugins.' + name + '.name')}
|
||||
if switch_buttons.length
|
||||
#service-switch.row
|
||||
header 服务开关
|
||||
for name in switch_buttons
|
||||
if account.attribute.plugin[name].is_enable
|
||||
button(data-name= name).btn.btn-danger 关闭 #{t('plugins.' + name + '.name')}
|
||||
else
|
||||
button(data-name= name).btn.btn-success 开启 #{t('plugins.' + name + '.name')}
|
||||
|
||||
for widget in widgets
|
||||
.row
|
||||
|
||||
Reference in New Issue
Block a user