From a1143254254715d8eef48ebde4dbcdc2d9d9b463 Mon Sep 17 00:00:00 2001 From: Artem Darius Weber Date: Mon, 9 Dec 2024 13:54:12 +0300 Subject: [PATCH] refactor history view to use Livewire component for dynamic updates; add navigation links for upload and processing history --- app/Http/Livewire/History.php | 28 ++++++++++++++ resources/views/history/index.blade.php | 43 +--------------------- resources/views/livewire/history.blade.php | 40 ++++++++++++++++++++ resources/views/navigation-menu.blade.php | 18 ++++++++- 4 files changed, 87 insertions(+), 42 deletions(-) create mode 100644 app/Http/Livewire/History.php create mode 100644 resources/views/livewire/history.blade.php diff --git a/app/Http/Livewire/History.php b/app/Http/Livewire/History.php new file mode 100644 index 0000000..0f7a725 --- /dev/null +++ b/app/Http/Livewire/History.php @@ -0,0 +1,28 @@ + '$refresh']; + + public function mount() + { + $this->loadHistories(); + } + + public function loadHistories() + { + $this->histories = ProcessHistories::orderBy('id', 'desc')->get(); + } + + public function render() + { + return view('livewire.history'); + } +} diff --git a/resources/views/history/index.blade.php b/resources/views/history/index.blade.php index a28bdc5..7d93609 100644 --- a/resources/views/history/index.blade.php +++ b/resources/views/history/index.blade.php @@ -3,44 +3,5 @@ История обработок -
-

История обработок

- - - - - - - - - - - - - - @foreach($histories as $h) - - - - - - - - - - @endforeach - -
IDИзображенияStep файлВремя началаВремя окончанияОбработаноЗатраты времени (сек)
{{ $h->id }} - @foreach($h->images as $img) -
{{ $img['original_name'] }} ({{ $img['path'] }})
- @endforeach -
{{ $h->step_file_name }}{{ $h->started_at }}{{ $h->finished_at }}{{ $h->processed_count }}/3 - @if($h->stages_timing) - Очередь: {{ $h->stages_timing['queue_wait_time'] ?? 'N/A' }}
- Загрузка: {{ $h->stages_timing['upload_time'] ?? 'N/A' }}
- Обработка: {{ $h->stages_timing['processing_time'] ?? 'N/A' }}
- Сохранение: {{ $h->stages_timing['saving_time'] ?? 'N/A' }}
- @endif -
-
- \ No newline at end of file + + diff --git a/resources/views/livewire/history.blade.php b/resources/views/livewire/history.blade.php new file mode 100644 index 0000000..98f1c39 --- /dev/null +++ b/resources/views/livewire/history.blade.php @@ -0,0 +1,40 @@ +
+

История обработок

+ + + + + + + + + + + + + + @foreach($histories as $h) + + + + + + + + + + @endforeach + +
IDИзображенияStep файлВремя началаВремя окончанияОбработаноЗатраты времени (сек)
{{ $h->id }} + @foreach($h->images as $img) +
{{ $img['original_name'] }} ({{ $img['path'] }})
+ @endforeach +
{{ $h->step_file_name }}{{ $h->started_at }}{{ $h->finished_at }}{{ $h->processed_count }}/3 + @if($h->stages_timing) + Очередь: {{ $h->stages_timing['queue_wait_time'] ?? 'N/A' }}
+ Загрузка: {{ $h->stages_timing['upload_time'] ?? 'N/A' }}
+ Обработка: {{ $h->stages_timing['processing_time'] ?? 'N/A' }}
+ Сохранение: {{ $h->stages_timing['saving_time'] ?? 'N/A' }}
+ @endif +
+
diff --git a/resources/views/navigation-menu.blade.php b/resources/views/navigation-menu.blade.php index 9ce13ca..cab8a78 100644 --- a/resources/views/navigation-menu.blade.php +++ b/resources/views/navigation-menu.blade.php @@ -15,7 +15,15 @@ {{ __('Dashboard') }} - + + + {{ __('Upload Images') }} + + + + {{ __('Processing History') }} + +