mirror of
https://github.com/HackPlan/RootPanel.git
synced 2026-03-29 08:38:02 +08:00
fix bugs
This commit is contained in:
@@ -38,7 +38,10 @@ exports.leavePlan = (account, plan, callback) ->
|
||||
|
||||
modifier['$unset']["attribute.plugin.#{plan}"] = ''
|
||||
|
||||
mAccount.update _id: account._id, modifier, ->
|
||||
console.log modifier
|
||||
|
||||
mAccount.update _id: account._id, modifier, (err) ->
|
||||
throw err if err
|
||||
(plugin.get serviceName).service.delete account, ->
|
||||
callback()
|
||||
|
||||
|
||||
@@ -197,37 +197,27 @@ $ ->
|
||||
$('#nginx-modal .site-id').text data.id
|
||||
$('#nginx-modal').modal 'show'
|
||||
|
||||
# refactored above
|
||||
|
||||
service = $ '#service'
|
||||
service.find 'button'
|
||||
.on 'click', (e) ->
|
||||
e.preventDefault()
|
||||
button = $ @
|
||||
prehead = if button.hasClass 'btn-success' then '' else 'un'
|
||||
$.post "/plan/#{prehead}subscribe/", JSON.stringify {
|
||||
plan: button.parents('tr').data 'type'
|
||||
}
|
||||
$('.plan-list .btn-danger').click ->
|
||||
if window.confirm 'Are you sure?'
|
||||
$.post "/plan/unsubscribe/", JSON.stringify
|
||||
plan: $(@).parents('tr').data 'name'
|
||||
.success ->
|
||||
location.reload()
|
||||
|
||||
ssh = $ '#ssh-input'
|
||||
ssh.find 'button'
|
||||
.on 'click', (e) ->
|
||||
e.preventDefault()
|
||||
$.post '/plugin/ssh/update_password/', JSON.stringify {
|
||||
password: ssh.find('input').val()
|
||||
}
|
||||
.success ->
|
||||
ErrorHandle.flushInfo 'success', '修改成功', ->
|
||||
location.reload()
|
||||
$('.plan-list .btn-success').click ->
|
||||
$.post "/plan/subscribe/", JSON.stringify
|
||||
plan: $(@).parents('tr').data 'name'
|
||||
.success ->
|
||||
location.reload()
|
||||
|
||||
mysql = $ '#mysql-input'
|
||||
mysql.find 'button'
|
||||
.on 'click', (e) ->
|
||||
e.preventDefault()
|
||||
$.post '/plugin/mysql/update_password/', JSON.stringify {
|
||||
password: (mysql.find 'input').val()
|
||||
}
|
||||
.success ->
|
||||
location.reload()
|
||||
$('#widget-ssh .update-password button').click ->
|
||||
$.post '/plugin/ssh/update_password/', JSON.stringify
|
||||
password: $('#widget-ssh .update-password input').val()
|
||||
.success ->
|
||||
location.reload()
|
||||
|
||||
$('#widget-mysql .update-password button').click ->
|
||||
$.post '/plugin/mysql/update_password/', JSON.stringify
|
||||
password: $('#widget-mysql .update-password input').val()
|
||||
.success ->
|
||||
location.reload()
|
||||
|
||||
@@ -21,9 +21,6 @@ block content
|
||||
| #{t('ticket.')}
|
||||
|
||||
.col-md-9
|
||||
#page-alert.alert.alert-danger
|
||||
#page-success.alert.alert-success
|
||||
|
||||
.row
|
||||
header= t('panel.overview')
|
||||
p
|
||||
@@ -35,10 +32,10 @@ block content
|
||||
|
||||
.row
|
||||
header= t('plan.')
|
||||
table.table.table-hover
|
||||
tbody#service
|
||||
table.table.table-hover.plan-list
|
||||
tbody
|
||||
for plan in plans
|
||||
tr(data-type='#{plan.name}')
|
||||
tr(data-name='#{plan.name}')
|
||||
td= plan.t_name
|
||||
td= plan.t_service
|
||||
td= plan.t_resources
|
||||
|
||||
@@ -4,7 +4,7 @@ header MySQL
|
||||
.panel-heading
|
||||
h3.panel-title 设置 MySQL 密码
|
||||
.panel-body
|
||||
.input-group#mysql-input
|
||||
.input-group.update-password
|
||||
input.form-control(type='password')
|
||||
span.input-group-btn
|
||||
button.btn.btn-default(type='button') 提交
|
||||
|
||||
@@ -4,7 +4,7 @@ header SSH
|
||||
.panel-heading
|
||||
h3.panel-title 设置 SSH 密码
|
||||
.panel-body
|
||||
.input-group#ssh-input
|
||||
.input-group.update-password
|
||||
input.form-control(type='password')
|
||||
span.input-group-btn
|
||||
button.btn.btn-default(type='button') 提交
|
||||
|
||||
Reference in New Issue
Block a user