Commit graph

2397 commits

Author SHA1 Message Date
Sukhwinder Dhillon
b69fb09c90 Don't show parents children tab if icingadb.schema does not support it 2025-01-22 13:44:32 +01:00
Sukhwinder Dhillon
cda2f4bb05 Add csv/json export support for parents and children tab 2025-01-22 13:44:32 +01:00
Sukhwinder Dhillon
18ba5a3dfb Add view mode functionality for RedundancyGroup items 2025-01-22 13:44:32 +01:00
Sukhwinder Dhillon
1ceb351e04 (Host|Service)Controller: Add return type to methods 2025-01-22 13:44:32 +01:00
Sukhwinder Dhillon
5e436dc57f (Host|Service)Controller: Fix tab activation
- Set the outer tab as active.

Previously, the inner tab was activated in the setTitleTab method, but the outer tab does not know about the state of inner tabs.
So whenever sendMultipartUpdate() -> getActiveTab() was called, the retured value was always null.
2025-01-22 13:44:32 +01:00
Sukhwinder Dhillon
d5d36d7233 (Host|Service)Controller: Shift the required param
- Otherwise the searchbar uses it as base filter and apply it on the query
2025-01-22 13:44:32 +01:00
Sukhwinder Dhillon
ad8d71b253 (Host|Service)Controller: Add parents and children tab 2025-01-22 13:44:32 +01:00
Sukhwinder Dhillon
645ae00155 (Host|Service)Controller: Let the init() render the object header 2025-01-22 13:44:32 +01:00
Sukhwinder Dhillon
7847f6eb94
RedundancygroupController: Separate (searchEditor/complete)Action for members & children tab (#1128) 2025-01-22 11:37:56 +01:00
Sukhwinder Dhillon
75c242ed07 common.less: Add margin-left to .affected-objects badge
The margin applied by `.title` only work with `<html> text <html>`... structure, here we have <html> followed by <html>, so the margin must be applied explicitely.

Applied the double, so it always looks same in all view modes
2025-01-22 11:36:42 +01:00
Sukhwinder Dhillon
793aa2414c ObjectSuggestions: Don't apply base filter to $customVars query
The basefilter may contain relations, that are not know to `CustomvarFlat`, which can leads to errors.
    For example: RedundancygroupController:completeActions's base filter is not known to `CustomvarFlat`.
2025-01-22 10:26:39 +01:00
Johannes Meyer
9eea87d1e9
ObjectSuggestions: Make CustomVar suggestion sources adjustable (#1100)
The `ObjectSuggestions` instance with `DependencyNode` as the model can
only retrieve custom variables for `Host, Service, Hostgroup and
Servicegroup`. Other relations are not defined and lead to an error.
2025-01-20 10:54:34 +01:00
Sukhwinder Dhillon
2e0ed5999e Models: Add missing parent & child relation 2025-01-20 10:50:18 +01:00
Sukhwinder Dhillon
59126da74f RedundancygroupController: Restrict customVar suggestions
- Only use fetchable relations.
- Restrict to `host`, `service`, `hostgroup` and `servicegroup`
2025-01-20 10:50:18 +01:00
Sukhwinder Dhillon
481dac43f9 ObjectSuggestions: Add methods to restrict $customVarSources 2025-01-20 10:50:18 +01:00
Johannes Meyer
b52c219881
Unreachable parent optimizations (#1126) 2025-01-15 16:40:14 +01:00
Johannes Meyer
0b51376820 UnreachableParent: Don't filter for group states
Since child edges of a group now have state as well,
filtering for the group's state is not required anymore.
2025-01-15 16:39:50 +01:00
Johannes Meyer
e5b499bbdb UnreachableParent: Eliminate duplicate nodes
Nodes might be referenced by multiple independent paths, which
might lead to the same root problem multiple times.
2025-01-15 16:39:50 +01:00
Johannes Meyer
02ff5d8ea8
Dependency postgres support (#1127) 2025-01-15 16:38:17 +01:00
Johannes Meyer
c42d469293 UnreachableParent: Properly retrieve child_id with postgres 2025-01-15 15:44:21 +01:00
Johannes Meyer
c2549fa9eb UnreachableParent: Use driver specific types in CAST expressions 2025-01-15 15:02:41 +01:00
Johannes Meyer
8d39fa30d9 DependencyNode: Cast boolenum to int where applicable
PostgreSQL doesn't like mixing different types with COALESCE()
2025-01-15 15:02:41 +01:00
Johannes Meyer
1eb1e72b6d
Hide unreachable parents in root problems (#1073) 2025-01-15 15:01:49 +01:00
Johannes Meyer
8e5a8161f4 DependencyEdge: Add column id and make it the pk 2025-01-15 13:15:20 +01:00
Sukhwinder Dhillon
dd744395c7 Keep compatibility with Icinga DB mysql v6 & pgsql v4 2025-01-14 13:13:25 +01:00
Sukhwinder Dhillon
d4f69516a2 RedundancygroupController: Add CSV/JSON export option for members & children tab 2025-01-14 11:50:39 +01:00
raviks789
46577ff26b Add column environment_id to the models related to the dependency feature 2025-01-14 11:43:12 +01:00
Johannes Meyer
ffd51260d7 Keep compatibility with Icinga DB v5 2024-12-18 16:27:06 +01:00
Johannes Meyer
30269efbe2 ui: Change visualization of redundancy group states
They can now be unreachable, thus get the same icon as others.
The state then isn't about reachability anymore, so it's just
critical or ok.
2024-12-17 17:53:02 +01:00
Johannes Meyer
e1ccc25961 UnreachableParent: Only fetch responsible nodes
A node is responsible if:

* it's a host which is reachable but has a problem
* it's a service which is reachable but has a problem
* it's a redundancy group which is reachable but has failed
2024-12-17 17:53:02 +01:00
Johannes Meyer
1332ba3bcc RedundancyGroupDetail: Show root problems if unreachable, not failed 2024-12-17 17:53:02 +01:00
Johannes Meyer
29ada79e96 db: Add is_reachable to RedundancyGroupState 2024-12-17 17:51:11 +01:00
Johannes Meyer
945eb5f9ae db: Update models to reflect latest schema updates 2024-12-17 17:50:42 +01:00
Sukhwinder Dhillon
299ca1f7d6 UnreachableParent: Fetch from_node_id column as child_id
This column is required to make prepare the path chain of root-problem
2024-12-17 17:35:30 +01:00
Johannes Meyer
8cf93027f6
Use singleton for db and redis connections (#1112)
Required for an upcoming change. Though, I wanted to change this already
a long time ago.

There's absolutely no need to have several open connections to the same
database. Which was the case before, since the connection was
established for each user (class) of the `Database` trait.

But with PDO, queries are by default all serially processed. Only for
MySQL it is possible to change this, by [disabling query
buffering](https://www.php.net/manual/en/mysqlinfo.concepts.buffering.php).

But Icinga DB Web is incompatible anyway, with disabled query buffering,
and so changing this to a singleton is fine in my opinion.

I've deliberately kept the `Database` trait, to not update all usages of
it. In case only the connection is required, the trait still has its
use.
2024-12-17 16:35:19 +01:00
Johannes Meyer
c57298e776 test: Make sure a backend exists 2024-12-17 16:33:05 +01:00
Johannes Meyer
1a23a6b3cc IcingaRedis: Use the new singleton instead 2024-12-17 16:33:05 +01:00
Johannes Meyer
edbafbd144 Database: Use the new singleton instead 2024-12-17 16:33:05 +01:00
Johannes Meyer
b10b534ee6 Introduce singleton Icinga\Module\Icingadb\Common\Backend 2024-12-17 16:33:05 +01:00
Johannes Meyer
eeb56ff33c db: Add model for the schema table 2024-12-17 16:33:05 +01:00
Johannes Meyer
9c86ab96db
Introduce child options for service downtimes (#1091)
`ScheduleDowntimeCommand` is basically what
`ScheduleServiceDowntimeCommand` previously was. Though, with the
addition of `get|setForAllServices()` which was only part of
`ScheduleHostDowntimeCommand`.

`ScheduleDowntimeCommand::get|setChildOption()` is completely new and
replaces `ScheduleHostDowntimeCommand::get|setTriggered()`.

`ScheduleHostDowntimeCommand`, `PropagateHostDowntimeCommand` and
`ScheduleServiceDowntimeCommand` are now deprecated.

fixes #1090
2024-12-09 12:58:49 +01:00
Johannes Meyer
f85f893f81 Deprecate old type-specific schedule downtime commands 2024-12-09 12:51:12 +01:00
Johannes Meyer
464a440f0f Introduce new class ScheduleDowntimeCommand
Covers the full functionality of the schedule-downtime
endpoint of Icinga 2's api now.

fixes #1090
2024-12-09 12:51:12 +01:00
Sukhwinder Dhillon
2642030e3b VolatileStateResults: Properly apply state changes in case of DependecyNode
- Use host behaviors for sevice hosts. Previously, the service behaviors was used.
2024-11-19 17:58:03 +01:00
Johannes Meyer
ae9002d80e
Add redundancy group detail view (#1079)
resolves #1056
2024-11-19 17:53:49 +01:00
Sukhwinder Dhillon
3567a406c7 RedundancygroupController: Fix that isChildrenTab apear in the browser url 2024-11-19 17:44:55 +01:00
Sukhwinder Dhillon
6455e3b8e2 DependencyNodeList: Add viewModeSwicher functionality for hosts/services
- Add missing relation `state.last_comment` for detailed view mode
2024-11-19 17:44:55 +01:00
Sukhwinder Dhillon
f4b4d92021 RedundancygroupController: Remove query execute() call
RedundancygroupController: Add class property for group summary

RedundancygroupController: Apply missing restrictions in `fetchNodes()` method

rg: Use $this->httpNotFound instead

rg: remove superfluous searchbar param
2024-11-19 17:44:55 +01:00
Sukhwinder Dhillon
2fb2c93ef8 RedundancyGroupListItem: Apply restrictions to summary query
- Add type hint for $state with @property tag instead
2024-11-19 17:44:55 +01:00
Sukhwinder Dhillon
8ae0f4ae9f RedundancyGroupListItem: make items clickable 2024-11-19 17:44:55 +01:00