Problems: improve ack dialog (add ack options), closes #942
This commit is contained in:
@@ -39,7 +39,6 @@ class FunctionEditor extends React.PureComponent<FunctionEditorProps, FunctionEd
|
||||
<div style={{ overflow: 'auto', maxHeight: '30rem', textAlign: 'left', fontWeight: 'normal' }}>
|
||||
<h4 style={{ color: 'white' }}> {name} </h4>
|
||||
<div>{description}</div>
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -28,8 +28,10 @@ export const SHOW_OK_EVENTS = 1;
|
||||
|
||||
// Acknowledge
|
||||
export const ZBX_ACK_ACTION_NONE = 0;
|
||||
export const ZBX_ACK_ACTION_CLOSE = 1;
|
||||
export const ZBX_ACK_ACTION_ACK = 2;
|
||||
export const ZBX_ACK_ACTION_ADD_MESSAGE = 4;
|
||||
export const ZBX_ACK_ACTION_CHANGE_SEVERITY = 8;
|
||||
|
||||
export const TRIGGER_SEVERITY = [
|
||||
{val: 0, text: 'Not classified'},
|
||||
|
||||
@@ -133,14 +133,21 @@ export class ZabbixAPIConnector {
|
||||
// Zabbix API method wrappers //
|
||||
////////////////////////////////
|
||||
|
||||
acknowledgeEvent(eventid, message) {
|
||||
const action = semver.gte(this.version, '4.0.0') ? ZBX_ACK_ACTION_ACK + ZBX_ACK_ACTION_ADD_MESSAGE : ZBX_ACK_ACTION_NONE;
|
||||
const params = {
|
||||
acknowledgeEvent(eventid: string, message: string, action?: number, severity?: number) {
|
||||
if (!action) {
|
||||
action = semver.gte(this.version, '4.0.0') ? ZBX_ACK_ACTION_ADD_MESSAGE : ZBX_ACK_ACTION_NONE;
|
||||
}
|
||||
|
||||
const params: any = {
|
||||
eventids: eventid,
|
||||
message: message,
|
||||
action: action
|
||||
};
|
||||
|
||||
if (severity) {
|
||||
params.severity = severity;
|
||||
}
|
||||
|
||||
return this.request('event.acknowledge', params);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user