MT#19439 non-destructive dashboard beautification

Change-Id: I72a3e0cbeffd7cb36a9fd063fb6c2782ebef2f9c
changes/85/5885/3
Gerhard Jungwirth 10 years ago
parent fdaf64a2ae
commit ca1996152b

@ -1,28 +1,14 @@
package NGCP::Panel::Controller::Dashboard;
use NGCP::Panel::Utils::Generic qw(:all);
use Sipwise::Base;
use parent 'Catalyst::Controller';
use NGCP::Panel::Widget;
=head1 NAME
NGCP::Panel::Controller::Dashboard - Catalyst Controller
=head1 DESCRIPTION
Catalyst Controller.
=head1 METHODS
=cut
=head2 index
use warnings;
use strict;
Dashboard index
use parent 'Catalyst::Controller';
=cut
use NGCP::Panel::Utils::Generic qw(:all);
use NGCP::Panel::Widget;
sub index :Path :Args(0) {
sub dashb_index :Path :Args(0) {
my ($self, $c) = @_;
my $plugin_finder = NGCP::Panel::Widget->new;
@ -60,17 +46,6 @@ sub ajax :Path('ajax') :Args(1) {
$c->detach( $c->view("JSON") );
}
=head1 AUTHOR
Andreas Granig,,,
=head1 LICENSE
This library is free software. You can redistribute it and/or modify
it under the same terms as Perl itself.
=cut
__PACKAGE__->meta->make_immutable;
1;

@ -1,5 +1,4 @@
package NGCP::Panel::Widget;
use Sipwise::Base;
use Moose;
with 'MooseX::Object::Pluggable';
@ -15,7 +14,7 @@ sub filter {
sub instantiate_plugins {
my ($self, $c, $type_filter) = @_;
my @plugins = map { s/^.*:://; $_; } $self->_plugin_locator->plugins;
my @plugins = map { s/^.*:://r; } $self->_plugin_locator->plugins;
my @instances = ();
foreach(@plugins) {
@ -25,7 +24,8 @@ sub instantiate_plugins {
push @instances, { instance => $inst, name => $_ };
}
}
return sort {$a->{instance}->priority <=> $b->{instance}->priority} @instances;
my @sorted_instances = sort {$a->{instance}->priority <=> $b->{instance}->priority} @instances;
return @sorted_instances;
}
no Moose;

Loading…
Cancel
Save