fixed the remaining bugs to make new spectre guts compatible with old subsystems
This commit is contained in:
parent
ba8ebc47d4
commit
bb4d7ab4a9
2 changed files with 51 additions and 28 deletions
|
|
@ -24,6 +24,7 @@ use Getopt::Long;
|
|||
use POE::Component::IKC::ClientLite;
|
||||
use Spectre::Admin;
|
||||
use WebGUI::Config;
|
||||
use JSON;
|
||||
|
||||
$|=1; # disable output buffering
|
||||
my $help;
|
||||
|
|
@ -158,7 +159,17 @@ sub getStatusReport {
|
|||
return $POE::Component::IKC::ClientLite::error unless defined $result;
|
||||
$remote->disconnect;
|
||||
undef $remote;
|
||||
return $result;
|
||||
my $pattern = "%8.8s %-9.9s %-30.30s %-22.22s %-15.15s %-20.20s\n";
|
||||
my $total = 0;
|
||||
my $output = sprintf $pattern, "Priority", "Status", "Sitename", "Instance Id", "Last Run", "Last Run Time";
|
||||
foreach my $instance (@{JSON->new->decode($result)}) {
|
||||
my $originalPriority = ($instance->{priority} - 1) * 10;
|
||||
my $priority = $instance->{workingPriority}."/".$originalPriority;
|
||||
$output .= sprintf $pattern, $priority, $instance->{status}, $instance->{sitename}, $instance->{instanceId}, $instance->{lastState}, $instance->{lastRunTime};
|
||||
$total++;
|
||||
}
|
||||
$output .= sprintf "\n%19.19s %4d\n", "Total Workflows", $total;
|
||||
return $output;
|
||||
}
|
||||
|
||||
__END__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue