Change to using location and open_in_same_window

This commit is contained in:
Oliver Gorwits
2014-03-04 20:28:32 +00:00
parent f72e6ff15d
commit a7cbc443c6
3 changed files with 15 additions and 17 deletions

View File

@@ -1,3 +1,7 @@
2.003000 - 2014-02-04
* Change to using location and open_in_same_window
2.002001 - 2014-02-27
* Fix config param name

View File

@@ -1,6 +1,6 @@
package App::NetdiscoX::Web::Plugin::Observium;
our $VERSION = '2.002001';
our $VERSION = '2.003000';
use Dancer ':syntax';
use App::Netdisco::Web::Plugin;
@@ -31,9 +31,8 @@ App::NetdiscoX::Web::Plugin::Observium - Port Traffic Links and Thumbnail Graphs
- X::Observium
plugin_observium:
webhost: "web-server.example.com"
open_in_new_window: true
http_secure: true
location: "https://web-server.example.com/"
open_in_same_window: false
=head1 Description
@@ -46,24 +45,19 @@ thumbnail graph for the port, taken from a local Observium installation.
Create an entry in your C<~/environments/deployment.yml> file named
"C<plugin_observium>", containing the following settings:
=head2 webhost
=head2 location
Value: String, Required.
Name of the server hosting your local Observium installation.
Full URL to your local Observium server, including HTTP/HTTPS scheme (as in
the example above).
=head2 open_in_new_window
=head2 open_in_same_window
Value: Boolean. Default: false.
If set to true, the hyperlink is configured to open the port's Observium page
in a new browser window or tab.
=head2 http_secure
Value: Boolean. Default: false.
If set to true, the hyperlink is configured to use HTTPS.
in the same browser window or tab as Netdisco. The default is false.
=head1 AUTHOR

View File

@@ -1,6 +1,6 @@
<a href="[% settings.plugin_observium.http_secure ? 'https' : '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 %]
<a href="[% settings.plugin_observium.location %]/device/hostname=[% device.dns || device.name | uri %]/tab=port/ifdescr=[% row.base64url_port %]/"
[% 'target="_blank"' UNLESS settings.plugin_observium.open_in_same_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"/>'
<img src="[% settings.plugin_observium.location %]/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>