260 Commits

Author SHA1 Message Date
Johannes Meyer
9194378c3c js: Don't refresh twice upon __BACK__ 2023-09-26 15:04:07 +02:00
Johannes Meyer
6e16ded825 loader.js: Don't attempt to load an extra update to a closed column 2023-09-07 13:00:45 +02:00
Johannes Meyer
a3c04f9108 loader.js: Allow to initiate a refresh with __REFRESH__ 2023-09-07 12:59:53 +02:00
Johannes Meyer
8f5b62f532 loader.js: Perform a proper redirect upon __CLOSE__
This allows the temporary adjustment of the autorefresh
interval.
2023-09-07 12:07:48 +02:00
Johannes Meyer
03f62887b8 loader.js: Don't refresh twice upon __CLOSE__ 2023-09-07 09:42:05 +02:00
Sukhwinder Dhillon
9dd21841a3 loader.js: Push current state to history only on onComplete.
- Previously, in case of `abort` the url was already pushed to history at the beginning of `onFailure`, setting `addToHistory` to true only prevents it from being added twice (again in `onComplete`).
- Now we only push the url to history in `onComplete`, so setting `addToHistory` to false is only necessary if req is scripted.
- We intentionally push the canceled url into history to continue navigating with the browser`s back/forward key.
2023-09-07 09:22:24 +02:00
Johannes Meyer
c3b1ad12ab loader.js: Don't update history for redirects
A redirect now also does NOT:

* Remove `.impact` from the container
* Try to set a menu item active..

fixes #4879
2023-08-29 15:02:44 +02:00
Yonas Habteab
9c7d19ea95 JS: Don't always prefix extra updates containers with # 2023-08-11 16:14:17 +02:00
Johannes Meyer
4a52a653e4 js: Always load redirects to their designated target
The server applies the redirection magic now, but only
for compatibility reasons.

resolves #4881
2023-08-11 16:08:00 +02:00
Johannes Meyer
51992f414e modal.js: Use a modal toggle's container as redirect target by default
Not the container's base target. The redirect target may still be
overridden by `data-base-target` on the `form` or by the response
using `X-Icinga-Container`.
2023-08-11 10:32:29 +02:00
Johannes Meyer
257a7070a1 js: Support __CLOSE__ as extra update 2023-08-11 10:32:29 +02:00
Johannes Meyer
eed6374dd2 js: Enhance server side container closing
* Let response header `X-Icinga-Container` either influence a request's `$target` or `$redirectTarget`, but not both
* Close a request's `$target` instead of the `$redirectTarget` upon the redirect url `__CLOSE__`

* Issuing a `__CLOSE__` in a detail url still closes `#col2` and refreshes `#col1`
* Issuing a `__CLOSE__` for a nested container still empties it
* Issuing a `__CLOSE__` in a modal, now refreshes the modal openers container
* If `X-Icinga-Extra-Updates` is set, automatic refreshing won't happen
2023-08-11 10:32:29 +02:00
Yonas Habteab
4ccebb78b5 loader.js: Allow to override the actual form action using formaction attr 2023-07-18 10:47:52 +02:00
Eric Lippmann
a3235555bb js: Also preserve scroll-y upon auto-refresh 2023-05-19 15:29:44 +02:00
Johannes Meyer
63eae12d33 loader.js: Transmit nearest identifiable parent as origin..
..upon autosubmit if the real element has no id or name.
2023-05-19 14:42:00 +02:00
Johannes Meyer
88caf3c141 loader.js: Empty nested containers upon __CLOSE__ 2023-05-19 14:17:41 +02:00
Johannes Meyer
cbf8cfc738 js: Transmit X-Icinga-AutoSubmittedBy upon autosubmits
This header contains the name or id of the element responsible
for triggering the automatic form submission.
2023-01-12 09:54:18 +01:00
Johannes Meyer
4641d8e820 js: Don't disable inputs upon auto-submits at all 2023-01-12 09:39:31 +01:00
Johannes Meyer
7cea0d78e4 js: Only disable submit buttons on form submit
Previously all `input` elements (text, date, number, ...)
got also disabled. This is unecessary.
2023-01-12 09:39:31 +01:00
Johannes Meyer
2a24f69fd8 loader.js: Remove legacy search request handling
Search requests are handled elsewhere in a more dynamic
way since .. some time. This part also used to be active
only in case Icinga Web is hosted at the root of the web
server, which many users don't do as otherwise we would
have gotten more reports in the past regarding the reload
animation. Or rather, about the login not working due to
the same reason.

It's gone for good now.

fixes #4834
2022-06-29 15:05:14 +02:00
Sukhwinder Dhillon
a3afc1cf5d loader.js: Remove deprecated method addUrlFlag() 2022-06-14 14:24:30 +02:00
Sukhwinder Dhillon
707775fe26
Fix: Scheme and hostname prepended to col2 url in the address bar (#4777) 2022-05-11 14:45:31 +02:00
Johannes Meyer
c83ab17826 js: Fix that redirects into currently empty columns don't work 2021-11-11 15:17:00 +01:00
Markus Frosch
d4763498e4
js: Fix regression for loading dependent modules for sub-containers (#4533) 2021-11-08 13:16:06 +01:00
Johannes Meyer
698ac5812f loader.js: Don't scroll to nav anchors that don't want this 2021-11-04 14:25:07 +01:00
Johannes Meyer
18188f7185 loader.js: Don't load a redirect in col1, if col2 has similar content
fixes Icinga/icingadb-web#284
2021-10-08 17:12:13 +02:00
Johannes Meyer
908adc66c1 js: Don't focus the announcment container
fixes #4543
2021-10-07 15:19:10 +02:00
Johannes Meyer
7ae8f26b92 js: Really maintain refresh interval over redirects
fixes #4549
2021-10-07 14:29:57 +02:00
Johannes Meyer
228e503131 js: Allow to reload the window 2021-07-07 09:41:48 +02:00
Florian Strohmaier
8b7a3f05af JS: Add icon to js notifications 2021-06-30 08:33:51 +02:00
Johannes Meyer
85e9f06510 js: Mark autosubmits as autosubmits, not as autorefreshes
fixes #4346
2021-04-12 09:39:48 +02:00
Johannes Meyer
aa03631eef js: Allow to mark requests explicitly as autosubmits 2021-04-12 09:39:48 +02:00
Johannes Meyer
a8be92c245 loader.js: Still apply some accessibility changes..
..if a renderHook discards an autorefresh. There is
unfortunately no way to distinguish between a renderHook
that really discards changes or one that applies them
on the DOM itself. If it's the first, this change
*shouldn't* hurt. If it's the latter, users should
benefit.
2021-03-31 12:38:35 +02:00
Johannes Meyer
e65ec1900a js: Add new special redirect target __CLOSE__
This has the same effect as a normal redirect. The benefit of it however
is that the server doesn't need to know what's being shown in the left
column. It just instructs the client to close the right and refresh the
left column. But still produces a new history state, it's a forward
navigation nonetheless.
2021-03-30 13:25:40 +02:00
Johannes Meyer
1f29c4a2fe js: Allow to suspend auto refresh for individual containers 2021-03-09 08:52:10 +01:00
Johannes Meyer
027e468943 js: Update a form's action if it's a auto submit response with X-Icinga-Location-Query 2021-03-09 08:52:10 +01:00
Johannes Meyer
43dd89f946 js: Also support _self and such target ids for response header X-Icinga-Container
The server can now instruct the client to render the response in a different container
2021-03-09 08:52:10 +01:00
Johannes Meyer
6e8ca9cdda js: Add method identifyLinkTarget() to the loader 2021-03-09 08:52:10 +01:00
Johannes Meyer
4f57aa68cd js: Transmit X-Icinga-Container for all requests
This tells the server which container the client will use
to render the response in
2021-03-09 08:52:10 +01:00
Johannes Meyer
5c5e83a700 loader.js: Don't use the regex DotAll modifier, it's ES2018+ only
i.e. not supported by Microsoft Edge
2021-02-22 15:07:55 +01:00
Johannes Meyer
9dae3bdf88 loader.js: Only abort GET autorefresh requests 2021-02-18 14:10:02 +01:00
Johannes Meyer
57b4a31bc3 js: Don't navigate right when opening a modal
Isn't the prettiest fix. I would have liked to completely
remove the target preparation from `getLinkTargetFor`.
But this is the easiest fix since it's only for modals
that preparation is not desired. It's also the most
compatible change.
2021-02-17 12:51:26 +01:00
Johannes Meyer
defd8132aa form.js: Don't abort content updates in case of auto submits 2021-02-09 09:13:11 +01:00
Johannes Meyer
f2e53d420b js: Don't mark requests caused by __BACK__ as autorefresh
It's not an autorefresh and causes issues with form.js otherwise.
2021-02-05 16:38:17 +01:00
Johannes Meyer
4019522da1 loader.js: Disable inputs in forms not having role search
Previously only the `#search` input wasn't disabled, now also
the new filter input isn't. This is required to re-focus the
input after submission as disabled elements loose focus.
2021-01-14 11:57:06 +01:00
Johannes Meyer
5924d610a1 js: Provide additional parameters for events beforerender and rendered
beforerender: content, action, autorefresh, scripted
rendered: autorefresh, scripted
2021-01-14 11:57:05 +01:00
Johannes Meyer
46769b9be2 js: Add .impact to .content if a control is automatically submitted 2021-01-13 17:19:39 +01:00
Johannes Meyer
fbf3a1f757 loader.js: Don't add form submits other than GETs to the history
This has previously not been an issue, as form submits seem to have
never targeted another url than their container's current one.
Though any form that did this, was pushed to history upon submit.
This happens now only for `GET` forms.
2021-01-13 17:17:48 +01:00
Johannes Meyer
3e29fba052 js: Transmit X-Icinga-Autorefresh=1 with autorefresh requests 2021-01-13 17:16:53 +01:00
Johannes Meyer
2c7b2330a7 loader.js: Support behaviors as well as multipart update targets 2021-01-13 17:16:30 +01:00