mirror of
https://github.com/pelican-dev/panel.git
synced 2025-11-09 18:19:27 +01:00
fixes
This commit is contained in:
parent
33869e718c
commit
8f77bc8fad
@ -68,9 +68,9 @@ class ListLogs extends BaseListLogs
|
|||||||
$uploadLines = $totalLines <= 1000 ? $lines : array_slice($lines, -1000);
|
$uploadLines = $totalLines <= 1000 ? $lines : array_slice($lines, -1000);
|
||||||
$content = implode("\n", $uploadLines);
|
$content = implode("\n", $uploadLines);
|
||||||
|
|
||||||
$hbUrl = 'https://logs.pelican.dev';
|
$logUrl = 'https://logs.pelican.dev';
|
||||||
try {
|
try {
|
||||||
$response = Http::timeout(10)->asMultipart()->post($hbUrl, [
|
$response = Http::timeout(10)->asMultipart()->post($logUrl, [
|
||||||
[
|
[
|
||||||
'name' => 'c',
|
'name' => 'c',
|
||||||
'contents' => $content,
|
'contents' => $content,
|
||||||
@ -83,8 +83,8 @@ class ListLogs extends BaseListLogs
|
|||||||
|
|
||||||
if ($response->failed()) {
|
if ($response->failed()) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title(trans('admin/log.actions.filed_to_upload'))
|
->title(trans('admin/log.actions.failed_to_upload'))
|
||||||
->body(trans('admin/log.actions.filed_to_upload', ['status' => $response->status()]))
|
->body(trans('admin/log.actions.failed_to_upload_description', ['status' => $response->status()]))
|
||||||
->danger()
|
->danger()
|
||||||
->send();
|
->send();
|
||||||
|
|
||||||
@ -109,7 +109,7 @@ class ListLogs extends BaseListLogs
|
|||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title(trans('admin/log.actions.filed_to_upload'))
|
->title(trans('admin/log.actions.failed_to_upload'))
|
||||||
->body($e->getMessage())
|
->body($e->getMessage())
|
||||||
->danger()
|
->danger()
|
||||||
->send();
|
->send();
|
||||||
|
|||||||
@ -27,9 +27,9 @@ class ViewLogs extends BaseViewLog
|
|||||||
->requiresConfirmation()
|
->requiresConfirmation()
|
||||||
->tooltip(trans('admin/log.actions.upload_tooltip', ['url' => 'logs.pelican.dev']))
|
->tooltip(trans('admin/log.actions.upload_tooltip', ['url' => 'logs.pelican.dev']))
|
||||||
->modalHeading(trans('admin/log.actions.upload_logs'))
|
->modalHeading(trans('admin/log.actions.upload_logs'))
|
||||||
->modalDescription(trans('admin/log.actions.upload_logs_description', ['file' => $this->record->date, 'url' => 'https://logs.pelican.dev']))
|
->modalDescription(trans('admin/log.actions.upload_logs_description', ['file' => $this->record['date'], 'url' => 'https://logs.pelican.dev']))
|
||||||
->action(function () {
|
->action(function () {
|
||||||
$logPath = storage_path('logs/' . $this->record->date);
|
$logPath = storage_path('logs/' . $this->record['date']);
|
||||||
|
|
||||||
if (!file_exists($logPath)) {
|
if (!file_exists($logPath)) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
@ -46,9 +46,9 @@ class ViewLogs extends BaseViewLog
|
|||||||
$uploadLines = $totalLines <= 1000 ? $lines : array_slice($lines, -1000);
|
$uploadLines = $totalLines <= 1000 ? $lines : array_slice($lines, -1000);
|
||||||
$content = implode("\n", $uploadLines);
|
$content = implode("\n", $uploadLines);
|
||||||
|
|
||||||
$hbUrl = 'https://logs.pelican.dev';
|
$logUrl = 'https://logs.pelican.dev';
|
||||||
try {
|
try {
|
||||||
$response = Http::timeout(10)->asMultipart()->post($hbUrl, [
|
$response = Http::timeout(10)->asMultipart()->post($logUrl, [
|
||||||
[
|
[
|
||||||
'name' => 'c',
|
'name' => 'c',
|
||||||
'contents' => $content,
|
'contents' => $content,
|
||||||
@ -61,8 +61,8 @@ class ViewLogs extends BaseViewLog
|
|||||||
|
|
||||||
if ($response->failed()) {
|
if ($response->failed()) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title(trans('admin/log.actions.filed_to_upload'))
|
->title(trans('admin/log.actions.failed_to_upload'))
|
||||||
->body(trans('admin/log.actions.filed_to_upload', ['status' => $response->status()]))
|
->body(trans('admin/log.actions.failed_to_upload_description', ['status' => $response->status()]))
|
||||||
->danger()
|
->danger()
|
||||||
->send();
|
->send();
|
||||||
|
|
||||||
@ -87,7 +87,7 @@ class ViewLogs extends BaseViewLog
|
|||||||
|
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
Notification::make()
|
Notification::make()
|
||||||
->title(trans('admin/log.actions.filed_to_upload'))
|
->title(trans('admin/log.actions.failed_to_upload'))
|
||||||
->body($e->getMessage())
|
->body($e->getMessage())
|
||||||
->danger()
|
->danger()
|
||||||
->send();
|
->send();
|
||||||
|
|||||||
4
composer.lock
generated
4
composer.lock
generated
@ -15329,7 +15329,7 @@
|
|||||||
"prefer-stable": true,
|
"prefer-stable": true,
|
||||||
"prefer-lowest": false,
|
"prefer-lowest": false,
|
||||||
"platform": {
|
"platform": {
|
||||||
"php": "^8.3 || ^8.4",
|
"php": "^8.2 || ^8.3 || ^8.4",
|
||||||
"ext-intl": "*",
|
"ext-intl": "*",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
@ -15338,7 +15338,7 @@
|
|||||||
},
|
},
|
||||||
"platform-dev": {},
|
"platform-dev": {},
|
||||||
"platform-overrides": {
|
"platform-overrides": {
|
||||||
"php": "8.3"
|
"php": "8.2"
|
||||||
},
|
},
|
||||||
"plugin-api-version": "2.6.0"
|
"plugin-api-version": "2.6.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@ return [
|
|||||||
'view_logs' => 'View Logs',
|
'view_logs' => 'View Logs',
|
||||||
'log_not_found' => 'Log not found!',
|
'log_not_found' => 'Log not found!',
|
||||||
'log_not_found_description' => 'Could not find log for :filename',
|
'log_not_found_description' => 'Could not find log for :filename',
|
||||||
'filed_to_upload' => 'Filed to upload.',
|
'failed_to_upload' => 'Filed to upload.',
|
||||||
'failed_to_upload_description' => 'HTTP Status: :status',
|
'failed_to_upload_description' => 'HTTP Status: :status',
|
||||||
'log_upload' => 'Log Uploaded!',
|
'log_upload' => 'Log Uploaded!',
|
||||||
'log_upload_action' => 'View Log',
|
'log_upload_action' => 'View Log',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user