mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-04-27 17:24:05 +08:00
将前端 JS 移到插件目录
This commit is contained in:
@@ -10,6 +10,6 @@ module.exports =
|
||||
action: action
|
||||
service: service
|
||||
|
||||
panel_widgets: [
|
||||
service.widget
|
||||
]
|
||||
panel:
|
||||
widget: service.widget
|
||||
script: '/script/panel.js'
|
||||
|
||||
34
plugin/mongodb/static/script/panel.coffee
Normal file
34
plugin/mongodb/static/script/panel.coffee
Normal file
@@ -0,0 +1,34 @@
|
||||
$ ->
|
||||
$('#widget-mongodb button.create-database').click ->
|
||||
$.post '/plugin/mongodb/create_database', JSON.stringify
|
||||
name: $(@).parents('.input-group').find('input').val()
|
||||
.fail (jqXHR) ->
|
||||
if jqXHR.responseJSON?.error
|
||||
alert jqXHR.responseJSON.error
|
||||
else
|
||||
alert jqXHR.statusText
|
||||
.success ->
|
||||
location.reload()
|
||||
|
||||
$('#widget-mongodb button.delete-database').click ->
|
||||
if window.confirm 'Are you sure?'
|
||||
$.post '/plugin/mongodb/delete_database', JSON.stringify
|
||||
name: $(@).parents('tr').data 'name'
|
||||
.fail (jqXHR) ->
|
||||
if jqXHR.responseJSON?.error
|
||||
alert jqXHR.responseJSON.error
|
||||
else
|
||||
alert jqXHR.statusText
|
||||
.success ->
|
||||
location.reload()
|
||||
|
||||
$('#widget-mongodb button.update-password').click ->
|
||||
$.post '/plugin/mongodb/update_password', JSON.stringify
|
||||
password: $(@).parents('.input-group').find('input').val()
|
||||
.fail (jqXHR) ->
|
||||
if jqXHR.responseJSON?.error
|
||||
alert jqXHR.responseJSON.error
|
||||
else
|
||||
alert jqXHR.statusText
|
||||
.success ->
|
||||
location.reload()
|
||||
Reference in New Issue
Block a user