Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add title support for the iframe widget for Icinga Web #90

Merged
merged 1 commit into from
Oct 16, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Add title support for the iframe widget for Icinga Web
fixes #82
dnsmichi committed Oct 16, 2019
commit 0bde978cc31cd39c907f2c81432aa7351a42aa1c
4 changes: 2 additions & 2 deletions dashboards/icinga2.erb
Original file line number Diff line number Diff line change
@@ -44,10 +44,10 @@ $(function() {

<!-- Icinga Web 2 iFrame. getIcingaWeb2Url() is defined in config.ru and reads from config/icinga2*.json -->
<li data-row="3" data-col="1" data-sizex="2" data-sizey="2">
<div data-id="iframe" data-view="Iframe" data-url="<%=getIcingaWeb2Url()%>/monitoring/list/hosts?host_problem=1&sort=host_severity&showFullscreen&showCompact"></div>
<div data-id="iframe" data-view="Iframe" data-title="Icinga Web Host Problems" data-url="<%=getIcingaWeb2Url()%>/monitoring/list/hosts?host_problem=1&sort=host_severity&showFullscreen&showCompact"></div>
</li>
<li data-row="3" data-col="3" data-sizex="2" data-sizey="2">
<div data-id="iframe" data-view="Iframe" data-url="<%=getIcingaWeb2Url()%>/monitoring/list/services?service_problem=1&sort=service_severity&dir=desc&showFullscreen&showCompact"></div>
<div data-id="iframe" data-view="Iframe" data-title="Icinga Web Service Problems" data-url="<%=getIcingaWeb2Url()%>/monitoring/list/services?service_problem=1&sort=service_severity&dir=desc&showFullscreen&showCompact"></div>
</li>
</ul>

2 changes: 2 additions & 0 deletions widgets/iframe/iframe.coffee
Original file line number Diff line number Diff line change
@@ -2,8 +2,10 @@ class Dashing.Iframe extends Dashing.Widget

ready: ->
# This is fired when the widget is done being rendered
$(@node).find(".iframe").attr('src', @get('src'))

onData: (data) ->
# Handle incoming data
# You can access the html node of this widget with `@node`
# Example: $(@node).fadeOut().fadeIn() will make the node flash each time data comes in.
$(@node).find(".iframe").attr('src', data.src)
1 change: 1 addition & 0 deletions widgets/iframe/iframe.html
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
<div class="header" data-bind="title"></div>
<iframe data-bind-src="url" frameborder=0></iframe>