Commit Graph

1769 Commits

Author SHA1 Message Date
Johannes Meyer f1dd69d877 ActionController: Set autorefresh interval on view as late as possible
This allows to initialize property `$autorefreshInterval` and have it
take an effect on non-XHR requests.
2021-01-15 15:08:48 +01:00
Johannes Meyer 765557af69 ActionController: Drop new param in method `setAutorefreshInterval()` 2021-01-15 15:08:48 +01:00
Johannes Meyer 67de8a079a js: Initialize all types of input enrichments 2021-01-14 11:57:24 +01:00
Johannes Meyer cb24eafdb5 JavaScript: Load behavior `complete.js` 2021-01-14 11:57:05 +01:00
Johannes Meyer cb9ccc68f7 Url: Drop unwanted boolean parameters in method `onlyWith()` 2021-01-13 17:20:22 +01:00
Sukhwinder Dhillon 53388a3940 Change __toString() to get encoded url string 2020-12-07 13:27:14 +01:00
Johannes Meyer 7c58b3ced1 LessCompiler: Add support for variable exports by modules
Using the following in a module's less file:

```
@exports: {
  @foo: "bar";
  @number: 4;
  @color: red;
};
```

will export the variables `@foo`, `@number` and `@color` into the global
scope. Though, exports are not able to override already defined variables.
That's still reserved for themes.
2020-12-02 10:51:01 +01:00
Alexander A. Klimov 81b19285a7 Make auto refresh interval configurable
refs #2819
2020-11-26 11:38:02 +01:00
Johannes Meyer e9fa9d95dd JavaScript: Also optimize `define()` calls in module JS 2020-11-18 13:21:33 +01:00
Johannes Meyer 5a38977906 js: Add `define.js` 2020-11-18 13:21:33 +01:00
Johannes Meyer ed7763c379 Introduce class `Icinga\Web\Controller\StaticController` 2020-11-18 13:20:09 +01:00
Johannes Meyer a9d6482533 Javascript: Load JS assets from loaded libraries 2020-11-18 13:20:09 +01:00
Johannes Meyer ad9099509d StyleSheet: Load css assets from loaded libraries 2020-11-18 13:20:09 +01:00
Alexander A. Klimov 74d5d69085 Url::fromPath(): var_export() input value to complain about
... not to hide its type.
2020-11-18 09:40:44 +01:00
Johannes Meyer d918d6c86f
Merge pull request #4235 from Icinga/fix/sparkline-js-performance
Drop sparkline.js and render inline-pies as SVG
2020-11-18 09:37:31 +01:00
Johannes Meyer 7c1886430b Controller: Don't accept `0` as default page limit 2020-11-16 13:29:49 +01:00
Johannes Meyer 8c73f0462e InlinePie: Utilize SVG to render charts instantly
Inline pie charts usually don't contain that much
data and the SVG should be rather small in size.
So it doesn't hurt rendering them instantly.
2020-09-28 16:40:39 +02:00
Johannes Meyer 37fb455977 js: Drop sparkline lib and behavior 2020-09-28 16:39:54 +02:00
Johannes Meyer 62dd0b3f1e ActionController: Fix that view variable `compact` is undefined
refs #4164
2020-06-08 09:26:36 +02:00
Johannes Meyer a240e306ed Preserve/Remove param `showCompact` instead of `view` 2020-06-04 08:50:41 +02:00
Johannes Meyer 6cf9f19048 ActionController: Shift parameter `view` if its value is `compact` 2020-06-04 08:50:41 +02:00
Johannes Meyer 60c3fd6406 FilterEditor: Use a new url from request when redirecting searches
Creating a new url has the benefit that all framework params are
still there. `$this->url()` however returns a url that's already
mangled and parameter preservation does not work for framework
params.

This is not quite the correct fix. But the entire parameter
handling here is way too convoluted.
2020-06-04 08:50:41 +02:00
Johannes Meyer 46c6201a21 Url: Add method `onlyWith()` 2020-06-04 08:50:41 +02:00
Johannes Meyer c2f380cf9b Dashlet: Use `showCompact` instead of `view=compact`
Allows dashlets to use their own value for parameter `view`
2020-05-19 16:46:58 +02:00
Johannes Meyer 8b8094e9cc dashboards: Increase size of dashlets in no-js envs 2020-04-15 09:42:36 +02:00
Johannes Meyer 5ed41868d9 css: Fix no-script apply styles in non-inline forms 2020-04-15 09:42:36 +02:00
Alexander A. Klimov 568619b92e Form: allow checkboxes to be required 2020-04-09 14:03:21 +02:00
Johannes Meyer 05135e716e
Merge pull request #4049 from Icinga/fix/pdfexport-hooks-may-cause-bad-loading-times
Fix pdfexport hooks may cause bad loading times
2020-01-16 09:02:31 +01:00
Johannes Meyer 69d15824fb
Merge pull request #4048 from Icinga/fix/server-side-window-handling
Fix server side window handling
2020-01-16 08:57:11 +01:00
Eric Lippmann dd500578c9 Url: Fix @return hints
Before, sublcasses of Url suffered from @return Url hints. This is
@return static now.
2020-01-14 14:26:14 +01:00
Johannes Meyer 6a8f17faf2 OutputFormat: Just provide the pdf export if there's a hook available
Calling `isSupported()` is bad here since there may be IO involved.
2020-01-14 11:01:53 +01:00
Johannes Meyer 9fe43dda5f ActionController: Drop method `handlerBrowserWindows()` 2020-01-14 10:14:02 +01:00
Johannes Meyer 855bb8ae72 Properly handle window id's and container id's 2020-01-14 10:14:02 +01:00
Johannes Meyer 2d3fc218db Window: Differentiate between window and container id 2020-01-14 10:14:02 +01:00
Johannes Meyer d459e58aca Response: Add methods to override the client's window id 2020-01-14 10:14:02 +01:00
Johannes Meyer 5a58279995 ActionController: Don't render exceptions as PDF 2020-01-10 14:11:52 +01:00
Johannes Meyer 5943e6bde9 Pdf: Restore previous state after rendering content
In case an exception occurs its output was previously merged
with the rendered content or even PDF..
2020-01-10 14:11:40 +01:00
Johannes Meyer 4157821c89 IcingaCheckbox: Don't `display:none` the checkbox but add `.sr-only` to it 2019-12-05 16:12:41 +01:00
Johannes Meyer 7b488d7f93 swag: Fix violations of PSR-12
PSR-2 has been deprecated and phpcs v3.5.3
now checks for the successor PSR-12
2019-12-04 11:28:08 +01:00
Johannes Meyer 0442c4f0ab View: Ignore setting `short_open_tag`
Adjusting class `Zend_View_Stream` according to https://www.php.net/manual/en/migration74.incompatible.php#migration74.incompatible.core.stream-wrappers
didn't work. (*syntax error, unexpected end of file* after every last php statement in phtml files)

So.. since `<?= ?>` instructions are permanently available since PHP 5.4 (https://www.php.net/manual/en/language.basic-syntax.phptags.php)
we'll just omit using a custom stream wrapper now.
2019-12-04 09:35:24 +01:00
Johannes Meyer 9b1dc44130 FilterEditor: Also trim trailing whitespace from search values
Simple values are wrapped with `*` anyway, so trimming all
whitespace doesn't pose an issue. (Even if inserted intentionally)
This doesn't apply to qualified search values. (e.g. `host = abc `)

resolves #4002
2019-12-03 10:33:00 +01:00
Eric Lippmann 9f4e29b56c JS/CSS: Load modal behavior and styles 2019-11-04 12:46:30 +01:00
Eric Lippmann c196631f5a Add Markdown::line() 2019-10-31 14:41:39 +01:00
Johannes Meyer 52d830170f LessCompiler: Put required assets into a module's css block
We have to include these there otherwise mixins from assets
can't be used.
2019-10-01 15:30:17 +02:00
Johannes Meyer d699191629
Let modules provide css/js assets to be used by other modules (#3961) 2019-09-25 09:53:53 +02:00
Johannes Meyer f98f988aff Remove tristate form element 2019-09-23 08:36:24 +02:00
Johannes Meyer 9cdf37410c ApplicationStateMessages: Fix message layout 2019-07-29 10:19:39 +02:00
Johannes Meyer 13ad506393 css: Rename class `icinga-forms` to `icinga-form` 2019-07-29 10:17:59 +02:00
Johannes Meyer 212606de78 setup: Apply new icinga form style 2019-07-29 10:17:59 +02:00
Johannes Meyer 0bc70a840c SortBox: Apply icinga form style 2019-07-29 10:17:59 +02:00
Johannes Meyer 346083109a Apply new form style to the filter editor 2019-07-29 10:17:59 +02:00
Johannes Meyer 05613c413d Enhance toggle-switch, spinner and control-info placement
tested with Chromium, IE11 (Win7), Edge (Win10)
2019-07-29 10:17:59 +02:00
Johannes Meyer 115bb80c6a View: Register our own view helper path
That's a different path than application/views/helpers because this one
uses a namespace so that we're able to extend Zend's view helpers
2019-07-29 10:17:59 +02:00
Johannes Meyer bc2e7588d7 FormNotifications: Don't ignore warning and error notifications 2019-07-29 10:17:59 +02:00
Johannes Meyer a5f292c2ae Form: Define classes `icinga-forms` and `icinga-controls` by default 2019-07-29 10:17:59 +02:00
Florian Strohmaier f14256a7ee CSS: Adapt form design with filter editor
refs #3676
2019-07-29 10:17:59 +02:00
Florian Strohmaier f70f996085 Announcements: Increase font-size and align control layout
refs #3676
refs #3560
refs #3839
2019-07-29 10:17:59 +02:00
Florian Strohmaier c492c6bb23 Announcements: Avoid duplicate `id attribute
refs #3762
2019-07-29 10:17:59 +02:00
Eric Lippmann c49f5d6a0f Don't override Zend's Checkbox for our toggle switch 2019-07-29 10:17:59 +02:00
Eric Lippmann 41ee36c7e6 Reduce default textarea rows 2019-07-29 10:17:59 +02:00
Jennifer Mourek bf48b6d26b WIP: New form styles
Signed-off-by: Eric Lippmann <eric.lippmann@icinga.com>
2019-07-29 10:17:59 +02:00
Johannes Meyer 9d0ef4cf33 Wrap any markdown output with a `<section>` and remove explicit containers 2019-07-23 14:45:32 +02:00
Johannes Meyer 40529e76ef
Merge pull request #3858 from Icinga/feature/downtime-schedule-times
Require time output for downtime schedule and end/expire times
2019-07-18 08:47:55 +02:00
Johannes Meyer fcde2a9eea dashboard: Use the non-translated versions of pane and dashlet names for storage
This is a dirty quick fix. And calling it *quick* is already an overstatement.
Of course, it's also a breaking change, as **all** non-english users need to
update their dashboard.ini after this change.

Oh, and don't dare to move this over to the new dashboards!

refs #3542
2019-07-18 08:33:35 +02:00
Johannes Meyer 4fdfb190ad Navigation/DashboardPane: Properly register dashlets as children
refs #3542
2019-07-18 08:33:35 +02:00
Johannes Meyer 37a972cf75 dashboard: Differentiate between `name` and `title`
The former is the original name while title may
be changed by the user. This change is strictly
necessary for the references bug and should also
be introduced when rewriting this mess.

refs #3542
2019-07-18 08:33:35 +02:00
Johannes Meyer f8d3f43965 js: Drop vendor library tipsy 2019-07-18 07:57:14 +02:00
Johannes Meyer c100654412 js: Integrate vendor library jquery-migrate 2019-07-18 07:57:14 +02:00
Jennifer Mourek 07586af41f Remove IE8 & IE9 traces 2019-07-18 07:56:09 +02:00
Florian Strohmaier 7cf620f3f1 JS: Use jquery 3.4.1
refs #3813
2019-07-18 07:56:09 +02:00
Jennifer Mourek 55d35b9e5b Remove jquery 1.11 dependency
refs #3784
2019-07-18 07:56:09 +02:00
Johannes Meyer e2cddc2d46 js: Introduce storage.js, a localStorage abstraction layer 2019-07-17 13:12:41 +02:00
Johannes Meyer 0574f44bd9 colllapsibleContainer.js: Rename to collapsible.js 2019-07-17 13:12:41 +02:00
Florian Strohmaier b07ffd4987 JS: Implement collapsible-container behavior 2019-07-17 13:12:41 +02:00
Eric Lippmann f9021e8fdd Add $requireTime to timeAgo() and timeSince() too 2019-07-15 10:11:52 +02:00
Johannes Meyer 3edda43bca ActionController: Utilize view variable `$defaultTitle` instead of the constant
Allows controllers to also customize the default title with translated contents.

refs #3851
2019-07-15 08:24:44 +02:00
Johannes Meyer b06103bfc5 NavigationItemRenderer: Don't fail to render an icon if there's none
fixes #3859
2019-07-12 07:42:33 +02:00
Eric Lippmann 1351be7da8 Add param to timeUntil() to require time output
If the time specified in timeUntil() is at least 3 days in the future,
the output will only contain the month and the day. With $requireTime it
will also ouput the time. This is useful for some views, e.g.
scheduled downtimes.
2019-07-11 13:07:17 +02:00
Johannes Meyer 801a6719b7
Merge pull request #3835 from Icinga/fix/problem-badges-not-visible-if-sidebar-is-collapsed-3568
ui: Show problem badges in collapsed sidebar
2019-07-11 08:00:12 +02:00
Johannes Meyer f0b5d8fd8e BadgeNavigationItemRenderer: Round counts to the neareset base
refs #3568
2019-07-03 11:29:37 +02:00
Johannes Meyer 6aa2cf69c7 HtmlPurifier: Enable cache directory
refs #3814
2019-06-27 14:41:13 +02:00
Johannes Meyer 74642d1cf7 FileCache: Add method to prepare sub directories
refs #3814
2019-06-25 16:18:26 +02:00
Johannes Meyer bd2060739e announcements: Transform markdown markup 2019-06-25 15:04:04 +02:00
Johannes Meyer 1ac5557187 lib: Introduce Markdown view helper
refs #3684
2019-06-25 15:01:35 +02:00
Johannes Meyer dd664aab98 Url: Trim all leading slashes from paths, not just the first
refs #3829
2019-06-25 09:18:15 +02:00
Eric Lippmann b9c2c45af1 CLI: Fix CSS path
CLI commands which require our LESS parser had no access to our CSS
because the public path was set to the path of the icingacli executable
which is most likely bin.
2019-06-04 09:43:39 +02:00
Johannes Meyer dcbb477d3a AnnouncementIniRepository: Also fetch column `start` in `findActive()` 2019-05-23 10:05:14 +02:00
Johannes Meyer 37df008d7f AnnouncementIniRepository: Don't transform retrieved timestamps to DateTime
refs #3414
2019-04-16 13:03:16 +02:00
Johannes Meyer 3fe810ecf9 Form: Properly preserve defaults from DateTimePicker elements
fixes #3612
2019-04-10 10:51:36 +02:00
Eric Lippmann 915c7b8fe5
Merge pull request #3504 from Icinga/fix/collapsible-sidebar-issues-3187
Fix collapsible sidebar issues
2019-03-21 09:09:27 +01:00
Jennifer Mourek b3b80fdc31 Make active first-level nav items better distinguishable 2019-03-20 11:07:39 +01:00
Jennifer Mourek 61b0d8aa90 Add icon with first letter of the li if there is no icon set else default to icon-circle 2019-03-20 11:07:39 +01:00
Eric Lippmann 9571d1059f Fix URLs in our image helper having multiple params 2019-01-25 09:20:55 +01:00
Johannes Meyer 4e6b936862 helpers/url: Properly escape image urls 2018-10-10 09:44:11 +02:00
Eric Lippmann 7d47875241 Introduce PdfexportHook 2018-07-18 14:22:18 +02:00
Johannes Meyer 84622bf27b Fix some XSS vulnerabilities
Only a real issue with <= IE9 as other browsers properly escape
urls prior transmission.

Signed-off-by: Eric Lippmann <eric.lippmann@icinga.com>
2018-07-16 09:53:30 +02:00
Eric Lippmann 6cddd6beed
Merge pull request #3508 from Icinga/fix/filter-entries-are-deleted-when-pushing-enter-3454
FilterEditor: Add a hidden submit button to the start of the form's m…
2018-07-10 09:28:35 +02:00
Eric Lippmann 47405127d0 Add config to hide/show pplication state messages
refs #2835
2018-07-09 16:28:28 +02:00
Eric Lippmann d18d05ccee Introduce ApplicationStateHook
refs #2835
2018-07-09 16:28:25 +02:00
Johannes Meyer 6e6251604b FilterEditor: Add a hidden submit button to the start of the form's markup
When pushing enter our JS mimics what a browser would do. And that is
pushing the first submit button found in the form. Without this, that's
a delete button of the first logical junction. (the root condition)

fixes #3454
2018-07-06 10:41:49 +02:00