Problems: don't limit ack message, fix #1122
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import React, { PureComponent } from 'react';
|
import React, { PureComponent } from 'react';
|
||||||
import { cx, css } from 'emotion';
|
import { cx, css } from 'emotion';
|
||||||
import { ZBX_ACK_ACTION_ADD_MESSAGE, ZBX_ACK_ACTION_ACK, ZBX_ACK_ACTION_CHANGE_SEVERITY, ZBX_ACK_ACTION_CLOSE } from '../../datasource-zabbix/constants';
|
import { ZBX_ACK_ACTION_ADD_MESSAGE, ZBX_ACK_ACTION_ACK, ZBX_ACK_ACTION_CHANGE_SEVERITY, ZBX_ACK_ACTION_CLOSE } from '../../datasource-zabbix/constants';
|
||||||
import { Button, VerticalGroup, Spinner, Modal, Input, Checkbox, RadioButtonGroup, stylesFactory, withTheme, Themeable } from '@grafana/ui';
|
import { Button, VerticalGroup, Spinner, Modal, Input, Checkbox, RadioButtonGroup, stylesFactory, withTheme, Themeable, TextArea } from '@grafana/ui';
|
||||||
import { FAIcon } from '../../components';
|
import { FAIcon } from '../../components';
|
||||||
import { GrafanaTheme } from '@grafana/data';
|
import { GrafanaTheme } from '@grafana/data';
|
||||||
|
|
||||||
@@ -65,13 +65,13 @@ export class AckModalUnthemed extends PureComponent<Props, State> {
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
handleChange = (event: React.ChangeEvent<HTMLInputElement>) => {
|
handleChange = (event: React.ChangeEvent<HTMLTextAreaElement>) => {
|
||||||
this.setState({ value: event.target.value, error: false });
|
this.setState({ value: event.target.value, error: false });
|
||||||
}
|
}
|
||||||
|
|
||||||
handleKeyUp = (event: React.KeyboardEvent<HTMLInputElement>) => {
|
handleKeyPress = (event: React.KeyboardEvent<HTMLTextAreaElement>) => {
|
||||||
if (event.which === KEYBOARD_ENTER_KEY || event.key === 'Enter') {
|
if (event.which === KEYBOARD_ENTER_KEY || event.key === 'Enter') {
|
||||||
this.submit();
|
// this.submit();
|
||||||
} else if (event.which === KEYBOARD_ESCAPE_KEY || event.key === 'Escape') {
|
} else if (event.which === KEYBOARD_ESCAPE_KEY || event.key === 'Escape') {
|
||||||
this.dismiss();
|
this.dismiss();
|
||||||
}
|
}
|
||||||
@@ -196,17 +196,16 @@ export class AckModalUnthemed extends PureComponent<Props, State> {
|
|||||||
>
|
>
|
||||||
<div className={inputGroupClass}>
|
<div className={inputGroupClass}>
|
||||||
<label className="gf-form-hint">
|
<label className="gf-form-hint">
|
||||||
<Input className={inputClass}
|
<TextArea className={inputClass}
|
||||||
type="text"
|
type="text"
|
||||||
name="message"
|
name="message"
|
||||||
placeholder="Message"
|
placeholder="Message"
|
||||||
maxLength={64}
|
|
||||||
autoComplete="off"
|
autoComplete="off"
|
||||||
autoFocus={true}
|
autoFocus={true}
|
||||||
value={this.state.value}
|
value={this.state.value}
|
||||||
onChange={this.handleChange}
|
onChange={this.handleChange}
|
||||||
onKeyUp={this.handleKeyUp}>
|
onKeyDown={this.handleKeyPress}>
|
||||||
</Input>
|
</TextArea>
|
||||||
<small className={inputHintClass}>Press Enter to submit</small>
|
<small className={inputHintClass}>Press Enter to submit</small>
|
||||||
{this.state.error &&
|
{this.state.error &&
|
||||||
<small className={inputErrorClass}>{this.state.errorMessage}</small>
|
<small className={inputErrorClass}>{this.state.errorMessage}</small>
|
||||||
|
|||||||
Reference in New Issue
Block a user