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.
|
|
|
import CRUDBase from './CRUDBase.js'
|
|
|
|
import { session } from '../service/Session.service.js'
|
|
|
|
|
|
|
|
class SettingResource extends CRUDBase {
|
|
|
|
constructor() {
|
|
|
|
super()
|
|
|
|
|
|
|
|
this.endpoint = '/api/v1/settings'
|
|
|
|
this.required_fields = ['key', 'value']
|
|
|
|
this.permission_base = 'v1:settings'
|
|
|
|
|
|
|
|
this.item = 'Setting'
|
|
|
|
this.plural = 'Settings'
|
|
|
|
|
|
|
|
this.listing_definition = {
|
|
|
|
display: `
|
|
|
|
<p>These are advanced settings that allow you to tweak the way ${session.get('app.name')} behaves. Tweak them at your own risk.</p>
|
|
|
|
`,
|
|
|
|
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',
|
|
|
|
},
|
|
|
|
],
|
|
|
|
}
|
|
|
|
|
|
|
|
this.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 }
|