How to use the xadmin.config function in xadmin

To help you get started, we’ve selected a few xadmin examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sshwsfc / xadmin / packages / xadmin-antd / src / layout / App.js View on Github external
render() {
    const { routes, params } = this.props
    return (
      
        
          <div>
            {_c('site.logo')}
            {_c('site.title', 'Admin')}
          </div>
          
        
        
          <header style="{{">
            
            {/*  */}
            <div style="{{">
              
                {items =&gt; <menu style="{{" mode="horizontal">{items}</menu>}
              </div></header>
github sshwsfc / xadmin / packages / xadmin-auth / src / models.js View on Github external
const UserSignIn = ({ context: { _t } }) => ({
  type: 'object',
  name: 'user_sign_in',
  resource: 'auth/login',
  title: _t('Sign In'),
  properties: {
    username: {
      title: _t('Username'),
      type: 'string'
    },
    password: {
      title: _t('Password'),
      type: 'string'
    },
    ...(_c('auth.login.captcha')?{
      code: {
        title: _t('Captcha Code'),
        type: 'string',
        fieldType: 'captcha'
      }
    }:{})
  },
  required: [ 'username', 'password', ...(_c('auth.login.captcha')?[ 'code' ]:[]) ],
  form: [ 
    'username', 
    { key: 'password', attrs: { type: 'password' } },
    ...(_c('auth.login.captcha')?[ {
      key: 'code', captcha_url: '/' + _c('auth.login.captcha')
    } ]:[])
  ]
})
github sshwsfc / xadmin / packages / xadmin-bootstrap / src / layout.js View on Github external
render() {
    return (
      <div id="footer">
        <hr>
        <footer>
          <p>© {_c('site.copyright')}</p>
        </footer>
        
      </div>
    )}
}
github sshwsfc / xadmin / packages / xadmin-auth / src / models.js View on Github external
...(_c('auth.registration.captcha')?{
      code: {
        title: _t('Captcha Code'),
        type: 'string',
        fieldType: 'captcha'
      }
    }:{})
  },
  permission: { add: true },
  required: [ 'username', 'email', 'password1', 'password2', ...(_c('auth.registration.captcha')?[ 'code' ]:[]) ],
  form: [ 
    'username', 
    'email', 
    { key: 'password1', attrs: { type: 'password' } },
    { key: 'password2', attrs: { type: 'password' } },
    ...(_c('auth.registration.captcha')?[ {
      key: 'code', captcha_url: '/' + _c('auth.registration.captcha') 
    } ]:[] )
  ]
})
github sshwsfc / xadmin / packages / xadmin-auth / src / models.js View on Github external
code: {
        title: _t('Captcha Code'),
        type: 'string',
        fieldType: 'captcha'
      }
    }:{})
  },
  permission: { add: true },
  required: [ 'username', 'email', 'password1', 'password2', ...(_c('auth.registration.captcha')?[ 'code' ]:[]) ],
  form: [ 
    'username', 
    'email', 
    { key: 'password1', attrs: { type: 'password' } },
    { key: 'password2', attrs: { type: 'password' } },
    ...(_c('auth.registration.captcha')?[ {
      key: 'code', captcha_url: '/' + _c('auth.registration.captcha') 
    } ]:[] )
  ]
})
github sshwsfc / xadmin / packages / xadmin-antd / src / filter / components / TextFilter.js View on Github external
const useTextFilter = ({ input }) => {

  let value = input.value
  let like = null
  
  if(value == null || value == undefined || value == '') {
    value = ''
    like = config('filter') && config('filter').textDefaultSearch == true
  } else if(value && value.like !== undefined) {
    value = value.like
    like = true
  } else {
    like = false
  }

  const onChange = ({ value, like }) => {
    if(like) {
      input.onChange({ like: value })
    } else {
      input.onChange(value)
    }
  }

  const onValueChange = value => {
github sshwsfc / xadmin / packages / xadmin-form / src / base.js View on Github external
const WrapForm = React.useMemo(() => {
    const formConfig = config('redux-form-config')
    return reduxForm({ 
      form: formKey,
      ...formConfig,
      ...wrapProps,
      validate: (values) => {
        let errors = validate ? validate(values) : {}
        return validateByFields(errors, values, fields)
      }
    })(BaseForm)
  }, [ formKey ])
github sshwsfc / xadmin / packages / xadmin-auth / src / models.js View on Github external
type: 'string'
    },
    ...(_c('auth.login.captcha')?{
      code: {
        title: _t('Captcha Code'),
        type: 'string',
        fieldType: 'captcha'
      }
    }:{})
  },
  required: [ 'username', 'password', ...(_c('auth.login.captcha')?[ 'code' ]:[]) ],
  form: [ 
    'username', 
    { key: 'password', attrs: { type: 'password' } },
    ...(_c('auth.login.captcha')?[ {
      key: 'code', captcha_url: '/' + _c('auth.login.captcha')
    } ]:[])
  ]
})
github sshwsfc / xadmin / packages / xadmin-bootstrap / src / layout.js View on Github external
render() {
    return (
      &lt;&gt;
        
        
        
          
          {this.props.children}
        
        <footer>
      
    )}
}</footer>