diff --git a/app/sections/logDirectoryMgr/LogDirectoryMgr.vue b/app/sections/logDirectoryMgr/LogDirectoryMgr.vue new file mode 100644 index 0000000..d52e56f --- /dev/null +++ b/app/sections/logDirectoryMgr/LogDirectoryMgr.vue @@ -0,0 +1,220 @@ + + + diff --git a/app/shareds/DiskUsage.vue b/app/shareds/DiskUsage.vue index 056657e..7c3db75 100644 --- a/app/shareds/DiskUsage.vue +++ b/app/shareds/DiskUsage.vue @@ -10,7 +10,7 @@

@@ -30,7 +30,7 @@
( - {{ diskUsageData['total-log-space-yesterday'] }} {{ diskUsageData['unit'] }} amount of logs collected yesterday + {{ diskUsageData['total-log-space-yesterday'] }} {{ diskUsageData['unit'] }} average logs per day diff --git a/routes/api/task-stat.php b/routes/api/task-stat.php index 4b0464a..7581929 100644 --- a/routes/api/task-stat.php +++ b/routes/api/task-stat.php @@ -918,7 +918,10 @@ static function (array $file) { $data = []; - $params = array_change_key_case($request->getQueryParams(), CASE_UPPER); + $params = []; + if(!empty($request->getParsedBody())){ + $params = array_change_key_case($request->getParsedBody(), CASE_UPPER); + } $app_configs = $this->get('configs')["app_configs"]; $base_path =$app_configs["paths"]["base_path"]; @@ -952,11 +955,19 @@ static function (array $file) { $data["total-log-files"]++; if (filemtime($file) < $margin_date) { - unlink($file); + + try { + unlink($file); + } catch(Exception $e) { + throw new Exception("ERROR - Error deleting logs"); + } $data["removed-log-files"]++; } } + $data["result"] = true; + $data["result_msg"] = ''; + $response->getBody()->write(json_encode($data, JSON_UNESCAPED_SLASHES | JSON_PRETTY_PRINT)); return $response->withStatus(200) ->withHeader("Content-Type", "application/json");