Compare commits
2 Commits
40fbeb6a63
...
ef865b50e1
Author | SHA1 | Date | |
---|---|---|---|
ef865b50e1 | |||
d7854a9905 |
89
app/Console/Commands/CheckFtpSongs.php
Normal file
89
app/Console/Commands/CheckFtpSongs.php
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
use Illuminate\Support\Str;
|
||||||
|
use App\Models\Song;
|
||||||
|
|
||||||
|
class CheckFtpSongs extends Command
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* The name and signature of the console command.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $signature = 'songs:check-ftp {disk : 如 DISK01,或 ALL 依序處理多個 DISK}';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* The console command description.
|
||||||
|
*
|
||||||
|
* @var string
|
||||||
|
*/
|
||||||
|
protected $description = '比對 songs.filename 與 FTP 檔案,找出缺失 / 多餘檔案';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Execute the console command.
|
||||||
|
*/
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$inputDisk = strtoupper($this->argument('disk'));
|
||||||
|
|
||||||
|
$disks = ($inputDisk === 'ALL')
|
||||||
|
? ['DISK01', 'DISK02', 'DISK03', 'DISK04', 'DISK05', 'DISK09', 'DISK10']
|
||||||
|
: [$inputDisk];
|
||||||
|
foreach ($disks as $diskName) {
|
||||||
|
$this->info("========== 🔍 處理 {$diskName} ==========");
|
||||||
|
|
||||||
|
$folder = $diskName;
|
||||||
|
$prefix = $diskName;
|
||||||
|
|
||||||
|
$this->processDisk($folder, $prefix);
|
||||||
|
$this->newLine();
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->info('🎉 所有比對完成!');
|
||||||
|
return self::SUCCESS;
|
||||||
|
}
|
||||||
|
protected function processDisk(string $folder, string $prefix): void
|
||||||
|
{
|
||||||
|
$disk = Storage::disk('ftp_test');
|
||||||
|
|
||||||
|
$this->info("📂 FTP 目錄: {$folder}");
|
||||||
|
$this->info("🎯 DB prefix: {$prefix}");
|
||||||
|
|
||||||
|
// 1) 取得 FTP 檔案清單
|
||||||
|
$this->info('🔍 取得 FTP 檔案列表…');
|
||||||
|
$ftpPaths = collect($disk->allFiles($folder))
|
||||||
|
->map(fn ($p) => strtolower(str_replace('\\', '/', ltrim($p, '/'))))
|
||||||
|
->filter(fn ($p) => Str::startsWith($p, strtolower($prefix)))
|
||||||
|
->unique()
|
||||||
|
->values();
|
||||||
|
|
||||||
|
$this->info("✅ FTP 檔案數:{$ftpPaths->count()}");
|
||||||
|
|
||||||
|
// 2) 資料庫 songs.filename
|
||||||
|
$this->info('🗃️ 讀取資料庫 songs.filename…');
|
||||||
|
$dbPaths = Song::query()
|
||||||
|
->when($prefix, fn ($q) => $q->where('filename', 'like', $prefix . '%'))
|
||||||
|
->pluck('filename')
|
||||||
|
->map(fn ($p) => strtolower(str_replace('\\', '/', $p)))
|
||||||
|
->unique()
|
||||||
|
->values();
|
||||||
|
|
||||||
|
$this->info("✅ DB 記錄數:{$dbPaths->count()}");
|
||||||
|
|
||||||
|
// 3) 比對
|
||||||
|
$missing = $dbPaths->diff($ftpPaths);
|
||||||
|
$extra = $ftpPaths->diff($dbPaths);
|
||||||
|
|
||||||
|
// 4) 結果
|
||||||
|
$this->warn("❌ 缺失檔案(DB 有 / FTP 無):{$missing->count()}");
|
||||||
|
$missing->each(fn ($p) => $this->line(" - $p"));
|
||||||
|
|
||||||
|
$this->info("⚠️ 多餘檔案(FTP 有 / DB 無):{$extra->count()}");
|
||||||
|
$extra->take(20)->each(fn ($p) => $this->line(" - $p"));
|
||||||
|
if ($extra->count() > 20) $this->line(' …其餘省略');
|
||||||
|
}
|
||||||
|
}
|
40
app/Console/Commands/TestFtpConnection.php
Normal file
40
app/Console/Commands/TestFtpConnection.php
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Console\Commands;
|
||||||
|
|
||||||
|
use Illuminate\Console\Command;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
|
class TestFtpConnection extends Command
|
||||||
|
{
|
||||||
|
protected $signature = 'ftp:test';
|
||||||
|
protected $description = '測試 FTP 連線、上傳、下載、刪除';
|
||||||
|
|
||||||
|
public function handle()
|
||||||
|
{
|
||||||
|
$disk = Storage::disk('ftp_test');
|
||||||
|
$testFile = 'laravel_ftp_test.txt';
|
||||||
|
$testContent = '這是 Laravel 的 FTP 測試檔案';
|
||||||
|
|
||||||
|
// 嘗試上傳
|
||||||
|
$this->info("🔼 上傳中...");
|
||||||
|
if (!$disk->put($testFile, $testContent)) {
|
||||||
|
return $this->error("❌ 上傳失敗");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 嘗試讀取
|
||||||
|
$this->info("📥 下載檢查...");
|
||||||
|
$content = $disk->get($testFile);
|
||||||
|
if ($content !== $testContent) {
|
||||||
|
return $this->error("❌ 檔案內容不符");
|
||||||
|
}
|
||||||
|
|
||||||
|
// 嘗試刪除
|
||||||
|
$this->info("🗑️ 刪除測試檔案...");
|
||||||
|
if (!$disk->delete($testFile)) {
|
||||||
|
return $this->error("❌ 刪除失敗");
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->info("✅ FTP 測試成功!");
|
||||||
|
}
|
||||||
|
}
|
60
app/Enums/SongLanguageType.php
Normal file
60
app/Enums/SongLanguageType.php
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Enums;
|
||||||
|
|
||||||
|
use App\Enums\Traits\HasLabels;
|
||||||
|
|
||||||
|
enum SongLanguageType: string
|
||||||
|
{
|
||||||
|
use HasLabels;
|
||||||
|
|
||||||
|
case Mandarin = '國語';
|
||||||
|
case Taiwanese = '台語';
|
||||||
|
case English = '英語';
|
||||||
|
case Japanese = '日語';
|
||||||
|
case Cantonese = '粵語';
|
||||||
|
case Korean = '韓語';
|
||||||
|
case Vietnamese = '越語';
|
||||||
|
case Hakka = '客語';
|
||||||
|
case Other = '其他';
|
||||||
|
|
||||||
|
// 返回對應的顯示文字
|
||||||
|
public function labels(): string
|
||||||
|
{
|
||||||
|
return match($this) {
|
||||||
|
self::Mandarin => __('enums.LanguageType.Mandarin'),
|
||||||
|
self::Taiwanese => __('enums.LanguageType.Taiwanese'),
|
||||||
|
self::English => __('enums.LanguageType.English'),
|
||||||
|
self::Japanese => __('enums.LanguageType.Japanese'),
|
||||||
|
self::Cantonese => __('enums.LanguageType.Cantonese'),
|
||||||
|
self::Korean => __('enums.LanguageType.Korean'),
|
||||||
|
self::Vietnamese => __('enums.LanguageType.Vietnamese'),
|
||||||
|
self::Hakka => __('enums.LanguageType.Hakka'),
|
||||||
|
self::Other => __('enums.LanguageType.Other'),
|
||||||
|
};
|
||||||
|
}
|
||||||
|
public static function fromLabelOrName(string $input): self
|
||||||
|
{
|
||||||
|
$aliasMap = [
|
||||||
|
'英文' => '英語',
|
||||||
|
'華語' => '國語',
|
||||||
|
'普通話' => '國語',
|
||||||
|
'台灣話' => '台語',
|
||||||
|
'客家話' => '客語',
|
||||||
|
];
|
||||||
|
// 將別名轉為正式值
|
||||||
|
$input = $aliasMap[$input] ?? $input;
|
||||||
|
foreach (self::cases() as $case) {
|
||||||
|
if ($case->value === $input || $case->name === $input) {
|
||||||
|
return $case;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return self::Unset;
|
||||||
|
}
|
||||||
|
public static function options(): array
|
||||||
|
{
|
||||||
|
return collect(self::cases())
|
||||||
|
->mapWithKeys(fn($case) => [$case->value => $case->labels()])
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
|
}
|
@ -108,7 +108,8 @@ class RoomSongController extends Controller
|
|||||||
$response = (new MachineStatusForwarder(
|
$response = (new MachineStatusForwarder(
|
||||||
$roomSession->room->branch->external_ip,
|
$roomSession->room->branch->external_ip,
|
||||||
"/api/room/sync-order-song",
|
"/api/room/sync-order-song",
|
||||||
$validated
|
$validated,
|
||||||
|
Auth::user()->api_plain_token
|
||||||
))->forward();
|
))->forward();
|
||||||
}
|
}
|
||||||
public function syncOrderSong(SyncOrderSongRequest $request)
|
public function syncOrderSong(SyncOrderSongRequest $request)
|
||||||
|
@ -179,7 +179,8 @@ class RoomControlController extends Controller
|
|||||||
$response = (new MachineStatusForwarder(
|
$response = (new MachineStatusForwarder(
|
||||||
$branch->external_ip,
|
$branch->external_ip,
|
||||||
"/api/room/session",
|
"/api/room/session",
|
||||||
$validated
|
$validated,
|
||||||
|
Auth::user()->api_plain_token
|
||||||
))->forward();
|
))->forward();
|
||||||
return ApiResponse::success([
|
return ApiResponse::success([
|
||||||
'room' => $room->latestSession,
|
'room' => $room->latestSession,
|
||||||
@ -269,13 +270,12 @@ class RoomControlController extends Controller
|
|||||||
$room->log_message='HeartBeat';
|
$room->log_message='HeartBeat';
|
||||||
$room->touch(); // 更新 updated_at
|
$room->touch(); // 更新 updated_at
|
||||||
$room->save();
|
$room->save();
|
||||||
$response = (
|
$response = (new MachineStatusForwarder(
|
||||||
new MachineStatusForwarder(
|
|
||||||
$branch->external_ip ?? '',
|
$branch->external_ip ?? '',
|
||||||
'/api/room/receiveSwitch',
|
'/api/room/receiveSwitch',
|
||||||
(new RoomResource($room->refresh()))->toArray(request())
|
(new RoomResource($room->refresh()))->toArray(request()),
|
||||||
)
|
Auth::user()->api_plain_token
|
||||||
)->forward();
|
))->forward();
|
||||||
return ApiResponse::success([
|
return ApiResponse::success([
|
||||||
'data' => MachineStatus::create($validated),
|
'data' => MachineStatus::create($validated),
|
||||||
]);
|
]);
|
||||||
@ -382,7 +382,8 @@ class RoomControlController extends Controller
|
|||||||
$response = (new MachineStatusForwarder(
|
$response = (new MachineStatusForwarder(
|
||||||
$branch->external_ip,
|
$branch->external_ip,
|
||||||
"/api/room/receiveSwitch",
|
"/api/room/receiveSwitch",
|
||||||
(new RoomResource($room->refresh()))->toArray(request())
|
(new RoomResource($room->refresh()))->toArray(request()),
|
||||||
|
Auth::user()->api_plain_token
|
||||||
))->forward();
|
))->forward();
|
||||||
return $validated['command']==='error' ? ApiResponse::error('機房控制失敗') : ApiResponse::success($room);
|
return $validated['command']==='error' ? ApiResponse::error('機房控制失敗') : ApiResponse::success($room);
|
||||||
}
|
}
|
||||||
|
36
app/Http/Middleware/ApiTokenMiddleware.php
Normal file
36
app/Http/Middleware/ApiTokenMiddleware.php
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Middleware;
|
||||||
|
|
||||||
|
use Closure;
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
|
use App\Models\User; // 如果你的 Token 存在 user table
|
||||||
|
|
||||||
|
class ApiTokenMiddleware
|
||||||
|
{
|
||||||
|
public function handle(Request $request, Closure $next)
|
||||||
|
{
|
||||||
|
$token = $request->bearerToken();
|
||||||
|
if (!$token) {
|
||||||
|
return response()->json(['error' => 'Missing token'], 401);
|
||||||
|
}
|
||||||
|
$response = Http::withToken($token)
|
||||||
|
->withOptions(['verify' => false])
|
||||||
|
->post('https://ktv.test/api/token/validate');
|
||||||
|
|
||||||
|
if ($response->failed() || !$response->json('valid')) {
|
||||||
|
return response()->json(['error' => 'Invalid token'], 401);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
$user = User::where('api_plain_token', $token)->first();
|
||||||
|
if (!$user) {
|
||||||
|
return response()->json(['message' => 'Invalid token'], 401);
|
||||||
|
}
|
||||||
|
|
||||||
|
$request->setUserResolver(fn() => $user);
|
||||||
|
|
||||||
|
return $next($request);
|
||||||
|
}
|
||||||
|
}
|
@ -1,16 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Livewire\Admin;
|
|
||||||
|
|
||||||
use Livewire\Component;
|
|
||||||
use Illuminate\Support\Facades\Auth;
|
|
||||||
|
|
||||||
class Dashboard extends Component
|
|
||||||
{
|
|
||||||
public function render()
|
|
||||||
{
|
|
||||||
$user = Auth::user();
|
|
||||||
|
|
||||||
return view('livewire.admin.dashboard', compact('user'));
|
|
||||||
}
|
|
||||||
}
|
|
60
app/Livewire/Layout/Navigation.php
Normal file
60
app/Livewire/Layout/Navigation.php
Normal file
@ -0,0 +1,60 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Layout;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
use App\Livewire\Actions\Logout;
|
||||||
|
|
||||||
|
class Navigation extends Component
|
||||||
|
{
|
||||||
|
private array $commonMenus = [
|
||||||
|
['name' => '首頁', 'route' => 'welcome'],
|
||||||
|
['name' => '新歌快報', 'route' => 'new-songs'],
|
||||||
|
['name' => '熱門排行', 'route' => 'top-ranking'],
|
||||||
|
['name' => '歌名查詢', 'route' => 'search-song'],
|
||||||
|
];
|
||||||
|
private array $roomMenus = [
|
||||||
|
['name' => '已點歌曲', 'route' => 'clicked-song'],
|
||||||
|
['name' => '聲音控制', 'route' => 'sound-control'],
|
||||||
|
['name' => '真情告白', 'route' => 'love-message'],
|
||||||
|
];
|
||||||
|
public array $adminmenus=[
|
||||||
|
['name' => '操作紀錄', 'route' => 'admin.activity-log', 'icon' => 'clock', 'permission' => null],
|
||||||
|
['name' => '包廂狀態紀錄', 'route' => 'admin.room-status-log', 'icon' => 'clock', 'permission' => null],
|
||||||
|
['name' => '設備狀態紀錄', 'route' => 'admin.machine-status', 'icon' => 'clock', 'permission' => null],
|
||||||
|
['name' => '使用者列表', 'route' => 'admin.users', 'icon' => 'user-circle', 'permission' => 'user-list'],
|
||||||
|
['name' => 'Room', 'route' => 'admin.rooms', 'icon' => 'building-library', 'permission' => 'room-list'],
|
||||||
|
['name' => 'RoomGrid', 'route' => 'admin.room-grids', 'icon' => 'film', 'permission' => 'room-list'],
|
||||||
|
['name' => '文字廣告', 'route' => 'admin.text-ads', 'icon' => 'megaphone', 'permission' => 'text-ad-list'],
|
||||||
|
['name' => '文字公告', 'route' => 'admin.broadcast-templates', 'icon' => 'megaphone', 'permission' => 'broadcast-list'],
|
||||||
|
];
|
||||||
|
public array $menus = [];
|
||||||
|
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
// 先放共用的
|
||||||
|
$this->menus = $this->commonMenus;
|
||||||
|
|
||||||
|
// 如果有 room_code,再合併
|
||||||
|
if (session()->has('room_code')) {
|
||||||
|
$this->menus = array_merge($this->menus, $this->roomMenus);
|
||||||
|
}
|
||||||
|
if (auth()->check()) {
|
||||||
|
$user = auth()->user();
|
||||||
|
foreach ($this->adminmenus as $menu)
|
||||||
|
if (!$menu['permission'] || $user->can($menu['permission']))
|
||||||
|
$this->menus[] = $menu;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function logout(Logout $logout)
|
||||||
|
{
|
||||||
|
$logout();
|
||||||
|
return redirect('/');
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.layout.navigation');
|
||||||
|
}
|
||||||
|
}
|
44
app/Livewire/Modals/StickerModal.php
Normal file
44
app/Livewire/Modals/StickerModal.php
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Modals;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class StickerModal extends Component
|
||||||
|
{
|
||||||
|
protected $listeners = [
|
||||||
|
'openModal','closeModal'
|
||||||
|
];
|
||||||
|
public bool $showModal = false;
|
||||||
|
public $selectedSticker = null;
|
||||||
|
public $stickers = [];
|
||||||
|
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
$this->stickers = collect(glob(storage_path('app/public/superstar-pic/*.png')))
|
||||||
|
//->map(fn($path) => 'superstar-pic/' . basename($path))
|
||||||
|
->map(fn($path) => basename($path))
|
||||||
|
->toArray();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function openModal()
|
||||||
|
{
|
||||||
|
$this->showModal = true;
|
||||||
|
}
|
||||||
|
public function closeModal()
|
||||||
|
{
|
||||||
|
$this->showModal = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function select($sticker)
|
||||||
|
{
|
||||||
|
$this->dispatch('stickerSelected', $sticker);
|
||||||
|
$this->selectedSticker =$sticker;
|
||||||
|
$this->showModal = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.modals.sticker-modal');
|
||||||
|
}
|
||||||
|
}
|
25
app/Livewire/Pages/Home.php
Normal file
25
app/Livewire/Pages/Home.php
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Pages;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class Home extends Component
|
||||||
|
{
|
||||||
|
public $roomCode;
|
||||||
|
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
// 先從 URL 取得 room_code,再存進 session
|
||||||
|
//session()->forget('room_code');
|
||||||
|
$this->roomCode = request()->query('room_code', session('room_code', null));
|
||||||
|
if ($this->roomCode) {
|
||||||
|
session(['room_code' => $this->roomCode]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.pages.home');
|
||||||
|
}
|
||||||
|
}
|
38
app/Livewire/Pages/LoveMessage.php
Normal file
38
app/Livewire/Pages/LoveMessage.php
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Pages;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class LoveMessage extends Component
|
||||||
|
{
|
||||||
|
protected $listeners = ['stickerSelected' => 'handleSticker'];
|
||||||
|
public $message = '';
|
||||||
|
public $selectedSticker=null;
|
||||||
|
|
||||||
|
public function handleSticker($sticker)
|
||||||
|
{
|
||||||
|
$this->selectedSticker = $sticker;
|
||||||
|
}
|
||||||
|
public function submitMessage()
|
||||||
|
{
|
||||||
|
// 實際存留言時,可同時存貼圖
|
||||||
|
$data = [
|
||||||
|
'message' => $this->message,
|
||||||
|
'sticker' => $this->selectedSticker,
|
||||||
|
'user' => auth()->user()?->name ?? '訪客',
|
||||||
|
];
|
||||||
|
// 存到資料庫或送到 API
|
||||||
|
// ...
|
||||||
|
session()->flash('success', '留言已送出!');
|
||||||
|
|
||||||
|
// 重置
|
||||||
|
$this->message = '';
|
||||||
|
$this->selectedSticker = null;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.pages.love-message');
|
||||||
|
}
|
||||||
|
}
|
58
app/Livewire/Pages/OrderedSongList.php
Normal file
58
app/Livewire/Pages/OrderedSongList.php
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Pages;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
use Illuminate\Database\Eloquent\Collection as EloquentCollection;
|
||||||
|
use App\Models\RoomSession;
|
||||||
|
use App\Models\OrderedSong;
|
||||||
|
|
||||||
|
class OrderedSongList extends Component
|
||||||
|
{
|
||||||
|
public ?string $roomSessionId = null;
|
||||||
|
|
||||||
|
public EloquentCollection $playing ;
|
||||||
|
public EloquentCollection $nextSong ;
|
||||||
|
public EloquentCollection $finished ;
|
||||||
|
|
||||||
|
|
||||||
|
public function mount()
|
||||||
|
{
|
||||||
|
$this->playing = new EloquentCollection();
|
||||||
|
$this->nextSong = new EloquentCollection();
|
||||||
|
$this->finished = new EloquentCollection();
|
||||||
|
$roomSession = $this->getRoomSession(session('room_code'))?->id ;
|
||||||
|
if ($roomSession) {
|
||||||
|
$this->roomSessionId = $roomSession->id;
|
||||||
|
$this->loadSongs($this->roomSessionId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
private function getRoomSession($apiToken): ?RoomSession
|
||||||
|
{
|
||||||
|
if (!$apiToken) return null;
|
||||||
|
return RoomSession::where('api_token', $apiToken)
|
||||||
|
->whereIn('status', ['active', 'maintain'])
|
||||||
|
->first();
|
||||||
|
}
|
||||||
|
|
||||||
|
public function refreshSongs()
|
||||||
|
{
|
||||||
|
if ($this->roomSessionId) {
|
||||||
|
$this->loadSongs($this->roomSessionId);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
protected function loadSongs(string $roomSessionId)
|
||||||
|
{
|
||||||
|
$this->playing = OrderedSong::forSession($roomSessionId)->playing()->get();
|
||||||
|
$this->nextSong = OrderedSong::forSession($roomSessionId)->nextSong()->get();
|
||||||
|
$this->finished = OrderedSong::forSession($roomSessionId)->finished()->get();
|
||||||
|
}
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.pages.ordered-song-list', [
|
||||||
|
'playing' => $this->playing,
|
||||||
|
'nextSong' => $this->nextSong,
|
||||||
|
'finished' => $this->finished,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
105
app/Livewire/Pages/SearchSong.php
Normal file
105
app/Livewire/Pages/SearchSong.php
Normal file
@ -0,0 +1,105 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Pages;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
use App\Models\Artist;
|
||||||
|
use App\Models\SongLibraryCache;
|
||||||
|
|
||||||
|
class SearchSong extends Component
|
||||||
|
{
|
||||||
|
public string $search = '';
|
||||||
|
public $searchCategory = '';
|
||||||
|
public $selectedLanguage = '國語'; // 預設語言
|
||||||
|
public $selectedArtists = []; // 儲存已選的歌手 id
|
||||||
|
public $artistOptions = []; // API 回傳的搜尋結果
|
||||||
|
public string $artistSearch = ''; // 即時搜尋文字
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 初始化(接收外部傳入的分類參數)
|
||||||
|
*/
|
||||||
|
public function mount(string $searchCategory = '')
|
||||||
|
{
|
||||||
|
$this->searchCategory = $searchCategory;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 切換語言標籤
|
||||||
|
*/
|
||||||
|
public function selectLanguage(string $lang): void
|
||||||
|
{
|
||||||
|
$this->selectedLanguage = $lang;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* 搜尋歌手(透過 API)
|
||||||
|
*/
|
||||||
|
public function updatedArtistSearch()
|
||||||
|
{
|
||||||
|
$search = $this->artistSearch;
|
||||||
|
|
||||||
|
if ($search) {
|
||||||
|
// 即時搜尋歌手,從資料庫查詢
|
||||||
|
$this->artistOptions = \App\Models\Artist::query()
|
||||||
|
->where('name', 'like', "{$search}%")
|
||||||
|
->limit(100)
|
||||||
|
->get(['id', 'name'])
|
||||||
|
->toArray();
|
||||||
|
} else {
|
||||||
|
$this->artistOptions = [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
public function addArtist($id, $name)
|
||||||
|
{
|
||||||
|
$this->selectedArtists[$id] = $name;
|
||||||
|
$this->artistSearch = ''; // 清空搜尋框
|
||||||
|
$this->artistOptions = [];
|
||||||
|
}
|
||||||
|
|
||||||
|
public function removeArtist($id)
|
||||||
|
{
|
||||||
|
unset($this->selectedArtists[$id]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 點歌
|
||||||
|
*/
|
||||||
|
public function orderSong(int $songId): void
|
||||||
|
{
|
||||||
|
// TODO: 加入已點歌曲邏輯,例如:
|
||||||
|
// auth()->user()->room->addSong($songId);
|
||||||
|
|
||||||
|
$this->dispatchBrowserEvent('notify', [
|
||||||
|
'message' => '已加入已點歌曲'
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 取得歌曲清單
|
||||||
|
*/
|
||||||
|
protected function loadSongs()
|
||||||
|
{
|
||||||
|
return SongLibraryCache::query()
|
||||||
|
->when($this->search, fn($q) => $q->where('song_name', 'like', "{$this->search}%"))
|
||||||
|
->when($this->selectedLanguage, fn($q) => $q->where('language_name', $this->selectedLanguage))
|
||||||
|
->when($this->selectedArtists, fn ($q) => $q->whereHas('artists', fn ($q2) => $q2->whereIn('id', array_keys($this->selectedArtists))))
|
||||||
|
->when($this->searchCategory === 'New', fn($q) => $q->orderByDesc('add_date'))
|
||||||
|
->when($this->searchCategory === 'Hot', fn($q) => $q->orderByDesc('song_counts'), fn($q) => $q->orderByDesc('song_id'))
|
||||||
|
//->take($this->search || $this->artistSearch ? 100 : 1000)
|
||||||
|
->take(1000)
|
||||||
|
->get();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Render
|
||||||
|
*/
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
$songs = $this->loadSongs();
|
||||||
|
|
||||||
|
return view('livewire.pages.search-song', [
|
||||||
|
'songs' => $songs,
|
||||||
|
'languages' => \App\Enums\SongLanguageType::options(),
|
||||||
|
'selectedLanguage' => $this->selectedLanguage,
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
}
|
42
app/Livewire/Pages/SoundControl.php
Normal file
42
app/Livewire/Pages/SoundControl.php
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Livewire\Pages;
|
||||||
|
|
||||||
|
use Livewire\Component;
|
||||||
|
|
||||||
|
class SoundControl extends Component
|
||||||
|
{
|
||||||
|
public $buttons = [
|
||||||
|
['img'=>'音控-01.jpg', 'action'=>'pause'],
|
||||||
|
['img'=>'音控-02.jpg', 'action'=>'volume_up'],
|
||||||
|
['img'=>'音控-04.jpg', 'action'=>'mic_up'],
|
||||||
|
['img'=>'音控-06.jpg', 'action'=>'mute'],
|
||||||
|
['img'=>'音控-03.jpg', 'action'=>'volume_down'],
|
||||||
|
['img'=>'音控-05.jpg', 'action'=>'mic_down'],
|
||||||
|
['img'=>'音控-07.jpg', 'action'=>'original_song'],
|
||||||
|
['img'=>'音控-08.jpg', 'action'=>'service'],
|
||||||
|
['img'=>'音控-09.jpg', 'action'=>'replay'],
|
||||||
|
['img'=>'音控-11.jpg', 'action'=>'male_key'],
|
||||||
|
['img'=>'音控-12.jpg', 'action'=>'female_key'],
|
||||||
|
['img'=>'音控-10.jpg', 'action'=>'cut'],
|
||||||
|
['img'=>'音控-15.jpg', 'action'=>'lower_key'],
|
||||||
|
['img'=>'音控-14.jpg', 'action'=>'standard_key'],
|
||||||
|
['img'=>'音控-13.jpg', 'action'=>'raise_key'],
|
||||||
|
];
|
||||||
|
|
||||||
|
public function sendVolumeControl(string $action)
|
||||||
|
{
|
||||||
|
// 這裡可以加你的 API 或邏輯
|
||||||
|
// 範例:發送到後台控制音量
|
||||||
|
info("Sound control action: ".$action);
|
||||||
|
|
||||||
|
$this->dispatchBrowserEvent('notify', [
|
||||||
|
'message' => "已執行操作: {$action}"
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function render()
|
||||||
|
{
|
||||||
|
return view('livewire.pages.sound-control');
|
||||||
|
}
|
||||||
|
}
|
@ -1,121 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
namespace App\Livewire\Tables;
|
|
||||||
|
|
||||||
use App\Models\SongLibraryCache;
|
|
||||||
use Illuminate\Support\Carbon;
|
|
||||||
use Illuminate\Database\Eloquent\Builder;
|
|
||||||
use PowerComponents\LivewirePowerGrid\Button;
|
|
||||||
use PowerComponents\LivewirePowerGrid\Column;
|
|
||||||
use PowerComponents\LivewirePowerGrid\Facades\Filter;
|
|
||||||
use PowerComponents\LivewirePowerGrid\Facades\PowerGrid;
|
|
||||||
use PowerComponents\LivewirePowerGrid\PowerGridFields;
|
|
||||||
use PowerComponents\LivewirePowerGrid\PowerGridComponent;
|
|
||||||
|
|
||||||
final class SongLibraryCacheTable extends PowerGridComponent
|
|
||||||
{
|
|
||||||
public string $tableName = 'song-library-cache-table';
|
|
||||||
public string $primaryKey = 'song_id';
|
|
||||||
public string $sortField = 'song_id';
|
|
||||||
public bool $useQueryBuilderPagination = true;
|
|
||||||
|
|
||||||
public bool $canDownload;
|
|
||||||
|
|
||||||
public function boot(): void
|
|
||||||
{
|
|
||||||
config(['livewire-powergrid.filter' => 'outside']);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setUp(): array
|
|
||||||
{
|
|
||||||
|
|
||||||
$actions = [];
|
|
||||||
|
|
||||||
$header = PowerGrid::header()
|
|
||||||
->withoutLoading()
|
|
||||||
->showToggleColumns();
|
|
||||||
|
|
||||||
$header->includeViewOnTop('livewire.headers.song-library-cache');
|
|
||||||
|
|
||||||
$actions[]=$header;
|
|
||||||
$actions[]=PowerGrid::footer()->showPerPage()->showRecordCount();
|
|
||||||
return $actions;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function datasource(): Builder
|
|
||||||
{
|
|
||||||
return SongLibraryCache::query()->orderBy('song_id');
|
|
||||||
}
|
|
||||||
|
|
||||||
public function relationSearch(): array
|
|
||||||
{
|
|
||||||
return [];
|
|
||||||
}
|
|
||||||
|
|
||||||
public function fields(): PowerGridFields
|
|
||||||
{
|
|
||||||
return PowerGrid::fields()
|
|
||||||
->add('song_id')
|
|
||||||
->add('song_name')
|
|
||||||
->add('song_simplified')
|
|
||||||
->add('phonetic_abbr')
|
|
||||||
->add('pinyin_abbr')
|
|
||||||
->add('strokes_abbr')
|
|
||||||
->add('song_number')
|
|
||||||
->add('artistA')
|
|
||||||
->add('artistB')
|
|
||||||
->add('artistA_simplified')
|
|
||||||
->add('artistB_simplified')
|
|
||||||
->add('artistA_category')
|
|
||||||
->add('artistB_category')
|
|
||||||
->add('artist_category')
|
|
||||||
->add('song_filename')
|
|
||||||
->add('song_category')
|
|
||||||
->add('language_name')
|
|
||||||
->add('add_date_formatted', fn (SongLibraryCache $model) => Carbon::parse($model->add_date)->format('Y-m-d'))
|
|
||||||
->add('situation')
|
|
||||||
->add('vocal')
|
|
||||||
->add('db_change')
|
|
||||||
->add('song_counts')
|
|
||||||
->add('updated_at_formatted', fn (SongLibraryCache $model) => Carbon::parse($model->updated_at)->format('Y-m-d H:i:s'));
|
|
||||||
}
|
|
||||||
|
|
||||||
public function columns(): array
|
|
||||||
{
|
|
||||||
$column=[];
|
|
||||||
$column[]=Column::make(__('song-library-cache.id'), 'song_id');
|
|
||||||
$column[]=Column::make(__('song-library-cache.name'), 'song_name')->sortable()->searchable();
|
|
||||||
$column[]=Column::make(__('song-library-cache.simplified'), 'song_simplified')->sortable()->searchable()->hidden(true, false);
|
|
||||||
$column[]=Column::make(__('song-library-cache.name.phinetic'), 'phonetic_abbr')->sortable()->searchable()->hidden(true, false);
|
|
||||||
$column[]=Column::make(__('song-library-cache.name.pinyin'), 'pinyin_abbr')->sortable()->searchable()->hidden(true, false);
|
|
||||||
$column[]=Column::make(__('song-library-cache.name.strokes'), 'strokes_abbr')->sortable()->searchable()->hidden(true, false);
|
|
||||||
$column[]=Column::make(__('song-library-cache.name_length'), 'song_number')->sortable()->searchable()->hidden(true, false);
|
|
||||||
$column[]=Column::make(__('song-library-cache.artists').'A', 'artistA')->sortable()->searchable();
|
|
||||||
$column[]=Column::make(__('song-library-cache.artists').'B', 'artistB')->sortable()->searchable();
|
|
||||||
$column[]=Column::make(__('song-library-cache.artists_simplified').'A', 'artistA_simplified')->sortable()->searchable()->hidden(true, false);
|
|
||||||
$column[]=Column::make(__('song-library-cache.artists_simplified').'B', 'artistB_simplified')->sortable()->searchable()->hidden(true, false);
|
|
||||||
$column[]=Column::make(__('song-library-cache.artists_category').'A', 'artistA_category')->sortable()->searchable()->hidden(true, false);
|
|
||||||
$column[]=Column::make(__('song-library-cache.artists_category').'B', 'artistB_category')->sortable()->searchable()->hidden(true, false);
|
|
||||||
$column[]=Column::make(__('song-library-cache.artists_category'), 'artist_category')->sortable()->searchable()->hidden(true, false);
|
|
||||||
$column[]=Column::make(__('song-library-cache.filename'), 'song_filename')->sortable()->searchable();
|
|
||||||
$column[]=Column::make(__('song-library-cache.categorys'), 'song_category')->sortable()->searchable();
|
|
||||||
$column[]=Column::make(__('song-library-cache.language_type'), 'language_name')->sortable()->searchable();
|
|
||||||
$column[]=Column::make(__('song-library-cache.adddate'), 'add_date_formatted', 'add_date')->sortable();
|
|
||||||
$column[]=Column::make(__('song-library-cache.situation'), 'situation')->sortable()->searchable();
|
|
||||||
$column[]=Column::make(__('song-library-cache.vocal'), 'vocal')->sortable()->searchable();
|
|
||||||
$column[]=Column::make(__('song-library-cache.db_change'), 'db_change')->sortable()->searchable();
|
|
||||||
$column[]=Column::make(__('song-library-cache.counts'), 'song_counts')->sortable()->searchable();
|
|
||||||
$column[]=Column::make(__('song-library-cache.updated_at'), 'updated_at_formatted', 'updated_at')->sortable()->hidden(true, false);
|
|
||||||
return $column;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function filters(): array
|
|
||||||
{
|
|
||||||
return [
|
|
||||||
Filter::datepicker('add_date'),
|
|
||||||
Filter::datetimepicker('updated_at'),
|
|
||||||
];
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
@ -38,9 +38,20 @@ class SongLibraryCache extends Model
|
|||||||
'song_counts',
|
'song_counts',
|
||||||
'updated_at',
|
'updated_at',
|
||||||
];
|
];
|
||||||
|
public function users(){
|
||||||
|
return $this->belongsToMany(User::class, 'user_song')->withTimestamps();
|
||||||
|
}
|
||||||
public function str_artists_plus(): string
|
public function str_artists_plus(): string
|
||||||
{
|
{
|
||||||
return ($this->artistB!=null) ? $this->artistA ." + ".$this->artistB :$this->artistA;
|
return ($this->artistB!=null) ? $this->artistA ." + ".$this->artistB :$this->artistA;
|
||||||
}
|
}
|
||||||
|
public function artists(){
|
||||||
|
return $this->belongsToMany(Artist::class);
|
||||||
|
}
|
||||||
|
public function str_categories(){
|
||||||
|
return $this->categories->pluck('name')->implode(', ');
|
||||||
|
}
|
||||||
|
public function categories(){
|
||||||
|
return $this->belongsToMany(SongCategory::class);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,7 +41,8 @@ class User extends Authenticatable
|
|||||||
'birthday',
|
'birthday',
|
||||||
'gender',
|
'gender',
|
||||||
'status',
|
'status',
|
||||||
'password',
|
'email_verified_at',
|
||||||
|
'api_plain_token',
|
||||||
];
|
];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
namespace App\Services;
|
namespace App\Services;
|
||||||
|
|
||||||
use App\Models\User;
|
|
||||||
use Illuminate\Support\Facades\Log;
|
use Illuminate\Support\Facades\Log;
|
||||||
use Illuminate\Http\Client\Response;
|
use Illuminate\Http\Client\Response;
|
||||||
use App\Services\ApiClient;
|
use App\Services\ApiClient;
|
||||||
@ -12,13 +11,14 @@ class MachineStatusForwarder
|
|||||||
protected string $externalUrl;
|
protected string $externalUrl;
|
||||||
protected string $endpoint;
|
protected string $endpoint;
|
||||||
protected array $validated;
|
protected array $validated;
|
||||||
protected ?User $user = null;
|
protected string $apiPlainToken;
|
||||||
|
|
||||||
public function __construct(string $externalUrl, string $endpoint, array $validated)
|
public function __construct(string $externalUrl, string $endpoint, array $validated, string $token=null)
|
||||||
{
|
{
|
||||||
$this->externalUrl = $externalUrl;
|
$this->externalUrl = $externalUrl;
|
||||||
$this->endpoint = $endpoint;
|
$this->endpoint = $endpoint;
|
||||||
$this->validated = $validated;
|
$this->validated = $validated;
|
||||||
|
$this->$apiPlainToken = $token;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function forward(): ?Response
|
public function forward(): ?Response
|
||||||
@ -30,11 +30,9 @@ class MachineStatusForwarder
|
|||||||
$mainDomain = implode('.', array_slice($hostParts, 1));
|
$mainDomain = implode('.', array_slice($hostParts, 1));
|
||||||
|
|
||||||
$mainDomainUrl = "{$parsed['scheme']}://{$mainDomain}";
|
$mainDomainUrl = "{$parsed['scheme']}://{$mainDomain}";
|
||||||
|
$token = $this->api_plain_token ?? User::find(2)?->api_plain_token;
|
||||||
$this->user = User::find(2); // 或用 dependency injection 把 User 帶進來
|
if ($token) {
|
||||||
|
$client = new ApiClient($mainDomainUrl, $token);
|
||||||
if ($this->user && $this->user->api_plain_token) {
|
|
||||||
$client = new ApiClient($mainDomainUrl, $this->user->api_plain_token);
|
|
||||||
$response = $client->post($this->endpoint, $this->validated);
|
$response = $client->post($this->endpoint, $this->validated);
|
||||||
|
|
||||||
/* Log::info('✅ Machine status forwarded', [
|
/* Log::info('✅ Machine status forwarded', [
|
||||||
|
@ -13,6 +13,7 @@ return Application::configure(basePath: dirname(__DIR__))
|
|||||||
)
|
)
|
||||||
->withMiddleware(function (Middleware $middleware) {
|
->withMiddleware(function (Middleware $middleware) {
|
||||||
$middleware->alias([
|
$middleware->alias([
|
||||||
|
'api_token' => \App\Http\Middleware\ApiTokenMiddleware::class,
|
||||||
'role' => \Spatie\Permission\Middleware\RoleMiddleware::class,
|
'role' => \Spatie\Permission\Middleware\RoleMiddleware::class,
|
||||||
'permission' => \Spatie\Permission\Middleware\PermissionMiddleware::class,
|
'permission' => \Spatie\Permission\Middleware\PermissionMiddleware::class,
|
||||||
'role_or_permission' => \Spatie\Permission\Middleware\RoleOrPermissionMiddleware::class
|
'role_or_permission' => \Spatie\Permission\Middleware\RoleOrPermissionMiddleware::class
|
||||||
|
@ -11,6 +11,7 @@
|
|||||||
"laravel/framework": "^12.0",
|
"laravel/framework": "^12.0",
|
||||||
"laravel/sanctum": "^4.1",
|
"laravel/sanctum": "^4.1",
|
||||||
"laravel/tinker": "^2.10.1",
|
"laravel/tinker": "^2.10.1",
|
||||||
|
"league/flysystem-ftp": "^3.29",
|
||||||
"livewire/livewire": "^3.4",
|
"livewire/livewire": "^3.4",
|
||||||
"livewire/volt": "^1.7.0",
|
"livewire/volt": "^1.7.0",
|
||||||
"maatwebsite/excel": "^3.1",
|
"maatwebsite/excel": "^3.1",
|
||||||
|
1130
composer.lock
generated
1130
composer.lock
generated
File diff suppressed because it is too large
Load Diff
@ -60,6 +60,18 @@ return [
|
|||||||
'report' => false,
|
'report' => false,
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'ftp_test' => [
|
||||||
|
'driver' => 'ftp',
|
||||||
|
'host' => env('FTP_HOST', '192.168.11.16'),
|
||||||
|
'username' => env('FTP_USERNAME', 'your_username'),
|
||||||
|
'password' => env('FTP_PASSWORD', 'your_password'),
|
||||||
|
'port' => 21,
|
||||||
|
'root' => '/', // 或指定資料夾
|
||||||
|
'passive' => true,
|
||||||
|
'ssl' => false,
|
||||||
|
'timeout' => 30,
|
||||||
|
],
|
||||||
|
|
||||||
],
|
],
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -35,4 +35,8 @@ return [
|
|||||||
],
|
],
|
||||||
],
|
],
|
||||||
|
|
||||||
|
'backend' => [
|
||||||
|
'url' => env('BACKEND_URL'),
|
||||||
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
@ -18,7 +18,7 @@ return [
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'prefix' => 'wireui:',
|
'prefix' => null,
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
@ -20,18 +20,11 @@ return new class extends Migration
|
|||||||
$table->enum('gender', ['unset','male', 'female', 'other'])->default('unset'); // 性別
|
$table->enum('gender', ['unset','male', 'female', 'other'])->default('unset'); // 性別
|
||||||
$table->tinyInteger('status')->default(0); // 啟動
|
$table->tinyInteger('status')->default(0); // 啟動
|
||||||
$table->timestamp('email_verified_at')->nullable();
|
$table->timestamp('email_verified_at')->nullable();
|
||||||
$table->string('password');
|
|
||||||
$table->rememberToken();
|
$table->rememberToken();
|
||||||
$table->text('api_plain_token')->nullable();
|
$table->text('api_plain_token')->nullable();
|
||||||
$table->timestamps();
|
$table->timestamps();
|
||||||
});
|
});
|
||||||
|
|
||||||
Schema::create('password_reset_tokens', function (Blueprint $table) {
|
|
||||||
$table->string('email')->primary();
|
|
||||||
$table->string('token');
|
|
||||||
$table->timestamp('created_at')->nullable();
|
|
||||||
});
|
|
||||||
|
|
||||||
Schema::create('sessions', function (Blueprint $table) {
|
Schema::create('sessions', function (Blueprint $table) {
|
||||||
$table->string('id')->primary();
|
$table->string('id')->primary();
|
||||||
$table->foreignId('user_id')->nullable()->index();
|
$table->foreignId('user_id')->nullable()->index();
|
||||||
@ -48,7 +41,6 @@ return new class extends Migration
|
|||||||
public function down(): void
|
public function down(): void
|
||||||
{
|
{
|
||||||
Schema::dropIfExists('users');
|
Schema::dropIfExists('users');
|
||||||
Schema::dropIfExists('password_reset_tokens');
|
|
||||||
Schema::dropIfExists('sessions');
|
Schema::dropIfExists('sessions');
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
@ -1,33 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use Illuminate\Database\Migrations\Migration;
|
|
||||||
use Illuminate\Database\Schema\Blueprint;
|
|
||||||
use Illuminate\Support\Facades\Schema;
|
|
||||||
|
|
||||||
return new class extends Migration
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Run the migrations.
|
|
||||||
*/
|
|
||||||
public function up(): void
|
|
||||||
{
|
|
||||||
Schema::create('personal_access_tokens', function (Blueprint $table) {
|
|
||||||
$table->id();
|
|
||||||
$table->morphs('tokenable');
|
|
||||||
$table->string('name');
|
|
||||||
$table->string('token', 64)->unique();
|
|
||||||
$table->text('abilities')->nullable();
|
|
||||||
$table->timestamp('last_used_at')->nullable();
|
|
||||||
$table->timestamp('expires_at')->nullable();
|
|
||||||
$table->timestamps();
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Reverse the migrations.
|
|
||||||
*/
|
|
||||||
public function down(): void
|
|
||||||
{
|
|
||||||
Schema::dropIfExists('personal_access_tokens');
|
|
||||||
}
|
|
||||||
};
|
|
@ -0,0 +1,29 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('song_categories', function (Blueprint $table) {
|
||||||
|
$table->id();
|
||||||
|
$table->string('code')->unique();
|
||||||
|
$table->string('name')->unique();
|
||||||
|
$table->timestamps();
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('song_categories');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('song_library_cache_song_category', function (Blueprint $table) {
|
||||||
|
$table->unsignedBigInteger('song_library_cache_id');
|
||||||
|
$table->unsignedBigInteger('song_category_id');
|
||||||
|
$table->primary(['song_library_cache_id', 'song_category_id']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('song_library_cache_song_category');
|
||||||
|
}
|
||||||
|
};
|
@ -0,0 +1,28 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
use Illuminate\Database\Migrations\Migration;
|
||||||
|
use Illuminate\Database\Schema\Blueprint;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
|
|
||||||
|
return new class extends Migration
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the migrations.
|
||||||
|
*/
|
||||||
|
public function up(): void
|
||||||
|
{
|
||||||
|
Schema::create('artist_song_library_cache', function (Blueprint $table) {
|
||||||
|
$table->unsignedBigInteger('song_library_cache_song_id');
|
||||||
|
$table->unsignedBigInteger('artist_id');
|
||||||
|
$table->primary(['song_library_cache_song_id', 'artist_id']);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Reverse the migrations.
|
||||||
|
*/
|
||||||
|
public function down(): void
|
||||||
|
{
|
||||||
|
Schema::dropIfExists('artist_song_library_cache');
|
||||||
|
}
|
||||||
|
};
|
34
database/seeders/CreateAdminUserSeeder.php
Normal file
34
database/seeders/CreateAdminUserSeeder.php
Normal file
@ -0,0 +1,34 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace Database\Seeders;
|
||||||
|
|
||||||
|
use Illuminate\Database\Console\Seeds\WithoutModelEvents;
|
||||||
|
use Illuminate\Database\Seeder;
|
||||||
|
use App\Models\User;
|
||||||
|
use App\Services\MachineStatusForwarder;
|
||||||
|
|
||||||
|
class CreateAdminUserSeeder extends Seeder
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* Run the database seeds.
|
||||||
|
*/
|
||||||
|
public function run(): void
|
||||||
|
{
|
||||||
|
$token='1|JCUnDeoWqSLWm2xW30nSQnlJf6NhfQdVqinpYRPx67b69f70';
|
||||||
|
$user = User::create([
|
||||||
|
'name' => 'admin'
|
||||||
|
,'email' => 'admin@gmail.com'
|
||||||
|
,'phone' => '0900000000'
|
||||||
|
,'api_plain_token' => $token
|
||||||
|
]);
|
||||||
|
|
||||||
|
//$forwarder = new MachineStatusForwarder(
|
||||||
|
// externalUrl: config('services.backend.url'),
|
||||||
|
// endpoint: '/api/sync',
|
||||||
|
// validated: [],
|
||||||
|
// $token
|
||||||
|
//);
|
||||||
|
|
||||||
|
//$forwarder->forward();
|
||||||
|
}
|
||||||
|
}
|
@ -3,7 +3,6 @@
|
|||||||
namespace Database\Seeders;
|
namespace Database\Seeders;
|
||||||
|
|
||||||
use Illuminate\Database\Seeder;
|
use Illuminate\Database\Seeder;
|
||||||
use App\Jobs\TransferSqliteTableJob;
|
|
||||||
|
|
||||||
class DatabaseSeeder extends Seeder
|
class DatabaseSeeder extends Seeder
|
||||||
{
|
{
|
||||||
@ -12,8 +11,8 @@ class DatabaseSeeder extends Seeder
|
|||||||
*/
|
*/
|
||||||
public function run(): void
|
public function run(): void
|
||||||
{
|
{
|
||||||
(new TransferSqliteTableJob('database/User.data', false))->handle();
|
|
||||||
$this->call([
|
$this->call([
|
||||||
|
CreateAdminUserSeeder::class,
|
||||||
BroadcastTemplateSeeder::class,
|
BroadcastTemplateSeeder::class,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
2
package-lock.json
generated
2
package-lock.json
generated
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "html",
|
"name": "KTVCentral",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
|
@ -6,3 +6,18 @@
|
|||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
|
||||||
|
body { font-family: 'Roboto', sans-serif; margin: 0; padding: 0; background-color: #f4f4f4; }
|
||||||
|
.container { text-align: center; margin: 20px; }
|
||||||
|
.header { background: #D32F2F; padding: 10px 0; color: white; font-size: 24px; font-weight: 500; text-align: center; }
|
||||||
|
.banner { width: 100%; max-width: 600px; margin: 0 auto 20px; }
|
||||||
|
.banner img { width: 100%; height: auto; }
|
||||||
|
.content { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; padding: 10px 20px; max-width: 600px; margin: 0 auto; justify-content: center; }
|
||||||
|
@media (max-width: 600px) { .content { grid-template-columns: repeat(2, 1fr); gap: 10px; } }
|
||||||
|
@media (max-width: 400px) { .content { grid-template-columns: repeat(2, 1fr); gap: 8px; } .card { width: auto; max-width: 160px; } }
|
||||||
|
.card { width: 100%; max-width: 180px; margin: 0 auto; display: flex; justify-content: center; align-items: center;
|
||||||
|
background: linear-gradient(135deg, #FF4081, #FF4081); color: white; border-radius: 10px; text-align: center;
|
||||||
|
box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1); overflow: hidden; cursor: pointer; }
|
||||||
|
.card:hover { transform: scale(1.05); }
|
||||||
|
.card img { width: 100%; height: auto; object-fit: contain; }
|
||||||
|
.section { display: none; }
|
||||||
|
.section.active { display: block; }
|
||||||
|
@ -15,6 +15,15 @@ return [
|
|||||||
'user.status.Active' => '正常',
|
'user.status.Active' => '正常',
|
||||||
'user.status.Suspended' => '停權',
|
'user.status.Suspended' => '停權',
|
||||||
'user.status.Deleting' => '刪除中',
|
'user.status.Deleting' => '刪除中',
|
||||||
|
'LanguageType.Mandarin' => '國語',
|
||||||
|
'LanguageType.Taiwanese' => '台語',
|
||||||
|
'LanguageType.English' => '英語',
|
||||||
|
'LanguageType.Japanese' => '日語',
|
||||||
|
'LanguageType.Cantonese' => '粵語',
|
||||||
|
'LanguageType.Korean' => '韓語',
|
||||||
|
'LanguageType.Vietnamese' => '越語',
|
||||||
|
'LanguageType.Hakka' => '客語',
|
||||||
|
'LanguageType.Other' => '其他',
|
||||||
|
|
||||||
'room.status.Active' => '啟用中',
|
'room.status.Active' => '啟用中',
|
||||||
'room.status.Closed' => '待機',
|
'room.status.Closed' => '待機',
|
||||||
|
10
resources/views/clicked-song.blade.php
Normal file
10
resources/views/clicked-song.blade.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<x-app-layout>
|
||||||
|
<x-slot name="header">
|
||||||
|
<div class="header">超級巨星 自助式KTV</div>
|
||||||
|
<div class="banner">
|
||||||
|
<img src="{{ asset('手機點歌/BANNER-07.png') }}" alt="超級巨星 Banner">
|
||||||
|
</div>
|
||||||
|
</x-slot>
|
||||||
|
|
||||||
|
<livewire:pages.ordered-song-list />
|
||||||
|
</x-app-layout>
|
19
resources/views/components/button/flat-card.blade.php
Normal file
19
resources/views/components/button/flat-card.blade.php
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
@props([
|
||||||
|
'image' => null,
|
||||||
|
'href' => null,
|
||||||
|
])
|
||||||
|
|
||||||
|
@php
|
||||||
|
// 使用 Tailwind aspect-auto 保持圖片原始比例
|
||||||
|
$classes = 'relative w-full rounded-lg overflow-hidden shadow-md hover:scale-105 transition-transform cursor-pointer';
|
||||||
|
@endphp
|
||||||
|
|
||||||
|
@if($href)
|
||||||
|
<a href="{{ $href }}" {{ $attributes->merge(['class' => $classes]) }}>
|
||||||
|
<img src="{{ $image }}" alt="" class="w-full h-auto object-contain">
|
||||||
|
</a>
|
||||||
|
@else
|
||||||
|
<div {{ $attributes->merge(['class' => $classes]) }}>
|
||||||
|
<img src="{{ $image }}" alt="" class="w-full h-auto object-contain">
|
||||||
|
</div>
|
||||||
|
@endif
|
@ -1,48 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
|
||||||
|
|
||||||
<title>{{ config('app.name', 'Laravel Admin') }}</title>
|
|
||||||
|
|
||||||
<!-- Fonts -->
|
|
||||||
<link rel="preconnect" href="https://fonts.bunny.net">
|
|
||||||
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
|
||||||
|
|
||||||
<!-- Scripts -->
|
|
||||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
|
||||||
@livewireStyles
|
|
||||||
@wireUiScripts
|
|
||||||
</head>
|
|
||||||
<body class="font-sans antialiased">
|
|
||||||
<div class="min-h-screen bg-gray-100 flex">
|
|
||||||
|
|
||||||
{{-- Sidebar --}}
|
|
||||||
<livewire:layout.admin.sidebar />
|
|
||||||
|
|
||||||
<div class="flex-1 flex flex-col">
|
|
||||||
|
|
||||||
{{-- Page Heading --}}
|
|
||||||
@if (isset($header))
|
|
||||||
<header class="bg-white shadow">
|
|
||||||
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
|
|
||||||
{{ $header }}
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
{{-- Page Content --}}
|
|
||||||
<main>
|
|
||||||
{{ $slot }}
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
</div>
|
|
||||||
|
|
||||||
@livewireScripts
|
|
||||||
@livewire('wire-elements-modal')
|
|
||||||
</body>
|
|
||||||
</html>
|
|
||||||
|
|
@ -1,9 +0,0 @@
|
|||||||
@if(auth()->user()->hasRole('User'))
|
|
||||||
<x-layouts.user>
|
|
||||||
{{ $slot }}
|
|
||||||
</x-layouts.user>
|
|
||||||
@else
|
|
||||||
<x-layouts.admin>
|
|
||||||
{{ $slot }}
|
|
||||||
</x-layouts.admin>
|
|
||||||
@endif
|
|
@ -1,40 +0,0 @@
|
|||||||
<!DOCTYPE html>
|
|
||||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
|
||||||
<head>
|
|
||||||
<meta charset="utf-8">
|
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
|
||||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
|
||||||
|
|
||||||
<title>{{ config('app.name', 'Laravel') }}</title>
|
|
||||||
|
|
||||||
<!-- Fonts -->
|
|
||||||
<link rel="preconnect" href="https://fonts.bunny.net">
|
|
||||||
<link href="https://fonts.bunny.net/css?family=figtree:400,500,600&display=swap" rel="stylesheet" />
|
|
||||||
|
|
||||||
<!-- Scripts -->
|
|
||||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
|
||||||
@livewireStyles
|
|
||||||
@wireUiScripts
|
|
||||||
</head>
|
|
||||||
<body class="font-sans antialiased">
|
|
||||||
<div class="min-h-screen bg-gray-100">
|
|
||||||
<livewire:layout.app.navigation />
|
|
||||||
|
|
||||||
<!-- Page Heading -->
|
|
||||||
@if (isset($header))
|
|
||||||
<header class="bg-white shadow">
|
|
||||||
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
|
|
||||||
{{ $header }}
|
|
||||||
</div>
|
|
||||||
</header>
|
|
||||||
@endif
|
|
||||||
|
|
||||||
<!-- Page Content -->
|
|
||||||
<main>
|
|
||||||
{{ $slot }}
|
|
||||||
</main>
|
|
||||||
</div>
|
|
||||||
@livewireScripts
|
|
||||||
@livewire('wire-elements-modal')
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,6 +1,6 @@
|
|||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
||||||
<head>
|
<head>
|
||||||
<meta charset="utf-8">
|
<meta charset="utf-8">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
<meta name="csrf-token" content="{{ csrf_token() }}">
|
<meta name="csrf-token" content="{{ csrf_token() }}">
|
||||||
@ -15,17 +15,15 @@
|
|||||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
||||||
@livewireStyles
|
@livewireStyles
|
||||||
@wireUiScripts
|
@wireUiScripts
|
||||||
</head>
|
</head>
|
||||||
<body class="font-sans antialiased">
|
<body class="font-sans antialiased bg-gray-100">
|
||||||
<div class="min-h-screen bg-gray-100">
|
<livewire:layout.navigation />
|
||||||
<livewire:layout.app.navigation />
|
|
||||||
|
|
||||||
|
<div class="min-h-screen">
|
||||||
<!-- Page Heading -->
|
<!-- Page Heading -->
|
||||||
@if (isset($header))
|
@if (isset($header))
|
||||||
<header class="bg-white shadow">
|
<header class="bg-white shadow">
|
||||||
<div class="max-w-7xl mx-auto py-6 px-4 sm:px-6 lg:px-8">
|
|
||||||
{{ $header }}
|
{{ $header }}
|
||||||
</div>
|
|
||||||
</header>
|
</header>
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
@ -35,5 +33,6 @@
|
|||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
@livewireScripts
|
@livewireScripts
|
||||||
</body>
|
@livewire('wire-elements-modal')
|
||||||
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -1,3 +1,6 @@
|
|||||||
<x-layouts.admin>
|
<x-app-layout>
|
||||||
|
<x-slot name="header">
|
||||||
|
<div class="header">超級巨星 自助式KTV</div>
|
||||||
|
</x-slot>
|
||||||
<livewire:tables.activity-log-table />
|
<livewire:tables.activity-log-table />
|
||||||
</x-layouts.admin>
|
</x-app-layout>
|
@ -1,7 +1,10 @@
|
|||||||
|
|
||||||
<x-layouts.admin>
|
<x-app-layout>
|
||||||
<x-wireui:notifications/>
|
<x-slot name="header">
|
||||||
|
<div class="header">超級巨星 自助式KTV</div>
|
||||||
|
</x-slot>
|
||||||
|
<x-notifications/>
|
||||||
<livewire:tables.broadcast-template-table />
|
<livewire:tables.broadcast-template-table />
|
||||||
<livewire:forms.broadcast-template-form />
|
<livewire:forms.broadcast-template-form />
|
||||||
<livewire:forms.broadcast-test-form />
|
<livewire:forms.broadcast-test-form />
|
||||||
</x-layouts.admin>
|
</x-app-layout>
|
@ -1,3 +0,0 @@
|
|||||||
<div>
|
|
||||||
{{-- To attain knowledge, add things every day; To attain wisdom, subtract things every day. --}}
|
|
||||||
</div>
|
|
@ -1,3 +1,6 @@
|
|||||||
<x-layouts.admin>
|
<x-app-layout>
|
||||||
|
<x-slot name="header">
|
||||||
|
<div class="header">超級巨星 自助式KTV</div>
|
||||||
|
</x-slot>
|
||||||
<livewire:tables.machine-status-table />
|
<livewire:tables.machine-status-table />
|
||||||
</x-layouts.admin>
|
</x-app-layout>
|
@ -1,4 +1,6 @@
|
|||||||
|
<x-app-layout>
|
||||||
<x-layouts.admin>
|
<x-slot name="header">
|
||||||
|
<div class="header">超級巨星 自助式KTV</div>
|
||||||
|
</x-slot>
|
||||||
<livewire:grids.room-grid />
|
<livewire:grids.room-grid />
|
||||||
</x-layouts.admin>
|
</x-app-layout>
|
@ -1,3 +1,6 @@
|
|||||||
<x-layouts.admin>
|
<x-app-layout>
|
||||||
|
<x-slot name="header">
|
||||||
|
<div class="header">超級巨星 自助式KTV</div>
|
||||||
|
</x-slot>
|
||||||
<livewire:tables.room-status-log-table />
|
<livewire:tables.room-status-log-table />
|
||||||
</x-layouts.admin>
|
</x-app-layout>
|
@ -1,7 +1,10 @@
|
|||||||
|
|
||||||
<x-layouts.admin>
|
<x-app-layout>
|
||||||
<x-wireui:notifications/>
|
<x-slot name="header">
|
||||||
|
<div class="header">超級巨星 自助式KTV</div>
|
||||||
|
</x-slot>
|
||||||
|
<x-notifications/>
|
||||||
<livewire:tables.room-table/>
|
<livewire:tables.room-table/>
|
||||||
<livewire:forms.room-form />
|
<livewire:forms.room-form />
|
||||||
<livewire:modals.room-detail-modal />
|
<livewire:modals.room-detail-modal />
|
||||||
</x-layouts.admin>
|
</x-app-layout>
|
@ -1,3 +0,0 @@
|
|||||||
<x-layouts.admin>
|
|
||||||
<livewire:tables.song-library-cache-table />
|
|
||||||
</x-layouts.admin>
|
|
@ -1,7 +1,10 @@
|
|||||||
|
|
||||||
<x-layouts.admin>
|
<x-app-layout>
|
||||||
<x-wireui:notifications/>
|
<x-slot name="header">
|
||||||
|
<div class="header">超級巨星 自助式KTV</div>
|
||||||
|
</x-slot>
|
||||||
|
<x-notifications/>
|
||||||
<livewire:tables.text-ads-table />
|
<livewire:tables.text-ads-table />
|
||||||
<livewire:forms.text-ads-form />
|
<livewire:forms.text-ads-form />
|
||||||
<livewire:forms.text-ad-test-form />
|
<livewire:forms.text-ad-test-form />
|
||||||
</x-layouts.admin>
|
</x-app-layout>
|
@ -1,3 +1,6 @@
|
|||||||
<x-layouts.admin>
|
<x-app-layout>
|
||||||
|
<x-slot name="header">
|
||||||
|
<div class="header">超級巨星 自助式KTV</div>
|
||||||
|
</x-slot>
|
||||||
<livewire:tables.user-table />
|
<livewire:tables.user-table />
|
||||||
</x-layouts.admin>
|
</x-app-layout>
|
@ -1,7 +1,7 @@
|
|||||||
<x-wireui:modal-card title="{{ $textId ? __('broadcast-templates.EditArtist') : __('broadcast-templates.CreateNew') }}" blur wire:model.defer="showModal">
|
<x-modal-card title="{{ $textId ? __('broadcast-templates.EditArtist') : __('broadcast-templates.CreateNew') }}" blur wire:model.defer="showModal">
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
<x-wireui:input label="{{__('broadcast-templates.content')}}" wire:model.defer="fields.content" />
|
<x-input label="{{__('broadcast-templates.content')}}" wire:model.defer="fields.content" />
|
||||||
<x-wireui:select
|
<x-select
|
||||||
label="{{__('broadcast-templates.color')}}"
|
label="{{__('broadcast-templates.color')}}"
|
||||||
wire:model.defer="fields.color"
|
wire:model.defer="fields.color"
|
||||||
placeholder="{{__('broadcast-templates.select_color')}}"
|
placeholder="{{__('broadcast-templates.select_color')}}"
|
||||||
@ -10,14 +10,14 @@
|
|||||||
option-value="value"
|
option-value="value"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<x-wireui:toggle label="{{__('broadcast-templates.is_active')}}" wire:model.defer="fields.is_active" />
|
<x-toggle label="{{__('broadcast-templates.is_active')}}" wire:model.defer="fields.is_active" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<x-slot name="footer">
|
<x-slot name="footer">
|
||||||
<div class="flex justify-between w-full">
|
<div class="flex justify-between w-full">
|
||||||
<x-wireui:button flat label="{{__('broadcast-templates.cancel')}}" wire:click="closeModal" />
|
<x-button flat label="{{__('broadcast-templates.cancel')}}" wire:click="closeModal" />
|
||||||
<x-wireui:button primary label="{{__('broadcast-templates.submit')}}" wire:click="save" />
|
<x-button primary label="{{__('broadcast-templates.submit')}}" wire:click="save" />
|
||||||
</div>
|
</div>
|
||||||
</x-slot>
|
</x-slot>
|
||||||
</x-wireui:modal-card>
|
</x-modal-card>
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
<div class="p-4 space-y-4">
|
<div class="p-4 space-y-4">
|
||||||
<x-wireui:modal-card title="發送" blur wire:model.defer="showModal">
|
<x-modal-card title="發送" blur wire:model.defer="showModal">
|
||||||
<x-wireui:select
|
<x-select
|
||||||
label="選擇房間"
|
label="選擇房間"
|
||||||
wire:model.defer="roomId"
|
wire:model.defer="roomId"
|
||||||
placeholder="請選擇房間"
|
placeholder="請選擇房間"
|
||||||
@ -10,7 +10,7 @@
|
|||||||
/>
|
/>
|
||||||
<div class="space-y-2">
|
<div class="space-y-2">
|
||||||
@foreach($variables as $varName => $value)
|
@foreach($variables as $varName => $value)
|
||||||
<x-wireui:input
|
<x-input
|
||||||
label="{{ $varName }}"
|
label="{{ $varName }}"
|
||||||
wire:model.defer="variables.{{ $varName }}"
|
wire:model.defer="variables.{{ $varName }}"
|
||||||
placeholder="請填入 {{ $varName }}"
|
placeholder="請填入 {{ $varName }}"
|
||||||
@ -25,9 +25,9 @@
|
|||||||
|
|
||||||
<x-slot name="footer">
|
<x-slot name="footer">
|
||||||
<div class="flex justify-between w-full">
|
<div class="flex justify-between w-full">
|
||||||
<x-wireui:button flat label="{{__('text_ads.cancel')}}" wire:click="closeModal" />
|
<x-button flat label="{{__('text_ads.cancel')}}" wire:click="closeModal" />
|
||||||
<x-wireui:button primary wire:click="send" primary label="立即發送" spinner />
|
<x-button primary wire:click="send" primary label="立即發送" spinner />
|
||||||
</div>
|
</div>
|
||||||
</x-slot>
|
</x-slot>
|
||||||
</x-wireui:modal-card>
|
</x-modal-card>
|
||||||
</div>
|
</div>
|
@ -1,7 +1,7 @@
|
|||||||
<x-wireui:modal-card title="{{ $roomId ? __('rooms.EditRoom') : __('rooms.CreateNew') }}" blur wire:model.defer="showModal">
|
<x-modal-card title="{{ $roomId ? __('rooms.EditRoom') : __('rooms.CreateNew') }}" blur wire:model.defer="showModal">
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
<x-wireui:input type="number" label="{{__('rooms.floor')}}" wire:model.defer="fields.floor" />
|
<x-input type="number" label="{{__('rooms.floor')}}" wire:model.defer="fields.floor" />
|
||||||
<x-wireui:select
|
<x-select
|
||||||
label="{{__('rooms.type')}}"
|
label="{{__('rooms.type')}}"
|
||||||
wire:model.defer="fields.type"
|
wire:model.defer="fields.type"
|
||||||
placeholder="{{__('rooms.select_type')}}"
|
placeholder="{{__('rooms.select_type')}}"
|
||||||
@ -9,13 +9,13 @@
|
|||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="value"
|
option-value="value"
|
||||||
/>
|
/>
|
||||||
<x-wireui:input label="{{__('rooms.name')}}" wire:model.defer="fields.name" />
|
<x-input label="{{__('rooms.name')}}" wire:model.defer="fields.name" />
|
||||||
</div>
|
</div>
|
||||||
<x-slot name="footer">
|
<x-slot name="footer">
|
||||||
<div class="flex justify-between w-full">
|
<div class="flex justify-between w-full">
|
||||||
<x-wireui:button flat label="{{__('rooms.cancel')}}" wire:click="closeModal" />
|
<x-button flat label="{{__('rooms.cancel')}}" wire:click="closeModal" />
|
||||||
<x-wireui:button primary label="{{__('rooms.submit')}}" wire:click="save" />
|
<x-button primary label="{{__('rooms.submit')}}" wire:click="save" />
|
||||||
</div>
|
</div>
|
||||||
</x-slot>
|
</x-slot>
|
||||||
</x-wireui:modal-card>
|
</x-modal-card>
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
<div class="p-4 space-y-4">
|
<div class="p-4 space-y-4">
|
||||||
<x-wireui:modal-card title="測試" blur wire:model.defer="showModal">
|
<x-modal-card title="測試" blur wire:model.defer="showModal">
|
||||||
<x-wireui:select
|
<x-select
|
||||||
label="選擇房間"
|
label="選擇房間"
|
||||||
wire:model.defer="roomId"
|
wire:model.defer="roomId"
|
||||||
placeholder="請選擇房間"
|
placeholder="請選擇房間"
|
||||||
@ -16,9 +16,9 @@
|
|||||||
|
|
||||||
<x-slot name="footer">
|
<x-slot name="footer">
|
||||||
<div class="flex justify-between w-full">
|
<div class="flex justify-between w-full">
|
||||||
<x-wireui:button flat label="{{__('text_ads.cancel')}}" wire:click="closeModal" />
|
<x-button flat label="{{__('text_ads.cancel')}}" wire:click="closeModal" />
|
||||||
<x-wireui:button primary wire:click="send" primary label="立即發送" spinner />
|
<x-button primary wire:click="send" primary label="立即發送" spinner />
|
||||||
</div>
|
</div>
|
||||||
</x-slot>
|
</x-slot>
|
||||||
</x-wireui:modal-card>
|
</x-modal-card>
|
||||||
</div>
|
</div>
|
@ -1,7 +1,7 @@
|
|||||||
<x-wireui:modal-card title="{{ $textAdId ? __('text_ads.EditArtist') : __('text_ads.CreateNew') }}" blur wire:model.defer="showModal">
|
<x-modal-card title="{{ $textAdId ? __('text_ads.EditArtist') : __('text_ads.CreateNew') }}" blur wire:model.defer="showModal">
|
||||||
<div class="space-y-4">
|
<div class="space-y-4">
|
||||||
<x-wireui:input label="{{__('text_ads.content')}}" wire:model.defer="fields.content" />
|
<x-input label="{{__('text_ads.content')}}" wire:model.defer="fields.content" />
|
||||||
<x-wireui:select
|
<x-select
|
||||||
label="{{__('text_ads.color')}}"
|
label="{{__('text_ads.color')}}"
|
||||||
wire:model.defer="fields.color"
|
wire:model.defer="fields.color"
|
||||||
placeholder="{{__('text_ads.select_color')}}"
|
placeholder="{{__('text_ads.select_color')}}"
|
||||||
@ -9,16 +9,16 @@
|
|||||||
option-label="name"
|
option-label="name"
|
||||||
option-value="value"
|
option-value="value"
|
||||||
/>
|
/>
|
||||||
<x-wireui:input label="{{__('text_ads.duration')}}" type="number" min="1" max="60" wire:model.defer="fields.duration" />
|
<x-input label="{{__('text_ads.duration')}}" type="number" min="1" max="60" wire:model.defer="fields.duration" />
|
||||||
|
|
||||||
<x-wireui:toggle label="{{__('text_ads.is_active')}}" wire:model.defer="fields.is_active" />
|
<x-toggle label="{{__('text_ads.is_active')}}" wire:model.defer="fields.is_active" />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<x-slot name="footer">
|
<x-slot name="footer">
|
||||||
<div class="flex justify-between w-full">
|
<div class="flex justify-between w-full">
|
||||||
<x-wireui:button flat label="{{__('text_ads.cancel')}}" wire:click="closeModal" />
|
<x-button flat label="{{__('text_ads.cancel')}}" wire:click="closeModal" />
|
||||||
<x-wireui:button primary label="{{__('text_ads.submit')}}" wire:click="save" />
|
<x-button primary label="{{__('text_ads.submit')}}" wire:click="save" />
|
||||||
</div>
|
</div>
|
||||||
</x-slot>
|
</x-slot>
|
||||||
</x-wireui:modal-card>
|
</x-modal-card>
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
<x-wireui:card title="{{ $branchName }} - 包廂設定" shadow="none">
|
<x-card title="{{ $branchName }} - 包廂設定" shadow="none">
|
||||||
<div x-data="{ floor: '{{ $floors[0] ?? 1 }}', type: 'all' }">
|
<div x-data="{ floor: '{{ $floors[0] ?? 1 }}', type: 'all' }">
|
||||||
{{-- 樓層 Tab --}}
|
{{-- 樓層 Tab --}}
|
||||||
<div class="flex gap-2 mb-2">
|
<div class="flex gap-2 mb-2">
|
||||||
@ -43,6 +43,6 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<x-wireui:notifications/>
|
<x-notifications/>
|
||||||
<livewire:modals.room-detail-modal />
|
<livewire:modals.room-detail-modal />
|
||||||
</x-wireui:card>
|
</x-card>
|
@ -1,6 +1,6 @@
|
|||||||
<x-admin.section-header title="{{ __('broadcast-templates.list') }}">
|
<x-admin.section-header title="{{ __('broadcast-templates.list') }}">
|
||||||
@if ($canCreate)
|
@if ($canCreate)
|
||||||
<x-wireui:button
|
<x-button
|
||||||
wire:click="$dispatchTo('forms.broadcast-template-form', 'openModal')"
|
wire:click="$dispatchTo('forms.broadcast-template-form', 'openModal')"
|
||||||
icon="plus"
|
icon="plus"
|
||||||
label="{{ __('broadcast-templates.CreateNew') }}"
|
label="{{ __('broadcast-templates.CreateNew') }}"
|
||||||
|
@ -5,7 +5,7 @@ $branch= Branch::first();
|
|||||||
|
|
||||||
@if ($branch)
|
@if ($branch)
|
||||||
<x-admin.section-header title="{{ $branch->name .' '. __('rooms.list').' '. $branch->external_ip}}">
|
<x-admin.section-header title="{{ $branch->name .' '. __('rooms.list').' '. $branch->external_ip}}">
|
||||||
<x-wireui:button
|
<x-button
|
||||||
wire:click="$dispatchTo('forms.room-form', 'openModal')"
|
wire:click="$dispatchTo('forms.room-form', 'openModal')"
|
||||||
icon="plus"
|
icon="plus"
|
||||||
label="{{ __('rooms.CreateNew') }}"
|
label="{{ __('rooms.CreateNew') }}"
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
<x-admin.section-header title="{{ __('text_ads.list') }}">
|
<x-admin.section-header title="{{ __('text_ads.list') }}">
|
||||||
<x-wireui:button
|
<x-button
|
||||||
wire:click="$dispatchTo('forms.text-ads-form', 'openModal')"
|
wire:click="$dispatchTo('forms.text-ads-form', 'openModal')"
|
||||||
icon="plus"
|
icon="plus"
|
||||||
label="{{ __('text_ads.CreateNew') }}"
|
label="{{ __('text_ads.CreateNew') }}"
|
||||||
|
@ -1,68 +0,0 @@
|
|||||||
<?php
|
|
||||||
use Illuminate\Support\Facades\Auth;
|
|
||||||
use App\Livewire\Actions\Logout;
|
|
||||||
use Livewire\Volt\Component;
|
|
||||||
|
|
||||||
new class extends Component
|
|
||||||
{
|
|
||||||
public array $menus=[
|
|
||||||
['label' => 'Dashboard', 'route' => 'admin.dashboard', 'icon' => 'home', 'permission' => null],
|
|
||||||
['label' => 'Song', 'route' => 'admin.song-library-cache', 'icon' => 'clock', 'permission' => null],
|
|
||||||
['label' => 'ActivityLog', 'route' => 'admin.activity-log', 'icon' => 'clock', 'permission' => null],
|
|
||||||
['label' => 'RoomStatusLog', 'route' => 'admin.room-status-log', 'icon' => 'clock', 'permission' => null],
|
|
||||||
['label' => 'MachineStatus', 'route' => 'admin.machine-status', 'icon' => 'clock', 'permission' => null],
|
|
||||||
['label' => 'User', 'route' => 'admin.users', 'icon' => 'user-circle', 'permission' => 'user-list'],
|
|
||||||
['label' => 'Room', 'route' => 'admin.rooms', 'icon' => 'building-library', 'permission' => 'room-list'],
|
|
||||||
['label' => 'RoomGrid', 'route' => 'admin.room-grids', 'icon' => 'film', 'permission' => 'room-list'],
|
|
||||||
['label' => 'TextAd', 'route' => 'admin.text-ads', 'icon' => 'megaphone', 'permission' => 'text-ad-list'],
|
|
||||||
['label' => 'BroadcastTemplate', 'route' => 'admin.broadcast-templates', 'icon' => 'megaphone', 'permission' => 'broadcast-list'],
|
|
||||||
];
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Log the current user out of the application.
|
|
||||||
*/
|
|
||||||
public function logout(Logout $logout): void
|
|
||||||
{
|
|
||||||
$logout();
|
|
||||||
|
|
||||||
$this->redirect('/', navigate: true);
|
|
||||||
}
|
|
||||||
}; ?>
|
|
||||||
|
|
||||||
<aside class="w-64 bg-white border-r flex flex-col justify-between h-screen">
|
|
||||||
{{-- 頂部區塊 --}}
|
|
||||||
<div>
|
|
||||||
<div class="p-4 border-b">
|
|
||||||
<div class="flex items-center justify-between">
|
|
||||||
<div class="font-bold text-lg">管理後台</div>
|
|
||||||
<div
|
|
||||||
class="inline-flex items-center px-2 py-1 text-sm font-medium text-gray-700"
|
|
||||||
x-data="{ name: '{{ auth()->user()->name }}' }"
|
|
||||||
x-text="name"
|
|
||||||
x-on:profile-updated.window="name = $event.detail.name">
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{-- 選單 --}}
|
|
||||||
<nav class="mt-4">
|
|
||||||
@foreach ($menus as $menu)
|
|
||||||
@if (!$menu['permission'] || Auth::user()->can($menu['permission']))
|
|
||||||
<a href="{{ route($menu['route']) }}"
|
|
||||||
class="flex items-center px-4 py-2 text-gray-700 hover:bg-gray-100 {{ request()->routeIs($menu['route']) ? 'bg-gray-100 font-semibold' : '' }}">
|
|
||||||
<x-wireui:icon name="{{ $menu['icon'] }}" class="w-5 h-5 mr-2" />
|
|
||||||
{{ $menu['label'] }}
|
|
||||||
</a>
|
|
||||||
@endif
|
|
||||||
@endforeach
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
{{-- 登出按鈕(固定底部) --}}
|
|
||||||
<div class="p-4 border-t">
|
|
||||||
<button wire:click="logout"
|
|
||||||
class="flex items-center text-sm text-gray-700 hover:text-red-600">
|
|
||||||
{{ __('Log Out') }}
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</aside>
|
|
@ -1,110 +0,0 @@
|
|||||||
<?php
|
|
||||||
|
|
||||||
use App\Livewire\Actions\Logout;
|
|
||||||
use Livewire\Volt\Component;
|
|
||||||
|
|
||||||
new class extends Component
|
|
||||||
{
|
|
||||||
/**
|
|
||||||
* Log the current user out of the application.
|
|
||||||
*/
|
|
||||||
public function logout(Logout $logout): void
|
|
||||||
{
|
|
||||||
$logout();
|
|
||||||
|
|
||||||
$this->redirect('/', navigate: true);
|
|
||||||
}
|
|
||||||
}; ?>
|
|
||||||
|
|
||||||
<nav x-data="{ open: false }" class="bg-white border-b border-gray-100">
|
|
||||||
<!-- Primary Navigation Menu -->
|
|
||||||
<div class="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
|
||||||
<div class="flex justify-between h-16">
|
|
||||||
<div class="flex">
|
|
||||||
<!-- Logo -->
|
|
||||||
<div class="shrink-0 flex items-center">
|
|
||||||
<a href="{{ route('dashboard') }}" wire:navigate>
|
|
||||||
<x-application-logo class="block h-9 w-auto fill-current text-gray-800" />
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Navigation Links -->
|
|
||||||
<div class="hidden space-x-8 sm:-my-px sm:ms-10 sm:flex">
|
|
||||||
<x-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')" wire:navigate>
|
|
||||||
{{ __('Dashboard') }}
|
|
||||||
</x-nav-link>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Settings Dropdown -->
|
|
||||||
<div class="hidden sm:flex sm:items-center sm:ms-6">
|
|
||||||
<x-dropdown align="right" width="48">
|
|
||||||
<x-slot name="trigger">
|
|
||||||
<button class="inline-flex items-center px-3 py-2 border border-transparent text-sm leading-4 font-medium rounded-md text-gray-500 bg-white hover:text-gray-700 focus:outline-none transition ease-in-out duration-150">
|
|
||||||
<div x-data="{{ json_encode(['name' => auth()->user()->name]) }}" x-text="name" x-on:profile-updated.window="name = $event.detail.name"></div>
|
|
||||||
|
|
||||||
<div class="ms-1">
|
|
||||||
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20">
|
|
||||||
<path fill-rule="evenodd" d="M5.293 7.293a1 1 0 011.414 0L10 10.586l3.293-3.293a1 1 0 111.414 1.414l-4 4a1 1 0 01-1.414 0l-4-4a1 1 0 010-1.414z" clip-rule="evenodd" />
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
</button>
|
|
||||||
</x-slot>
|
|
||||||
|
|
||||||
<x-slot name="content">
|
|
||||||
<x-dropdown-link :href="route('profile')" wire:navigate>
|
|
||||||
{{ __('Profile') }}
|
|
||||||
</x-dropdown-link>
|
|
||||||
|
|
||||||
<!-- Authentication -->
|
|
||||||
<button wire:click="logout" class="w-full text-start">
|
|
||||||
<x-dropdown-link>
|
|
||||||
{{ __('Log Out') }}
|
|
||||||
</x-dropdown-link>
|
|
||||||
</button>
|
|
||||||
</x-slot>
|
|
||||||
</x-dropdown>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Hamburger -->
|
|
||||||
<div class="-me-2 flex items-center sm:hidden">
|
|
||||||
<button @click="open = ! open" class="inline-flex items-center justify-center p-2 rounded-md text-gray-400 hover:text-gray-500 hover:bg-gray-100 focus:outline-none focus:bg-gray-100 focus:text-gray-500 transition duration-150 ease-in-out">
|
|
||||||
<svg class="h-6 w-6" stroke="currentColor" fill="none" viewBox="0 0 24 24">
|
|
||||||
<path :class="{'hidden': open, 'inline-flex': ! open }" class="inline-flex" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h16" />
|
|
||||||
<path :class="{'hidden': ! open, 'inline-flex': open }" class="hidden" stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M6 18L18 6M6 6l12 12" />
|
|
||||||
</svg>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Responsive Navigation Menu -->
|
|
||||||
<div :class="{'block': open, 'hidden': ! open}" class="hidden sm:hidden">
|
|
||||||
<div class="pt-2 pb-3 space-y-1">
|
|
||||||
<x-responsive-nav-link :href="route('dashboard')" :active="request()->routeIs('dashboard')" wire:navigate>
|
|
||||||
{{ __('Dashboard') }}
|
|
||||||
</x-responsive-nav-link>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<!-- Responsive Settings Options -->
|
|
||||||
<div class="pt-4 pb-1 border-t border-gray-200">
|
|
||||||
<div class="px-4">
|
|
||||||
<div class="font-medium text-base text-gray-800" x-data="{{ json_encode(['name' => auth()->user()->name]) }}" x-text="name" x-on:profile-updated.window="name = $event.detail.name"></div>
|
|
||||||
<div class="font-medium text-sm text-gray-500">{{ auth()->user()->email }}</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="mt-3 space-y-1">
|
|
||||||
<x-responsive-nav-link :href="route('profile')" wire:navigate>
|
|
||||||
{{ __('Profile') }}
|
|
||||||
</x-responsive-nav-link>
|
|
||||||
|
|
||||||
<!-- Authentication -->
|
|
||||||
<button wire:click="logout" class="w-full text-start">
|
|
||||||
<x-responsive-nav-link>
|
|
||||||
{{ __('Log Out') }}
|
|
||||||
</x-responsive-nav-link>
|
|
||||||
</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</nav>
|
|
44
resources/views/livewire/layout/navigation.blade.php
Normal file
44
resources/views/livewire/layout/navigation.blade.php
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
<div x-data="{ open: false }" @click.outside="open = false" class="relative">
|
||||||
|
<!-- Menu Toggle -->
|
||||||
|
<button class="absolute top-2.5 left-2.5 cursor-pointer" @click="open = !open" aria-label="Toggle Menu">
|
||||||
|
<x-icon name="bars-3" solid class="w-9 h-9 text-gray-700" />
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<!-- Navigation Menu -->
|
||||||
|
<nav
|
||||||
|
class="fixed top-0 left-0 h-full w-64 bg-white shadow-lg transform -translate-x-full transition-transform duration-300 ease-in-out z-50"
|
||||||
|
:class="{ 'translate-x-0': open }"
|
||||||
|
>
|
||||||
|
<div class="flex flex-col h-full">
|
||||||
|
<div class="divide-y flex-1 overflow-y-auto">
|
||||||
|
@guest
|
||||||
|
<x-button flat class="w-full justify-start px-4 py-3" :href="route('login')" label="Log in / Register" />
|
||||||
|
@else
|
||||||
|
<div class="p-4 border-b">
|
||||||
|
<div class="flex items-center justify-between">
|
||||||
|
<div class="font-bold text-lg">超級巨星</div>
|
||||||
|
<div
|
||||||
|
class="inline-flex items-center px-2 py-1 text-sm font-medium text-gray-700"
|
||||||
|
x-data="{ name: '{{ auth()->user()->name }}' }"
|
||||||
|
x-text="name"
|
||||||
|
x-on:profile-updated.window="name = $event.detail.name">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
@endguest
|
||||||
|
|
||||||
|
@foreach($menus as $menu)
|
||||||
|
<x-button flat class="w-full px-4 py-3 text-left {{ request()->routeIs($menu['route']) ? 'bg-gray-100 font-semibold' : '' }}"
|
||||||
|
:href="route($menu['route'])"
|
||||||
|
label="{{ $menu['name'] }}"
|
||||||
|
/>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@auth
|
||||||
|
<div class="p-4 border-t">
|
||||||
|
<x-button flat class="w-full justify-start px-4 py-3 text-red-600" label="{{ __('Log Out') }}" wire:click="logout" />
|
||||||
|
</div>
|
||||||
|
@endauth
|
||||||
|
</div>
|
||||||
|
</nav>
|
||||||
|
</div>
|
@ -1,5 +1,5 @@
|
|||||||
<x-wireui:modal id="room-detail-modal" wire:model.defer="showModal" persistent>
|
<x-modal id="room-detail-modal" wire:model.defer="showModal" persistent>
|
||||||
<x-wireui:card class="border border-gray-200">
|
<x-card class="border border-gray-200">
|
||||||
<x-slot name="action">
|
<x-slot name="action">
|
||||||
<button class="cursor-pointer p-1 rounded-full focus:outline-none focus:outline-hidden focus:ring-2 focus:ring-secondary-200 text-secondary-300"
|
<button class="cursor-pointer p-1 rounded-full focus:outline-none focus:outline-hidden focus:ring-2 focus:ring-secondary-200 text-secondary-300"
|
||||||
wire:click="closeModal"
|
wire:click="closeModal"
|
||||||
@ -16,9 +16,9 @@
|
|||||||
{{ $room_name ?? '未選擇' }}包廂設定
|
{{ $room_name ?? '未選擇' }}包廂設定
|
||||||
</x-slot>
|
</x-slot>
|
||||||
<div class="grid grid-cols-3 gap-4 mb-4">
|
<div class="grid grid-cols-3 gap-4 mb-4">
|
||||||
<x-wireui:button wire:click="startNotify">維修</x-wireui:button>
|
<x-button wire:click="startNotify">維修</x-button>
|
||||||
<x-wireui:button wire:click="stopNotify" >關機</x-wireui:button>
|
<x-button wire:click="stopNotify" >關機</x-button>
|
||||||
<x-wireui:button wire:click="fireNotify" >火災</x-wireui:button>
|
<x-button wire:click="fireNotify" >火災</x-button>
|
||||||
</div>
|
</div>
|
||||||
</x-wireui:card>
|
</x-card>
|
||||||
</x-wireui:modal>
|
</x-modal>
|
27
resources/views/livewire/modals/sticker-modal.blade.php
Normal file
27
resources/views/livewire/modals/sticker-modal.blade.php
Normal file
@ -0,0 +1,27 @@
|
|||||||
|
|
||||||
|
<x-modal id="sticker-modal" wire:model.defer="showModal" persistent>
|
||||||
|
<x-card class="border border-gray-200">
|
||||||
|
<x-slot name="action">
|
||||||
|
<button class="cursor-pointer p-1 rounded-full focus:outline-none focus:outline-hidden focus:ring-2 focus:ring-secondary-200 text-secondary-300"
|
||||||
|
wire:click="closeModal"
|
||||||
|
tabindex="-1"
|
||||||
|
>
|
||||||
|
<x-dynamic-component :component="WireUi::component('icon')" name="x-mark" class="w-5 h-5" />
|
||||||
|
</button>
|
||||||
|
</x-slot>
|
||||||
|
<x-slot name="title">
|
||||||
|
選擇貼圖
|
||||||
|
</x-slot>
|
||||||
|
|
||||||
|
<div class="flex flex-wrap gap-2 max-h-64 overflow-y-auto">
|
||||||
|
@foreach($stickers as $sticker)
|
||||||
|
<img
|
||||||
|
src="{{ asset('superstar-pic/'.$sticker) }}"
|
||||||
|
wire:click="select('{{ $sticker }}')"
|
||||||
|
class="w-16 h-16 object-contain bg-white border-2 rounded cursor-pointer
|
||||||
|
{{ $selectedSticker === $sticker ? 'border-pink-500' : 'border-transparent' }}"
|
||||||
|
>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</x-card>
|
||||||
|
</x-modal>
|
@ -1,6 +1,7 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use App\Livewire\Forms\LoginForm;
|
use App\Livewire\Forms\LoginForm;
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
use Illuminate\Support\Facades\Session;
|
use Illuminate\Support\Facades\Session;
|
||||||
use Livewire\Attributes\Layout;
|
use Livewire\Attributes\Layout;
|
||||||
use Livewire\Volt\Component;
|
use Livewire\Volt\Component;
|
||||||
@ -16,17 +17,48 @@ new #[Layout('layouts.guest')] class extends Component
|
|||||||
{
|
{
|
||||||
$this->validate();
|
$this->validate();
|
||||||
|
|
||||||
$this->form->authenticate();
|
//$this->form->authenticate();
|
||||||
|
// 呼叫遠端 API 驗證帳號密碼
|
||||||
|
$response = Http::withOptions(['verify' => false])
|
||||||
|
->post(config('services.backend.url').'/api/login', [
|
||||||
|
'email' => $this->form->email,
|
||||||
|
'password' => $this->form->password,
|
||||||
|
]);
|
||||||
|
if ($response->failed()) {
|
||||||
|
throw \Illuminate\Validation\ValidationException::withMessages([
|
||||||
|
'email' => '登入失敗,請檢查帳號或密碼。',
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
$data = $response->json("data");
|
||||||
|
|
||||||
|
// 假設遠端回傳 token + user profile
|
||||||
|
$token = $data['token'];
|
||||||
|
$userData = $data['user'];
|
||||||
|
|
||||||
|
// 在本地建立/更新使用者
|
||||||
|
$user = \App\Models\User::updateOrCreate(
|
||||||
|
[ 'id' => $userData['id']],
|
||||||
|
[
|
||||||
|
'name' => $userData['name'],
|
||||||
|
'email' => $userData['email'],
|
||||||
|
'phone' => $userData['phone'],
|
||||||
|
'birthday' => $userData['birthday'],
|
||||||
|
'gender' => $userData['gender'],
|
||||||
|
'status' => $userData['status'],
|
||||||
|
'email_verified_at' => $userData['email_verified_at'],
|
||||||
|
'api_plain_token' => $token,
|
||||||
|
'created_at' => $userData['created_at'],
|
||||||
|
'updated_at' => $userData['updated_at'],
|
||||||
|
|
||||||
|
]
|
||||||
|
);
|
||||||
|
|
||||||
|
Auth::login($user, remember: true);
|
||||||
|
|
||||||
Session::regenerate();
|
Session::regenerate();
|
||||||
|
|
||||||
//$this->redirectIntended(default: route('dashboard', absolute: false), navigate: true);
|
$this->redirectIntended(default: route('welcome', absolute: false), navigate: true);
|
||||||
$user = auth()->user();
|
|
||||||
if ($user->hasRole('User')) {
|
|
||||||
$this->redirect(route('dashboard'), navigate: true);
|
|
||||||
} else {
|
|
||||||
$this->redirect(route('admin.dashboard'), navigate: true);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}; ?>
|
}; ?>
|
||||||
|
|
||||||
|
15
resources/views/livewire/pages/home.blade.php
Normal file
15
resources/views/livewire/pages/home.blade.php
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
<div class="py-12 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||||
|
<div class="grid grid-cols-2 md:grid-cols-3 lg:grid-cols-4 gap-6">
|
||||||
|
|
||||||
|
<x-button.flat-card image="{{ asset('手機點歌/首頁-新歌快報.png') }}" href="{{ route('new-songs') }}" />
|
||||||
|
<x-button.flat-card image="{{ asset('手機點歌/首頁-熱門排行.png') }}" href="{{ route('top-ranking') }}" />
|
||||||
|
<x-button.flat-card image="{{ asset('手機點歌/首頁-歌名查詢.png') }}" href="{{ route('search-song') }}" />
|
||||||
|
@if($roomCode)
|
||||||
|
<x-button.flat-card image="{{ asset('手機點歌/首頁-已點歌曲.png') }}" onclick="orderSongAndNavigate()" />
|
||||||
|
<x-button.flat-card image="{{ asset('手機點歌/首頁-聲音控制.png') }}" href="{{ route('sound-control') }}" />
|
||||||
|
<x-button.flat-card image="{{ asset('手機點歌/首頁-社群媒體.png') }}" href="{{ route('social-media') }}" />
|
||||||
|
<x-button.flat-card image="{{ asset('手機點歌/首頁-真情告白.png') }}" href="{{ route('love-message') }}" />
|
||||||
|
<x-button.flat-card image="{{ asset('手機點歌/首頁-心情貼圖.png') }}" href="{{ route('mood-stickers') }}" />
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
</div>
|
50
resources/views/livewire/pages/love-message.blade.php
Normal file
50
resources/views/livewire/pages/love-message.blade.php
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
<div class="max-w-lg mx-auto py-12 px-4 sm:px-6 lg:px-8">
|
||||||
|
<div class="bg-white shadow rounded-lg p-6 space-y-4">
|
||||||
|
<h2 class="text-2xl font-semibold text-center">真情告白</h2>
|
||||||
|
|
||||||
|
<div class="space-y-2">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
maxlength="64"
|
||||||
|
placeholder="請輸入您的留言"
|
||||||
|
wire:model.lazy="message"
|
||||||
|
class="w-full border rounded-lg p-3 focus:ring-2 focus:ring-pink-400 focus:outline-none"
|
||||||
|
/>
|
||||||
|
<div class="text-gray-500 text-sm text-right">
|
||||||
|
字串長度:{{ strlen($message) }} 個單位
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<x-button
|
||||||
|
wire:click="submitMessage"
|
||||||
|
pink
|
||||||
|
label="確認送出"
|
||||||
|
class="w-full mt-4 text-xl font-semibold py-2 px-4 rounded-lg transition"
|
||||||
|
/>
|
||||||
|
|
||||||
|
{{-- 打開貼圖 Modal --}}
|
||||||
|
<x-card
|
||||||
|
class="mt-2 w-full cursor-pointer hover:bg-gray-50 transition"
|
||||||
|
wire:click="$dispatchTo('modals.sticker-modal','openModal')"
|
||||||
|
>
|
||||||
|
<div class="flex flex-col items-center text-gray-400">
|
||||||
|
<span class="text-gray-600 mb-2">已選貼圖:</span>
|
||||||
|
@if($selectedSticker)
|
||||||
|
<img src="{{ asset('superstar-pic/'.$selectedSticker) }}" class="w-16 h-16 object-contain bg-white border-2 rounded cursor-pointer ">
|
||||||
|
@else
|
||||||
|
<span class="w-16 h-16 flex items-center justify-center text-gray-400 text-sm text-center">選擇貼圖</span>
|
||||||
|
@endif
|
||||||
|
<span class="text-sm">點擊此處選擇</span>
|
||||||
|
</div>
|
||||||
|
</x-card>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="mt-6 bg-yellow-50 border-l-4 border-yellow-400 p-4 text-sm text-yellow-700 rounded-lg space-y-1">
|
||||||
|
<ul class="list-disc pl-5 space-y-1">
|
||||||
|
<li>注意:不要使用特殊符號,可能無法正常顯示!</li>
|
||||||
|
<li>播歌畫面可顯示的字串長度為64(會員名稱 + 訊息內容)!</li>
|
||||||
|
<li>如果非要給這愛加個期限,我希望是一萬年…真情告白,等您留言!(每則留言輪播三次)</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<livewire:modals.sticker-modal />
|
||||||
|
</div>
|
||||||
|
|
88
resources/views/livewire/pages/ordered-song-list.blade.php
Normal file
88
resources/views/livewire/pages/ordered-song-list.blade.php
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
<div wire:poll.5s="refreshSongs" class="space-y-6 p-4">
|
||||||
|
|
||||||
|
<x-table bordered striped size="sm" class="w-full">
|
||||||
|
<x-slot name="header">
|
||||||
|
<tr>
|
||||||
|
<th class="px-4 py-2 w-16 text-center">編號</th>
|
||||||
|
<th class="px-4 py-2">歌曲</th>
|
||||||
|
<th class="px-4 py-2 w-24 text-center">狀態</th>
|
||||||
|
</tr>
|
||||||
|
</x-slot>
|
||||||
|
|
||||||
|
{{-- 正在播放 --}}
|
||||||
|
<tr>
|
||||||
|
<td class="px-4 py-2 text-center text-blue-600 font-semibold" colspan="3">
|
||||||
|
🎵 正在播放
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@forelse($playing as $song)
|
||||||
|
<tr class="hover:bg-gray-50 cursor-pointer">
|
||||||
|
<td class="px-4 py-2 text-center">{{ $song->song_id }}</td>
|
||||||
|
<td class="px-4 py-2">
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-lg font-semibold">{{ $song->song_name }}</span>
|
||||||
|
<span class="text-xs text-gray-500 self-end">{{ $song->artist_name }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-4 py-2 text-blue-500 text-center">{{ $song->status->labels() }}</td>
|
||||||
|
</tr>
|
||||||
|
@empty
|
||||||
|
<tr>
|
||||||
|
<td class="px-4 py-4 text-center text-gray-400" colspan="3">
|
||||||
|
目前沒有正在播放的歌曲
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforelse
|
||||||
|
|
||||||
|
{{-- 待播 / 插播 --}}
|
||||||
|
<tr>
|
||||||
|
<td class="px-4 py-2 text-center text-yellow-600 font-semibold" colspan="3">
|
||||||
|
⏳ 待播 / 插播
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@forelse($nextSong as $song)
|
||||||
|
<tr class="hover:bg-gray-50 cursor-pointer">
|
||||||
|
<td class="px-4 py-2 text-center">{{ $song->song_id }}</td>
|
||||||
|
<td class="px-4 py-2">
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-lg font-semibold">{{ $song->song_name }}</span>
|
||||||
|
<span class="text-xs text-gray-500 self-end">{{ $song->artist_name }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-4 py-2 text-yellow-500 text-center">{{ $song->status->labels() }}</td>
|
||||||
|
</tr>
|
||||||
|
@empty
|
||||||
|
<tr>
|
||||||
|
<td class="px-4 py-4 text-center text-gray-400" colspan="3">
|
||||||
|
目前沒有待播歌曲
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforelse
|
||||||
|
|
||||||
|
{{-- 已結束播放 --}}
|
||||||
|
<tr>
|
||||||
|
<td class="px-4 py-2 text-center text-gray-600 font-semibold" colspan="3">
|
||||||
|
✅ 已結束播放
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@forelse($finished as $song)
|
||||||
|
<tr class="hover:bg-gray-50 cursor-pointer">
|
||||||
|
<td class="px-4 py-2 text-center">{{ $song->song_id }}</td>
|
||||||
|
<td class="px-4 py-2">
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-lg font-semibold">{{ $song->song_name }}</span>
|
||||||
|
<span class="text-xs text-gray-500 self-end">{{ $song->artist_name }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-4 py-2 text-gray-500 text-center">{{ $song->status->labels() }}</td>
|
||||||
|
</tr>
|
||||||
|
@empty
|
||||||
|
<tr>
|
||||||
|
<td class="px-4 py-4 text-center text-gray-400" colspan="3">
|
||||||
|
尚無結束播放的歌曲
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforelse
|
||||||
|
|
||||||
|
</x-table>
|
||||||
|
</div>
|
89
resources/views/livewire/pages/search-song.blade.php
Normal file
89
resources/views/livewire/pages/search-song.blade.php
Normal file
@ -0,0 +1,89 @@
|
|||||||
|
<div class="space-y-4 p-4">
|
||||||
|
<div class="space-y-2">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
wire:model.live.debounce.250ms="artistSearch"
|
||||||
|
placeholder="搜尋歌手..."
|
||||||
|
class="border rounded-lg p-2 w-full focus:ring-2 focus:ring-pink-400 focus:outline-none"
|
||||||
|
/>
|
||||||
|
|
||||||
|
<!-- 搜尋結果清單 -->
|
||||||
|
@if(!empty($artistOptions))
|
||||||
|
<div class="border rounded max-h-40 overflow-y-auto bg-white shadow">
|
||||||
|
@foreach($artistOptions as $artist)
|
||||||
|
<div class="px-2 py-1 cursor-pointer hover:bg-pink-100 flex justify-between items-center"
|
||||||
|
wire:click="addArtist({{ $artist['id'] }}, '{{ $artist['name'] }}')">
|
||||||
|
{{ $artist['name'] }}
|
||||||
|
@if(in_array($artist['id'], $selectedArtists))
|
||||||
|
<span class="text-pink-500 font-bold">✔</span>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
|
||||||
|
<!-- 已選歌手 -->
|
||||||
|
@if($selectedArtists)
|
||||||
|
<div class="flex gap-2 flex-wrap mt-2">
|
||||||
|
@foreach($selectedArtists as $artistId => $artistName)
|
||||||
|
<span class="bg-pink-200 text-pink-700 px-2 py-1 rounded-full flex items-center gap-1">
|
||||||
|
{{ $artistName }}
|
||||||
|
<button type="button" wire:click="removeArtist({{ $artistId }})" class="font-bold">×</button>
|
||||||
|
</span>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
@endif
|
||||||
|
</div>
|
||||||
|
{{-- 搜尋框 --}}
|
||||||
|
<div class="w-full mb-4">
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
wire:model.live.debounce.250ms="search"
|
||||||
|
placeholder="輸入歌名查詢..."
|
||||||
|
class="border rounded-lg p-3 w-full focus:ring-2 focus:ring-pink-400 focus:outline-none"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- 語言篩選 --}}
|
||||||
|
<div class="flex flex-wrap gap-2 mb-4">
|
||||||
|
@foreach($languages as $key => $label)
|
||||||
|
<button
|
||||||
|
wire:click="selectLanguage('{{ $key }}')"
|
||||||
|
class="px-4 py-2 rounded-lg border transition
|
||||||
|
{{ $selectedLanguage === $key ? 'bg-pink-500 text-white border-pink-500' : 'bg-white text-gray-700 border-gray-300' }}">
|
||||||
|
{{ $label }}
|
||||||
|
</button>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{{-- 歌曲列表 Table --}}
|
||||||
|
<x-table bordered striped size="sm" class="w-full">
|
||||||
|
<x-slot name="header">
|
||||||
|
<tr>
|
||||||
|
<th class="px-4 py-2 w-16 text-center">編號</th>
|
||||||
|
<th class="px-4 py-2">歌曲</th>
|
||||||
|
<th class="px-4 py-2 w-24 text-center">操作</th>
|
||||||
|
</tr>
|
||||||
|
</x-slot>
|
||||||
|
|
||||||
|
@forelse($songs as $song)
|
||||||
|
<tr wire:click="orderSong({{ $song->id }})" class="hover:bg-gray-50 cursor-pointer">
|
||||||
|
<td class="px-4 py-2 text-center">{{ $song->song_id }}</td>
|
||||||
|
<td class="px-4 py-2">
|
||||||
|
<div class="flex flex-col">
|
||||||
|
<span class="text-lg font-semibold">{{ $song->song_name }}</span>
|
||||||
|
<span class="text-xs text-gray-500 self-end">{{ $song->str_artists_plus() }}</span>
|
||||||
|
</div>
|
||||||
|
</td>
|
||||||
|
<td class="px-4 py-2 text-blue-500 text-center">點歌</td>
|
||||||
|
</tr>
|
||||||
|
@empty
|
||||||
|
<tr>
|
||||||
|
<td class="px-4 py-4 text-center text-gray-400" colspan="3">
|
||||||
|
沒有符合的歌曲
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
@endforelse
|
||||||
|
</x-table>
|
||||||
|
|
||||||
|
</div>
|
10
resources/views/livewire/pages/sound-control.blade.php
Normal file
10
resources/views/livewire/pages/sound-control.blade.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<div class="py-12 max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
|
||||||
|
<div class="grid grid-cols-3 gap-6">
|
||||||
|
@foreach($buttons as $btn)
|
||||||
|
<x-button.flat-card
|
||||||
|
image="{{ asset('手機點歌/'.$btn['img']) }}"
|
||||||
|
wire:click="sendVolumeControl('{{ $btn['action'] }}')"
|
||||||
|
/>
|
||||||
|
@endforeach
|
||||||
|
</div>
|
||||||
|
</div>
|
@ -76,7 +76,7 @@ new class extends Component
|
|||||||
@if($token)
|
@if($token)
|
||||||
<div class="mt-4">
|
<div class="mt-4">
|
||||||
<x-input-label value="New Token" />
|
<x-input-label value="New Token" />
|
||||||
<x-wireui:textarea readonly rows="2" class="mt-1 w-full">{{ $token }}</x-wireui:textarea>
|
<x-textarea readonly rows="2" class="mt-1 w-full">{{ $token }}</x-textarea>
|
||||||
<p class="text-xs text-gray-500 mt-1">Please copy this token now. You won't be able to see it again.</p>
|
<p class="text-xs text-gray-500 mt-1">Please copy this token now. You won't be able to see it again.</p>
|
||||||
</div>
|
</div>
|
||||||
@endif
|
@endif
|
||||||
|
10
resources/views/love-message.blade.php
Normal file
10
resources/views/love-message.blade.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<x-app-layout>
|
||||||
|
<x-slot name="header">
|
||||||
|
<div class="header">超級巨星 自助式KTV</div>
|
||||||
|
<div class="banner">
|
||||||
|
<img src="{{ asset('手機點歌/BANNER-12.png') }}" alt="超級巨星 Banner">
|
||||||
|
</div>
|
||||||
|
</x-slot>
|
||||||
|
|
||||||
|
<livewire:pages.love-message />
|
||||||
|
</x-app-layout>
|
12
resources/views/new-songs.blade.php
Normal file
12
resources/views/new-songs.blade.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<x-app-layout>
|
||||||
|
<x-slot name="header">
|
||||||
|
<div class="header">超級巨星 自助式KTV</div>
|
||||||
|
<div class="banner">
|
||||||
|
<img src="{{ asset('手機點歌/BANNER-01.png') }}" alt="新歌快報">
|
||||||
|
</div>
|
||||||
|
</x-slot>
|
||||||
|
<livewire:pages.search-song :searchCategory="'New'" />
|
||||||
|
<div class="image-container">
|
||||||
|
<img src="{{ asset('手機點歌/LOGO_800x400px.png') }}" alt="Wolf Fox Logo">
|
||||||
|
</div>
|
||||||
|
</x-app-layout>
|
9
resources/views/search-song.blade.php
Normal file
9
resources/views/search-song.blade.php
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
<x-app-layout>
|
||||||
|
<x-slot name="header">
|
||||||
|
<div class="header">超級巨星 自助式KTV</div>
|
||||||
|
<div class="banner">
|
||||||
|
<img src="{{ asset('手機點歌/BANNER-06.png') }}" alt="歌名查詢">
|
||||||
|
</div>
|
||||||
|
</x-slot>
|
||||||
|
<livewire:pages.search-song />
|
||||||
|
</x-app-layout>
|
10
resources/views/sound-control.blade.php
Normal file
10
resources/views/sound-control.blade.php
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
<x-app-layout>
|
||||||
|
<x-slot name="header">
|
||||||
|
<div class="header">超級巨星 自助式KTV</div>
|
||||||
|
<div class="banner">
|
||||||
|
<img src="{{ asset('手機點歌/BANNER-09.png') }}" alt="超級巨星 Banner">
|
||||||
|
</div>
|
||||||
|
</x-slot>
|
||||||
|
|
||||||
|
<livewire:pages.sound-control />
|
||||||
|
</x-app-layout>
|
12
resources/views/top-ranking.blade.php
Normal file
12
resources/views/top-ranking.blade.php
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
<x-app-layout>
|
||||||
|
<x-slot name="header">
|
||||||
|
<div class="header">超級巨星 自助式KTV</div>
|
||||||
|
<div class="banner">
|
||||||
|
<img src="{{ asset('手機點歌/BANNER-02.png') }}" alt="熱門排行">
|
||||||
|
</div>
|
||||||
|
</x-slot>
|
||||||
|
<livewire:pages.search-song :searchCategory="'Hot'" />
|
||||||
|
<div class="image-container">
|
||||||
|
<img src="{{ asset('手機點歌/LOGO_800x400px.png') }}" alt="Wolf Fox Logo">
|
||||||
|
</div>
|
||||||
|
</x-app-layout>
|
@ -1,145 +1,10 @@
|
|||||||
<!DOCTYPE html>
|
<x-app-layout>
|
||||||
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
|
<x-slot name="header">
|
||||||
<head>
|
<div class="header">超級巨星 自助式KTV</div>
|
||||||
<meta charset="utf-8">
|
<div class="banner">
|
||||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
<img src="{{ asset('手機點歌/LOGO_721x211px.png') }}" alt="超級巨星 Banner">
|
||||||
|
|
||||||
<title>Laravel</title>
|
|
||||||
|
|
||||||
<!-- Fonts -->
|
|
||||||
<link rel="preconnect" href="https://fonts.bunny.net">
|
|
||||||
<link href="https://fonts.bunny.net/css?family=figtree:400,600&display=swap" rel="stylesheet" />
|
|
||||||
|
|
||||||
<!-- Styles -->
|
|
||||||
@vite(['resources/css/app.css', 'resources/js/app.js'])
|
|
||||||
</head>
|
|
||||||
<body class="antialiased font-sans">
|
|
||||||
<div class="bg-gray-50 text-black/50 dark:bg-black dark:text-white/50">
|
|
||||||
<img id="background" class="absolute -left-20 top-0 max-w-[877px]" src="https://laravel.com/assets/img/welcome/background.svg" />
|
|
||||||
<div class="relative min-h-screen flex flex-col items-center justify-center selection:bg-[#FF2D20] selection:text-white">
|
|
||||||
<div class="relative w-full max-w-2xl px-6 lg:max-w-7xl">
|
|
||||||
<header class="grid grid-cols-2 items-center gap-2 py-10 lg:grid-cols-3">
|
|
||||||
<div class="flex lg:justify-center lg:col-start-2">
|
|
||||||
<svg class="h-12 w-auto text-white lg:h-16 lg:text-[#FF2D20]" viewBox="0 0 62 65" fill="none" xmlns="http://www.w3.org/2000/svg"><path d="M61.8548 14.6253C61.8778 14.7102 61.8895 14.7978 61.8897 14.8858V28.5615C61.8898 28.737 61.8434 28.9095 61.7554 29.0614C61.6675 29.2132 61.5409 29.3392 61.3887 29.4265L49.9104 36.0351V49.1337C49.9104 49.4902 49.7209 49.8192 49.4118 49.9987L25.4519 63.7916C25.3971 63.8227 25.3372 63.8427 25.2774 63.8639C25.255 63.8714 25.2338 63.8851 25.2101 63.8913C25.0426 63.9354 24.8666 63.9354 24.6991 63.8913C24.6716 63.8838 24.6467 63.8689 24.6205 63.8589C24.5657 63.8389 24.5084 63.8215 24.456 63.7916L0.501061 49.9987C0.348882 49.9113 0.222437 49.7853 0.134469 49.6334C0.0465019 49.4816 0.000120578 49.3092 0 49.1337L0 8.10652C0 8.01678 0.0124642 7.92953 0.0348998 7.84477C0.0423783 7.8161 0.0598282 7.78993 0.0697995 7.76126C0.0884958 7.70891 0.105946 7.65531 0.133367 7.6067C0.152063 7.5743 0.179485 7.54812 0.20192 7.51821C0.230588 7.47832 0.256763 7.43719 0.290416 7.40229C0.319084 7.37362 0.356476 7.35243 0.388883 7.32751C0.425029 7.29759 0.457436 7.26518 0.498568 7.2415L12.4779 0.345059C12.6296 0.257786 12.8015 0.211853 12.9765 0.211853C13.1515 0.211853 13.3234 0.257786 13.475 0.345059L25.4531 7.2415H25.4556C25.4955 7.26643 25.5292 7.29759 25.5653 7.32626C25.5977 7.35119 25.6339 7.37362 25.6625 7.40104C25.6974 7.43719 25.7224 7.47832 25.7523 7.51821C25.7735 7.54812 25.8021 7.5743 25.8196 7.6067C25.8483 7.65656 25.8645 7.70891 25.8844 7.76126C25.8944 7.78993 25.9118 7.8161 25.9193 7.84602C25.9423 7.93096 25.954 8.01853 25.9542 8.10652V33.7317L35.9355 27.9844V14.8846C35.9355 14.7973 35.948 14.7088 35.9704 14.6253C35.9792 14.5954 35.9954 14.5692 36.0053 14.5405C36.0253 14.4882 36.0427 14.4346 36.0702 14.386C36.0888 14.3536 36.1163 14.3274 36.1375 14.2975C36.1674 14.2576 36.1923 14.2165 36.2272 14.1816C36.2559 14.1529 36.292 14.1317 36.3244 14.1068C36.3618 14.0769 36.3942 14.0445 36.4341 14.0208L48.4147 7.12434C48.5663 7.03694 48.7383 6.99094 48.9133 6.99094C49.0883 6.99094 49.2602 7.03694 49.4118 7.12434L61.3899 14.0208C61.4323 14.0457 61.4647 14.0769 61.5021 14.1055C61.5333 14.1305 61.5694 14.1529 61.5981 14.1803C61.633 14.2165 61.6579 14.2576 61.6878 14.2975C61.7103 14.3274 61.7377 14.3536 61.7551 14.386C61.7838 14.4346 61.8 14.4882 61.8199 14.5405C61.8312 14.5692 61.8474 14.5954 61.8548 14.6253ZM59.893 27.9844V16.6121L55.7013 19.0252L49.9104 22.3593V33.7317L59.8942 27.9844H59.893ZM47.9149 48.5566V37.1768L42.2187 40.4299L25.953 49.7133V61.2003L47.9149 48.5566ZM1.99677 9.83281V48.5566L23.9562 61.199V49.7145L12.4841 43.2219L12.4804 43.2194L12.4754 43.2169C12.4368 43.1945 12.4044 43.1621 12.3682 43.1347C12.3371 43.1097 12.3009 43.0898 12.2735 43.0624L12.271 43.0586C12.2386 43.0275 12.2162 42.9888 12.1887 42.9539C12.1638 42.9203 12.1339 42.8916 12.114 42.8567L12.1127 42.853C12.0903 42.8156 12.0766 42.7707 12.0604 42.7283C12.0442 42.6909 12.023 42.656 12.013 42.6161C12.0005 42.5688 11.998 42.5177 11.9931 42.4691C11.9881 42.4317 11.9781 42.3943 11.9781 42.3569V15.5801L6.18848 12.2446L1.99677 9.83281ZM12.9777 2.36177L2.99764 8.10652L12.9752 13.8513L22.9541 8.10527L12.9752 2.36177H12.9777ZM18.1678 38.2138L23.9574 34.8809V9.83281L19.7657 12.2459L13.9749 15.5801V40.6281L18.1678 38.2138ZM48.9133 9.14105L38.9344 14.8858L48.9133 20.6305L58.8909 14.8846L48.9133 9.14105ZM47.9149 22.3593L42.124 19.0252L37.9323 16.6121V27.9844L43.7219 31.3174L47.9149 33.7317V22.3593ZM24.9533 47.987L39.59 39.631L46.9065 35.4555L36.9352 29.7145L25.4544 36.3242L14.9907 42.3482L24.9533 47.987Z" fill="currentColor"/></svg>
|
|
||||||
</div>
|
</div>
|
||||||
@if (Route::has('login'))
|
</x-slot>
|
||||||
<livewire:welcome.navigation />
|
|
||||||
@endif
|
|
||||||
</header>
|
|
||||||
|
|
||||||
<main class="mt-6">
|
<livewire:pages.home />
|
||||||
<div class="grid gap-6 lg:grid-cols-2 lg:gap-8">
|
</x-app-layout>
|
||||||
<a
|
|
||||||
href="https://laravel.com/docs"
|
|
||||||
id="docs-card"
|
|
||||||
class="flex flex-col items-start gap-6 overflow-hidden rounded-lg bg-white p-6 shadow-[0px_14px_34px_0px_rgba(0,0,0,0.08)] ring-1 ring-white/[0.05] transition duration-300 hover:text-black/70 hover:ring-black/20 focus:outline-none focus-visible:ring-[#FF2D20] md:row-span-3 lg:p-10 lg:pb-10 dark:bg-zinc-900 dark:ring-zinc-800 dark:hover:text-white/70 dark:hover:ring-zinc-700 dark:focus-visible:ring-[#FF2D20]"
|
|
||||||
>
|
|
||||||
<div id="screenshot-container" class="relative flex w-full flex-1 items-stretch">
|
|
||||||
<img
|
|
||||||
src="https://laravel.com/assets/img/welcome/docs-light.svg"
|
|
||||||
alt="Laravel documentation screenshot"
|
|
||||||
class="aspect-video h-full w-full flex-1 rounded-[10px] object-top object-cover drop-shadow-[0px_4px_34px_rgba(0,0,0,0.06)] dark:hidden"
|
|
||||||
onerror="
|
|
||||||
document.getElementById('screenshot-container').classList.add('!hidden');
|
|
||||||
document.getElementById('docs-card').classList.add('!row-span-1');
|
|
||||||
document.getElementById('docs-card-content').classList.add('!flex-row');
|
|
||||||
document.getElementById('background').classList.add('!hidden');
|
|
||||||
"
|
|
||||||
/>
|
|
||||||
<img
|
|
||||||
src="https://laravel.com/assets/img/welcome/docs-dark.svg"
|
|
||||||
alt="Laravel documentation screenshot"
|
|
||||||
class="hidden aspect-video h-full w-full flex-1 rounded-[10px] object-top object-cover drop-shadow-[0px_4px_34px_rgba(0,0,0,0.25)] dark:block"
|
|
||||||
/>
|
|
||||||
<div
|
|
||||||
class="absolute -bottom-16 -left-16 h-40 w-[calc(100%+8rem)] bg-gradient-to-b from-transparent via-white to-white dark:via-zinc-900 dark:to-zinc-900"
|
|
||||||
></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="relative flex items-center gap-6 lg:items-end">
|
|
||||||
<div id="docs-card-content" class="flex items-start gap-6 lg:flex-col">
|
|
||||||
<div class="flex size-12 shrink-0 items-center justify-center rounded-full bg-[#FF2D20]/10 sm:size-16">
|
|
||||||
<svg class="size-5 sm:size-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><path fill="#FF2D20" d="M23 4a1 1 0 0 0-1.447-.894L12.224 7.77a.5.5 0 0 1-.448 0L2.447 3.106A1 1 0 0 0 1 4v13.382a1.99 1.99 0 0 0 1.105 1.79l9.448 4.728c.14.065.293.1.447.1.154-.005.306-.04.447-.105l9.453-4.724a1.99 1.99 0 0 0 1.1-1.789V4ZM3 6.023a.25.25 0 0 1 .362-.223l7.5 3.75a.251.251 0 0 1 .138.223v11.2a.25.25 0 0 1-.362.224l-7.5-3.75a.25.25 0 0 1-.138-.22V6.023Zm18 11.2a.25.25 0 0 1-.138.224l-7.5 3.75a.249.249 0 0 1-.329-.099.249.249 0 0 1-.033-.12V9.772a.251.251 0 0 1 .138-.224l7.5-3.75a.25.25 0 0 1 .362.224v11.2Z"/><path fill="#FF2D20" d="m3.55 1.893 8 4.048a1.008 1.008 0 0 0 .9 0l8-4.048a1 1 0 0 0-.9-1.785l-7.322 3.706a.506.506 0 0 1-.452 0L4.454.108a1 1 0 0 0-.9 1.785H3.55Z"/></svg>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="pt-3 sm:pt-5 lg:pt-0">
|
|
||||||
<h2 class="text-xl font-semibold text-black dark:text-white">Documentation</h2>
|
|
||||||
|
|
||||||
<p class="mt-4 text-sm/relaxed">
|
|
||||||
Laravel has wonderful documentation covering every aspect of the framework. Whether you are a newcomer or have prior experience with Laravel, we recommend reading our documentation from beginning to end.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<svg class="size-6 shrink-0 stroke-[#FF2D20]" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12h15m0 0l-6.75-6.75M19.5 12l-6.75 6.75"/></svg>
|
|
||||||
</div>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a
|
|
||||||
href="https://laracasts.com"
|
|
||||||
class="flex items-start gap-4 rounded-lg bg-white p-6 shadow-[0px_14px_34px_0px_rgba(0,0,0,0.08)] ring-1 ring-white/[0.05] transition duration-300 hover:text-black/70 hover:ring-black/20 focus:outline-none focus-visible:ring-[#FF2D20] lg:pb-10 dark:bg-zinc-900 dark:ring-zinc-800 dark:hover:text-white/70 dark:hover:ring-zinc-700 dark:focus-visible:ring-[#FF2D20]"
|
|
||||||
>
|
|
||||||
<div class="flex size-12 shrink-0 items-center justify-center rounded-full bg-[#FF2D20]/10 sm:size-16">
|
|
||||||
<svg class="size-5 sm:size-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><g fill="#FF2D20"><path d="M24 8.25a.5.5 0 0 0-.5-.5H.5a.5.5 0 0 0-.5.5v12a2.5 2.5 0 0 0 2.5 2.5h19a2.5 2.5 0 0 0 2.5-2.5v-12Zm-7.765 5.868a1.221 1.221 0 0 1 0 2.264l-6.626 2.776A1.153 1.153 0 0 1 8 18.123v-5.746a1.151 1.151 0 0 1 1.609-1.035l6.626 2.776ZM19.564 1.677a.25.25 0 0 0-.177-.427H15.6a.106.106 0 0 0-.072.03l-4.54 4.543a.25.25 0 0 0 .177.427h3.783c.027 0 .054-.01.073-.03l4.543-4.543ZM22.071 1.318a.047.047 0 0 0-.045.013l-4.492 4.492a.249.249 0 0 0 .038.385.25.25 0 0 0 .14.042h5.784a.5.5 0 0 0 .5-.5v-2a2.5 2.5 0 0 0-1.925-2.432ZM13.014 1.677a.25.25 0 0 0-.178-.427H9.101a.106.106 0 0 0-.073.03l-4.54 4.543a.25.25 0 0 0 .177.427H8.4a.106.106 0 0 0 .073-.03l4.54-4.543ZM6.513 1.677a.25.25 0 0 0-.177-.427H2.5A2.5 2.5 0 0 0 0 3.75v2a.5.5 0 0 0 .5.5h1.4a.106.106 0 0 0 .073-.03l4.54-4.543Z"/></g></svg>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="pt-3 sm:pt-5">
|
|
||||||
<h2 class="text-xl font-semibold text-black dark:text-white">Laracasts</h2>
|
|
||||||
|
|
||||||
<p class="mt-4 text-sm/relaxed">
|
|
||||||
Laracasts offers thousands of video tutorials on Laravel, PHP, and JavaScript development. Check them out, see for yourself, and massively level up your development skills in the process.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<svg class="size-6 shrink-0 self-center stroke-[#FF2D20]" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12h15m0 0l-6.75-6.75M19.5 12l-6.75 6.75"/></svg>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<a
|
|
||||||
href="https://laravel-news.com"
|
|
||||||
class="flex items-start gap-4 rounded-lg bg-white p-6 shadow-[0px_14px_34px_0px_rgba(0,0,0,0.08)] ring-1 ring-white/[0.05] transition duration-300 hover:text-black/70 hover:ring-black/20 focus:outline-none focus-visible:ring-[#FF2D20] lg:pb-10 dark:bg-zinc-900 dark:ring-zinc-800 dark:hover:text-white/70 dark:hover:ring-zinc-700 dark:focus-visible:ring-[#FF2D20]"
|
|
||||||
>
|
|
||||||
<div class="flex size-12 shrink-0 items-center justify-center rounded-full bg-[#FF2D20]/10 sm:size-16">
|
|
||||||
<svg class="size-5 sm:size-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24"><g fill="#FF2D20"><path d="M8.75 4.5H5.5c-.69 0-1.25.56-1.25 1.25v4.75c0 .69.56 1.25 1.25 1.25h3.25c.69 0 1.25-.56 1.25-1.25V5.75c0-.69-.56-1.25-1.25-1.25Z"/><path d="M24 10a3 3 0 0 0-3-3h-2V2.5a2 2 0 0 0-2-2H2a2 2 0 0 0-2 2V20a3.5 3.5 0 0 0 3.5 3.5h17A3.5 3.5 0 0 0 24 20V10ZM3.5 21.5A1.5 1.5 0 0 1 2 20V3a.5.5 0 0 1 .5-.5h14a.5.5 0 0 1 .5.5v17c0 .295.037.588.11.874a.5.5 0 0 1-.484.625L3.5 21.5ZM22 20a1.5 1.5 0 1 1-3 0V9.5a.5.5 0 0 1 .5-.5H21a1 1 0 0 1 1 1v10Z"/><path d="M12.751 6.047h2a.75.75 0 0 1 .75.75v.5a.75.75 0 0 1-.75.75h-2A.75.75 0 0 1 12 7.3v-.5a.75.75 0 0 1 .751-.753ZM12.751 10.047h2a.75.75 0 0 1 .75.75v.5a.75.75 0 0 1-.75.75h-2A.75.75 0 0 1 12 11.3v-.5a.75.75 0 0 1 .751-.753ZM4.751 14.047h10a.75.75 0 0 1 .75.75v.5a.75.75 0 0 1-.75.75h-10A.75.75 0 0 1 4 15.3v-.5a.75.75 0 0 1 .751-.753ZM4.75 18.047h7.5a.75.75 0 0 1 .75.75v.5a.75.75 0 0 1-.75.75h-7.5A.75.75 0 0 1 4 19.3v-.5a.75.75 0 0 1 .75-.753Z"/></g></svg>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="pt-3 sm:pt-5">
|
|
||||||
<h2 class="text-xl font-semibold text-black dark:text-white">Laravel News</h2>
|
|
||||||
|
|
||||||
<p class="mt-4 text-sm/relaxed">
|
|
||||||
Laravel News is a community driven portal and newsletter aggregating all of the latest and most important news in the Laravel ecosystem, including new package releases and tutorials.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<svg class="size-6 shrink-0 self-center stroke-[#FF2D20]" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5"><path stroke-linecap="round" stroke-linejoin="round" d="M4.5 12h15m0 0l-6.75-6.75M19.5 12l-6.75 6.75"/></svg>
|
|
||||||
</a>
|
|
||||||
|
|
||||||
<div class="flex items-start gap-4 rounded-lg bg-white p-6 shadow-[0px_14px_34px_0px_rgba(0,0,0,0.08)] ring-1 ring-white/[0.05] lg:pb-10 dark:bg-zinc-900 dark:ring-zinc-800">
|
|
||||||
<div class="flex size-12 shrink-0 items-center justify-center rounded-full bg-[#FF2D20]/10 sm:size-16">
|
|
||||||
<svg class="size-5 sm:size-6" xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24">
|
|
||||||
<g fill="#FF2D20">
|
|
||||||
<path
|
|
||||||
d="M16.597 12.635a.247.247 0 0 0-.08-.237 2.234 2.234 0 0 1-.769-1.68c.001-.195.03-.39.084-.578a.25.25 0 0 0-.09-.267 8.8 8.8 0 0 0-4.826-1.66.25.25 0 0 0-.268.181 2.5 2.5 0 0 1-2.4 1.824.045.045 0 0 0-.045.037 12.255 12.255 0 0 0-.093 3.86.251.251 0 0 0 .208.214c2.22.366 4.367 1.08 6.362 2.118a.252.252 0 0 0 .32-.079 10.09 10.09 0 0 0 1.597-3.733ZM13.616 17.968a.25.25 0 0 0-.063-.407A19.697 19.697 0 0 0 8.91 15.98a.25.25 0 0 0-.287.325c.151.455.334.898.548 1.328.437.827.981 1.594 1.619 2.28a.249.249 0 0 0 .32.044 29.13 29.13 0 0 0 2.506-1.99ZM6.303 14.105a.25.25 0 0 0 .265-.274 13.048 13.048 0 0 1 .205-4.045.062.062 0 0 0-.022-.07 2.5 2.5 0 0 1-.777-.982.25.25 0 0 0-.271-.149 11 11 0 0 0-5.6 2.815.255.255 0 0 0-.075.163c-.008.135-.02.27-.02.406.002.8.084 1.598.246 2.381a.25.25 0 0 0 .303.193 19.924 19.924 0 0 1 5.746-.438ZM9.228 20.914a.25.25 0 0 0 .1-.393 11.53 11.53 0 0 1-1.5-2.22 12.238 12.238 0 0 1-.91-2.465.248.248 0 0 0-.22-.187 18.876 18.876 0 0 0-5.69.33.249.249 0 0 0-.179.336c.838 2.142 2.272 4 4.132 5.353a.254.254 0 0 0 .15.048c1.41-.01 2.807-.282 4.117-.802ZM18.93 12.957l-.005-.008a.25.25 0 0 0-.268-.082 2.21 2.21 0 0 1-.41.081.25.25 0 0 0-.217.2c-.582 2.66-2.127 5.35-5.75 7.843a.248.248 0 0 0-.09.299.25.25 0 0 0 .065.091 28.703 28.703 0 0 0 2.662 2.12.246.246 0 0 0 .209.037c2.579-.701 4.85-2.242 6.456-4.378a.25.25 0 0 0 .048-.189 13.51 13.51 0 0 0-2.7-6.014ZM5.702 7.058a.254.254 0 0 0 .2-.165A2.488 2.488 0 0 1 7.98 5.245a.093.093 0 0 0 .078-.062 19.734 19.734 0 0 1 3.055-4.74.25.25 0 0 0-.21-.41 12.009 12.009 0 0 0-10.4 8.558.25.25 0 0 0 .373.281 12.912 12.912 0 0 1 4.826-1.814ZM10.773 22.052a.25.25 0 0 0-.28-.046c-.758.356-1.55.635-2.365.833a.25.25 0 0 0-.022.48c1.252.43 2.568.65 3.893.65.1 0 .2 0 .3-.008a.25.25 0 0 0 .147-.444c-.526-.424-1.1-.917-1.673-1.465ZM18.744 8.436a.249.249 0 0 0 .15.228 2.246 2.246 0 0 1 1.352 2.054c0 .337-.08.67-.23.972a.25.25 0 0 0 .042.28l.007.009a15.016 15.016 0 0 1 2.52 4.6.25.25 0 0 0 .37.132.25.25 0 0 0 .096-.114c.623-1.464.944-3.039.945-4.63a12.005 12.005 0 0 0-5.78-10.258.25.25 0 0 0-.373.274c.547 2.109.85 4.274.901 6.453ZM9.61 5.38a.25.25 0 0 0 .08.31c.34.24.616.561.8.935a.25.25 0 0 0 .3.127.631.631 0 0 1 .206-.034c2.054.078 4.036.772 5.69 1.991a.251.251 0 0 0 .267.024c.046-.024.093-.047.141-.067a.25.25 0 0 0 .151-.23A29.98 29.98 0 0 0 15.957.764a.25.25 0 0 0-.16-.164 11.924 11.924 0 0 0-2.21-.518.252.252 0 0 0-.215.076A22.456 22.456 0 0 0 9.61 5.38Z"
|
|
||||||
/>
|
|
||||||
</g>
|
|
||||||
</svg>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="pt-3 sm:pt-5">
|
|
||||||
<h2 class="text-xl font-semibold text-black dark:text-white">Vibrant Ecosystem</h2>
|
|
||||||
|
|
||||||
<p class="mt-4 text-sm/relaxed">
|
|
||||||
Laravel's robust library of first-party tools and libraries, such as <a href="https://forge.laravel.com" class="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white dark:focus-visible:ring-[#FF2D20]">Forge</a>, <a href="https://vapor.laravel.com" class="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white">Vapor</a>, <a href="https://nova.laravel.com" class="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white">Nova</a>, <a href="https://envoyer.io" class="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white">Envoyer</a>, and <a href="https://herd.laravel.com" class="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white">Herd</a> help you take your projects to the next level. Pair them with powerful open source libraries like <a href="https://laravel.com/docs/billing" class="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white">Cashier</a>, <a href="https://laravel.com/docs/dusk" class="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white">Dusk</a>, <a href="https://laravel.com/docs/broadcasting" class="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white">Echo</a>, <a href="https://laravel.com/docs/horizon" class="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white">Horizon</a>, <a href="https://laravel.com/docs/sanctum" class="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white">Sanctum</a>, <a href="https://laravel.com/docs/telescope" class="rounded-sm underline hover:text-black focus:outline-none focus-visible:ring-1 focus-visible:ring-[#FF2D20] dark:hover:text-white">Telescope</a>, and more.
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</main>
|
|
||||||
|
|
||||||
<footer class="py-16 text-center text-sm text-black dark:text-white/70">
|
|
||||||
Laravel v{{ Illuminate\Foundation\Application::VERSION }} (PHP v{{ PHP_VERSION }})
|
|
||||||
</footer>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -1,7 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
use Illuminate\Support\Facades\Route;
|
use Illuminate\Support\Facades\Route;
|
||||||
use App\Http\Controllers\ArtistController;
|
|
||||||
use App\Http\Controllers\AuthController;
|
use App\Http\Controllers\AuthController;
|
||||||
use App\Http\Controllers\RoomControlController;
|
use App\Http\Controllers\RoomControlController;
|
||||||
use App\Http\Controllers\Api\RoomSongController;
|
use App\Http\Controllers\Api\RoomSongController;
|
||||||
@ -9,7 +8,8 @@ use App\Http\Controllers\SqliteUploadController;
|
|||||||
|
|
||||||
Route::post('/room/receiveRegister', [RoomControlController::class, 'receiveRegister']);
|
Route::post('/room/receiveRegister', [RoomControlController::class, 'receiveRegister']);
|
||||||
|
|
||||||
Route::middleware('auth:sanctum')->group(function () {
|
//Route::middleware('auth:sanctum')->group(function () {
|
||||||
|
Route::middleware('api_token')->group(function () {
|
||||||
Route::get('/profile', [AuthController::class, 'profile']);
|
Route::get('/profile', [AuthController::class, 'profile']);
|
||||||
Route::post('/room/sendSwitch', [RoomControlController::class, 'sendSwitch']);
|
Route::post('/room/sendSwitch', [RoomControlController::class, 'sendSwitch']);
|
||||||
Route::post('/room/heartbeat', [RoomControlController::class, 'HeartBeat']);
|
Route::post('/room/heartbeat', [RoomControlController::class, 'HeartBeat']);
|
||||||
|
@ -5,11 +5,20 @@ use Illuminate\Support\Facades\Route;
|
|||||||
use App\Livewire\Admin\Dashboard as AdminDashboard;
|
use App\Livewire\Admin\Dashboard as AdminDashboard;
|
||||||
|
|
||||||
|
|
||||||
Route::redirect('/', '/login');
|
//Route::redirect('/', '/login');
|
||||||
|
Route::view('/', 'welcome');
|
||||||
|
|
||||||
Route::view('dashboard', 'dashboard')
|
Route::view('/welcome', 'welcome')->name('welcome');
|
||||||
->middleware(['auth', 'verified'])
|
Route::view('/new-songs', 'new-songs')->name('new-songs');
|
||||||
->name('dashboard');
|
Route::view('/top-ranking', 'top-ranking')->name('top-ranking');
|
||||||
|
Route::view('/search-song', 'search-song')->name('search-song');
|
||||||
|
Route::view('/clicked-song', 'clicked-song')->name('clicked-song');
|
||||||
|
Route::view('/sound-control', 'sound-control')->name('sound-control');
|
||||||
|
Route::view('/love-message', 'love-message')->name('love-message');
|
||||||
|
|
||||||
|
//Route::view('dashboard', 'dashboard')
|
||||||
|
// ->middleware(['auth', 'verified'])
|
||||||
|
//. ->name('dashboard');
|
||||||
|
|
||||||
Route::view('profile', 'profile')
|
Route::view('profile', 'profile')
|
||||||
->middleware(['auth'])
|
->middleware(['auth'])
|
||||||
@ -18,8 +27,6 @@ Route::view('profile', 'profile')
|
|||||||
require __DIR__.'/auth.php';
|
require __DIR__.'/auth.php';
|
||||||
|
|
||||||
Route::middleware(['auth'])->prefix('admin')->name('admin.')->group(function () {
|
Route::middleware(['auth'])->prefix('admin')->name('admin.')->group(function () {
|
||||||
Route::get('/dashboard', AdminDashboard::class)->name('dashboard');
|
|
||||||
Route::get('/song-library-cache', function () {return view('livewire.admin.song-library-cache');})->name('song-library-cache');
|
|
||||||
Route::get('/activity-log', function () {return view('livewire.admin.activity-log');})->name('activity-log');
|
Route::get('/activity-log', function () {return view('livewire.admin.activity-log');})->name('activity-log');
|
||||||
Route::get('/room-status-log', function () {return view('livewire.admin.room-status-log');})->name('room-status-log');
|
Route::get('/room-status-log', function () {return view('livewire.admin.room-status-log');})->name('room-status-log');
|
||||||
Route::get('/machine-status', function () {return view('livewire.admin.machine-status');})->name('machine-status');
|
Route::get('/machine-status', function () {return view('livewire.admin.machine-status');})->name('machine-status');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user