單機版 v0.0.0

加入 歌曲列表加上同步
20250617
This commit is contained in:
allen.yan 2025-06-17 12:40:49 +08:00
parent 424739eea5
commit 7b562e6112
2 changed files with 19 additions and 1 deletions

View File

@ -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()
{

View File

@ -12,4 +12,11 @@
label="{{ __('songs.ImportData') }}"
class="bg-green-600 text-white"
/>
<x-wireui:button
wire:click="$dispatchTo('forms.song-form','synchronous')"
icon="document-plus"
label="同步歌庫"
class="bg-green-600 text-white"
/>
</x-admin.section-header>