diff --git a/core/static/script/panel/panel.coffee b/core/static/script/panel/panel.coffee index 1268ed4..546fed0 100644 --- a/core/static/script/panel/panel.coffee +++ b/core/static/script/panel/panel.coffee @@ -29,6 +29,23 @@ $ -> $.post '/plugin/phpfpm/switch/', JSON.stringify {enable: enable} .success -> location.reload() + #nginx + # $ '.nginx-edit-button' + # .on 'click', (e) -> + # ($ '#nginxModal').modal 'show' + + + $ '.nginx-remove-btn' + .on 'click', (e) -> + e.preventDefault() + id = ($(@).closet 'tr').data 'id' + $.post '/plugin/nginx/update_site', JSON.stringify { + action: 'delete' + id: id + type: $('#nginxConfigType').find('.active a').attr('href').substr 1 + } + .success -> + location.reload() $ '#nginxSave' .on 'click', (e) -> diff --git a/plugin/nginx/view/widget.jade b/plugin/nginx/view/widget.jade index f19cf34..745faaf 100644 --- a/plugin/nginx/view/widget.jade +++ b/plugin/nginx/view/widget.jade @@ -13,9 +13,9 @@ table.table.table-hover td= site.server_name.join(', ') td fastcgi_pass: ~#{site.location['/'].fastcgi_pass.match(/unix:\/\/\/home\/[^\/]+(.*)/)[1]} td(style= 'width: 150px;') - button.btn.btn-info.btn-xs + button.nginx-edit-btn.btn.btn-info.btn-xs span.glyphicon.glyphicon-edit - button.btn.btn-danger.btn-xs + button.nginx-remove-btn.btn.btn-danger.btn-xs span.glyphicon.glyphicon-remove-sign .modal.fade#nginxModal(tabindex='-1', role='dialog', aria-hidden='true', aria-labelledby='nginxModalLabel')