mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 07:44:35 +02:00
Merge branch 'ent-12941-Tiempos-de-intervalo-1-min' into 'develop'
Ent 12941 tiempos de intervalo 1 min See merge request artica/pandorafms!6974
This commit is contained in:
commit
731adf3300
@ -4676,7 +4676,8 @@
|
||||
"function" == typeof _ &&
|
||||
"function" == typeof Symbol &&
|
||||
"symbol" == typeof _("foo") &&
|
||||
"symbol" == typeof Symbol("bar") && w()
|
||||
"symbol" == typeof Symbol("bar") &&
|
||||
w()
|
||||
);
|
||||
};
|
||||
},
|
||||
@ -13386,7 +13387,9 @@
|
||||
null != s &&
|
||||
!w(s)
|
||||
) ||
|
||||
j.test(s) || !x.test(s) || (null != i && s in Object(i))
|
||||
j.test(s) ||
|
||||
!x.test(s) ||
|
||||
(null != i && s in Object(i))
|
||||
);
|
||||
};
|
||||
},
|
||||
@ -20230,7 +20233,8 @@
|
||||
var i = s.memoizedState;
|
||||
if (
|
||||
(null === i &&
|
||||
null !== (s = s.alternate) && (i = s.memoizedState),
|
||||
null !== (s = s.alternate) &&
|
||||
(i = s.memoizedState),
|
||||
null !== i)
|
||||
)
|
||||
return i.dehydrated;
|
||||
@ -21697,7 +21701,8 @@
|
||||
null !== ae &&
|
||||
((Z = ae),
|
||||
null !== X &&
|
||||
null != (ae = Kb(ee, X)) && U.push(tf(ee, ae, Z))),
|
||||
null != (ae = Kb(ee, X)) &&
|
||||
U.push(tf(ee, ae, Z))),
|
||||
Y)
|
||||
)
|
||||
break;
|
||||
@ -22675,7 +22680,8 @@
|
||||
? s.shouldComponentUpdate(_, x, j)
|
||||
: !i.prototype ||
|
||||
!i.prototype.isPureReactComponent ||
|
||||
!Ie(u, _) || !Ie(w, x);
|
||||
!Ie(u, _) ||
|
||||
!Ie(w, x);
|
||||
}
|
||||
function ph(s, i, u) {
|
||||
var _ = !1,
|
||||
@ -25282,7 +25288,8 @@
|
||||
case 15:
|
||||
if (
|
||||
!Po &&
|
||||
null !== (_ = u.updateQueue) && null !== (_ = _.lastEffect)
|
||||
null !== (_ = u.updateQueue) &&
|
||||
null !== (_ = _.lastEffect)
|
||||
) {
|
||||
w = _ = _.next;
|
||||
do {
|
||||
@ -26026,7 +26033,8 @@
|
||||
return !0;
|
||||
})(w) &&
|
||||
(2 === (i = Jk(s, _)) &&
|
||||
0 !== (x = xc(s)) && ((_ = x), (i = Ok(s, x))),
|
||||
0 !== (x = xc(s)) &&
|
||||
((_ = x), (i = Ok(s, x))),
|
||||
1 === i))
|
||||
)
|
||||
throw ((u = Go), Lk(s, 0), Dk(s, _), Ek(s, yt()), u);
|
||||
@ -28469,7 +28477,8 @@
|
||||
return (
|
||||
void 0 !== this._readableState &&
|
||||
void 0 !== this._writableState &&
|
||||
this._readableState.destroyed && this._writableState.destroyed
|
||||
this._readableState.destroyed &&
|
||||
this._writableState.destroyed
|
||||
);
|
||||
},
|
||||
set: function set(s) {
|
||||
@ -29506,7 +29515,8 @@
|
||||
return (
|
||||
!!$.call(this, s) ||
|
||||
(this === Writable &&
|
||||
s && s._writableState instanceof WritableState)
|
||||
s &&
|
||||
s._writableState instanceof WritableState)
|
||||
);
|
||||
}
|
||||
}))
|
||||
@ -33989,7 +33999,8 @@
|
||||
j = s;
|
||||
if (
|
||||
"object" == typeof s &&
|
||||
(j = s[(_ = Object.keys(s)[0])]) && j._elem
|
||||
(j = s[(_ = Object.keys(s)[0])]) &&
|
||||
j._elem
|
||||
)
|
||||
return (
|
||||
(j._elem.name = _),
|
||||
@ -46940,7 +46951,8 @@
|
||||
!_isString(s) &&
|
||||
(0 === s.length ||
|
||||
(s.length > 0 &&
|
||||
s.hasOwnProperty(0) && s.hasOwnProperty(s.length - 1))))
|
||||
s.hasOwnProperty(0) &&
|
||||
s.hasOwnProperty(s.length - 1))))
|
||||
);
|
||||
});
|
||||
var sc = "undefined" != typeof Symbol ? Symbol.iterator : "@@iterator";
|
||||
@ -49050,7 +49062,8 @@
|
||||
"object" == typeof i &&
|
||||
null !== i &&
|
||||
"primitive" in i &&
|
||||
"function" == typeof i.primitive && i.primitive() === s,
|
||||
"function" == typeof i.primitive &&
|
||||
i.primitive() === s,
|
||||
hasClass = (s, i) =>
|
||||
"object" == typeof i &&
|
||||
null !== i &&
|
||||
@ -58903,8 +58916,7 @@
|
||||
!!s.isStringElement(i.in) &&
|
||||
!!s.isStringElement(u.name) &&
|
||||
!!s.isStringElement(u.in) &&
|
||||
serializers_value(i.name) ===
|
||||
serializers_value(u.name) &&
|
||||
serializers_value(i.name) === serializers_value(u.name) &&
|
||||
serializers_value(i.in) === serializers_value(u.in),
|
||||
i = [];
|
||||
return {
|
||||
@ -62689,9 +62701,7 @@
|
||||
He.createElement(
|
||||
"div",
|
||||
{ className: "modal-ux-content" },
|
||||
j
|
||||
.valueSeq()
|
||||
.map((j, B) =>
|
||||
j.valueSeq().map((j, B) =>
|
||||
He.createElement(P, {
|
||||
key: B,
|
||||
AST: x,
|
||||
@ -65124,9 +65134,7 @@
|
||||
He.createElement(
|
||||
"tbody",
|
||||
null,
|
||||
s
|
||||
.entrySeq()
|
||||
.map(([s, i]) =>
|
||||
s.entrySeq().map(([s, i]) =>
|
||||
He.createElement(u, {
|
||||
key: `${s}-${i}`,
|
||||
xKey: s,
|
||||
@ -65560,9 +65568,7 @@
|
||||
He.createElement(_e, { source: _.get("description") })
|
||||
),
|
||||
ie && le.size
|
||||
? le
|
||||
.entrySeq()
|
||||
.map(([s, i]) =>
|
||||
? le.entrySeq().map(([s, i]) =>
|
||||
He.createElement(de, {
|
||||
key: `${s}-${i}`,
|
||||
xKey: s,
|
||||
@ -66472,9 +66478,7 @@
|
||||
")"
|
||||
),
|
||||
Z && et.size
|
||||
? et
|
||||
.entrySeq()
|
||||
.map(([s, i]) =>
|
||||
? et.entrySeq().map(([s, i]) =>
|
||||
He.createElement(de, {
|
||||
key: `${s}-${i}`,
|
||||
xKey: s,
|
||||
@ -66483,9 +66487,7 @@
|
||||
)
|
||||
: null,
|
||||
X && tt.size
|
||||
? tt
|
||||
.entrySeq()
|
||||
.map(([s, i]) =>
|
||||
? tt.entrySeq().map(([s, i]) =>
|
||||
He.createElement(de, {
|
||||
key: `${s}-${i}`,
|
||||
xKey: s,
|
||||
@ -68903,9 +68905,7 @@
|
||||
He.createElement("span", { className: "brace-close" }, "}")
|
||||
),
|
||||
ye.size
|
||||
? ye
|
||||
.entrySeq()
|
||||
.map(([s, i]) =>
|
||||
? ye.entrySeq().map(([s, i]) =>
|
||||
He.createElement(Re, {
|
||||
key: `${s}-${i}`,
|
||||
propKey: s,
|
||||
@ -69093,9 +69093,7 @@
|
||||
")"
|
||||
),
|
||||
ae.size
|
||||
? ae
|
||||
.entrySeq()
|
||||
.map(([s, i]) =>
|
||||
? ae.entrySeq().map(([s, i]) =>
|
||||
He.createElement(de, {
|
||||
key: `${s}-${i}`,
|
||||
propKey: s,
|
||||
@ -69105,9 +69103,7 @@
|
||||
)
|
||||
: null,
|
||||
P && ee.size
|
||||
? ee
|
||||
.entrySeq()
|
||||
.map(([s, i]) =>
|
||||
? ee.entrySeq().map(([s, i]) =>
|
||||
He.createElement(de, {
|
||||
key: `${s}-${i}`,
|
||||
propKey: s,
|
||||
@ -69453,7 +69449,8 @@
|
||||
!(s >= 0 && s <= 8) &&
|
||||
11 !== s &&
|
||||
!(s >= 14 && s <= 31) &&
|
||||
!(s >= 127 && s <= 159) && !(s > 1114111)
|
||||
!(s >= 127 && s <= 159) &&
|
||||
!(s > 1114111)
|
||||
);
|
||||
}
|
||||
function fromCodePoint(s) {
|
||||
@ -75977,9 +75974,7 @@
|
||||
? He.createElement(
|
||||
"select",
|
||||
{ "data-variable": s, onChange: $ },
|
||||
u
|
||||
.get("enum")
|
||||
.map(u =>
|
||||
u.get("enum").map(u =>
|
||||
He.createElement(
|
||||
"option",
|
||||
{
|
||||
@ -80766,7 +80761,8 @@
|
||||
const { examples: i, example: u, default: _ } = s;
|
||||
return (
|
||||
!!(Array.isArray(i) && i.length >= 1) ||
|
||||
void 0 !== _ || void 0 !== u
|
||||
void 0 !== _ ||
|
||||
void 0 !== u
|
||||
);
|
||||
},
|
||||
extractExample = s => {
|
||||
|
@ -2323,7 +2323,8 @@ var ve = {
|
||||
return (
|
||||
void 0 !== this._readableState &&
|
||||
void 0 !== this._writableState &&
|
||||
this._readableState.destroyed && this._writableState.destroyed
|
||||
this._readableState.destroyed &&
|
||||
this._writableState.destroyed
|
||||
);
|
||||
},
|
||||
set: function set(e) {
|
||||
@ -3336,7 +3337,8 @@ var ve = {
|
||||
return (
|
||||
!!c.call(this, e) ||
|
||||
(this === Writable &&
|
||||
e && e._writableState instanceof WritableState)
|
||||
e &&
|
||||
e._writableState instanceof WritableState)
|
||||
);
|
||||
}
|
||||
}))
|
||||
@ -10833,9 +10835,7 @@ var we = {};
|
||||
Ke.default.createElement(
|
||||
"div",
|
||||
{ className: "modal-ux-content" },
|
||||
s
|
||||
.valueSeq()
|
||||
.map((s, i) =>
|
||||
s.valueSeq().map((s, i) =>
|
||||
Ke.default.createElement(l, {
|
||||
key: i,
|
||||
AST: o,
|
||||
@ -13194,9 +13194,7 @@ var we = {};
|
||||
Ke.default.createElement(
|
||||
"tbody",
|
||||
null,
|
||||
e
|
||||
.entrySeq()
|
||||
.map(([e, t]) =>
|
||||
e.entrySeq().map(([e, t]) =>
|
||||
Ke.default.createElement(r, {
|
||||
key: `${e}-${t}`,
|
||||
xKey: e,
|
||||
@ -13627,9 +13625,7 @@ var we = {};
|
||||
Ke.default.createElement(x, { source: n.get("description") })
|
||||
),
|
||||
g && y.size
|
||||
? y
|
||||
.entrySeq()
|
||||
.map(([e, t]) =>
|
||||
? y.entrySeq().map(([e, t]) =>
|
||||
Ke.default.createElement(v, {
|
||||
key: `${e}-${t}`,
|
||||
xKey: e,
|
||||
@ -16688,9 +16684,7 @@ var we = {};
|
||||
Ke.default.createElement("span", { className: "brace-close" }, "}")
|
||||
),
|
||||
w.size
|
||||
? w
|
||||
.entrySeq()
|
||||
.map(([e, t]) =>
|
||||
? w.entrySeq().map(([e, t]) =>
|
||||
Ke.default.createElement(R, {
|
||||
key: `${e}-${t}`,
|
||||
propKey: e,
|
||||
@ -16748,9 +16742,7 @@ var we = {};
|
||||
{ title: _, expanded: n <= a, collapsedContent: "[...]" },
|
||||
"[",
|
||||
d.size
|
||||
? d
|
||||
.entrySeq()
|
||||
.map(([e, t]) =>
|
||||
? d.entrySeq().map(([e, t]) =>
|
||||
Ke.default.createElement(y, {
|
||||
key: `${e}-${t}`,
|
||||
propKey: e,
|
||||
@ -16874,9 +16866,7 @@ var we = {};
|
||||
")"
|
||||
),
|
||||
h.size
|
||||
? h
|
||||
.entrySeq()
|
||||
.map(([e, t]) =>
|
||||
? h.entrySeq().map(([e, t]) =>
|
||||
Ke.default.createElement(v, {
|
||||
key: `${e}-${t}`,
|
||||
propKey: e,
|
||||
@ -16886,9 +16876,7 @@ var we = {};
|
||||
)
|
||||
: null,
|
||||
l && f.size
|
||||
? f
|
||||
.entrySeq()
|
||||
.map(([e, t]) =>
|
||||
? f.entrySeq().map(([e, t]) =>
|
||||
Ke.default.createElement(v, {
|
||||
key: `${e}-${t}`,
|
||||
propKey: e,
|
||||
@ -18263,9 +18251,7 @@ var we = {};
|
||||
")"
|
||||
),
|
||||
x && c.size
|
||||
? c
|
||||
.entrySeq()
|
||||
.map(([e, r]) =>
|
||||
? c.entrySeq().map(([e, r]) =>
|
||||
Ke.default.createElement(t, {
|
||||
key: `${e}-${r}`,
|
||||
xKey: e,
|
||||
@ -20384,10 +20370,12 @@ var we = {};
|
||||
Ke.default.createElement(
|
||||
"ul",
|
||||
{
|
||||
className: (0,
|
||||
ha.default)("json-schema-2020-12-keyword__children", {
|
||||
className: (0, ha.default)(
|
||||
"json-schema-2020-12-keyword__children",
|
||||
{
|
||||
"json-schema-2020-12-keyword__children--collapsed": !c
|
||||
})
|
||||
}
|
||||
)
|
||||
},
|
||||
c &&
|
||||
Ke.default.createElement(
|
||||
@ -20577,10 +20565,12 @@ var we = {};
|
||||
Ke.default.createElement(
|
||||
"ul",
|
||||
{
|
||||
className: (0,
|
||||
ha.default)("json-schema-2020-12-keyword__children", {
|
||||
className: (0, ha.default)(
|
||||
"json-schema-2020-12-keyword__children",
|
||||
{
|
||||
"json-schema-2020-12-keyword__children--collapsed": !c
|
||||
})
|
||||
}
|
||||
)
|
||||
},
|
||||
c &&
|
||||
Ke.default.createElement(
|
||||
@ -20661,10 +20651,12 @@ var we = {};
|
||||
Ke.default.createElement(
|
||||
"ul",
|
||||
{
|
||||
className: (0,
|
||||
ha.default)("json-schema-2020-12-keyword__children", {
|
||||
className: (0, ha.default)(
|
||||
"json-schema-2020-12-keyword__children",
|
||||
{
|
||||
"json-schema-2020-12-keyword__children--collapsed": !c
|
||||
})
|
||||
}
|
||||
)
|
||||
},
|
||||
c &&
|
||||
Ke.default.createElement(
|
||||
@ -21224,10 +21216,12 @@ var we = {};
|
||||
"li",
|
||||
{
|
||||
key: e,
|
||||
className: (0,
|
||||
ha.default)("json-schema-2020-12-$vocabulary-uri", {
|
||||
className: (0, ha.default)(
|
||||
"json-schema-2020-12-$vocabulary-uri",
|
||||
{
|
||||
"json-schema-2020-12-$vocabulary-uri--disabled": !t
|
||||
})
|
||||
}
|
||||
)
|
||||
},
|
||||
Ke.default.createElement(
|
||||
"span",
|
||||
@ -21422,10 +21416,12 @@ var we = {};
|
||||
Ke.default.createElement(
|
||||
"ul",
|
||||
{
|
||||
className: (0,
|
||||
ha.default)("json-schema-2020-12-keyword__children", {
|
||||
className: (0, ha.default)(
|
||||
"json-schema-2020-12-keyword__children",
|
||||
{
|
||||
"json-schema-2020-12-keyword__children--collapsed": !n
|
||||
})
|
||||
}
|
||||
)
|
||||
},
|
||||
n &&
|
||||
Ke.default.createElement(
|
||||
@ -21512,10 +21508,12 @@ var we = {};
|
||||
Ke.default.createElement(
|
||||
"ul",
|
||||
{
|
||||
className: (0,
|
||||
ha.default)("json-schema-2020-12-keyword__children", {
|
||||
className: (0, ha.default)(
|
||||
"json-schema-2020-12-keyword__children",
|
||||
{
|
||||
"json-schema-2020-12-keyword__children--collapsed": !a
|
||||
})
|
||||
}
|
||||
)
|
||||
},
|
||||
a &&
|
||||
Ke.default.createElement(
|
||||
@ -21583,10 +21581,12 @@ var we = {};
|
||||
Ke.default.createElement(
|
||||
"ul",
|
||||
{
|
||||
className: (0,
|
||||
ha.default)("json-schema-2020-12-keyword__children", {
|
||||
className: (0, ha.default)(
|
||||
"json-schema-2020-12-keyword__children",
|
||||
{
|
||||
"json-schema-2020-12-keyword__children--collapsed": !a
|
||||
})
|
||||
}
|
||||
)
|
||||
},
|
||||
a &&
|
||||
Ke.default.createElement(
|
||||
@ -21654,10 +21654,12 @@ var we = {};
|
||||
Ke.default.createElement(
|
||||
"ul",
|
||||
{
|
||||
className: (0,
|
||||
ha.default)("json-schema-2020-12-keyword__children", {
|
||||
className: (0, ha.default)(
|
||||
"json-schema-2020-12-keyword__children",
|
||||
{
|
||||
"json-schema-2020-12-keyword__children--collapsed": !a
|
||||
})
|
||||
}
|
||||
)
|
||||
},
|
||||
a &&
|
||||
Ke.default.createElement(
|
||||
@ -21813,10 +21815,12 @@ var we = {};
|
||||
Ke.default.createElement(
|
||||
"ul",
|
||||
{
|
||||
className: (0,
|
||||
ha.default)("json-schema-2020-12-keyword__children", {
|
||||
className: (0, ha.default)(
|
||||
"json-schema-2020-12-keyword__children",
|
||||
{
|
||||
"json-schema-2020-12-keyword__children--collapsed": !n
|
||||
})
|
||||
}
|
||||
)
|
||||
},
|
||||
n &&
|
||||
Ke.default.createElement(
|
||||
@ -21877,10 +21881,12 @@ var we = {};
|
||||
Ke.default.createElement(
|
||||
"ul",
|
||||
{
|
||||
className: (0,
|
||||
ha.default)("json-schema-2020-12-keyword__children", {
|
||||
className: (0, ha.default)(
|
||||
"json-schema-2020-12-keyword__children",
|
||||
{
|
||||
"json-schema-2020-12-keyword__children--collapsed": !a
|
||||
})
|
||||
}
|
||||
)
|
||||
},
|
||||
a &&
|
||||
Ke.default.createElement(
|
||||
|
@ -4588,7 +4588,8 @@
|
||||
"function" == typeof _ &&
|
||||
"function" == typeof Symbol &&
|
||||
"symbol" == typeof _("foo") &&
|
||||
"symbol" == typeof Symbol("bar") && w()
|
||||
"symbol" == typeof Symbol("bar") &&
|
||||
w()
|
||||
);
|
||||
};
|
||||
},
|
||||
@ -13205,7 +13206,9 @@
|
||||
null != s &&
|
||||
!w(s)
|
||||
) ||
|
||||
j.test(s) || !x.test(s) || (null != i && s in Object(i))
|
||||
j.test(s) ||
|
||||
!x.test(s) ||
|
||||
(null != i && s in Object(i))
|
||||
);
|
||||
};
|
||||
},
|
||||
@ -19958,7 +19961,8 @@
|
||||
var i = s.memoizedState;
|
||||
if (
|
||||
(null === i &&
|
||||
null !== (s = s.alternate) && (i = s.memoizedState),
|
||||
null !== (s = s.alternate) &&
|
||||
(i = s.memoizedState),
|
||||
null !== i)
|
||||
)
|
||||
return i.dehydrated;
|
||||
@ -21407,7 +21411,8 @@
|
||||
null !== ae &&
|
||||
((Z = ae),
|
||||
null !== X &&
|
||||
null != (ae = Kb(ee, X)) && U.push(tf(ee, ae, Z))),
|
||||
null != (ae = Kb(ee, X)) &&
|
||||
U.push(tf(ee, ae, Z))),
|
||||
Y)
|
||||
)
|
||||
break;
|
||||
@ -22372,7 +22377,8 @@
|
||||
? s.shouldComponentUpdate(_, x, j)
|
||||
: !i.prototype ||
|
||||
!i.prototype.isPureReactComponent ||
|
||||
!Ie(u, _) || !Ie(w, x);
|
||||
!Ie(u, _) ||
|
||||
!Ie(w, x);
|
||||
}
|
||||
function ph(s, i, u) {
|
||||
var _ = !1,
|
||||
@ -24957,7 +24963,8 @@
|
||||
case 15:
|
||||
if (
|
||||
!Po &&
|
||||
null !== (_ = u.updateQueue) && null !== (_ = _.lastEffect)
|
||||
null !== (_ = u.updateQueue) &&
|
||||
null !== (_ = _.lastEffect)
|
||||
) {
|
||||
w = _ = _.next;
|
||||
do {
|
||||
@ -25693,7 +25700,8 @@
|
||||
return !0;
|
||||
})(w) &&
|
||||
(2 === (i = Jk(s, _)) &&
|
||||
0 !== (x = xc(s)) && ((_ = x), (i = Ok(s, x))),
|
||||
0 !== (x = xc(s)) &&
|
||||
((_ = x), (i = Ok(s, x))),
|
||||
1 === i))
|
||||
)
|
||||
throw ((u = Go), Lk(s, 0), Dk(s, _), Ek(s, yt()), u);
|
||||
@ -28109,7 +28117,8 @@
|
||||
return (
|
||||
void 0 !== this._readableState &&
|
||||
void 0 !== this._writableState &&
|
||||
this._readableState.destroyed && this._writableState.destroyed
|
||||
this._readableState.destroyed &&
|
||||
this._writableState.destroyed
|
||||
);
|
||||
},
|
||||
set: function set(s) {
|
||||
@ -29135,7 +29144,8 @@
|
||||
return (
|
||||
!!$.call(this, s) ||
|
||||
(this === Writable &&
|
||||
s && s._writableState instanceof WritableState)
|
||||
s &&
|
||||
s._writableState instanceof WritableState)
|
||||
);
|
||||
}
|
||||
}))
|
||||
@ -33559,7 +33569,8 @@
|
||||
j = s;
|
||||
if (
|
||||
"object" == typeof s &&
|
||||
(j = s[(_ = Object.keys(s)[0])]) && j._elem
|
||||
(j = s[(_ = Object.keys(s)[0])]) &&
|
||||
j._elem
|
||||
)
|
||||
return (
|
||||
(j._elem.name = _),
|
||||
@ -46146,7 +46157,8 @@
|
||||
!_isString(s) &&
|
||||
(0 === s.length ||
|
||||
(s.length > 0 &&
|
||||
s.hasOwnProperty(0) && s.hasOwnProperty(s.length - 1))))
|
||||
s.hasOwnProperty(0) &&
|
||||
s.hasOwnProperty(s.length - 1))))
|
||||
);
|
||||
});
|
||||
var sc = "undefined" != typeof Symbol ? Symbol.iterator : "@@iterator";
|
||||
@ -47696,9 +47708,7 @@
|
||||
: ("undefined" != typeof File && s instanceof File) ||
|
||||
("undefined" != typeof Blob && s instanceof Blob) ||
|
||||
!!ArrayBuffer.isView(s) ||
|
||||
(null !== s &&
|
||||
"object" == typeof s &&
|
||||
"function" == typeof s.pipe)
|
||||
(null !== s && "object" == typeof s && "function" == typeof s.pipe)
|
||||
);
|
||||
}
|
||||
function isArrayOfFile(s, i) {
|
||||
@ -48197,7 +48207,8 @@
|
||||
"object" == typeof i &&
|
||||
null !== i &&
|
||||
"primitive" in i &&
|
||||
"function" == typeof i.primitive && i.primitive() === s,
|
||||
"function" == typeof i.primitive &&
|
||||
i.primitive() === s,
|
||||
hasClass = (s, i) =>
|
||||
"object" == typeof i &&
|
||||
null !== i &&
|
||||
@ -61244,9 +61255,7 @@
|
||||
He.createElement(
|
||||
"div",
|
||||
{ className: "modal-ux-content" },
|
||||
j
|
||||
.valueSeq()
|
||||
.map((j, B) =>
|
||||
j.valueSeq().map((j, B) =>
|
||||
He.createElement(P, {
|
||||
key: B,
|
||||
AST: x,
|
||||
@ -64919,9 +64928,7 @@
|
||||
")"
|
||||
),
|
||||
Z && et.size
|
||||
? et
|
||||
.entrySeq()
|
||||
.map(([s, i]) =>
|
||||
? et.entrySeq().map(([s, i]) =>
|
||||
He.createElement(de, {
|
||||
key: `${s}-${i}`,
|
||||
xKey: s,
|
||||
@ -64930,9 +64937,7 @@
|
||||
)
|
||||
: null,
|
||||
X && tt.size
|
||||
? tt
|
||||
.entrySeq()
|
||||
.map(([s, i]) =>
|
||||
? tt.entrySeq().map(([s, i]) =>
|
||||
He.createElement(de, {
|
||||
key: `${s}-${i}`,
|
||||
xKey: s,
|
||||
@ -67252,9 +67257,7 @@
|
||||
He.createElement("span", { className: "brace-close" }, "}")
|
||||
),
|
||||
ye.size
|
||||
? ye
|
||||
.entrySeq()
|
||||
.map(([s, i]) =>
|
||||
? ye.entrySeq().map(([s, i]) =>
|
||||
He.createElement(Re, {
|
||||
key: `${s}-${i}`,
|
||||
propKey: s,
|
||||
@ -67430,9 +67433,7 @@
|
||||
")"
|
||||
),
|
||||
ae.size
|
||||
? ae
|
||||
.entrySeq()
|
||||
.map(([s, i]) =>
|
||||
? ae.entrySeq().map(([s, i]) =>
|
||||
He.createElement(de, {
|
||||
key: `${s}-${i}`,
|
||||
propKey: s,
|
||||
@ -67442,9 +67443,7 @@
|
||||
)
|
||||
: null,
|
||||
P && ee.size
|
||||
? ee
|
||||
.entrySeq()
|
||||
.map(([s, i]) =>
|
||||
? ee.entrySeq().map(([s, i]) =>
|
||||
He.createElement(de, {
|
||||
key: `${s}-${i}`,
|
||||
propKey: s,
|
||||
@ -67784,7 +67783,8 @@
|
||||
!(s >= 0 && s <= 8) &&
|
||||
11 !== s &&
|
||||
!(s >= 14 && s <= 31) &&
|
||||
!(s >= 127 && s <= 159) && !(s > 1114111)
|
||||
!(s >= 127 && s <= 159) &&
|
||||
!(s > 1114111)
|
||||
);
|
||||
}
|
||||
function fromCodePoint(s) {
|
||||
@ -74095,9 +74095,7 @@
|
||||
? He.createElement(
|
||||
"select",
|
||||
{ "data-variable": s, onChange: $ },
|
||||
u
|
||||
.get("enum")
|
||||
.map(u =>
|
||||
u.get("enum").map(u =>
|
||||
He.createElement(
|
||||
"option",
|
||||
{
|
||||
|
@ -6859,7 +6859,9 @@
|
||||
null != e &&
|
||||
!i(e)
|
||||
) ||
|
||||
a.test(e) || !o.test(e) || (null != t && e in Object(t))
|
||||
a.test(e) ||
|
||||
!o.test(e) ||
|
||||
(null != t && e in Object(t))
|
||||
);
|
||||
};
|
||||
},
|
||||
|
@ -4819,9 +4819,7 @@
|
||||
k().createElement(
|
||||
"div",
|
||||
{ className: "modal-ux-content" },
|
||||
o
|
||||
.valueSeq()
|
||||
.map((o, c) =>
|
||||
o.valueSeq().map((o, c) =>
|
||||
k().createElement(l, {
|
||||
key: c,
|
||||
AST: s,
|
||||
@ -7258,9 +7256,7 @@
|
||||
k().createElement(
|
||||
"tbody",
|
||||
null,
|
||||
e
|
||||
.entrySeq()
|
||||
.map(([e, t]) =>
|
||||
e.entrySeq().map(([e, t]) =>
|
||||
k().createElement(r, {
|
||||
key: `${e}-${t}`,
|
||||
xKey: e,
|
||||
@ -7698,9 +7694,7 @@
|
||||
k().createElement(C, { source: a.get("description") })
|
||||
),
|
||||
y && f.size
|
||||
? f
|
||||
.entrySeq()
|
||||
.map(([e, t]) =>
|
||||
? f.entrySeq().map(([e, t]) =>
|
||||
k().createElement(_, {
|
||||
key: `${e}-${t}`,
|
||||
xKey: e,
|
||||
@ -10816,9 +10810,7 @@
|
||||
k().createElement("span", { className: "brace-close" }, "}")
|
||||
),
|
||||
w.size
|
||||
? w
|
||||
.entrySeq()
|
||||
.map(([e, t]) =>
|
||||
? w.entrySeq().map(([e, t]) =>
|
||||
k().createElement(j, {
|
||||
key: `${e}-${t}`,
|
||||
propKey: e,
|
||||
@ -10882,9 +10874,7 @@
|
||||
{ title: E, expanded: a <= n, collapsedContent: "[...]" },
|
||||
"[",
|
||||
m.size
|
||||
? m
|
||||
.entrySeq()
|
||||
.map(([e, t]) =>
|
||||
? m.entrySeq().map(([e, t]) =>
|
||||
k().createElement(f, {
|
||||
key: `${e}-${t}`,
|
||||
propKey: e,
|
||||
@ -11008,9 +10998,7 @@
|
||||
")"
|
||||
),
|
||||
g.size
|
||||
? g
|
||||
.entrySeq()
|
||||
.map(([e, t]) =>
|
||||
? g.entrySeq().map(([e, t]) =>
|
||||
k().createElement(_, {
|
||||
key: `${e}-${t}`,
|
||||
propKey: e,
|
||||
@ -11020,9 +11008,7 @@
|
||||
)
|
||||
: null,
|
||||
l && h.size
|
||||
? h
|
||||
.entrySeq()
|
||||
.map(([e, t]) =>
|
||||
? h.entrySeq().map(([e, t]) =>
|
||||
k().createElement(_, {
|
||||
key: `${e}-${t}`,
|
||||
propKey: e,
|
||||
@ -12452,9 +12438,7 @@
|
||||
")"
|
||||
),
|
||||
C && i.size
|
||||
? i
|
||||
.entrySeq()
|
||||
.map(([e, r]) =>
|
||||
? i.entrySeq().map(([e, r]) =>
|
||||
k().createElement(t, {
|
||||
key: `${e}-${r}`,
|
||||
xKey: e,
|
||||
@ -12703,9 +12687,7 @@
|
||||
? k().createElement(
|
||||
"select",
|
||||
{ "data-variable": e, onChange: i },
|
||||
r
|
||||
.get("enum")
|
||||
.map(r =>
|
||||
r.get("enum").map(r =>
|
||||
k().createElement(
|
||||
"option",
|
||||
{
|
||||
@ -17499,7 +17481,8 @@
|
||||
const { examples: t, example: r, default: a } = e;
|
||||
return (
|
||||
!!(Array.isArray(t) && t.length >= 1) ||
|
||||
void 0 !== a || void 0 !== r
|
||||
void 0 !== a ||
|
||||
void 0 !== r
|
||||
);
|
||||
},
|
||||
extractExample = e => {
|
||||
|
@ -558,7 +558,7 @@ if ($broker === false) {
|
||||
$tableAgent->data['caption_interval'][0] = __('Interval').ui_print_help_tip(__('Time that elapses when updating data in the agent. Remote modules have their own interval, but this time is used to find out if an agent stopped responding (unknown state). When twice the time interval defined in an agent goes by, it is considered to be in unknown state (or also if all its remote modules are in unknown state). An agent may be in unknown state if all of its local (software agent-based) modules have a last contact time longer than twice the agent interval, even if it has updated remote modules.'), true);
|
||||
// $tableAgent->rowstyle['interval'] = 'width: 260px';
|
||||
$tableAgent->rowclass['interval'] = 'w540px';
|
||||
$tableAgent->data['interval'][0] = html_print_extended_select_for_time(
|
||||
$tableAgent->data['interval'][0] = html_print_select_agentmodule_interval(
|
||||
'intervalo',
|
||||
$intervalo,
|
||||
'',
|
||||
|
@ -1501,6 +1501,11 @@ if ($update_module === true || $create_module === true) {
|
||||
$min = (int) get_parameter('min');
|
||||
$max = (int) get_parameter('max');
|
||||
$interval = (int) get_parameter('module_interval', $intervalo);
|
||||
// Limit module interval to at least 60 secs.
|
||||
if ($interval > 0) {
|
||||
$interval = max($interval, 60);
|
||||
}
|
||||
|
||||
$ff_interval = (int) get_parameter('module_ff_interval');
|
||||
$quiet_module = (int) get_parameter('quiet_module');
|
||||
$cps_module = (int) get_parameter('cps_module');
|
||||
|
@ -705,7 +705,19 @@ if ((int) $moduletype === MODULE_DATA) {
|
||||
// be taken the agent interval (this code is at configurar_agente.php).
|
||||
} else {
|
||||
$interval = ($interval === '') ? '300' : $interval;
|
||||
$outputExecutionInterval = html_print_extended_select_for_time('module_interval', $interval, '', '', '0', false, true, false, false, $classdisabledBecauseInPolicy, $disabledBecauseInPolicy);
|
||||
$outputExecutionInterval = html_print_select_agentmodule_interval(
|
||||
'module_interval',
|
||||
$interval,
|
||||
'',
|
||||
'',
|
||||
'0',
|
||||
false,
|
||||
true,
|
||||
false,
|
||||
false,
|
||||
$classdisabledBecauseInPolicy,
|
||||
$disabledBecauseInPolicy
|
||||
);
|
||||
}
|
||||
|
||||
$module_id_policy_module = 0;
|
||||
|
@ -131,6 +131,10 @@ if ($update_agents) {
|
||||
) {
|
||||
if (get_parameter('interval') != -2) {
|
||||
$values['intervalo'] = get_parameter('interval');
|
||||
|
||||
if ($values['intervalo'] < 60) {
|
||||
$values['intervalo'] = 60;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -753,7 +757,7 @@ $table->data[1][0] = html_print_label_input_block(
|
||||
|
||||
$table->data[1][1] = html_print_label_input_block(
|
||||
__('Interval'),
|
||||
html_print_extended_select_for_time(
|
||||
html_print_select_agentmodule_interval(
|
||||
'interval',
|
||||
-2,
|
||||
'',
|
||||
|
@ -865,7 +865,7 @@ $table->data[15][0] = html_print_label_input_block(
|
||||
|
||||
$table->data[16][0] = html_print_label_input_block(
|
||||
__('Interval'),
|
||||
html_print_extended_select_for_time(
|
||||
html_print_select_agentmodule_interval(
|
||||
'module_interval',
|
||||
0,
|
||||
'',
|
||||
@ -2444,6 +2444,10 @@ function process_manage_edit($module_name, $agents_select=null, $module_status='
|
||||
case 'module_interval':
|
||||
if ($value != 0) {
|
||||
$values[$field] = $value;
|
||||
|
||||
if ($values[$field] < 60) {
|
||||
$values[$field] = 60;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
@ -82,6 +82,11 @@ $snmp_oid = (string) get_parameter('snmp_oid');
|
||||
$snmp_community = (string) get_parameter('snmp_community');
|
||||
$id_module_group = (int) get_parameter('id_module_group');
|
||||
$module_interval = (int) get_parameter('module_interval');
|
||||
// Limit module interval to at least 60 secs.
|
||||
if ($module_interval > 0) {
|
||||
$module_interval = max($module_interval, 60);
|
||||
}
|
||||
|
||||
$id_group = (int) get_parameter('id_group');
|
||||
$plugin_user = (string) get_parameter('plugin_user');
|
||||
$plugin_pass = io_input_password((string) get_parameter('plugin_pass'));
|
||||
|
@ -154,7 +154,7 @@ $table->data[2][0] = html_print_label_input_block(
|
||||
|
||||
$table->data[2][1] = html_print_label_input_block(
|
||||
__('Interval'),
|
||||
html_print_extended_select_for_time('module_interval', $module_interval, '', '', '0', false, true)
|
||||
html_print_select_agentmodule_interval('module_interval', $module_interval, '', '', '0', false, true)
|
||||
);
|
||||
|
||||
$dynamic_interval_img = '<a onclick="advanced_option_dynamic()" class="mrgn_lft_5px mrgn_top_6px">'.html_print_image(
|
||||
|
@ -322,6 +322,11 @@ function clippy_context_help($help=null)
|
||||
$title = $clippy_modules_not_learning_mode['tours']['modules_not_learning_mode']['steps'][0]['title'];
|
||||
$intro = $clippy_modules_not_learning_mode['tours']['modules_not_learning_mode']['steps'][0]['intro'];
|
||||
$img = $clippy_modules_not_learning_mode['tours']['modules_not_learning_mode']['steps'][0]['img'];
|
||||
} else if ($help === 'agent_module_interval') {
|
||||
$clippy_agent_module_interval = clippy_agent_module_interval();
|
||||
$title = $clippy_agent_module_interval['tours']['agent_module_interval']['steps'][0]['title'];
|
||||
$intro = $clippy_agent_module_interval['tours']['agent_module_interval']['steps'][0]['intro'];
|
||||
$img = $clippy_agent_module_interval['tours']['agent_module_interval']['steps'][0]['img'];
|
||||
} else {
|
||||
$img = html_print_image(
|
||||
'images/info-warning.svg',
|
||||
|
@ -2587,7 +2587,7 @@ function html_print_extended_select_for_time(
|
||||
|
||||
echo '</div>';
|
||||
|
||||
echo '<div id="'.$uniq_name.'_manual" class="w100p inline_flex">';
|
||||
echo '<div id="'.$uniq_name.'_manual" class="inline_flex">';
|
||||
html_print_input_text($uniq_name.'_text', $selected, '', $size, 255, false, $readonly, false, '', $class, $script_input);
|
||||
|
||||
html_print_input_hidden($name, $selected, false, $uniq_name);
|
||||
@ -2614,7 +2614,7 @@ function html_print_extended_select_for_time(
|
||||
false,
|
||||
false
|
||||
);
|
||||
echo ' <a href="javascript:">'.html_print_image(
|
||||
echo '  <a href="javascript:">'.html_print_image(
|
||||
'images/logs@svg.svg',
|
||||
true,
|
||||
[
|
||||
@ -2655,6 +2655,174 @@ function html_print_extended_select_for_time(
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Render agent/module interval-specific time selection set of inputs
|
||||
* from html_print_extended_select_for_time with additional structure and
|
||||
* behavior associated (establishes a limit of at least 60 seconds to be
|
||||
* selected and displays notice when this limit is actively selected).
|
||||
*
|
||||
* @param string $name Select form name.
|
||||
* @param mixed $selected Current selected value. Can be a single value or an array of selected values (in combination with multiple).
|
||||
* @param string $script Javascript onChange (select) code.
|
||||
* @param string $nothing Label when nothing is selected.
|
||||
* @param mixed $nothing_value Value when nothing is selected.
|
||||
* @param integer $size Size of the input.
|
||||
* @param boolean $return Whether to return an output string or echo now (optional, echo by default).
|
||||
* @param boolean $select_style Wherter to assign to combo a unique name (to have more than one on same page, like dashboard).
|
||||
* @param boolean $unique_name Uunique name value.
|
||||
* @param string $class Class value.
|
||||
* @param boolean $readonly Readonly value.
|
||||
* @param string $custom_fields Custom fields value.
|
||||
* @param string $style_icon Style icon value.
|
||||
* @param boolean $no_change No change value.
|
||||
* @param boolean $allow_zero Allow the use of the value zero.
|
||||
|
||||
* @return string HTML code if return parameter is true.
|
||||
*/
|
||||
function html_print_select_agentmodule_interval(
|
||||
$name,
|
||||
$selected='',
|
||||
$script='',
|
||||
$nothing='',
|
||||
$nothing_value='0',
|
||||
$size=false,
|
||||
$return=false,
|
||||
$select_style=false,
|
||||
$unique_name=true,
|
||||
$class='',
|
||||
$readonly=false,
|
||||
$custom_fields=false,
|
||||
$style_icon='',
|
||||
$no_change=false,
|
||||
$allow_zero=0,
|
||||
$units=null,
|
||||
$script_input=''
|
||||
) {
|
||||
global $config;
|
||||
|
||||
include_once $config['homedir'].'/include/functions_clippy.php';
|
||||
|
||||
$output = '<div style="display: inline-flex;">';
|
||||
$output .= html_print_extended_select_for_time(
|
||||
$name,
|
||||
$selected,
|
||||
$script,
|
||||
$nothing,
|
||||
$nothing_value,
|
||||
$size,
|
||||
$return,
|
||||
$select_style,
|
||||
$unique_name,
|
||||
$class,
|
||||
$readonly
|
||||
);
|
||||
|
||||
$unique_id = '';
|
||||
|
||||
if ($unique_name === true) {
|
||||
$pattern = '/'.$name.'([a-fA-F0-9]+)_default/';
|
||||
|
||||
if (preg_match($pattern, $output, $matches)) {
|
||||
// Obtain the unique ID of the generated input.
|
||||
$unique_id = $matches[1];
|
||||
$name .= $unique_id;
|
||||
}
|
||||
}
|
||||
|
||||
$output .= html_print_div(
|
||||
[
|
||||
'id' => 'agent_module_interval_clippy'.$unique_id,
|
||||
'class' => 'invisible flex align-self-center',
|
||||
'content' => clippy_context_help('agent_module_interval'),
|
||||
],
|
||||
true
|
||||
);
|
||||
|
||||
$output .= "<script type='text/javascript'>
|
||||
$(document).ready (function () {
|
||||
// Trigger first check.
|
||||
$('#text-".$name."_text').trigger('change');
|
||||
|
||||
$('#text-".$name."_text').on('keyup change', function() {
|
||||
var unit_multiplier = parseInt($('#".$name."_units').val());
|
||||
var numeric_value = parseInt($(this).val());
|
||||
|
||||
if (unit_multiplier <= 0 || numeric_value <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var curr_secs = numeric_value * unit_multiplier;
|
||||
|
||||
if (curr_secs === 60) {
|
||||
$('#agent_module_interval_clippy".$unique_id."').show();
|
||||
} else {
|
||||
$('#agent_module_interval_clippy".$unique_id."').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('.".$name."_toggler').on('click', function() {
|
||||
if ($('#".$name."_default').css('display') != 'none') {
|
||||
$('#agent_module_interval_clippy".$unique_id."').hide();
|
||||
} else {
|
||||
$('#text-".$name."_text').trigger('change');
|
||||
}
|
||||
});
|
||||
|
||||
$('#".$name."_units').on('input change', function() {
|
||||
var numeric_value = parseInt($('#text-".$name."_text').val());
|
||||
var unit_multiplier = parseInt($(this).val());
|
||||
|
||||
if (unit_multiplier <= 0 || numeric_value <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var curr_secs = numeric_value * unit_multiplier;
|
||||
|
||||
if (curr_secs== 60) {
|
||||
$('#agent_module_interval_clippy".$unique_id."').show();
|
||||
} else {
|
||||
$('#agent_module_interval_clippy".$unique_id."').hide();
|
||||
}
|
||||
});
|
||||
|
||||
$('#text-".$name."_text').on('change', function() {
|
||||
checkMinValue($(this));
|
||||
});
|
||||
|
||||
$('#".$name."_units').on('input change', function() {
|
||||
checkMinValue($('#text-".$name."_text'));
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
|
||||
function checkMinValue(that) {
|
||||
if (isNaN(that.val()) === true) {
|
||||
return;
|
||||
}
|
||||
|
||||
var unit_multiplier = parseInt($('#".$name."_units').val());
|
||||
var numeric_value = parseInt(that.val());
|
||||
|
||||
if (unit_multiplier <= 0 || numeric_value <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
var curr_secs = numeric_value * unit_multiplier;
|
||||
|
||||
if (curr_secs < 60) {
|
||||
// Override value to minimum limited seconds (60).
|
||||
that
|
||||
.val((60 / unit_multiplier))
|
||||
.trigger('change');
|
||||
}
|
||||
}
|
||||
</script>";
|
||||
$output .= '</div>';
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Print selects to configure the cron of a module.
|
||||
*
|
||||
|
@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
// Pandora FMS - https://pandorafms.com
|
||||
// ==================================================
|
||||
// Copyright (c) 2005-2023 Pandora FMS
|
||||
// Please see https://pandorafms.com/community/ for full contribution list
|
||||
// This program is free software; you can redistribute it and/or
|
||||
// modify it under the terms of the GNU Lesser General Public License
|
||||
// as published by the Free Software Foundation; version 2
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
|
||||
/**
|
||||
* @package Include
|
||||
* @subpackage Clippy
|
||||
*/
|
||||
|
||||
|
||||
function clippy_agent_module_interval()
|
||||
{
|
||||
$return_tours = [];
|
||||
$return_tours['first_step_by_default'] = true;
|
||||
$return_tours['help_context'] = true;
|
||||
$return_tours['tours'] = [];
|
||||
|
||||
$return_tours['tours']['agent_module_interval'] = [];
|
||||
$return_tours['tours']['agent_module_interval']['steps'] = [];
|
||||
$return_tours['tours']['agent_module_interval']['steps'][] = [
|
||||
'init_step_context' => true,
|
||||
'intro' => __('Pandora FMS has been designed to monitor thousands of elements. It is possible to use very low sampling intervals by using specific items for that purpose (Satellite Server), but doing so in a centralized way may negatively affect performance. That is why it is limited to 60-second intervals. Even so, 60-second interval sampling should only take place in very specific modules. The impact on your infrastructure may be severe, leading to event storms and monitoring delays. Should you use 60-second intervals, it is recommended to disable unknown detection monitoring to avoid undesired events and use the FlipFlop protection setup'),
|
||||
'title' => __('Notice'),
|
||||
'img' => html_print_image(
|
||||
'images/info-warning.svg',
|
||||
true,
|
||||
[
|
||||
'class' => 'main_menu_icon invert_filter',
|
||||
'style' => 'margin-left: 5px;',
|
||||
]
|
||||
),
|
||||
];
|
||||
$return_tours['tours']['agent_module_interval']['conf'] = [];
|
||||
$return_tours['tours']['agent_module_interval']['conf']['autostart'] = false;
|
||||
$return_tours['tours']['agent_module_interval']['conf']['show_bullets'] = 0;
|
||||
$return_tours['tours']['agent_module_interval']['conf']['show_step_numbers'] = 0;
|
||||
|
||||
return $return_tours;
|
||||
}
|
@ -32,7 +32,7 @@ function clippy_data_configuration_module()
|
||||
$return_tours['tours']['data_configuration_module']['steps'] = [];
|
||||
$return_tours['tours']['data_configuration_module']['steps'][] = [
|
||||
'init_step_context' => true,
|
||||
'intro' => __('Please note that information provided here affects how the agent collect information and generate the data XML. Any data/configuration reported by the agent, different from data or description is discarded, and the configuration shown in the console prevails over any configuration coming from the agent, this applies for example for crit/warn thresholds, interval, module group, min/max value, tags, etc.').__('Information imported FIRST time from the XML will fill the information you can see in the console, but after the first import, system will ignore any update coming from the XML/Agent.'),
|
||||
'intro' => __('Please note that information provided here affects how the agent collects information and generate the data XML. Any data/configuration reported by the agent, different from data or description is discarded, and the configuration shown in the console prevails over any configuration coming from the agent, this applies for example to crit/warn thresholds, interval, module group, min/max value, tags, etc.').' '.__('Information imported FIRST time from the XML will fill the information you can see in the console, but after the first import, system will ignore any update coming from the XML/Agent.'),
|
||||
'title' => __('Data Configuration Module.'),
|
||||
'img' => html_print_image(
|
||||
'images/info-warning.svg',
|
||||
|
@ -8,15 +8,20 @@ use PandoraFMS\Modules\Shared\Services\ValidateAclSystem;
|
||||
|
||||
final class CreateTokenAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private CreateTokenService $createTokenService,
|
||||
private ValidateAclSystem $acl,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(Token $token): Token
|
||||
{
|
||||
$this->acl->validateAclToken($token);
|
||||
return $this->createTokenService->__invoke($token);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -8,15 +8,20 @@ use PandoraFMS\Modules\Shared\Services\ValidateAclSystem;
|
||||
|
||||
final class DeleteTokenAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private DeleteTokenService $deleteTokenService,
|
||||
private ValidateAclSystem $acl,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(Token $token): void
|
||||
{
|
||||
$this->acl->validateAclToken($token);
|
||||
$this->deleteTokenService->__invoke($token);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Authentication\Services\GetTokenService;
|
||||
|
||||
final class GetTokenAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private GetTokenService $getTokenService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(int $idToken): Token
|
||||
{
|
||||
return $this->getTokenService->__invoke($idToken);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -10,12 +10,15 @@ use PandoraFMS\Modules\Shared\Entities\PaginationData;
|
||||
|
||||
final class ListTokenAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private ListTokenService $listTokenService,
|
||||
private CountTokenService $countTokenService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(TokenFilter $tokenFilter): array
|
||||
{
|
||||
return (new PaginationData(
|
||||
@ -25,4 +28,6 @@ final class ListTokenAction
|
||||
$this->listTokenService->__invoke($tokenFilter)
|
||||
))->toArray();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -8,15 +8,20 @@ use PandoraFMS\Modules\Shared\Services\ValidateAclSystem;
|
||||
|
||||
final class UpdateTokenAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private UpdateTokenService $updateTokenService,
|
||||
private ValidateAclSystem $acl,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(Token $token, Token $oldToken): Token
|
||||
{
|
||||
$this->acl->validateAclToken($token);
|
||||
return $this->updateTokenService->__invoke($token, $oldToken);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -11,11 +11,14 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class CreateTokenController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private CreateTokenAction $createTokenAction
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Post(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
@ -40,4 +43,6 @@ final class CreateTokenController extends Controller
|
||||
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -11,12 +11,15 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class DeleteTokenController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private DeleteTokenAction $deleteTokenAction,
|
||||
private GetTokenAction $getTokenAction
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Delete(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
@ -40,4 +43,6 @@ final class DeleteTokenController extends Controller
|
||||
$result = $this->deleteTokenAction->__invoke($token);
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -10,11 +10,14 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class GetTokenController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private GetTokenAction $getTokenAction
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Get(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
@ -37,4 +40,6 @@ final class GetTokenController extends Controller
|
||||
$result = $this->getTokenAction->__invoke($idToken);
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -10,11 +10,14 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class ListTokenController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private ListTokenAction $listTokenAction
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Post(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
@ -66,4 +69,6 @@ final class ListTokenController extends Controller
|
||||
$result = $this->listTokenAction->__invoke($tokenFilter);
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -9,10 +9,13 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class PingController extends Controller
|
||||
{
|
||||
public function __construct(
|
||||
) {
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Get(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
@ -48,4 +51,6 @@ final class PingController extends Controller
|
||||
{
|
||||
return $this->getResponse($response, ['valid' => true]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -28,12 +28,15 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
*/
|
||||
final class UpdateTokenController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private UpdateTokenAction $updateTokenAction,
|
||||
private GetTokenAction $getTokenAction
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(Request $request, Response $response): Response
|
||||
{
|
||||
$idToken = $this->getParam($request, 'id');
|
||||
@ -46,4 +49,6 @@ final class UpdateTokenController extends Controller
|
||||
$result = $this->updateTokenAction->__invoke($token, $oldToken);
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -95,20 +95,29 @@ use PandoraFMS\Modules\Shared\Validators\Validator;
|
||||
*/
|
||||
final class Token extends Entity
|
||||
{
|
||||
|
||||
private ?int $idToken = null;
|
||||
|
||||
private ?string $label = null;
|
||||
|
||||
private ?string $uuid = null;
|
||||
|
||||
private ?string $challenge = null;
|
||||
|
||||
private ?string $idUser = null;
|
||||
|
||||
private ?string $validity = null;
|
||||
|
||||
private ?string $lastUsage = null;
|
||||
|
||||
private ?string $token = null;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public function fieldsReadOnly(): array
|
||||
{
|
||||
return [
|
||||
@ -120,6 +129,7 @@ final class Token extends Entity
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return [
|
||||
@ -133,6 +143,7 @@ final class Token extends Entity
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function getValidations(): array
|
||||
{
|
||||
return [
|
||||
@ -149,11 +160,13 @@ final class Token extends Entity
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function validateFields(array $filters): array
|
||||
{
|
||||
return (new Validator())->validate($filters);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of idToken.
|
||||
*
|
||||
@ -164,11 +177,11 @@ final class Token extends Entity
|
||||
return $this->idToken;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the value of idToken.
|
||||
*
|
||||
* @param ?int $idToken
|
||||
*
|
||||
* @param integer $idToken
|
||||
*/
|
||||
public function setIdToken(?int $idToken): self
|
||||
{
|
||||
@ -188,11 +201,11 @@ final class Token extends Entity
|
||||
return $this->label;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the value of label.
|
||||
*
|
||||
* @param ?string $label
|
||||
*
|
||||
* @param string $label
|
||||
*/
|
||||
public function setLabel(?string $label): self
|
||||
{
|
||||
@ -201,6 +214,7 @@ final class Token extends Entity
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of uuid.
|
||||
*
|
||||
@ -211,11 +225,11 @@ final class Token extends Entity
|
||||
return $this->uuid;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the value of uuid.
|
||||
*
|
||||
* @param ?string $uuid
|
||||
*
|
||||
* @param string $uuid
|
||||
*/
|
||||
public function setUuid(?string $uuid): self
|
||||
{
|
||||
@ -224,6 +238,7 @@ final class Token extends Entity
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of challenge.
|
||||
*
|
||||
@ -234,11 +249,11 @@ final class Token extends Entity
|
||||
return $this->challenge;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the value of challenge.
|
||||
*
|
||||
* @param ?string $challenge
|
||||
*
|
||||
* @param string $challenge
|
||||
*/
|
||||
public function setChallenge(?string $challenge): self
|
||||
{
|
||||
@ -247,6 +262,7 @@ final class Token extends Entity
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of idUser.
|
||||
*
|
||||
@ -257,11 +273,11 @@ final class Token extends Entity
|
||||
return $this->idUser;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the value of idUser.
|
||||
*
|
||||
* @param ?string $idUser
|
||||
*
|
||||
* @param string $idUser
|
||||
*/
|
||||
public function setIdUser(?string $idUser): self
|
||||
{
|
||||
@ -270,6 +286,7 @@ final class Token extends Entity
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of validity.
|
||||
*
|
||||
@ -280,11 +297,11 @@ final class Token extends Entity
|
||||
return $this->validity;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the value of validity.
|
||||
*
|
||||
* @param ?string $validity
|
||||
*
|
||||
* @param string $validity
|
||||
*/
|
||||
public function setValidity(?string $validity): self
|
||||
{
|
||||
@ -293,6 +310,7 @@ final class Token extends Entity
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of lastUsage.
|
||||
*
|
||||
@ -303,11 +321,11 @@ final class Token extends Entity
|
||||
return $this->lastUsage;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the value of lastUsage.
|
||||
*
|
||||
* @param ?string $lastUsage
|
||||
*
|
||||
* @param string $lastUsage
|
||||
*/
|
||||
public function setLastUsage(?string $lastUsage): self
|
||||
{
|
||||
@ -316,6 +334,7 @@ final class Token extends Entity
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of token.
|
||||
*
|
||||
@ -326,11 +345,11 @@ final class Token extends Entity
|
||||
return $this->token;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the value of token.
|
||||
*
|
||||
* @param ?string $token
|
||||
*
|
||||
* @param string $token
|
||||
*/
|
||||
public function setToken(?string $token): self
|
||||
{
|
||||
@ -338,4 +357,6 @@ final class Token extends Entity
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -18,6 +18,7 @@ final class TokenDataMapper extends DataMapperAbstract
|
||||
public const VALIDITY = 'validity';
|
||||
public const LAST_USAGE = 'last_usage';
|
||||
|
||||
|
||||
public function __construct(
|
||||
private Repository $repository,
|
||||
private Builder $builder,
|
||||
@ -28,14 +29,18 @@ final class TokenDataMapper extends DataMapperAbstract
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function getClassName(): string
|
||||
{
|
||||
return Token::class;
|
||||
}
|
||||
|
||||
|
||||
public function fromDatabase(array $data): Token
|
||||
{
|
||||
return $this->builder->build(new Token(), [
|
||||
return $this->builder->build(
|
||||
new Token(),
|
||||
[
|
||||
'idToken' => $data[self::ID_TOKEN],
|
||||
'label' => $this->repository->safeOutput($data[self::LABEL]),
|
||||
'uuid' => $data[self::UUID],
|
||||
@ -43,12 +48,16 @@ final class TokenDataMapper extends DataMapperAbstract
|
||||
'idUser' => $data[self::ID_USER],
|
||||
'validity' => $data[self::VALIDITY],
|
||||
'lastUsage' => $data[self::LAST_USAGE],
|
||||
]);
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function toDatabase(MappeableInterface $data): array
|
||||
{
|
||||
/** @var Token $data */
|
||||
/*
|
||||
@var Token $data
|
||||
*/
|
||||
return [
|
||||
self::ID_TOKEN => $data->getIdToken(),
|
||||
self::LABEL => $this->repository->safeInput($data->getLabel()),
|
||||
@ -59,4 +68,6 @@ final class TokenDataMapper extends DataMapperAbstract
|
||||
self::LAST_USAGE => $data->getLastUsage(),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -39,8 +39,10 @@ use PandoraFMS\Modules\Shared\Validators\Validator;
|
||||
*/
|
||||
final class TokenFilter extends FilterAbstract
|
||||
{
|
||||
|
||||
private ?string $freeSearch = null;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->setDefaultFieldOrder(TokenDataMapper::LABEL);
|
||||
@ -48,6 +50,7 @@ final class TokenFilter extends FilterAbstract
|
||||
$this->setEntityFilter(new Token());
|
||||
}
|
||||
|
||||
|
||||
public function fieldsTranslate(): array
|
||||
{
|
||||
return [
|
||||
@ -58,11 +61,13 @@ final class TokenFilter extends FilterAbstract
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function fieldsReadOnly(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return [
|
||||
@ -70,6 +75,7 @@ final class TokenFilter extends FilterAbstract
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function getValidations(): array
|
||||
{
|
||||
$validations = [];
|
||||
@ -80,24 +86,30 @@ final class TokenFilter extends FilterAbstract
|
||||
return $validations;
|
||||
}
|
||||
|
||||
|
||||
public function validateFields(array $filters): array
|
||||
{
|
||||
return (new Validator())->validate($filters);
|
||||
}
|
||||
|
||||
|
||||
public function getFreeSearch(): ?string
|
||||
{
|
||||
return $this->freeSearch;
|
||||
}
|
||||
|
||||
|
||||
public function setFreeSearch(?string $freeSearch): self
|
||||
{
|
||||
$this->freeSearch = $freeSearch;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getFieldsFreeSearch(): ?array
|
||||
{
|
||||
return [TokenDataMapper::TABLE_NAME.'.'.TokenDataMapper::LABEL];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,20 +7,30 @@ use PandoraFMS\Modules\Authentication\Entities\TokenFilter;
|
||||
|
||||
interface TokenRepository
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* @return Token[],
|
||||
*/
|
||||
public function list(TokenFilter $tokenFilter): array;
|
||||
|
||||
|
||||
public function count(TokenFilter $tokenFilter): int;
|
||||
|
||||
|
||||
public function getOne(TokenFilter $tokenFilter): Token;
|
||||
|
||||
|
||||
public function create(Token $token): Token;
|
||||
|
||||
|
||||
public function update(Token $token): Token;
|
||||
|
||||
|
||||
public function delete(int $id): void;
|
||||
|
||||
|
||||
public function getExistToken(string $label): Token;
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Authentication\Repositories\TokenRepository;
|
||||
|
||||
final class CountTokenService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private TokenRepository $tokenRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(TokenFilter $tokenFilter): int
|
||||
{
|
||||
return $this->tokenRepository->count($tokenFilter);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,8 @@ use PandoraFMS\Modules\Shared\Services\Audit;
|
||||
|
||||
final class CreateTokenService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private Audit $audit,
|
||||
private TokenRepository $tokenRepository,
|
||||
@ -19,6 +21,7 @@ final class CreateTokenService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(Token $token): Token
|
||||
{
|
||||
$this->tokenValidation->__invoke($token);
|
||||
@ -40,4 +43,6 @@ final class CreateTokenService
|
||||
|
||||
return $token;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -9,12 +9,15 @@ use PandoraFMS\Modules\Shared\Services\Audit;
|
||||
|
||||
final class DeleteTokenService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private Audit $audit,
|
||||
private TokenRepository $tokenRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(Token $token): void
|
||||
{
|
||||
$idToken = $token->getIdToken();
|
||||
@ -27,4 +30,6 @@ final class DeleteTokenService
|
||||
json_encode($token->toArray())
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -9,15 +9,20 @@ use PandoraFMS\Modules\Shared\Exceptions\NotFoundException;
|
||||
|
||||
final class ExistLabelTokenService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private TokenRepository $tokenRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(string $label): bool
|
||||
{
|
||||
$tokenFilter = new TokenFilter();
|
||||
/** @var Token $entityFilter */
|
||||
/*
|
||||
@var Token $entityFilter
|
||||
*/
|
||||
$entityFilter = $tokenFilter->getEntityFilter();
|
||||
$entityFilter->setLabel($label);
|
||||
|
||||
@ -28,4 +33,6 @@ final class ExistLabelTokenService
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -4,14 +4,19 @@ namespace PandoraFMS\Modules\Authentication\Services;
|
||||
|
||||
final class GenerateUserTokenService
|
||||
{
|
||||
public function __construct(
|
||||
) {
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(): string
|
||||
{
|
||||
$base = preg_replace(
|
||||
'/[^a-zA-Z0-9]/', '', base64_encode(random_bytes(100)),
|
||||
'/[^a-zA-Z0-9]/',
|
||||
'',
|
||||
base64_encode(random_bytes(100)),
|
||||
);
|
||||
|
||||
$token = substr($base, 0, 8);
|
||||
@ -19,4 +24,6 @@ final class GenerateUserTokenService
|
||||
|
||||
return $token;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -6,12 +6,17 @@ use Ramsey\Uuid\Uuid;
|
||||
|
||||
final class GenerateUserUUIDService
|
||||
{
|
||||
public function __construct(
|
||||
) {
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(): string
|
||||
{
|
||||
return Uuid::uuid4()->toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -8,18 +8,25 @@ use PandoraFMS\Modules\Authentication\Repositories\TokenRepository;
|
||||
|
||||
final class GetTokenService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private TokenRepository $tokenRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(int $idToken): Token
|
||||
{
|
||||
$tokenFilter = new TokenFilter();
|
||||
/** @var Token $entityFilter */
|
||||
/*
|
||||
@var Token $entityFilter
|
||||
*/
|
||||
$entityFilter = $tokenFilter->getEntityFilter();
|
||||
$entityFilter->setIdToken($idToken);
|
||||
|
||||
return $this->tokenRepository->getOne($tokenFilter);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -8,18 +8,25 @@ use PandoraFMS\Modules\Authentication\Repositories\TokenRepository;
|
||||
|
||||
final class GetUserTokenService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private TokenRepository $tokenRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(string $uuid): Token
|
||||
{
|
||||
$tokenFilter = new TokenFilter();
|
||||
/** @var Token $entityFilter */
|
||||
/*
|
||||
@var Token $entityFilter
|
||||
*/
|
||||
$entityFilter = $tokenFilter->getEntityFilter();
|
||||
$entityFilter->setUuid($uuid);
|
||||
|
||||
return $this->tokenRepository->getOne($tokenFilter);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Authentication\Repositories\TokenRepository;
|
||||
|
||||
final class ListTokenService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private TokenRepository $tokenRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(TokenFilter $tokenFilter): array
|
||||
{
|
||||
return $this->tokenRepository->list($tokenFilter);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -4,12 +4,17 @@ namespace PandoraFMS\Modules\Authentication\Services;
|
||||
|
||||
final class PrepareUserTokenService
|
||||
{
|
||||
public function __construct(
|
||||
) {
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(string $plainToken): string
|
||||
{
|
||||
return password_hash($plainToken, PASSWORD_DEFAULT);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,8 @@ use PandoraFMS\Modules\Shared\Services\Audit;
|
||||
|
||||
final class UpdateTokenService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private Audit $audit,
|
||||
private TokenRepository $tokenRepository,
|
||||
@ -16,6 +18,7 @@ final class UpdateTokenService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(Token $token, Token $oldToken): Token
|
||||
{
|
||||
$this->tokenValidation->__invoke($token, $oldToken);
|
||||
@ -30,4 +33,6 @@ final class UpdateTokenService
|
||||
|
||||
return $token;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -6,16 +6,22 @@ use PandoraFMS\Modules\Shared\Services\Config;
|
||||
|
||||
final class ValidateServerIdentifierTokenService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private readonly Config $config,
|
||||
) {
|
||||
}
|
||||
|
||||
public function __invoke(string $token): bool {
|
||||
|
||||
public function __invoke(string $token): bool
|
||||
{
|
||||
$serverUniqueIdentifier = $this->config->get('server_unique_identifier');
|
||||
$apiPassword = $this->config->get('api_password');
|
||||
|
||||
$tokenUniqueServerIdentifier = md5($serverUniqueIdentifier).md5($apiPassword);
|
||||
return ($tokenUniqueServerIdentifier === $token);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -4,11 +4,14 @@ namespace PandoraFMS\Modules\Authentication\Services;
|
||||
|
||||
final class ValidateUserTokenService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private readonly GetUserTokenService $getUserTokenService,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(
|
||||
string $uuid,
|
||||
string $strToken,
|
||||
@ -28,4 +31,6 @@ final class ValidateUserTokenService
|
||||
$challenge
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -11,6 +11,8 @@ use PandoraFMS\Modules\Users\Services\GetUserService;
|
||||
|
||||
final class TokenValidation
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private Config $config,
|
||||
private Timestamp $timestamp,
|
||||
@ -19,6 +21,7 @@ final class TokenValidation
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(Token $token, ?Token $oldToken=null): void
|
||||
{
|
||||
if (!$token->getLabel()) {
|
||||
@ -42,13 +45,17 @@ final class TokenValidation
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function getCurrentTimestamp(): string
|
||||
{
|
||||
return $this->timestamp->getMysqlCurrentTimestamp(0);
|
||||
}
|
||||
|
||||
|
||||
private function validateUser(string $idUser): void
|
||||
{
|
||||
$this->getUserService->__invoke($idUser);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Events\Services\CreateEventService;
|
||||
|
||||
final class CreateEventAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private CreateEventService $createEventService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(Event $event): Event
|
||||
{
|
||||
return $this->createEventService->__invoke($event);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Events\Services\DeleteEventService;
|
||||
|
||||
final class DeleteEventAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private DeleteEventService $deleteEventService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(Event $event): void
|
||||
{
|
||||
$this->deleteEventService->__invoke($event);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Events\Services\GetEventService;
|
||||
|
||||
final class GetEventAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private GetEventService $getEventService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(int $idEvent): Event
|
||||
{
|
||||
return $this->getEventService->__invoke($idEvent);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -10,12 +10,15 @@ use PandoraFMS\Modules\Shared\Entities\PaginationData;
|
||||
|
||||
final class ListEventAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private ListEventService $listEventService,
|
||||
private CountEventService $countEventService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventFilter $eventFilter): array
|
||||
{
|
||||
return (new PaginationData(
|
||||
@ -25,4 +28,6 @@ final class ListEventAction
|
||||
$this->listEventService->__invoke($eventFilter)
|
||||
))->toArray();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Events\Services\UpdateEventService;
|
||||
|
||||
final class UpdateEventAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private UpdateEventService $updateEventService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(Event $event, Event $oldEvent): Event
|
||||
{
|
||||
return $this->updateEventService->__invoke($event, $oldEvent);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Events\Comments\Services\CreateEventCommentService;
|
||||
|
||||
final class CreateEventCommentAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private CreateEventCommentService $createEventCommentService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventComment $eventComment): EventComment
|
||||
{
|
||||
return $this->createEventCommentService->__invoke($eventComment);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Events\Comments\Services\DeleteEventCommentService;
|
||||
|
||||
final class DeleteEventCommentAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private DeleteEventCommentService $deleteEventCommentService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventComment $eventComment): void
|
||||
{
|
||||
$this->deleteEventCommentService->__invoke($eventComment);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Events\Comments\Services\GetEventCommentService;
|
||||
|
||||
final class GetEventCommentAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private GetEventCommentService $getEventCommentService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(int $idTypeField, int $idComment): EventComment
|
||||
{
|
||||
return $this->getEventCommentService->__invoke($idTypeField, $idComment);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ use PandoraFMS\Modules\Shared\Entities\PaginationData;
|
||||
|
||||
final class ListEventCommentAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private ListEventCommentService $listEventCommentService,
|
||||
private CountEventCommentService $countEventCommentService
|
||||
@ -26,4 +28,6 @@ final class ListEventCommentAction
|
||||
$this->listEventCommentService->__invoke($eventCommentFilter)
|
||||
))->toArray();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Events\Comments\Services\UpdateEventCommentService;
|
||||
|
||||
final class UpdateEventCommentAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private UpdateEventCommentService $updateEventCommentService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventComment $eventComment, EventComment $oldEventComment): EventComment
|
||||
{
|
||||
return $this->updateEventCommentService->__invoke($eventComment, $oldEventComment);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -14,6 +14,8 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class CreateEventCommentController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private CreateEventCommentAction $createEventCommentAction,
|
||||
private ValidateAclSystem $acl,
|
||||
@ -21,6 +23,7 @@ final class CreateEventCommentController extends Controller
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Post(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
@ -56,4 +59,6 @@ final class CreateEventCommentController extends Controller
|
||||
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -13,6 +13,8 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class DeleteEventCommentController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private DeleteEventCommentAction $deleteEventCommentAction,
|
||||
private ValidateAclSystem $acl,
|
||||
@ -21,6 +23,7 @@ final class DeleteEventCommentController extends Controller
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Delete(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
@ -55,4 +58,6 @@ final class DeleteEventCommentController extends Controller
|
||||
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -12,6 +12,8 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class GetEventCommentController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private GetEventAction $getEventAction,
|
||||
private GetEventCommentAction $getEventCommentAction,
|
||||
@ -19,6 +21,7 @@ final class GetEventCommentController extends Controller
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Get(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
@ -37,7 +40,6 @@ final class GetEventCommentController extends Controller
|
||||
*/
|
||||
public function __invoke(Request $request, Response $response): Response
|
||||
{
|
||||
|
||||
$idEvent = $this->getParam($request, 'idEvent');
|
||||
$event = $this->getEventAction->__invoke($idEvent);
|
||||
|
||||
@ -53,4 +55,6 @@ final class GetEventCommentController extends Controller
|
||||
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -14,6 +14,8 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class ListEventCommentController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private ListEventCommentAction $listEventCommentAction,
|
||||
private GetEventAction $getEventAction,
|
||||
@ -21,6 +23,7 @@ final class ListEventCommentController extends Controller
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Post(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
@ -66,7 +69,6 @@ final class ListEventCommentController extends Controller
|
||||
*/
|
||||
public function __invoke(Request $request, Response $response): Response
|
||||
{
|
||||
|
||||
$idEvent = $this->getParam($request, 'idEvent');
|
||||
$event = $this->getEventAction->__invoke($idEvent);
|
||||
|
||||
@ -84,4 +86,6 @@ final class ListEventCommentController extends Controller
|
||||
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -31,6 +31,8 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
*/
|
||||
final class UpdateEventCommentController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private UpdateEventCommentAction $updateEventCommentAction,
|
||||
private ValidateAclSystem $acl,
|
||||
@ -39,6 +41,7 @@ final class UpdateEventCommentController extends Controller
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(Request $request, Response $response): Response
|
||||
{
|
||||
$idEvent = $this->getParam($request, 'idEvent');
|
||||
@ -62,4 +65,6 @@ final class UpdateEventCommentController extends Controller
|
||||
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -94,17 +94,25 @@ use PandoraFMS\Modules\Shared\Validators\Validator;
|
||||
*/
|
||||
final class EventComment extends Entity
|
||||
{
|
||||
|
||||
private ?int $idEventComment = null;
|
||||
|
||||
private ?int $idEvent = null;
|
||||
|
||||
private ?int $utimestamp = null;
|
||||
|
||||
private ?string $comment = null;
|
||||
|
||||
private ?string $idUser = null;
|
||||
|
||||
private ?string $action = null;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public function fieldsReadOnly(): array
|
||||
{
|
||||
return [
|
||||
@ -115,6 +123,7 @@ final class EventComment extends Entity
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return [
|
||||
@ -127,6 +136,7 @@ final class EventComment extends Entity
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function getValidations(): array
|
||||
{
|
||||
return [
|
||||
@ -148,68 +158,89 @@ final class EventComment extends Entity
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function validateFields(array $filters): array
|
||||
{
|
||||
return (new Validator())->validate($filters);
|
||||
}
|
||||
|
||||
|
||||
public function getIdEventComment(): ?int
|
||||
{
|
||||
return $this->idEventComment;
|
||||
}
|
||||
|
||||
|
||||
public function setIdEventComment(?int $idEventComment): self
|
||||
{
|
||||
$this->idEventComment = $idEventComment;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getIdEvent(): ?int
|
||||
{
|
||||
return $this->idEvent;
|
||||
}
|
||||
|
||||
|
||||
public function setIdEvent(?int $idEvent): self
|
||||
{
|
||||
$this->idEvent = $idEvent;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getUtimestamp(): ?int
|
||||
{
|
||||
return $this->utimestamp;
|
||||
}
|
||||
|
||||
|
||||
public function setUtimestamp(?int $utimestamp): self
|
||||
{
|
||||
$this->utimestamp = $utimestamp;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getComment(): ?string
|
||||
{
|
||||
return $this->comment;
|
||||
}
|
||||
|
||||
|
||||
public function setComment(?string $comment): self
|
||||
{
|
||||
$this->comment = $comment;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getIdUser(): ?string
|
||||
{
|
||||
return $this->idUser;
|
||||
}
|
||||
|
||||
|
||||
public function setIdUser(?string $idUser): self
|
||||
{
|
||||
$this->idUser = $idUser;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getAction(): ?string
|
||||
{
|
||||
return $this->action;
|
||||
}
|
||||
|
||||
|
||||
public function setAction(?string $action): self
|
||||
{
|
||||
$this->action = $action;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -17,6 +17,7 @@ final class EventCommentDataMapper extends DataMapperAbstract
|
||||
public const ID_USER = 'id_user';
|
||||
public const ACTION = 'action';
|
||||
|
||||
|
||||
public function __construct(
|
||||
private Repository $repository,
|
||||
private Builder $builder,
|
||||
@ -27,26 +28,34 @@ final class EventCommentDataMapper extends DataMapperAbstract
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function getClassName(): string
|
||||
{
|
||||
return EventComment::class;
|
||||
}
|
||||
|
||||
|
||||
public function fromDatabase(array $data): EventComment
|
||||
{
|
||||
return $this->builder->build(new EventComment(), [
|
||||
return $this->builder->build(
|
||||
new EventComment(),
|
||||
[
|
||||
'idEventComment' => $data[self::ID_EVENT_COMMENT],
|
||||
'idEvent' => $data[self::ID_EVENT],
|
||||
'utimestamp' => $data[self::UTIMESTAMP],
|
||||
'comment' => $this->repository->safeOutput($data[self::COMMENT]),
|
||||
'idUser' => $this->repository->safeOutput($data[self::ID_USER]),
|
||||
'action' => $this->repository->safeOutput($data[self::ACTION]),
|
||||
]);
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function toDatabase(MappeableInterface $data): array
|
||||
{
|
||||
/** @var EventComment $data */
|
||||
/*
|
||||
@var EventComment $data
|
||||
*/
|
||||
return [
|
||||
self::ID_EVENT_COMMENT => $data->getIdEventComment(),
|
||||
self::ID_EVENT => $data->getIdEvent(),
|
||||
@ -56,4 +65,6 @@ final class EventCommentDataMapper extends DataMapperAbstract
|
||||
self::ACTION => $this->repository->safeInput($data->getAction()),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -39,8 +39,10 @@ use PandoraFMS\Modules\Shared\Validators\Validator;
|
||||
*/
|
||||
final class EventCommentFilter extends FilterAbstract
|
||||
{
|
||||
|
||||
private ?string $freeSearch = null;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->setDefaultFieldOrder(EventCommentDataMapper::UTIMESTAMP);
|
||||
@ -48,6 +50,7 @@ final class EventCommentFilter extends FilterAbstract
|
||||
$this->setEntityFilter(new EventComment());
|
||||
}
|
||||
|
||||
|
||||
public function fieldsTranslate(): array
|
||||
{
|
||||
return [
|
||||
@ -60,11 +63,13 @@ final class EventCommentFilter extends FilterAbstract
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function fieldsReadOnly(): array
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return [
|
||||
@ -72,21 +77,25 @@ final class EventCommentFilter extends FilterAbstract
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function getValidations(): array
|
||||
{
|
||||
$validations = [];
|
||||
if ($this->getEntityFilter() !== null) {
|
||||
$validations = $this->getEntityFilter()->getValidations();
|
||||
}
|
||||
|
||||
$validations['freeSearch'] = Validator::STRING;
|
||||
return $validations;
|
||||
}
|
||||
|
||||
|
||||
public function validateFields(array $filters): array
|
||||
{
|
||||
return (new Validator())->validate($filters);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of freeSearch.
|
||||
*
|
||||
@ -97,11 +106,11 @@ final class EventCommentFilter extends FilterAbstract
|
||||
return $this->freeSearch;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the value of freeSearch.
|
||||
*
|
||||
* @param ?string $freeSearch
|
||||
*
|
||||
* @param string $freeSearch
|
||||
*/
|
||||
public function setFreeSearch(?string $freeSearch): self
|
||||
{
|
||||
@ -109,6 +118,7 @@ final class EventCommentFilter extends FilterAbstract
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of fieldsFreeSearch.
|
||||
*
|
||||
@ -119,4 +129,5 @@ final class EventCommentFilter extends FilterAbstract
|
||||
return [EventCommentDataMapper::COMMENT];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -9,12 +9,15 @@ use PandoraFMS\Modules\Shared\Repositories\Repository;
|
||||
|
||||
class EventCommentRepository
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private Repository $repository,
|
||||
private EventCommentDataMapper $eventCommentDataMapper
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return EventComments[],
|
||||
*/
|
||||
@ -26,6 +29,7 @@ class EventCommentRepository
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function count(EventCommentFilter $eventCommentFilter): int
|
||||
{
|
||||
return $this->repository->__count(
|
||||
@ -34,6 +38,7 @@ class EventCommentRepository
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function getOne(EventCommentFilter $eventCommentFilter): EventComment
|
||||
{
|
||||
return $this->repository->__getOne(
|
||||
@ -42,12 +47,14 @@ class EventCommentRepository
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function create(EventComment $eventComment): EventComment
|
||||
{
|
||||
$id = $this->repository->__create($eventComment, $this->eventCommentDataMapper);
|
||||
return $eventComment->setIdEventComment($id);
|
||||
}
|
||||
|
||||
|
||||
public function update(EventComment $eventComment): EventComment
|
||||
{
|
||||
return $this->repository->__update(
|
||||
@ -57,9 +64,11 @@ class EventCommentRepository
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function delete(int $id): void
|
||||
{
|
||||
$this->repository->__delete($id, $this->eventCommentDataMapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Events\Comments\Repositories\EventCommentRepository;
|
||||
|
||||
final class CountEventCommentService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private EventCommentRepository $eventCommentRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventCommentFilter $eventCommentFilter): int
|
||||
{
|
||||
return $this->eventCommentRepository->count($eventCommentFilter);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,8 @@ use PandoraFMS\Modules\Shared\Services\Audit;
|
||||
|
||||
final class CreateEventCommentService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private EventCommentRepository $eventCommentRepository,
|
||||
private EventCommentValidation $eventCommentValidation,
|
||||
@ -16,6 +18,7 @@ final class CreateEventCommentService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventComment $eventComment): EventComment
|
||||
{
|
||||
$this->eventCommentValidation->__invoke($eventComment);
|
||||
@ -26,7 +29,8 @@ final class CreateEventCommentService
|
||||
// 'Incidence Management',
|
||||
// ' Create Field #'.$eventComment->getIdEventComment().'in a incidence type #'.$eventComment->getIdEvent()
|
||||
// );
|
||||
|
||||
return $eventComment;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,8 @@ use PandoraFMS\Modules\Shared\Services\Config;
|
||||
|
||||
final class DeleteEventCommentService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private Config $config,
|
||||
private Audit $audit,
|
||||
@ -29,4 +31,6 @@ final class DeleteEventCommentService
|
||||
// ' Deleted field incidence type #'.$idEventComment
|
||||
// );
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -8,19 +8,26 @@ use PandoraFMS\Modules\Events\Comments\Repositories\EventCommentRepository;
|
||||
|
||||
final class GetEventCommentService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private EventCommentRepository $eventCommentRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(int $idEvent, int $idEventComment): EventComment
|
||||
{
|
||||
$eventCommentFilter = new EventCommentFilter();
|
||||
/** @var EventComment $entityFilter */
|
||||
/*
|
||||
@var EventComment $entityFilter
|
||||
*/
|
||||
$entityFilter = $eventCommentFilter->getEntityFilter();
|
||||
$entityFilter->setIdEvent($idEvent);
|
||||
$entityFilter->setIdEventComment($idEventComment);
|
||||
|
||||
return $this->eventCommentRepository->getOne($eventCommentFilter);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Events\Comments\Repositories\EventCommentRepository;
|
||||
|
||||
final class ListEventCommentService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private EventCommentRepository $eventCommentRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventCommentFilter $eventCommentFilter): array
|
||||
{
|
||||
return $this->eventCommentRepository->list($eventCommentFilter);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,8 @@ use PandoraFMS\Modules\Shared\Services\Audit;
|
||||
|
||||
final class UpdateEventCommentService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private Audit $audit,
|
||||
private EventCommentRepository $eventCommentRepository,
|
||||
@ -16,6 +18,7 @@ final class UpdateEventCommentService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventComment $eventComment, EventComment $oldEventComment): EventComment
|
||||
{
|
||||
$this->eventCommentValidation->__invoke($eventComment, $oldEventComment);
|
||||
@ -26,7 +29,8 @@ final class UpdateEventCommentService
|
||||
// 'Incidence Management',
|
||||
// ' Update Field #'.$eventComment->getIdEventComment().' in a incidence type #'.$eventComment->getIdEvent()
|
||||
// );
|
||||
|
||||
return $eventComment;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -10,6 +10,8 @@ use PandoraFMS\Modules\Shared\Services\Timestamp;
|
||||
|
||||
final class EventCommentValidation
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private Config $config,
|
||||
private Timestamp $timestamp,
|
||||
@ -17,6 +19,7 @@ final class EventCommentValidation
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventComment $eventComment, ?EventComment $oldEventComment=null): void
|
||||
{
|
||||
if (!$eventComment->getComment()) {
|
||||
@ -33,8 +36,11 @@ final class EventCommentValidation
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
protected function getCurrentUtimestamp(): int
|
||||
{
|
||||
return $this->timestamp->getMysqlSystemUtimestamp();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -12,12 +12,15 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class CreateEventController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private CreateEventAction $createEventAction,
|
||||
private ValidateAclSystem $acl,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Post(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
@ -44,4 +47,6 @@ final class CreateEventController extends Controller
|
||||
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -12,6 +12,8 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class DeleteEventController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private DeleteEventAction $deleteEventAction,
|
||||
private ValidateAclSystem $acl,
|
||||
@ -19,6 +21,7 @@ final class DeleteEventController extends Controller
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Delete(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
@ -44,4 +47,6 @@ final class DeleteEventController extends Controller
|
||||
$result = $this->deleteEventAction->__invoke($event);
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -11,12 +11,15 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class GetEventController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private GetEventAction $getEventAction,
|
||||
private ValidateAclSystem $acl
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Get(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
@ -41,4 +44,6 @@ final class GetEventController extends Controller
|
||||
$result = $this->getEventAction->__invoke($idEvent);
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -12,12 +12,15 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class ListEventController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private ListEventAction $listEventAction,
|
||||
private ValidateAclSystem $acl,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Post(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
@ -71,4 +74,6 @@ final class ListEventController extends Controller
|
||||
$result = $this->listEventAction->__invoke($eventFilter);
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -28,6 +28,8 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
*/
|
||||
final class UpdateEventController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private UpdateEventAction $updateEventAction,
|
||||
private ValidateAclSystem $acl,
|
||||
@ -35,6 +37,7 @@ final class UpdateEventController extends Controller
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(Request $request, Response $response): Response
|
||||
{
|
||||
$idEvent = $this->getParam($request, 'idEvent');
|
||||
@ -49,4 +52,6 @@ final class UpdateEventController extends Controller
|
||||
$result = $this->updateEventAction->__invoke($event, $oldEvent);
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ final class EventDataMapper extends DataMapperAbstract
|
||||
public const MODULE_STATUS = 'module_status';
|
||||
public const EVENT_CUSTOM_ID = 'event_custom_id';
|
||||
|
||||
|
||||
public function __construct(
|
||||
private Repository $repository,
|
||||
private Builder $builder,
|
||||
@ -48,14 +49,18 @@ final class EventDataMapper extends DataMapperAbstract
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function getClassName(): string
|
||||
{
|
||||
return Event::class;
|
||||
}
|
||||
|
||||
|
||||
public function fromDatabase(array $data): Event
|
||||
{
|
||||
return $this->builder->build(new Event(), [
|
||||
return $this->builder->build(
|
||||
new Event(),
|
||||
[
|
||||
'idEvent' => $data[self::ID_EVENT],
|
||||
'idAgent' => $data[self::ID_AGENT],
|
||||
'idUser' => $data[self::ID_USER],
|
||||
@ -80,12 +85,16 @@ final class EventDataMapper extends DataMapperAbstract
|
||||
'data' => $this->repository->safeOutput($data[self::DATA]),
|
||||
'moduleStatus' => $data[self::MODULE_STATUS],
|
||||
'eventCustomId' => $this->repository->safeOutput($data[self::EVENT_CUSTOM_ID]),
|
||||
]);
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function toDatabase(MappeableInterface $data): array
|
||||
{
|
||||
/** @var Event $data */
|
||||
/*
|
||||
@var Event $data
|
||||
*/
|
||||
return [
|
||||
self::ID_EVENT => $data->getIdEvent(),
|
||||
self::ID_AGENT => $data->getIdAgent(),
|
||||
@ -113,4 +122,6 @@ final class EventDataMapper extends DataMapperAbstract
|
||||
self::EVENT_CUSTOM_ID => $this->repository->safeInput($data->getEventCustomId()),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -8,7 +8,7 @@ enum EventStatusEnum: int
|
||||
{
|
||||
use EnumTrait;
|
||||
|
||||
case NEW = 0;
|
||||
case new = 0;
|
||||
case VALIDATED = 1;
|
||||
case INPROCESS = 2;
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Events\Filters\Services\CreateEventFilterService;
|
||||
|
||||
final class CreateEventFilterAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private CreateEventFilterService $createEventFilterService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventFilter $eventFilter): EventFilter
|
||||
{
|
||||
return $this->createEventFilterService->__invoke($eventFilter);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Events\Filters\Services\DeleteEventFilterService;
|
||||
|
||||
final class DeleteEventFilterAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private DeleteEventFilterService $deleteEventFilterService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventFilter $eventFilter): void
|
||||
{
|
||||
$this->deleteEventFilterService->__invoke($eventFilter);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Events\Filters\Services\GetEventFilterService;
|
||||
|
||||
final class GetEventFilterAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private GetEventFilterService $getEventFilterService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(int $idEventFilter): EventFilter
|
||||
{
|
||||
return $this->getEventFilterService->__invoke($idEventFilter);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -10,12 +10,15 @@ use PandoraFMS\Modules\Shared\Entities\PaginationData;
|
||||
|
||||
final class ListEventFilterAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private ListEventFilterService $listEventFilterService,
|
||||
private CountEventFilterService $countEventFilterService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventFilterFilter $eventFilterFilter): array
|
||||
{
|
||||
return (new PaginationData(
|
||||
@ -25,4 +28,6 @@ final class ListEventFilterAction
|
||||
$this->listEventFilterService->__invoke($eventFilterFilter)
|
||||
))->toArray();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Events\Filters\Services\UpdateEventFilterService;
|
||||
|
||||
final class UpdateEventFilterAction
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private UpdateEventFilterService $updateEventFilterService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventFilter $eventFilter, EventFilter $oldEventFilter): EventFilter
|
||||
{
|
||||
return $this->updateEventFilterService->__invoke($eventFilter, $oldEventFilter);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -12,12 +12,15 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class CreateEventFilterController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private CreateEventFilterAction $createEventFilterAction,
|
||||
private ValidateAclSystem $acl,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Post(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
@ -44,4 +47,6 @@ final class CreateEventFilterController extends Controller
|
||||
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -12,6 +12,8 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class DeleteEventFilterController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private DeleteEventFilterAction $deleteEventFilterAction,
|
||||
private ValidateAclSystem $acl,
|
||||
@ -19,6 +21,7 @@ final class DeleteEventFilterController extends Controller
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Delete(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
@ -44,4 +47,6 @@ final class DeleteEventFilterController extends Controller
|
||||
$result = $this->deleteEventFilterAction->__invoke($eventFilter);
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -11,12 +11,15 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class GetEventFilterController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private GetEventFilterAction $getEventFilterAction,
|
||||
private ValidateAclSystem $acl
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Get(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
@ -41,4 +44,6 @@ final class GetEventFilterController extends Controller
|
||||
$result = $this->getEventFilterAction->__invoke($idEventFilter);
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -12,12 +12,15 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
|
||||
final class ListEventFilterController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private ListEventFilterAction $listEventFilterAction,
|
||||
private ValidateAclSystem $acl,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @OA\Post(
|
||||
* security={{ "bearerAuth": {}}},
|
||||
@ -71,4 +74,6 @@ final class ListEventFilterController extends Controller
|
||||
$result = $this->listEventFilterAction->__invoke($eventFilterFilter);
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -28,6 +28,8 @@ use Psr\Http\Message\ServerRequestInterface as Request;
|
||||
*/
|
||||
final class UpdateEventFilterController extends Controller
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private UpdateEventFilterAction $updateEventFilterAction,
|
||||
private ValidateAclSystem $acl,
|
||||
@ -35,6 +37,7 @@ final class UpdateEventFilterController extends Controller
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(Request $request, Response $response): Response
|
||||
{
|
||||
$idEventFilter = $this->getParam($request, 'idEventFilter');
|
||||
@ -49,4 +52,6 @@ final class UpdateEventFilterController extends Controller
|
||||
$result = $this->updateEventFilterAction->__invoke($eventFilter, $oldEventFilter);
|
||||
return $this->getResponse($response, $result);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -402,50 +402,87 @@ final class EventFilter extends Entity
|
||||
private ?int $idEvent = null;
|
||||
|
||||
private ?int $idEventFilter = null;
|
||||
|
||||
private ?int $idGroupFilter = null;
|
||||
|
||||
private ?string $name = null;
|
||||
|
||||
private ?int $idGroup = null;
|
||||
|
||||
private ?EventTypeEnum $eventType = null;
|
||||
|
||||
private ?array $severity = null;
|
||||
|
||||
private ?EventFilterStatusEnum $status = null;
|
||||
|
||||
private ?string $search = null;
|
||||
|
||||
private ?bool $isNotSearch = null;
|
||||
|
||||
private ?string $textAgent = null;
|
||||
|
||||
private ?int $idAgent = null;
|
||||
|
||||
private ?int $idAgentModule = null;
|
||||
|
||||
private ?int $pagination = null;
|
||||
|
||||
private ?int $slice = null;
|
||||
|
||||
private ?string $idUserAck = null;
|
||||
|
||||
private ?EventFilterGroupByEnum $groupBy = null;
|
||||
|
||||
private ?array $tagWith = null;
|
||||
|
||||
private ?array $tagWithout = null;
|
||||
|
||||
private ?EventFilterAlertEnum $filterOnlyAlert = null;
|
||||
|
||||
private ?bool $searchSecondaryGroups = null;
|
||||
|
||||
private ?bool $searchRecursiveGroups = null;
|
||||
|
||||
private ?string $dateFrom = null;
|
||||
|
||||
private ?string $dateTo = null;
|
||||
|
||||
private ?string $source = null;
|
||||
|
||||
private ?string $idExtra = null;
|
||||
|
||||
private ?string $userComment = null;
|
||||
|
||||
private ?int $idSourceEvent = null;
|
||||
|
||||
private ?array $serverId = null;
|
||||
|
||||
private ?string $timeFrom = null;
|
||||
|
||||
private ?string $timeTo = null;
|
||||
|
||||
private ?string $customData = null;
|
||||
|
||||
private ?EventFilterCustomDataEnum $customDataFilterType = null;
|
||||
|
||||
private ?string $ownerUser = null;
|
||||
|
||||
private ?string $privateFilterUser = null;
|
||||
|
||||
private ?string $regex = null;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
public function fieldsReadOnly(): array
|
||||
{
|
||||
return ['idEventFilter' => 1];
|
||||
}
|
||||
|
||||
|
||||
public function toTranslateFilters(): array
|
||||
{
|
||||
$eventFilterFilter = new EventFilterFilter();
|
||||
@ -463,6 +500,7 @@ final class EventFilter extends Entity
|
||||
return $result;
|
||||
}
|
||||
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return [
|
||||
@ -505,6 +543,7 @@ final class EventFilter extends Entity
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function getValidations(): array
|
||||
{
|
||||
return [
|
||||
@ -574,55 +613,71 @@ final class EventFilter extends Entity
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function validateFields(array $filters): array
|
||||
{
|
||||
return (new EventFilterValidator())->validate($filters);
|
||||
}
|
||||
|
||||
|
||||
public function getIdEventFilter(): ?int
|
||||
{
|
||||
return $this->idEventFilter;
|
||||
}
|
||||
|
||||
|
||||
public function setIdEventFilter(?int $idEventFilter): self
|
||||
{
|
||||
$this->idEventFilter = $idEventFilter;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getIdGroupFilter(): ?int
|
||||
{
|
||||
return $this->idGroupFilter;
|
||||
}
|
||||
|
||||
|
||||
public function setIdGroupFilter(?int $idGroupFilter): self
|
||||
{
|
||||
$this->idGroupFilter = $idGroupFilter;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getName(): ?string
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
|
||||
public function setName(?string $name): self
|
||||
{
|
||||
$this->name = $name;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getIdGroup(): ?int
|
||||
{
|
||||
return $this->idGroup;
|
||||
}
|
||||
|
||||
|
||||
public function setIdGroup(?int $idGroup): self
|
||||
{
|
||||
$this->idGroup = $idGroup;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getEventType(): ?EventTypeEnum
|
||||
{
|
||||
return $this->eventType;
|
||||
}
|
||||
|
||||
|
||||
public function setEventType(null|string|EventTypeEnum $eventType): self
|
||||
{
|
||||
if (is_string($eventType) === true) {
|
||||
@ -630,23 +685,30 @@ final class EventFilter extends Entity
|
||||
} else {
|
||||
$this->eventType = $eventType;
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getSeverity(): ?array
|
||||
{
|
||||
return $this->severity;
|
||||
}
|
||||
|
||||
|
||||
public function setSeverity(?array $severity): self
|
||||
{
|
||||
$this->severity = $severity;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getStatus(): ?EventFilterStatusEnum
|
||||
{
|
||||
return $this->status;
|
||||
}
|
||||
|
||||
|
||||
public function setStatus(null|string|EventFilterStatusEnum $status): self
|
||||
{
|
||||
if (is_string($status) === true) {
|
||||
@ -658,90 +720,117 @@ final class EventFilter extends Entity
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getSearch(): ?string
|
||||
{
|
||||
return $this->search;
|
||||
}
|
||||
|
||||
|
||||
public function setSearch(?string $search): self
|
||||
{
|
||||
$this->search = $search;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getIsNotSearch(): ?bool
|
||||
{
|
||||
return $this->isNotSearch;
|
||||
}
|
||||
|
||||
|
||||
public function setIsNotSearch(?bool $isNotSearch): self
|
||||
{
|
||||
$this->isNotSearch = $isNotSearch;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getTextAgent(): ?string
|
||||
{
|
||||
return $this->textAgent;
|
||||
}
|
||||
|
||||
|
||||
public function setTextAgent(?string $textAgent): self
|
||||
{
|
||||
$this->textAgent = $textAgent;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getIdAgent(): ?int
|
||||
{
|
||||
return $this->idAgent;
|
||||
}
|
||||
|
||||
|
||||
public function setIdAgent(?int $idAgent): self
|
||||
{
|
||||
$this->idAgent = $idAgent;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getIdAgentModule(): ?int
|
||||
{
|
||||
return $this->idAgentModule;
|
||||
}
|
||||
|
||||
|
||||
public function setIdAgentModule(?int $idAgentModule): self
|
||||
{
|
||||
$this->idAgentModule = $idAgentModule;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getPagination(): ?int
|
||||
{
|
||||
return $this->pagination;
|
||||
}
|
||||
|
||||
|
||||
public function setPagination(?int $pagination): self
|
||||
{
|
||||
$this->pagination = $pagination;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getSlice(): ?int
|
||||
{
|
||||
return $this->slice;
|
||||
}
|
||||
|
||||
|
||||
public function setSlice(?int $slice): self
|
||||
{
|
||||
$this->slice = $slice;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getIdUserAck(): ?string
|
||||
{
|
||||
return $this->idUserAck;
|
||||
}
|
||||
|
||||
|
||||
public function setIdUserAck(?string $idUserAck): self
|
||||
{
|
||||
$this->idUserAck = $idUserAck;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getGroupBy(): ?EventFilterGroupByEnum
|
||||
{
|
||||
return $this->groupBy;
|
||||
}
|
||||
|
||||
|
||||
public function setGroupBy(null|string|EventFilterGroupByEnum $groupBy): self
|
||||
{
|
||||
if (is_string($groupBy) === true) {
|
||||
@ -753,30 +842,39 @@ final class EventFilter extends Entity
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getTagWith(): ?array
|
||||
{
|
||||
return $this->tagWith;
|
||||
}
|
||||
|
||||
|
||||
public function setTagWith(?array $tagWith): self
|
||||
{
|
||||
$this->tagWith = $tagWith;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getTagWithout(): ?array
|
||||
{
|
||||
return $this->tagWithout;
|
||||
}
|
||||
|
||||
|
||||
public function setTagWithout(?array $tagWithout): self
|
||||
{
|
||||
$this->tagWithout = $tagWithout;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getFilterOnlyAlert(): ?EventFilterAlertEnum
|
||||
{
|
||||
return $this->filterOnlyAlert;
|
||||
}
|
||||
|
||||
|
||||
public function setFilterOnlyAlert(null|string|EventFilterAlertEnum $filterOnlyAlert): self
|
||||
{
|
||||
if (is_string($filterOnlyAlert) === true) {
|
||||
@ -788,130 +886,169 @@ final class EventFilter extends Entity
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getSearchSecondaryGroups(): ?bool
|
||||
{
|
||||
return $this->searchSecondaryGroups;
|
||||
}
|
||||
|
||||
|
||||
public function setSearchSecondaryGroups(?bool $searchSecondaryGroups): self
|
||||
{
|
||||
$this->searchSecondaryGroups = $searchSecondaryGroups;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getSearchRecursiveGroups(): ?bool
|
||||
{
|
||||
return $this->searchRecursiveGroups;
|
||||
}
|
||||
|
||||
|
||||
public function setSearchRecursiveGroups(?bool $searchRecursiveGroups): self
|
||||
{
|
||||
$this->searchRecursiveGroups = $searchRecursiveGroups;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getDateFrom(): ?string
|
||||
{
|
||||
return $this->dateFrom;
|
||||
}
|
||||
|
||||
|
||||
public function setDateFrom(?string $dateFrom): self
|
||||
{
|
||||
$this->dateFrom = $dateFrom;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getDateTo(): ?string
|
||||
{
|
||||
return $this->dateTo;
|
||||
}
|
||||
|
||||
|
||||
public function setDateTo(?string $dateTo): self
|
||||
{
|
||||
$this->dateTo = $dateTo;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getSource(): ?string
|
||||
{
|
||||
return $this->source;
|
||||
}
|
||||
|
||||
|
||||
public function setSource(?string $source): self
|
||||
{
|
||||
$this->source = $source;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getIdExtra(): ?string
|
||||
{
|
||||
return $this->idExtra;
|
||||
}
|
||||
|
||||
|
||||
public function setIdExtra(?string $idExtra): self
|
||||
{
|
||||
$this->idExtra = $idExtra;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getUserComment(): ?string
|
||||
{
|
||||
return $this->userComment;
|
||||
}
|
||||
|
||||
|
||||
public function setUserComment(?string $userComment): self
|
||||
{
|
||||
$this->userComment = $userComment;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getIdSourceEvent(): ?int
|
||||
{
|
||||
return $this->idSourceEvent;
|
||||
}
|
||||
|
||||
|
||||
public function setIdSourceEvent(?int $idSourceEvent): self
|
||||
{
|
||||
$this->idSourceEvent = $idSourceEvent;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getServerId(): ?array
|
||||
{
|
||||
return $this->serverId;
|
||||
}
|
||||
|
||||
|
||||
public function setServerId(?array $serverId): self
|
||||
{
|
||||
$this->serverId = $serverId;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getTimeFrom(): ?string
|
||||
{
|
||||
return $this->timeFrom;
|
||||
}
|
||||
|
||||
|
||||
public function setTimeFrom(?string $timeFrom): self
|
||||
{
|
||||
$this->timeFrom = $timeFrom;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getTimeTo(): ?string
|
||||
{
|
||||
return $this->timeTo;
|
||||
}
|
||||
|
||||
|
||||
public function setTimeTo(?string $timeTo): self
|
||||
{
|
||||
$this->timeTo = $timeTo;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getCustomData(): ?string
|
||||
{
|
||||
return $this->customData;
|
||||
}
|
||||
|
||||
|
||||
public function setCustomData(?string $customData): self
|
||||
{
|
||||
$this->customData = $customData;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getCustomDataFilterType(): ?EventFilterCustomDataEnum
|
||||
{
|
||||
return $this->customDataFilterType;
|
||||
}
|
||||
|
||||
|
||||
public function setCustomDataFilterType(null|string|EventFilterCustomDataEnum $customDataFilterType): self
|
||||
{
|
||||
if (is_string($customDataFilterType) === true) {
|
||||
@ -923,43 +1060,57 @@ final class EventFilter extends Entity
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getOwnerUser(): ?string
|
||||
{
|
||||
return $this->ownerUser;
|
||||
}
|
||||
|
||||
|
||||
public function setOwnerUser(?string $ownerUser): self
|
||||
{
|
||||
$this->ownerUser = $ownerUser;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getPrivateFilterUser(): ?string
|
||||
{
|
||||
return $this->privateFilterUser;
|
||||
}
|
||||
|
||||
|
||||
public function setPrivateFilterUser(?string $privateFilterUser): self
|
||||
{
|
||||
$this->privateFilterUser = $privateFilterUser;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getRegex(): ?string
|
||||
{
|
||||
return $this->regex;
|
||||
}
|
||||
|
||||
|
||||
public function setRegex(?string $regex): self
|
||||
{
|
||||
$this->regex = $regex;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
public function getIdEvent(): ?int
|
||||
{
|
||||
return $this->idEvent;
|
||||
}
|
||||
|
||||
|
||||
public function setIdEvent(?int $idEvent): self
|
||||
{
|
||||
$this->idEvent = $idEvent;
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -52,6 +52,7 @@ final class EventFilterDataMapper extends DataMapperAbstract
|
||||
public const PRIVATE_FILTER_USER = 'private_filter_user';
|
||||
public const REGEX = 'regex';
|
||||
|
||||
|
||||
public function __construct(
|
||||
private Repository $repository,
|
||||
private Builder $builder,
|
||||
@ -62,11 +63,13 @@ final class EventFilterDataMapper extends DataMapperAbstract
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function getClassName(): string
|
||||
{
|
||||
return EventFilter::class;
|
||||
}
|
||||
|
||||
|
||||
public function fromDatabase(array $data): EventFilter
|
||||
{
|
||||
$severity = null;
|
||||
@ -77,7 +80,9 @@ final class EventFilterDataMapper extends DataMapperAbstract
|
||||
}
|
||||
}
|
||||
|
||||
return $this->builder->build(new EventFilter(), [
|
||||
return $this->builder->build(
|
||||
new EventFilter(),
|
||||
[
|
||||
'idEventFilter' => $data[self::ID_FILTER],
|
||||
'idGroupFilter' => $data[self::ID_GROUP_FILTER],
|
||||
'name' => $this->repository->safeOutput($data[self::NAME]),
|
||||
@ -113,18 +118,23 @@ final class EventFilterDataMapper extends DataMapperAbstract
|
||||
'ownerUser' => $data[self::OWNER_USER],
|
||||
'privateFilterUser' => $data[self::PRIVATE_FILTER_USER],
|
||||
'regex' => $this->repository->safeOutput($data[self::REGEX]),
|
||||
]);
|
||||
]
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function toDatabase(MappeableInterface $data): array
|
||||
{
|
||||
/** @var EventFilter $data */
|
||||
/*
|
||||
@var EventFilter $data
|
||||
*/
|
||||
$severity = null;
|
||||
if (empty($data->getSeverity()) === false) {
|
||||
$severities = [];
|
||||
foreach ($data->getSeverity() as $value) {
|
||||
$severities[] = EventSeverityEnum::get($value)?->value;
|
||||
}
|
||||
|
||||
$severity = implode(',', $severities);
|
||||
}
|
||||
|
||||
@ -166,4 +176,6 @@ final class EventFilterDataMapper extends DataMapperAbstract
|
||||
self::REGEX => $this->repository->safeInput($data->getRegex()),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -39,9 +39,12 @@ use PandoraFMS\Modules\Shared\Validators\Validator;
|
||||
*/
|
||||
final class EventFilterFilter extends FilterAbstract
|
||||
{
|
||||
|
||||
private ?string $freeSearch = null;
|
||||
|
||||
private ?string $fieldAclGroupMysql = EventFilterDataMapper::ID_GROUP;
|
||||
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->setDefaultFieldOrder(EventFilterDataMapper::NAME);
|
||||
@ -49,6 +52,7 @@ final class EventFilterFilter extends FilterAbstract
|
||||
$this->setEntityFilter(new EventFilter());
|
||||
}
|
||||
|
||||
|
||||
public function fieldsTranslate(): array
|
||||
{
|
||||
return [
|
||||
@ -93,6 +97,7 @@ final class EventFilterFilter extends FilterAbstract
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function fieldsReadOnly(): array
|
||||
{
|
||||
return [
|
||||
@ -101,6 +106,7 @@ final class EventFilterFilter extends FilterAbstract
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function jsonSerialize(): mixed
|
||||
{
|
||||
return [
|
||||
@ -108,21 +114,25 @@ final class EventFilterFilter extends FilterAbstract
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
public function getValidations(): array
|
||||
{
|
||||
$validations = [];
|
||||
if ($this->getEntityFilter() !== null) {
|
||||
$validations = $this->getEntityFilter()->getValidations();
|
||||
}
|
||||
|
||||
$validations['freeSearch'] = Validator::STRING;
|
||||
return $validations;
|
||||
}
|
||||
|
||||
|
||||
public function validateFields(array $filters): array
|
||||
{
|
||||
return (new Validator())->validate($filters);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of freeSearch.
|
||||
*
|
||||
@ -133,11 +143,11 @@ final class EventFilterFilter extends FilterAbstract
|
||||
return $this->freeSearch;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the value of freeSearch.
|
||||
*
|
||||
* @param ?string $freeSearch
|
||||
*
|
||||
* @param string $freeSearch
|
||||
*/
|
||||
public function setFreeSearch(?string $freeSearch): self
|
||||
{
|
||||
@ -145,6 +155,7 @@ final class EventFilterFilter extends FilterAbstract
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of fieldsFreeSearch.
|
||||
*
|
||||
@ -155,6 +166,7 @@ final class EventFilterFilter extends FilterAbstract
|
||||
return [EventFilterDataMapper::NAME];
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of fieldAclGroupMysql.
|
||||
*
|
||||
@ -165,11 +177,11 @@ final class EventFilterFilter extends FilterAbstract
|
||||
return $this->fieldAclGroupMysql;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Set the value of fieldAclGroupMysql.
|
||||
*
|
||||
* @param ?string $fieldAclGroupMysql
|
||||
*
|
||||
* @param string $fieldAclGroupMysql
|
||||
*/
|
||||
public function setFieldAclGroupMysql(?string $fieldAclGroupMysql): self
|
||||
{
|
||||
@ -178,6 +190,7 @@ final class EventFilterFilter extends FilterAbstract
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get the value of mode for check ACL.
|
||||
*
|
||||
@ -187,4 +200,6 @@ final class EventFilterFilter extends FilterAbstract
|
||||
{
|
||||
return '';
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -9,7 +9,7 @@ enum EventFilterStatusEnum: int
|
||||
use EnumTrait;
|
||||
|
||||
case ALL = -1;
|
||||
case NEW = 0;
|
||||
case new = 0;
|
||||
case VALIDATED = 1;
|
||||
case IN_PROCESS = 2;
|
||||
case NOT_VALIDATED = 3;
|
||||
|
@ -9,12 +9,15 @@ use PandoraFMS\Modules\Shared\Repositories\Repository;
|
||||
|
||||
class EventFilterRepository
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private Repository $repository,
|
||||
private EventFilterDataMapper $eventFilterDataMapper
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return EventFilter[],
|
||||
*/
|
||||
@ -26,6 +29,7 @@ class EventFilterRepository
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function count(EventFilterFilter $eventFilterFilter): int
|
||||
{
|
||||
return $this->repository->__count(
|
||||
@ -34,6 +38,7 @@ class EventFilterRepository
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function getOne(EventFilterFilter $eventFilterFilter): EventFilter
|
||||
{
|
||||
return $this->repository->__getOne(
|
||||
@ -42,12 +47,14 @@ class EventFilterRepository
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function create(EventFilter $eventFilter): EventFilter
|
||||
{
|
||||
$id = $this->repository->__create($eventFilter, $this->eventFilterDataMapper);
|
||||
return $eventFilter->setIdEventFilter($id);
|
||||
}
|
||||
|
||||
|
||||
public function update(EventFilter $eventFilter): EventFilter
|
||||
{
|
||||
return $this->repository->__update(
|
||||
@ -57,9 +64,11 @@ class EventFilterRepository
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
public function delete(int $id): void
|
||||
{
|
||||
$this->repository->__delete($id, $this->eventFilterDataMapper);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Events\Filters\Repositories\EventFilterRepository;
|
||||
|
||||
final class CountEventFilterService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private EventFilterRepository $eventFilterRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventFilterFilter $eventFilterFilter): int
|
||||
{
|
||||
return $this->eventFilterRepository->count($eventFilterFilter);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,8 @@ use PandoraFMS\Modules\Shared\Services\Audit;
|
||||
|
||||
final class CreateEventFilterService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private Audit $audit,
|
||||
private EventFilterRepository $eventFilterRepository,
|
||||
@ -16,6 +18,7 @@ final class CreateEventFilterService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventFilter $eventFilter): EventFilter
|
||||
{
|
||||
$this->eventFilterValidation->__invoke($eventFilter);
|
||||
@ -30,4 +33,6 @@ final class CreateEventFilterService
|
||||
|
||||
return $eventFilter;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -9,12 +9,15 @@ use PandoraFMS\Modules\Shared\Services\Audit;
|
||||
|
||||
final class DeleteEventFilterService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private Audit $audit,
|
||||
private EventFilterRepository $eventFilterRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventFilter $eventFilter): void
|
||||
{
|
||||
$idEventFilter = $eventFilter->getIdEventFilter();
|
||||
@ -26,4 +29,6 @@ final class DeleteEventFilterService
|
||||
'Deleted eventFilter '.$nameEventFilter
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -9,15 +9,20 @@ use PandoraFMS\Modules\Shared\Exceptions\NotFoundException;
|
||||
|
||||
final class ExistNameEventFilterService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private EventFilterRepository $eventFilterRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(string $name): bool
|
||||
{
|
||||
$eventFilterFilter = new EventFilterFilter();
|
||||
/** @var EventFilter $entityFilter */
|
||||
/*
|
||||
@var EventFilter $entityFilter
|
||||
*/
|
||||
$entityFilter = $eventFilterFilter->getEntityFilter();
|
||||
$entityFilter->setName($name);
|
||||
|
||||
@ -28,4 +33,6 @@ final class ExistNameEventFilterService
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -8,18 +8,25 @@ use PandoraFMS\Modules\Events\Filters\Repositories\EventFilterRepository;
|
||||
|
||||
final class GetEventFilterService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private EventFilterRepository $eventFilterRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(int $idEventFilter): EventFilter
|
||||
{
|
||||
$eventFilterFilter = new EventFilterFilter();
|
||||
/** @var EventFilter $entityFilter */
|
||||
/*
|
||||
@var EventFilter $entityFilter
|
||||
*/
|
||||
$entityFilter = $eventFilterFilter->getEntityFilter();
|
||||
$entityFilter->setIdEventFilter($idEventFilter);
|
||||
|
||||
return $this->eventFilterRepository->getOne($eventFilterFilter);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -7,13 +7,18 @@ use PandoraFMS\Modules\Events\Filters\Repositories\EventFilterRepository;
|
||||
|
||||
final class ListEventFilterService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private EventFilterRepository $eventFilterRepository,
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventFilterFilter $eventFilterFilter): array
|
||||
{
|
||||
return $this->eventFilterRepository->list($eventFilterFilter);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
@ -9,6 +9,8 @@ use PandoraFMS\Modules\Shared\Services\Audit;
|
||||
|
||||
final class UpdateEventFilterService
|
||||
{
|
||||
|
||||
|
||||
public function __construct(
|
||||
private Audit $audit,
|
||||
private EventFilterRepository $eventFilterRepository,
|
||||
@ -16,6 +18,7 @@ final class UpdateEventFilterService
|
||||
) {
|
||||
}
|
||||
|
||||
|
||||
public function __invoke(EventFilter $eventFilter, EventFilter $oldEventFilter): EventFilter
|
||||
{
|
||||
$this->eventFilterValidation->__invoke($eventFilter, $oldEventFilter);
|
||||
@ -30,4 +33,6 @@ final class UpdateEventFilterService
|
||||
|
||||
return $eventFilter;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user