You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
CoreID/app/assets/app/resource/Setting.resource.js

53 lines
1.1 KiB

import CRUDBase from './CRUDBase.js'
class SettingResource extends CRUDBase {
endpoint = '/api/v1/settings'
required_fields = ['key', 'value']
permission_base = 'v1:settings'
item = 'Setting'
plural = 'Settings'
listing_definition = {
columns: [
{
name: 'Setting Key',
field: 'key',
},
{
name: 'Value',
field: 'value',
renderer: (v) => JSON.stringify(v),
},
],
actions: [
{
type: 'resource',
position: 'row',
action: 'update',
icon: 'fa fa-edit',
color: 'primary',
},
],
}
form_definition = {
fields: [
{
name: 'Setting Key',
field: 'key',
type: 'text',
readonly: true,
},
{
name: 'Value (JSON)',
field: 'value',
type: 'json',
},
],
}
}
const setting = new SettingResource()
export { setting }