Commit graph

2169 commits

Author SHA1 Message Date
Johannes Meyer
ac94de2750 doc: Add chapter Automation 2023-09-28 14:07:29 +02:00
Yonas Habteab
00978102af Enhance package installation & configuration docs 2023-09-28 10:31:29 +02:00
Johannes Meyer
eff6d7aaa4 ObjectDetail: Don't try to group the user query if it's not there
fixes #892
2023-09-28 10:29:34 +02:00
Yonas Habteab
c85e85496c Transform compat action & notes url macros automatically 2023-09-28 10:29:15 +02:00
Johannes Meyer
1c83c83d30
Fix that the migration widget doesn't suggest updated search urls if the sort column/direction is changed (#891)
fixes #890
2023-09-28 10:09:04 +02:00
Johannes Meyer
a6f608f580 migrate.js: Decode container urls with decodeURIComponent
`decodeURI` only decodes the path. `decodeURIComponent` decodes
everything, just like PHP's `rawurldecode`, which is used by the
server.
2023-09-28 09:48:05 +02:00
Johannes Meyer
445410f6ef Revert "migrate: Fix false positives once more"
This reverts commit 436bac321a.
2023-09-28 09:47:41 +02:00
Johannes Meyer
2d85d98259 Controller: Preserve only selected search request parameters
fixes #887
2023-09-28 09:06:20 +02:00
Johannes Meyer
cd41a207a1 IcingaRedis: Don't throw in method isUnavailable
fixes #883
2023-09-27 10:24:50 +02:00
Johannes Meyer
f6e808bac1 migrate: Properly override url params
fixes #881
2023-09-26 14:49:04 +02:00
Johannes Meyer
76f37867c5 js: Fix broken autorefresh of col2
Suspending the autorefresh is only required while the user
is actively choosing multiple list items.

fixes #879
2023-09-26 14:40:13 +02:00
Yonas Habteab
bef893b9b9
Update phpstan baseline config (#876)
IPL orm has received a lot of updates that make these ignore patterns
obsolete.
2023-09-22 11:25:19 +02:00
Yonas Habteab
9ad7df73da Update phpstan baseline config 2023-09-22 10:20:49 +02:00
Johannes Meyer
de96826f28 Use ipl\Web\EmptyStateBar where applicable 2023-09-13 12:37:03 +02:00
Johannes Meyer
cf957fbcdf
Allow to reset active db connection (#859)
resolves #805
2023-09-12 14:58:13 +02:00
Yonas Habteab
0a31addffe X509\Sni: Cleanup some codes 2023-09-12 14:45:27 +02:00
Yonas Habteab
9be9d072f1 X509\Sni: Ping DB connection before using it 2023-09-12 14:45:27 +02:00
Johannes Meyer
84eeeaa57d
action-list.js: Don't add footer for list in .controls (#867)
fixes #866
2023-09-12 14:43:38 +02:00
Sukhwinder Dhillon
5c30e53765 DetailsActions: Only add data-action-item attr if list is an .action-list 2023-09-12 13:57:11 +02:00
Sukhwinder Dhillon
d73691017f (Hosts/Services)Controller: Do not make object list in detail view controls an .action-list 2023-09-12 13:57:11 +02:00
Sukhwinder Dhillon
a9b058fea7 action-list.js: Only add footer for list in .content 2023-09-12 13:57:11 +02:00
Johannes Meyer
959f06cafd Utilize ipl\Web\Url::setFilter() where applicable 2023-09-12 09:52:19 +02:00
Johannes Meyer
a076438e65
Fix redis states not applied to exports (#847)
fixes #844
2023-09-08 16:53:03 +02:00
Johannes Meyer
dfc5485d45 JsonResultSet: Extend VolatileStateResults 2023-09-08 16:49:55 +02:00
Johannes Meyer
57e6f3ce15 CsvResultSet: Extend VolatileStateResults 2023-09-08 16:49:55 +02:00
Johannes Meyer
333c94f589 VolatileStateResults: Fetch individual redis results..
..if the cache is disabled.
2023-09-08 16:49:55 +02:00
Johannes Meyer
a1aa4cdbda
Make command actions easier to use with curl (#863)
The routes used are the same that are used when issuing commands on
multiple objects (bulk actions). So the filter that's used in the
examples can be any other filter as well. Input data must be provided as
`multipart/form-data`.

They respond with the JSON format provided by Icinga Web and are only
accessible for non-XHR clients.

## Examples

### Adding a comment
```
curl -H "Accept: application/json" -u icingaadmin:icinga "http://localhost/icingaweb2/icingadb/hosts/add-comment?host.name=docker-master" -F "comment=kaput" -F "expire_time=2023-09-05T20:00:00" -F "expire=y" -v
*   Trying 127.0.0.1:80...
* Connected to localhost (127.0.0.1) port 80 (#0)
* Server auth using Basic with user 'icingaadmin'
> POST /icingaweb2/icingadb/api/v1/hosts/add-comment?host.name=docker-master HTTP/1.1
> Host: localhost
> Authorization: Basic aWNpbmdhYWRtaW46aWNpbmdh
> User-Agent: curl/7.81.0
> Accept: application/json
> Content-Length: 362
> Content-Type: multipart/form-data; boundary=------------------------da76739ff7328fd9
> 
* We are completely uploaded and fine
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: nginx/1.23.4
< Date: Tue, 05 Sep 2023 07:44:56 GMT
< Content-Type: application/json
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Powered-By: PHP/8.2.3
< X-Xdebug-Profile-Filename: /tmp/cachegrind.out.128.gz
< 
* Connection #0 to host localhost left intact
{"status":"success","data":[{"type":"success","message":"Added comment successfully"}]}
```

#### In case there's an error
```
curl -H "Accept: application/json" -u icingaadmin:icinga "http://localhost/icingaweb2/icingadb/hosts/add-comment?host.name=docker-master" -F "comment=kaput" -F "expire_time=2023-08-05T20:00:00" -F "expire=y" -v
*   Trying 127.0.0.1:80...
* Connected to localhost (127.0.0.1) port 80 (#0)
* Server auth using Basic with user 'icingaadmin'
> POST /icingaweb2/icingadb/api/v1/hosts/add-comment?host.name=docker-master HTTP/1.1
> Host: localhost
> Authorization: Basic aWNpbmdhYWRtaW46aWNpbmdh
> User-Agent: curl/7.81.0
> Accept: application/json
> Content-Length: 362
> Content-Type: multipart/form-data; boundary=------------------------53cd05bc746f90be
> 
* We are completely uploaded and fine
* Mark bundle as not supporting multiuse
< HTTP/1.1 422
< Server: nginx/1.23.4
< Date: Tue, 05 Sep 2023 07:45:31 GMT
< Content-Type: application/json
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Powered-By: PHP/8.2.3
< X-Xdebug-Profile-Filename: /tmp/cachegrind.out.129.gz
< 
* Connection #0 to host localhost left intact
{"status":"fail","data":{"comment":[],"expire":[],"expire_time":["The expire time must not be in the past"]}}
```

### Scheduling a downtime
```
curl -H "Accept: application/json" -u icingaadmin:icinga "http://localhost/icingaweb2/icingadb/hosts/schedule-downtime?host.name=docker-master" -F "comment=kaput" -F "start=2023-09-05T20:00:00" -F "end=2023-09-05T22:00:00" -F "flexible=y" -F "hours=1" -F "minutes=0" -F "all_services=n" -F "child_options=0" -v
*   Trying 127.0.0.1:80...
* Connected to localhost (127.0.0.1) port 80 (#0)
* Server auth using Basic with user 'icingaadmin'
> POST /icingaweb2/icingadb/api/v1/hosts/schedule-downtime?host.name=docker-master HTTP/1.1
> Host: localhost
> Authorization: Basic aWNpbmdhYWRtaW46aWNpbmdh
> User-Agent: curl/7.81.0
> Accept: application/json
> Content-Length: 866
> Content-Type: multipart/form-data; boundary=------------------------2222dcc7ed0e5442
> 
* We are completely uploaded and fine
* Mark bundle as not supporting multiuse
< HTTP/1.1 200 OK
< Server: nginx/1.23.4
< Date: Tue, 05 Sep 2023 07:47:10 GMT
< Content-Type: application/json
< Transfer-Encoding: chunked
< Connection: keep-alive
< X-Powered-By: PHP/8.2.3
< X-Xdebug-Profile-Filename: /tmp/cachegrind.out.129.gz
< 
* Connection #0 to host localhost left intact
{"status":"success","data":[{"type":"success","message":"Scheduled downtime successfully"}]}
```
2023-09-08 16:41:10 +02:00
Johannes Meyer
59d3c1148d CommandActions: Respond with JSON if requested 2023-09-08 16:37:44 +02:00
Johannes Meyer
3d0949edcb CommandForm: Don't add a submit button and CSRF token..
..if it's an API target
2023-09-08 16:37:44 +02:00
Johannes Meyer
57d2fc0647
IcingaDbWizard: Fix requirements (#853)
requires https://github.com/Icinga/icingaweb2/pull/5094

## TODOs
- [ ] `icinga-php-thirdparty` in module.info and module doc does not
match.
- [x] Db/Redis Form: Disable password auto-complete.
2023-09-08 16:37:01 +02:00
Sukhwinder Dhillon
b2a512dc1b Forms: Don't autocomplete password elements
- Setting `autocomplete` to `off` does not work, but `new-password` does.
2023-09-08 16:32:24 +02:00
Sukhwinder Dhillon
2b046ecf1f IcingaDbWizard: Update the module requirements
- The php version requirement has been removed as it is already defined in icingaweb.
2023-09-08 16:32:24 +02:00
Sukhwinder Dhillon
7f49dd826d IcingaDbWizard: Read required library versions from Module class 2023-09-08 16:32:24 +02:00
Johannes Meyer
e92d90a2ac
Apply csp to inline css style (#807)
## Blocked by
- https://github.com/Icinga/ipl-web/pull/167
- https://github.com/Icinga/icingaweb2/pull/5059
2023-09-08 16:31:32 +02:00
Sukhwinder Dhillon
f388b223f2 Remove not in use code 2023-09-08 16:27:59 +02:00
Sukhwinder Dhillon
77a7eef7f8 Move inline css to the style element to provide csp 2023-09-08 16:27:57 +02:00
Sukhwinder Dhillon
1bd2a83be7 Avoid using inline style 2023-09-08 16:25:40 +02:00
Johannes Meyer
459db5163c
Use ipl web widgets (#830)
## Blocked by
- https://github.com/Icinga/ipl-web/pull/183
2023-09-08 16:23:58 +02:00
Yonas Habteab
152d83219a Add missing argument type hint declaration 2023-09-08 15:28:46 +02:00
Yonas Habteab
7638be9733 Use addHtml() instead of add() where applicable 2023-09-08 15:28:46 +02:00
Yonas Habteab
f66b551c75 Add missing return type declaration 2023-09-08 15:28:46 +02:00
Yonas Habteab
8179025748 Add missing property type hints 2023-09-08 15:26:58 +02:00
Yonas Habteab
6016f7e8b9 StateListItem: Use only one return statement in a method 2023-09-08 15:12:57 +02:00
Yonas Habteab
705a470a1f Utilize widgets moved to ipl-web 2023-09-08 14:54:47 +02:00
Yonas Habteab
cacc770ce5
Fix failed to resolve reversed host/service -> comment relations (#858)
fixes #827
2023-09-06 13:50:44 +02:00
Yonas Habteab
b17c30632d Fix failed to resolve reversed host/service -> comment relations 2023-09-05 18:06:02 +02:00
Johannes Meyer
c626bc147d
Do not evaluate invalid performance data (#849)
fix #838
2023-09-05 16:56:28 +02:00
raviks789
3031a09629 PHPStan Baseline: Remove fixed phpstan errors 2023-09-05 16:44:44 +02:00
raviks789
81cf29884c Add unit tests for invalid performance data evaluation 2023-09-05 16:44:44 +02:00
raviks789
172e75102f Do not evaluate invalid performance data 2023-09-05 16:44:42 +02:00