Le mirroring des dépôts vers Github est maintenant natif dans Gitlab (et donc Framagit). Merci de passer à la fonction native pour que nous puissions couper notre solution maison. Détails sur https://docs.gitlab.com/ee/workflow/repository_mirroring.html#pushing-to-a-remote-repository (pensez à supprimer le webhook de notre solution maison).

Commit e616c86b by Luc Didry

Add json format to admin stats output

parent 0ab2abf6
Pipeline #10477 passed with stage
in 4 minutes 35 seconds
......@@ -157,16 +157,35 @@ sub stats {
my ($first, $last) = (!$page, ($page * $c->config('page_offset') <= $total && $total < ($page + 1) * $c->config('page_offset')));
my @urls = LstuModel::Lstu->select("WHERE url IS NOT NULL ORDER BY counter DESC LIMIT ? offset ?", $c->config('page_offset'), $page * $c->config('page_offset'));
$c->render(
template => 'stats',
prefix => $c->prefix,
urls => \@urls,
first => $first,
last => $last,
page => $page,
admin => 1,
total => $total
)
$c->respond_to(
json => sub {
my $c = shift;
$c->render(
json => {
prefix => $c->prefix,
urls => \@urls,
first => $first,
last => $last,
page => $page,
admin => 1,
total => $total
}
);
},
any => sub {
my $c = shift;
$c->render(
template => 'stats',
prefix => $c->prefix,
urls => \@urls,
first => $first,
last => $last,
page => $page,
admin => 1,
total => $total
)
}
);
} else {
my $u = (defined($c->cookie('url'))) ? decode_json $c->cookie('url') : [];
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment