- <Tabs
- tabs={rateLimitTypes.map(rateLimitType => ({
- key: rateLimitType,
- label: rateLimitType,
- getNode: () => (
- <RateLimits
- handleRateLimit={linkEvent(
- { rateLimitType, ctx: this },
- handleRateLimitChange
- )}
- handleRateLimitPerSecond={linkEvent(
- { rateLimitType, ctx: this },
- handlePerSecondChange
+ <form onSubmit={linkEvent(this, submitRateLimitForm)}>
+ <Tabs
+ tabs={rateLimitTypes.map(rateLimitType => ({
+ key: rateLimitType,
+ label: rateLimitType,
+ getNode: () => (
+ <RateLimits
+ handleRateLimit={linkEvent(
+ { rateLimitType, ctx: this },
+ handleRateLimitChange
+ )}
+ handleRateLimitPerSecond={linkEvent(
+ { rateLimitType, ctx: this },
+ handlePerSecondChange
+ )}
+ rateLimitLabel={i18n.t(`rate_limit_${rateLimitType}`)}
+ rateLimitValue={this.state.form[rateLimitType]}
+ rateLimitPerSecondValue={
+ this.state.form[`${rateLimitType}_per_second`]
+ }
+ />
+ ),
+ }))}
+ />
+ <div className="form-group row">
+ <div className="col-12">
+ <button
+ type="submit"
+ className="btn btn-secondary mr-2"
+ disabled={this.state.loading}
+ >
+ {this.state.loading ? (
+ <Spinner />
+ ) : (
+ capitalizeFirstLetter(i18n.t("save"))