Giter Site home page Giter Site logo

admin-as-service's Introduction

admin-as-service

Generated administration for RESTful api.

Configuration (config.yml)

You define list of entities that should be displayed. These are mapped to api endpoints.

title: admin-as-service example
url: <base api url>
oauth: <oauth configuration>
entities:
  companies: # key associated to entity (also mapped to endpoint /{key})
    identifier: id # the field to be used as identifier
    readonly: false # read-only entity doesn't allow mutations
    endpoint: "api/companies" # endpoint for all views of this entity
    hidden: false # doesn't diplay entity in left menu
    listActions: # list of buttons for edit
      - edit # predefined button, redirect to edit form
      - delete # predefined button, delete record
      - title: test # custom created button with redirect action
        icon: new-window
        action: redirect
        url: 'https://www.google.cz/?ei={{entry.values.id}}'
        target: blank
    actions: # actions visible in page header (in list, edit, create screens)
      - create
      - export
      - filter
    name: Company # entity name displayed in menu item/titles
    fields: # default list of fields
      - <field configuration>
    list: # configuration of list page
      title: This is list page
      filters:
        - <filter configuration>
      fields: # fields for list page only
        - <field configuration>
    create: # configuration of create page
      title: Create new item
      fields: # fields for create page only
        - <field configuration>
    edit: # configuration of edit page
      title: Edit existing item
      fields: # fields for edit page only
        - <field configuration>

Field configuration

Each field is described by object with following structure:

...
  fields:
    attribute: <columnName>
    type: string # type of field (string, text, date, select, reference)
    label: <label> # human friendly name of field (default: attribute value)
    format: $0,0.00 # formatted number for numeric fields
    readonly: false
    validation:
      required: false
      minlength: 0
      maxlength: 250
      pattern: '[a-z]+'

Choices field (enum/Select)

... deprecated, use choice/choices
  fields:
    attribute: state
    type: choice # choice/choices, select is deprecated
    options:
      - { value: US, label: USA }
      - { value: FR, label: France }

Reference field

...
  fields:
    attribute: user_id
    type: reference
    toMany: false
    entity: <entity key> # eg. companies
    targetField: name # field to be displayed in displayed reference (companies.name)

Filters configuration

For list you can configure filtering as list of filters:

...
    list:
      filters:
        q: # query string attribute that will be mapped ?q={value}
          label: Search
          pinned: true # specify if the search is always displayed
          attributes:
            placeholder: search text
            searchColumns: title # specify on which columns the filter should be applied
        where[user_id]: # query string attribute that will be mapped ?where[user_id]={value}
          label: User
          type: reference
          entity: users
          targetField: firstname

Actions configuration

For every page you can configure buttons displayed in header.

...
    list:
      actions:
        - title: test
          icon: new-window
          action: redirect
          url: 'https://www.google.cz/?ei={{entry.values.id}}&token={{access_token}}' # you can extract data from entity
          target: blank
        - delete

List actions configuration

The same way you specify page action, you can also specify list actions (buttons in table).

...
    list:
      listActions:
        - title: test
          icon: new-window
          action: redirect
          url: 'https://www.google.cz/?ei={{entry.values.id}}' # you can extract data from entity
          target: blank
        - filter
        - edit
        - delete

OAuth configuration

oauth:
  flow: resourceOwnerPasswordCredentials
  authorizeUrl: https://api.example.com/authorize

Fullscreen mode

You can also use application in fullscreen mode (only content is display, navigation bar and side menu is hidden). Application switch to this mode when fullscreen=true substring is detected in URL.

admin-as-service's People

Contributors

jakubknejzlik avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.