4 Commits
0.11 ... 0.11.3

Author SHA1 Message Date
Luc Didry
b8d2defe61 Fix gallery bug 2018-07-31 13:23:56 +02:00
Luc Didry
c030e371ae Fix stats graph if no upload happens in the time range 2018-07-31 12:55:15 +02:00
Luc Didry
85d0aabef8 Add upload_enabled info to server infos endpoint 2018-07-30 13:45:48 +02:00
Luc Didry
da8a0642ec Fix year_disabled_in_month_pct stat 2018-07-30 13:36:24 +02:00
6 changed files with 59 additions and 33 deletions

View File

@@ -1,5 +1,15 @@
Revision history for Lutim
0.11.3 2018-07-31
- Fix gallery bug
0.11.2 2018-07-31
- Fix stats graph if no upload happens in the time range
0.11.1 2018-07-30
- Add upload_enabled info to server infos endpoint
- Add log message when failing to render an image
0.11.0 2018-07-29
- Allow to install only needed deps
- Notification when copying to clipboard or deleting images

View File

@@ -71,15 +71,27 @@ sub run {
);
my $total = $img->count_created_before($separation);
for my $year (sort {$a <=> $b} keys %data) {
for my $month (sort {$a <=> $b} keys %{$data{$year}}) {
for my $day (sort {$a <=> $b} keys %{$data{$year}->{$month}}) {
$thead_tr->append_content('<th>'."$day/$month/$year".'</th>'."\n");
$tbody_tr->append_content('<td>'.$data{$year}->{$month}->{$day}.'</td>'."\n");
$total += $data{$year}->{$month}->{$day};
$tbody_t2->append_content('<td>'.$total.'</td>'."\n");
if (scalar(keys %data)) {
for my $year (sort {$a <=> $b} keys %data) {
for my $month (sort {$a <=> $b} keys %{$data{$year}}) {
for my $day (sort {$a <=> $b} keys %{$data{$year}->{$month}}) {
$thead_tr->append_content(sprintf("<th>%#.2d/%#.2d/%d</th>\n", $day, $month, $year));
$tbody_tr->append_content(sprintf("<td>%d</td>\n", $data{$year}->{$month}->{$day}));
$total += $data{$year}->{$month}->{$day};
$tbody_t2->append_content(sprintf("<td>%d</td>\n", $total));
}
}
}
} else {
my $dt = DateTime->from_epoch(epoch => $separation);
$thead_tr->append_content(sprintf("<th>%#.2d/%#.2d/%d</th>\n", $dt->day(), $dt->month(), $dt->year()));
$tbody_tr->append_content("<td>0</td>\n");
$tbody_t2->append_content(sprintf("<td>%d</td>\n", $total));
$dt = DateTime->now();
$thead_tr->append_content(sprintf("<th>%#.2d/%#.2d/%d</th>\n", $dt->day(), $dt->month(), $dt->year()));
$tbody_tr->append_content("<td>0</td>\n");
$tbody_t2->append_content(sprintf("<td>%d</td>\n", $total));
}
my $moy = $total / $config->{stats_day_num};
@@ -126,7 +138,7 @@ sub run {
disabled => $year_disabled
};
my $year_disabled_in_month_pct = ($year_enabled != 0) ? " (".sprintf('%.2f', $year_disabled_in_month/$year_enabled)."%)" : '';
my $year_disabled_in_month_pct = ($year_enabled != 0) ? " (".sprintf('%.2f', 100*$year_disabled_in_month/$year_enabled)."%)" : '';
$raw->append_content("\n<tr><td><%= \$raw[4] %></td><td>".$unlimited_enabled."</td><td>".$unlimited_disabled."</td><td>ø</td></tr>\n");
$raw->append_content("<tr><td><%= \$raw[5] %></td><td>".$day_enabled."</td><td>".$day_disabled."</td><td>".$day_enabled." (100%)</td></tr>\n");

View File

@@ -81,6 +81,7 @@ sub infos {
default_delay => $c->config('default_delay'),
max_delay => $c->config('max_delay'),
always_encrypt => ($c->config('always_encrypt')) ? true : false,
upload_enabled => ($c->app->stop_upload()) ? false : true,
}
);
}
@@ -647,6 +648,8 @@ sub short {
$c->delete_image($image);
}
});
} else {
$c->app->log->error('[ERROR] Can\'t render '.$image->short);
}
} elsif ($image->path && !$image->enabled) {
# Log access try

View File

@@ -88,7 +88,8 @@ $t->get_ok('/infos')
'/contact' => 'John Doe, admin[at]example.com',
'/default_delay' => 30,
'/max_delay' => 200,
'/max_file_size' => 1048576
'/max_file_size' => 1048576,
'/upload_enabled' => true
);
# Post image

View File

@@ -19,7 +19,7 @@ msgstr ""
#. (30)
#. ($delay)
#. (config('max_delay')
#: lib/Lutim/Command/cron/stats.pm:147 lib/Lutim/Command/cron/stats.pm:148 lib/Lutim/Command/cron/stats.pm:161 lib/Lutim/Command/cron/stats.pm:162 lib/Lutim/Command/cron/stats.pm:178 lib/Lutim/Command/cron/stats.pm:179 themes/default/templates/myfiles.html.ep:24 themes/default/templates/myfiles.html.ep:33 themes/default/templates/myfiles.html.ep:34 themes/default/templates/partial/for_my_delay.html.ep:13 themes/default/templates/partial/for_my_delay.html.ep:14 themes/default/templates/partial/for_my_delay.html.ep:4 themes/default/templates/partial/lutim.js.ep:140 themes/default/templates/partial/lutim.js.ep:149 themes/default/templates/partial/lutim.js.ep:150 themes/default/templates/partial/raw.js.ep:23 themes/default/templates/partial/raw.js.ep:24 themes/default/templates/partial/raw.js.ep:6 themes/default/templates/partial/raw.js.ep:7 themes/default/templates/raw.html.ep:8 themes/default/templates/raw.html.ep:9
#: lib/Lutim/Command/cron/stats.pm:159 lib/Lutim/Command/cron/stats.pm:160 lib/Lutim/Command/cron/stats.pm:173 lib/Lutim/Command/cron/stats.pm:174 lib/Lutim/Command/cron/stats.pm:190 lib/Lutim/Command/cron/stats.pm:191 themes/default/templates/myfiles.html.ep:24 themes/default/templates/myfiles.html.ep:33 themes/default/templates/myfiles.html.ep:34 themes/default/templates/partial/for_my_delay.html.ep:13 themes/default/templates/partial/for_my_delay.html.ep:14 themes/default/templates/partial/for_my_delay.html.ep:4 themes/default/templates/partial/lutim.js.ep:140 themes/default/templates/partial/lutim.js.ep:149 themes/default/templates/partial/lutim.js.ep:150 themes/default/templates/partial/raw.js.ep:23 themes/default/templates/partial/raw.js.ep:24 themes/default/templates/partial/raw.js.ep:6 themes/default/templates/partial/raw.js.ep:7 themes/default/templates/raw.html.ep:8 themes/default/templates/raw.html.ep:9
msgid "%1 days"
msgstr ""
@@ -32,11 +32,11 @@ msgstr ""
msgid "-or-"
msgstr ""
#: lib/Lutim.pm:350 lib/Lutim/Command/cron/stats.pm:149 lib/Lutim/Command/cron/stats.pm:163 lib/Lutim/Command/cron/stats.pm:180 themes/default/templates/index.html.ep:5 themes/default/templates/myfiles.html.ep:5 themes/default/templates/partial/raw.js.ep:25 themes/default/templates/partial/raw.js.ep:8 themes/default/templates/raw.html.ep:10
#: lib/Lutim.pm:350 lib/Lutim/Command/cron/stats.pm:161 lib/Lutim/Command/cron/stats.pm:175 lib/Lutim/Command/cron/stats.pm:192 themes/default/templates/index.html.ep:5 themes/default/templates/myfiles.html.ep:5 themes/default/templates/partial/raw.js.ep:25 themes/default/templates/partial/raw.js.ep:8 themes/default/templates/raw.html.ep:10
msgid "1 year"
msgstr ""
#: lib/Lutim.pm:349 lib/Lutim/Command/cron/stats.pm:146 lib/Lutim/Command/cron/stats.pm:160 lib/Lutim/Command/cron/stats.pm:177 themes/default/templates/index.html.ep:4 themes/default/templates/myfiles.html.ep:33 themes/default/templates/myfiles.html.ep:4 themes/default/templates/partial/for_my_delay.html.ep:13 themes/default/templates/partial/lutim.js.ep:149 themes/default/templates/partial/raw.js.ep:22 themes/default/templates/partial/raw.js.ep:5 themes/default/templates/raw.html.ep:7
#: lib/Lutim.pm:349 lib/Lutim/Command/cron/stats.pm:158 lib/Lutim/Command/cron/stats.pm:172 lib/Lutim/Command/cron/stats.pm:189 themes/default/templates/index.html.ep:4 themes/default/templates/myfiles.html.ep:33 themes/default/templates/myfiles.html.ep:4 themes/default/templates/partial/for_my_delay.html.ep:13 themes/default/templates/partial/lutim.js.ep:149 themes/default/templates/partial/raw.js.ep:22 themes/default/templates/partial/raw.js.ep:5 themes/default/templates/raw.html.ep:7
msgid "24 hours"
msgstr ""
@@ -48,11 +48,11 @@ msgstr ""
msgid "About"
msgstr ""
#: lib/Lutim/Command/cron/stats.pm:142 themes/default/templates/raw.html.ep:3
#: lib/Lutim/Command/cron/stats.pm:154 themes/default/templates/raw.html.ep:3
msgid "Active images"
msgstr ""
#: lib/Lutim/Controller/Image.pm:327
#: lib/Lutim/Controller/Image.pm:328
msgid "An error occured while downloading the image."
msgstr ""
@@ -108,11 +108,11 @@ msgstr ""
msgid "Delete at first view?"
msgstr ""
#: lib/Lutim/Command/cron/stats.pm:143 themes/default/templates/raw.html.ep:4
#: lib/Lutim/Command/cron/stats.pm:155 themes/default/templates/raw.html.ep:4
msgid "Deleted images"
msgstr ""
#: lib/Lutim/Command/cron/stats.pm:144 themes/default/templates/raw.html.ep:5
#: lib/Lutim/Command/cron/stats.pm:156 themes/default/templates/raw.html.ep:5
msgid "Deleted images in 30 days"
msgstr ""
@@ -204,7 +204,7 @@ msgstr ""
msgid "Image URL"
msgstr ""
#: lib/Lutim/Command/cron/stats.pm:141 themes/default/templates/raw.html.ep:2
#: lib/Lutim/Command/cron/stats.pm:153 themes/default/templates/raw.html.ep:2
msgid "Image delay"
msgstr ""
@@ -212,7 +212,7 @@ msgstr ""
msgid "Image deleted"
msgstr ""
#: lib/Lutim/Controller/Image.pm:753
#: lib/Lutim/Controller/Image.pm:756
msgid "Image not found."
msgstr ""
@@ -362,7 +362,7 @@ msgid "Something bad happened"
msgstr ""
#. ($c->config('contact')
#: lib/Lutim/Controller/Image.pm:760
#: lib/Lutim/Controller/Image.pm:763
msgid "Something went wrong when creating the zip file. Try again later or contact the administrator (%1)."
msgstr ""
@@ -386,7 +386,7 @@ msgstr ""
msgid "The Lutim software is a <a href=\"http://en.wikipedia.org/wiki/Free_software\">free software</a>, which allows you to download and install it on you own server. Have a look at the <a href=\"https://www.gnu.org/licenses/agpl-3.0.html\">AGPL</a> to see what you can do."
msgstr ""
#: lib/Lutim/Controller/Image.pm:346
#: lib/Lutim/Controller/Image.pm:347
msgid "The URL is not valid."
msgstr ""
@@ -398,19 +398,19 @@ msgstr ""
msgid "The data has been successfully imported."
msgstr ""
#: lib/Lutim/Controller/Image.pm:159 lib/Lutim/Controller/Image.pm:227
#: lib/Lutim/Controller/Image.pm:160 lib/Lutim/Controller/Image.pm:228
msgid "The delete token is invalid."
msgstr ""
#. ($upload->filename)
#: lib/Lutim/Controller/Image.pm:487
#: lib/Lutim/Controller/Image.pm:488
msgid "The file %1 is not an image."
msgstr ""
#. ($tx->res->max_message_size)
#. ($c->req->max_message_size)
#. (config('max_file_size')
#: lib/Lutim/Controller/Image.pm:310 lib/Lutim/Controller/Image.pm:379 themes/default/templates/partial/lutim.js.ep:249
#: lib/Lutim/Controller/Image.pm:311 lib/Lutim/Controller/Image.pm:380 themes/default/templates/partial/lutim.js.ep:249
msgid "The file exceed the size limit (%1)"
msgstr ""
@@ -419,16 +419,16 @@ msgid "The graph's datas are not updated in real-time."
msgstr ""
#. ($image->filename)
#: lib/Lutim/Controller/Image.pm:229
#: lib/Lutim/Controller/Image.pm:230
msgid "The image %1 has already been deleted."
msgstr ""
#. ($image->filename)
#: lib/Lutim/Controller/Image.pm:238 lib/Lutim/Controller/Image.pm:243
#: lib/Lutim/Controller/Image.pm:239 lib/Lutim/Controller/Image.pm:244
msgid "The image %1 has been successfully deleted"
msgstr ""
#: lib/Lutim/Controller/Image.pm:167
#: lib/Lutim/Controller/Image.pm:168
msgid "The image's delay has been successfully modified"
msgstr ""
@@ -445,7 +445,7 @@ msgid "There is XXXX image(s) in the gallery"
msgstr ""
#. ($c->config->{contact})
#: lib/Lutim/Controller/Image.pm:484
#: lib/Lutim/Controller/Image.pm:485
msgid "There is no more available URL. Retry or contact the administrator. %1"
msgstr ""
@@ -457,7 +457,7 @@ msgstr ""
msgid "Toggle navigation"
msgstr ""
#: lib/Lutim/Command/cron/stats.pm:150 themes/default/templates/raw.html.ep:11
#: lib/Lutim/Command/cron/stats.pm:162 themes/default/templates/raw.html.ep:11
msgid "Total"
msgstr ""
@@ -470,15 +470,15 @@ msgid "Unable to copy to clipboard"
msgstr ""
#. ($short)
#: lib/Lutim/Controller/Image.pm:107 lib/Lutim/Controller/Image.pm:201 lib/Lutim/Controller/Image.pm:272
#: lib/Lutim/Controller/Image.pm:108 lib/Lutim/Controller/Image.pm:202 lib/Lutim/Controller/Image.pm:273
msgid "Unable to find the image %1."
msgstr ""
#: lib/Lutim/Controller/Image.pm:573 lib/Lutim/Controller/Image.pm:618 lib/Lutim/Controller/Image.pm:657 lib/Lutim/Controller/Image.pm:700 lib/Lutim/Controller/Image.pm:712 lib/Lutim/Controller/Image.pm:723 lib/Lutim/Controller/Image.pm:750 lib/Lutim/Plugin/Helpers.pm:88
#: lib/Lutim/Controller/Image.pm:574 lib/Lutim/Controller/Image.pm:619 lib/Lutim/Controller/Image.pm:660 lib/Lutim/Controller/Image.pm:703 lib/Lutim/Controller/Image.pm:715 lib/Lutim/Controller/Image.pm:726 lib/Lutim/Controller/Image.pm:753 lib/Lutim/Plugin/Helpers.pm:88
msgid "Unable to find the image: it has been deleted."
msgstr ""
#: lib/Lutim/Controller/Image.pm:144
#: lib/Lutim/Controller/Image.pm:145
msgid "Unable to get counter"
msgstr ""
@@ -559,7 +559,7 @@ msgstr ""
msgid "core developer"
msgstr ""
#: lib/Lutim.pm:348 lib/Lutim/Command/cron/stats.pm:145 lib/Lutim/Command/cron/stats.pm:159 lib/Lutim/Command/cron/stats.pm:176 themes/default/templates/index.html.ep:3 themes/default/templates/myfiles.html.ep:3 themes/default/templates/partial/raw.js.ep:21 themes/default/templates/partial/raw.js.ep:4 themes/default/templates/raw.html.ep:6
#: lib/Lutim.pm:348 lib/Lutim/Command/cron/stats.pm:157 lib/Lutim/Command/cron/stats.pm:171 lib/Lutim/Command/cron/stats.pm:188 themes/default/templates/index.html.ep:3 themes/default/templates/myfiles.html.ep:3 themes/default/templates/partial/raw.js.ep:21 themes/default/templates/partial/raw.js.ep:4 themes/default/templates/raw.html.ep:6
msgid "no time limit"
msgstr ""

View File

@@ -218,7 +218,7 @@ function addElement(keys) {
element = keys.shift();
if (!element.match('xcf')) {
$.ajax({
url: '<%= url_for('about_img') %>'+'/'+element,
url: '<%= url_for('about_img') %>'+element,
method: 'GET',
dataType: 'json',
success: function(data, textStatus, jqXHR) {