complete the observium plugin
This commit is contained in:
@@ -7,6 +7,8 @@ package App::Netdisco::DB::Result::DevicePort;
|
||||
use strict;
|
||||
use warnings;
|
||||
|
||||
use MIME::Base64 'encode_base64url';
|
||||
|
||||
use base 'DBIx::Class::Core';
|
||||
__PACKAGE__->table("device_port");
|
||||
__PACKAGE__->add_columns(
|
||||
@@ -266,4 +268,13 @@ See the C<with_is_free> and C<only_free_ports> modifiers to C<search()>.
|
||||
|
||||
sub is_free { return (shift)->get_column('is_free') }
|
||||
|
||||
=head2 base64url_port
|
||||
|
||||
Returns a Base64 encoded version of the C<port> column value suitable for use
|
||||
in a URL.
|
||||
|
||||
=cut
|
||||
|
||||
sub base64url_port { return encode_base64url((shift)->port) }
|
||||
|
||||
1;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
package App::NetdiscoX::Web::Plugin::ObserviumSparklines;
|
||||
package App::NetdiscoX::Web::Plugin::Observium;
|
||||
|
||||
use Dancer ':syntax';
|
||||
use Dancer::Plugin::DBIC;
|
||||
@@ -9,13 +9,13 @@ use File::ShareDir 'dist_dir';
|
||||
use Path::Class;
|
||||
|
||||
register_device_port_column({
|
||||
name => 'observiumsparklines',
|
||||
name => 'observium',
|
||||
position => 'mid',
|
||||
label => 'Traffic',
|
||||
default => 'on',
|
||||
});
|
||||
|
||||
register_css('observiumsparklines');
|
||||
register_javascript('observiumsparklines');
|
||||
register_css('observium');
|
||||
register_javascript('observium');
|
||||
|
||||
true;
|
||||
Reference in New Issue
Block a user