s;
use Data::Printer;
use Mojo::Base 'Mojolicious::Controller';
use JSON::XS;
use Number::Format qw/format_bytes/;
my $json = JSON::XS->new->allow_nonref;
# Multipart upload handler
sub store {
ogger::Stdout;
use strict;
use warnings;
use base 'Flower::Chronos::Logger::Base';
#use Data::Printer;
#use JSON ();
sub log {
my $self = shift;
my ($info) = @_;
return $info;
}
1;
se 'Mojolicious::Controller';
use JSON::XS;
use Number::Format qw/format_bytes/;
use Data::FreqConvert;
my $json = JSON::XS->new->allow_nonref;
#my $json = JSON::XS->new->allow_nonref();
# resp
a ping
sub ping {
my $self = shift;
my $config = $self->config;
my $nodes = $self->req->json;
# Add all the nodes that have been advertised to us by the pinger.
foreach (@$nodes) {
UID
$config->{nodes}->add_if_necessary($_)
if ( $_->{uuid} );
}
$self->render(
json => { result => 'ok', 'uuid' => $config->{nodes}->self->uuid } );
}
# list my files
sub files {
package Flower::Chronos::Report;
use strict;
use warnings;
use Time::Piece;
use JSON ();
use Digest::MD5 ();
use Flower::Chronos::Utils qw(parse_time);
use Encode;
sub new {
my $class =
ne = <$fh>)) {
chomp $line;
next unless $line;
my $record = eval { JSON::decode_json($line) };
next unless $record;
my $start = $record->{_start};
my
Firefox;
use strict;
use warnings;
use base 'Flower::Chronos::Application::Base';
use URI;
use JSON ();
sub run {
my $self = shift;
my ($info) = @_;
return
unless $info->{rol
1;
}
sub _find_current_url {
my $self = shift;
my $json = $self->_parse_current_session;
my @tabs;
foreach my $w (@{$json->{"windows"}}) {
foreach my $t (@{$w->{"tabs"}}) {
urrent_session {
my $self = shift;
my $session = $self->_slurp_session;
return JSON::decode_json($session);
}
sub _slurp_session {
my $self = shift;
my ($session_file) =
gl
use JSON::XS;
use AnyEvent;
use Scalar::Util qw/refaddr/;
use Carp qw/confess/;
use overload '""' => \&to_string;
use Data::UUID;
my $uuid = Data::UUID->new();
my $timeout = 60;
my $json
= JSON::XS->new->allow_nonref;
#my $json = JSON->new();
sub new {
my $class = shift;
confess "called as object method" if ref $class;
my $args = shift || {};
confess "no parent supplie
my $url = "https://" . $self->ip . ":" . $self->port . "/REST/1.0/ping?";
my $nodedata = $json->encode($all_nodes);
$self->{ping_ua} = Mojo::UserAgent->new;
$self->{ping_cv} = AE::cv;