Settings resource; oauth2 app authorization model; UI cleanup

This commit is contained in:
garrettmills
2020-05-17 21:13:38 -05:00
parent d558f21375
commit 2b2e7d2ebe
19 changed files with 393 additions and 2 deletions

View File

@@ -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}`)
}