From 7b562e61128f602fad70a163eecaa9552f0d33eb Mon Sep 17 00:00:00 2001 From: "allen.yan" Date: Tue, 17 Jun 2025 12:40:49 +0800 Subject: [PATCH] =?UTF-8?q?=E5=96=AE=E6=A9=9F=E7=89=88=20v0.0.0=20?= =?UTF-8?q?=E5=8A=A0=E5=85=A5=20=E6=AD=8C=E6=9B=B2=E5=88=97=E8=A1=A8?= =?UTF-8?q?=E5=8A=A0=E4=B8=8A=E5=90=8C=E6=AD=A5=2020250617?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app/Livewire/Forms/SongForm.php | 13 ++++++++++++- resources/views/livewire/header/song.blade.php | 7 +++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/app/Livewire/Forms/SongForm.php b/app/Livewire/Forms/SongForm.php index f647887..18f66a3 100644 --- a/app/Livewire/Forms/SongForm.php +++ b/app/Livewire/Forms/SongForm.php @@ -12,12 +12,13 @@ use App\Enums\SongLanguageType; use App\Enums\SongSituation; use App\Models\Song; use App\Models\SongCategory; +use App\Jobs\ExportSqliteSongLibraryCacheJob; class SongForm extends Component { use WireUiActions; - protected $listeners = ['openModal','closeModal', 'deleteSong']; + protected $listeners = ['openModal','closeModal', 'deleteSong','synchronous']; public bool $canCreate; public bool $canEdit; @@ -90,6 +91,16 @@ class SongForm extends Component $this->resetFields(); $this->showModal = false; } + public function synchronous(): void + { + ExportSqliteSongLibraryCacheJob::dispatch(); + + $this->notification()->send([ + 'icon' => 'success', + 'title' => '歌庫_Cache 同步', + 'description' => '已經加入排程', + ]); + } public function save() { diff --git a/resources/views/livewire/header/song.blade.php b/resources/views/livewire/header/song.blade.php index 6453903..51b3be7 100644 --- a/resources/views/livewire/header/song.blade.php +++ b/resources/views/livewire/header/song.blade.php @@ -12,4 +12,11 @@ label="{{ __('songs.ImportData') }}" class="bg-green-600 text-white" /> + + \ No newline at end of file