Settings resource; oauth2 app authorization model; UI cleanup
This commit is contained in:
@@ -23,6 +23,26 @@ class ActionService {
|
||||
} else if ( action === 'list' ) {
|
||||
return location_service.redirect(`/dash/c/listing/${resource}`, 0)
|
||||
}
|
||||
} else if ( action === 'post' ) {
|
||||
const inputs = []
|
||||
|
||||
if ( args.params ) {
|
||||
for (const param in args.params) {
|
||||
if ( !args.params.hasOwnProperty(param) ) continue
|
||||
inputs.push(`<input type="hidden" name="${param}" value="${args.params[param]}"/>`)
|
||||
}
|
||||
}
|
||||
|
||||
const form_attrs = ['method="POST"']
|
||||
if ( args.destination ) {
|
||||
form_attrs.push(`action="${args.destination}"`)
|
||||
}
|
||||
|
||||
$(`
|
||||
<form ${form_attrs.join(' ')}>
|
||||
${inputs.join('\n')}
|
||||
</form>
|
||||
`).appendTo('body').submit()
|
||||
} else {
|
||||
throw new TypeError(`Unknown action type: ${action}`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user