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.
93 lines
2.6 KiB
93 lines
2.6 KiB
import CRUDBase from '../CRUDBase.js'
|
|
|
|
class MachineResource extends CRUDBase {
|
|
constructor() {
|
|
super()
|
|
|
|
this.endpoint = '/api/v1/ldap/machines'
|
|
this.required_fields = ['name', 'description']
|
|
this.permission_base = 'v1:ldap:machines'
|
|
|
|
this.item = 'Computer'
|
|
this.plural = 'Computers'
|
|
|
|
this.listing_definition = {
|
|
columns: [
|
|
{
|
|
name: 'Machine Name',
|
|
field: 'name',
|
|
},
|
|
{
|
|
name: 'Host Name',
|
|
field: 'host_name',
|
|
},
|
|
{
|
|
name: 'Description',
|
|
field: 'description',
|
|
},
|
|
],
|
|
actions: [
|
|
{
|
|
type: 'resource',
|
|
position: 'main',
|
|
action: 'insert',
|
|
text: 'Create New',
|
|
color: 'success',
|
|
},
|
|
{
|
|
type: 'resource',
|
|
position: 'row',
|
|
action: 'update',
|
|
icon: 'fa fa-edit',
|
|
color: 'primary',
|
|
},
|
|
{
|
|
type: 'resource',
|
|
position: 'row',
|
|
action: 'delete',
|
|
icon: 'fa fa-times',
|
|
color: 'danger',
|
|
confirm: true,
|
|
},
|
|
],
|
|
}
|
|
|
|
this.form_definition = {
|
|
// back_action: {
|
|
// text: 'Back',
|
|
// action: 'back',
|
|
// },
|
|
fields: [
|
|
{
|
|
name: 'Machine Name',
|
|
field: 'name',
|
|
placeholder: 'DNS01',
|
|
required: true,
|
|
type: 'text',
|
|
},
|
|
{
|
|
name: 'Description',
|
|
field: 'description',
|
|
required: true,
|
|
type: 'textarea',
|
|
},
|
|
{
|
|
name: 'Location',
|
|
field: 'location',
|
|
type: 'text',
|
|
placeholder: 'Server room 1',
|
|
},
|
|
{
|
|
name: 'Host Name (FQDN)',
|
|
field: 'host_name',
|
|
type: 'text',
|
|
placeholder: 'dns01.my.domain',
|
|
},
|
|
],
|
|
}
|
|
}
|
|
}
|
|
|
|
const ldap_machine = new MachineResource()
|
|
export { ldap_machine }
|