render()

in console-ui/src/pages/AI/NewCredential/NewCredential.js [436:515]


  render() {
    const { locale = {} } = this.props;
    const { init } = this.field;
    const formItemLayout = {
      labelCol: {
        span: 2,
      },
      wrapperCol: {
        span: 22,
      },
    };
    const { editorClass } = this.state;
    const isEdit = getParams('mcptype') === 'edit';

    return (
      <Loading
        shape={'flower'}
        tip={'Loading...'}
        style={{ width: '100%', position: 'relative' }}
        visible={this.state.loading}
        color={'#333'}
      >
        <h1>{locale.newListing}</h1>
        <Form className="new-config-form" field={this.field} {...formItemLayout}>
          <FormItem label={locale.credentialId} required>
            <Input
              {...init('credentialId', {
                rules: [
                  {
                    required: true,
                    message: locale.newConfig,
                  },
                  { validator: this.validateChart.bind(this) },
                ],
              })}
              maxLength={255}
              addonTextBefore={
                this.state.addonBefore ? (
                  <div style={{ minWidth: 100, color: '#373D41' }}>{this.state.addonBefore}</div>
                ) : null
              }
              isPreview={isEdit}
            />
          </FormItem>

          <FormItem label={locale.description}>
            <Input.TextArea htmlType={'text'} multiple rows={3} {...init('desc')} />
          </FormItem>
          <FormItem
            label={
              <>
                <span>{locale.credentialContent}</span>
                <p>{locale.onlySupportJsonFormat}</p>
              </>
            }
            required
          >
            <div id={'container'} className={editorClass} style={{ minHeight: 450 }} />
          </FormItem>

          <FormItem label=" ">
            <div style={{ textAlign: 'right' }}>
              <Button
                type={'primary'}
                style={{ marginRight: 10 }}
                onClick={this.publishConfig.bind(this)}
              >
                {locale.escExit}
              </Button>

              <Button type={'normal'} onClick={this.goList.bind(this)}>
                {locale.release}
              </Button>
            </div>
          </FormItem>
        </Form>
        <SuccessDialog ref={this.successDialog} />
      </Loading>
    );
  }