1 | ;
|
2 | var _a;
|
3 | Object.defineProperty(exports, "__esModule", { value: true });
|
4 | exports.AlarmStatusWidget = exports.AlarmStatusWidgetSortBy = void 0;
|
5 | const jsiiDeprecationWarnings = require("../.warnings.jsii.js");
|
6 | const JSII_RTTI_SYMBOL_1 = Symbol.for("jsii.rtti");
|
7 | const widget_1 = require("./widget");
|
8 | /**
|
9 | * The sort possibilities for AlarmStatusWidgets
|
10 | */
|
11 | var AlarmStatusWidgetSortBy;
|
12 | (function (AlarmStatusWidgetSortBy) {
|
13 | /**
|
14 | * Choose DEFAULT to sort them in alphabetical order by alarm name.
|
15 | */
|
16 | AlarmStatusWidgetSortBy["DEFAULT"] = "default";
|
17 | /**
|
18 | * Choose STATE_UPDATED_TIMESTAMP to sort them first by alarm state, with alarms in ALARM state first,
|
19 | * INSUFFICIENT_DATA alarms next, and OK alarms last.
|
20 | * Within each group, the alarms are sorted by when they last changed state, with more recent state changes listed first.
|
21 | */
|
22 | AlarmStatusWidgetSortBy["STATE_UPDATED_TIMESTAMP"] = "stateUpdatedTimestamp";
|
23 | /**
|
24 | * Choose TIMESTAMP to sort them by the time when the alarms most recently changed state,
|
25 | * no matter the current alarm state.
|
26 | * The alarm that changed state most recently is listed first.
|
27 | */
|
28 | AlarmStatusWidgetSortBy["TIMESTAMP"] = "timestamp";
|
29 | })(AlarmStatusWidgetSortBy = exports.AlarmStatusWidgetSortBy || (exports.AlarmStatusWidgetSortBy = {}));
|
30 | /**
|
31 | * A dashboard widget that displays alarms in a grid view
|
32 | */
|
33 | class AlarmStatusWidget extends widget_1.ConcreteWidget {
|
34 | constructor(props) {
|
35 | super(props.width || 6, props.height || 3);
|
36 | try {
|
37 | jsiiDeprecationWarnings._aws_cdk_aws_cloudwatch_AlarmStatusWidgetProps(props);
|
38 | }
|
39 | catch (error) {
|
40 | if (process.env.JSII_DEBUG !== "1" && error.name === "DeprecationError") {
|
41 | Error.captureStackTrace(error, AlarmStatusWidget);
|
42 | }
|
43 | throw error;
|
44 | }
|
45 | this.props = props;
|
46 | }
|
47 | position(x, y) {
|
48 | this.x = x;
|
49 | this.y = y;
|
50 | }
|
51 | toJson() {
|
52 | return [
|
53 | {
|
54 | type: 'alarm',
|
55 | width: this.width,
|
56 | height: this.height,
|
57 | x: this.x,
|
58 | y: this.y,
|
59 | properties: {
|
60 | title: this.props.title ? this.props.title : 'Alarm Status',
|
61 | alarms: this.props.alarms.map((alarm) => alarm.alarmArn),
|
62 | states: this.props.states,
|
63 | sortBy: this.props.sortBy,
|
64 | },
|
65 | },
|
66 | ];
|
67 | }
|
68 | }
|
69 | exports.AlarmStatusWidget = AlarmStatusWidget;
|
70 | _a = JSII_RTTI_SYMBOL_1;
|
71 | AlarmStatusWidget[_a] = { fqn: "@aws-cdk/aws-cloudwatch.AlarmStatusWidget", version: "1.198.0" };
|
72 | //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYWxhcm0tc3RhdHVzLXdpZGdldC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbImFsYXJtLXN0YXR1cy13aWRnZXQudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBRUEscUNBQTBDO0FBRzFDOztHQUVHO0FBQ0gsSUFBWSx1QkFvQlg7QUFwQkQsV0FBWSx1QkFBdUI7SUFFakM7O09BRUc7SUFDSCw4Q0FBbUIsQ0FBQTtJQUVuQjs7OztPQUlHO0lBQ0gsNEVBQWlELENBQUE7SUFFakQ7Ozs7T0FJRztJQUNILGtEQUF1QixDQUFBO0FBQ3pCLENBQUMsRUFwQlcsdUJBQXVCLEdBQXZCLCtCQUF1QixLQUF2QiwrQkFBdUIsUUFvQmxDO0FBZ0REOztHQUVHO0FBQ0gsTUFBYSxpQkFBa0IsU0FBUSx1QkFBYztJQUduRCxZQUFZLEtBQTZCO1FBQ3ZDLEtBQUssQ0FBQyxLQUFLLENBQUMsS0FBSyxJQUFJLENBQUMsRUFBRSxLQU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NpdGlvbih4OiBudW1iZXIsIHk6IG51bWJlcik6IHZvaWQge1xuICAgIHRoaXMueCA9IHg7XG4gICAgdGhpcy55ID0geTtcbiAgfVxuXG4gIHB1YmxpYyB0b0pzb24oKTogYW55W10ge1xuICAgIHJldHVybiBbXG4gICAgICB7XG4gICAgICAgIHR5cGU6ICdhbGFybScsXG4gICAgICAgIHdpZHRoOiB0aGlzLndpZHRoLFxuICAgICAgICBoZWlnaHQ6IHRoaXMuaGVpZ2h0LFxuICAgICAgICB4OiB0aGlzLngsXG4gICAgICAgIHk6IHRoaXMueSxcbiAgICAgICAgcHJvcGVydGllczoge1xuICAgICAgICAgIHRpdGxlOiB0aGlzLnByb3BzLnRpdGxlID8gdGhpcy5wcm9wcy50aXRsZSA6ICdBbGFybSBTdGF0dXMnLFxuICAgICAgICAgIGFsYXJtczogdGhpcy5wcm9wcy5hbGFybXMubWFwKChhbGFybSkgPT4gYWxhcm0uYWxhcm1Bcm4pLFxuICAgICAgICAgIHN0YXRlczogdGhpcy5wcm9wcy5zdGF0ZXMsXG4gICAgICAgICAgc29ydEJ5OiB0aGlzLnByb3BzLnNvcnRCeSxcbiAgICAgICAgfSxcbiAgICAgIH0sXG4gICAgXTtcbiAgfVxufVxuIl19 |
\ | No newline at end of file |