Web UI project for Gohan project (https://github.com/cloudwan/gohan)
See getting started in Gohan
https://github.com/cloudwan/gohan
- Run gohan server
- Install npm dependencies
$ npm install
- Copy configurations files
$ cp app/config.json.sample app/config.json
- Build application for development
$ npm run build-dev
- Start dev server with auto refresh and options. Learn more about options, read the official document.
$ npm run dev-server
$ npm run dev-server -- --host 0.0.0.0 --https
- Server starts on
http://localhost:8080/
- Start tests
$ npm run test
- Build application for production
$ npm run build
config.json file should be located in the same directory as all source files. Sample configuration is included in config.json.sample file.
Possible fields in config file:
authUrl- URL to Keystonegohan- Gohan connection config, must be an object with following fields:schema- path to JSON Schemaurl- URL to Gohan server
sidebar- array of custom sidebar buttons, must contain objects with following fields:pathtitleid
sidebarFavorites- array of links to views, must contain resources' IDssidebarCategories- array of objects including information about views' categories, must contain objects with following fields:name- display name of categoryid- ID of categoryitems- array of links to views in the category
sidebarChildResources- array of schema IDs of child resources which should be visible in sidebar menuroutes- config array for routing, must contain objects with following fields:path- URL path to viewviewClass- name of React component related to the view (insrc/routes/componentList.js)name- name of routeexact- match path exactly, defaulttrue
errorMessages- map of error messagestokenExpire- token expired message
pageLimit- limit of displayed items in pageloginRequestTimeout- time left (in ms) to token expiration (when token renew dialog should be shown)polling- flag to enable polling (must be true or false)pollingInterval- interval (in ms) of pollingstoragePrefix- prefix to store token information (local- and sessionStorage)tableDefaultSortKey- default sort keytableDefaultSortOrder- default sort order (asc or desc)title- title of web pagefollowableRelations- flag to enable following resource by referenceuseKeystoneDomain- flag to enable use domain feature in keystone v3selectDomainFromHost- regex to select domain from host (keystone v3)domainName- default domain name
locales/en-us/uiSchema.json file containg the definition of specific UI behaviors in dialogs like hiding and showing fields
The JSON file should contain an array of objects with following fields:
id- ID of JSON Schema resourcetitle- (optional) - title of resourceproperties- (optional) - properties customization, objects with following fields:[fieldName]- (optional) - customization of single field, objects with following fields:ui:widget- (optional) - alternative widgetui:field- (optional) - alternative fieldui:step- (optional) - specified step in number input fieldui:labelTemplate- (optional) - label custom template for select fieldui:requiredResource- (optional) - custom require collection for select fieldui:query- (optional) - query to fetch additional data for select field
logic- (optional) - custom dialog logic[fieldName]- (optional) - field name[fieldName]- (field name (if parent is Object), when array,[fieldName]should beitems[value]- (optional) - specified value of fieldhide- array of fields to hide
Other methods of customization using UI schema can be find react-jsonschema-form documentation