complete the observium plugin

This commit is contained in:
Oliver Gorwits
2013-06-02 15:30:26 +01:00
parent 66b3ced179
commit 798086ca29
10 changed files with 67 additions and 12 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+5 -1
View File
@@ -66,9 +66,13 @@
[% FOREACH config IN settings._extra_device_port_cols %]
[% NEXT UNLESS config.position == 'mid' AND params.${config.name} %]
<td>
[% TRY %]
[% INCLUDE "plugin/${config.name}/device_port_column.tt" %]
[% CATCH %]
<!-- dummy content required by Template Toolkit TRY -->
[% END %]
</td>
[% END -%]
[% END %]
[% IF params.c_descr %]
<td nowrap>[% row.descr | html_entity %]</td>
@@ -0,0 +1,6 @@
<a href="http://[% settings.plugin_observium.webhost | uri %]/device/hostname=[% device.dns || device.name | uri %]/tab=port/ifdescr=[% row.base64url_port %]/"
[% 'target="_blank"' IF settings.plugin_observium.open_in_new_window %]
class="btn nd_observium"
data-content='
<img src="http://[% settings.plugin_observium.webhost | uri %]/graph.php?type=port_bits&device=[% device.dns || device.name | uri %]&port=[% row.port | uri %]&from=-1w&to=now&width=208&height=100&title=yes"/>'
><i class="icon-bar-chart"></i></a>
@@ -0,0 +1,6 @@
.nd_observium-style {
min-width: none;
max-width: none;
margin-top: 5px;
margin-left: 15px;
}
@@ -0,0 +1,25 @@
$(document).ready(function() {
// bind qtip2 even to all future .observium buttons
$('#ports_pane').on('mouseover', '.nd_observium', function(event) {
$(this).qtip({
overwrite: false,
content: {
attr: 'data-content'
},
show: {
event: event.type,
ready: true
},
position: {
my: 'left center',
at: 'right centre',
target: 'mouse'
},
style: {
classes: 'qtip-bootstrap nd_observium-style'
}
});
});
});
@@ -1,4 +0,0 @@
<button class="btn" rel="popover" data-trigger="hover" data-html="true" data-content='
<img src="http://[% settings.plugin_observiumsparklines.webhost | html_entity %]/graph.php?type=port_bits&device=[% device.dns || device.name | uri %]&port=[% row.port | uri %]&from=-1w&to=now&width=208&height=100&title=yes"/>
'
><i class="icon-bar-chart"></i></button>