diff --git a/app/Http/Controllers/Admin/Machine/MachinePermissionController.php b/app/Http/Controllers/Admin/Machine/MachinePermissionController.php index 7a75699..a9eec69 100644 --- a/app/Http/Controllers/Admin/Machine/MachinePermissionController.php +++ b/app/Http/Controllers/Admin/Machine/MachinePermissionController.php @@ -3,6 +3,7 @@ namespace App\Http\Controllers\Admin\Machine; use App\Http\Controllers\Admin\AdminController; +use App\Models\System\Company; use App\Models\Machine\Machine; use App\Models\System\User; use Illuminate\Http\Request; @@ -19,6 +20,7 @@ class MachinePermissionController extends AdminController { $per_page = $request->input('per_page', 10); $search = $request->input('search'); + $company_id = $request->input('company_id'); $currentUser = auth()->user(); @@ -33,6 +35,9 @@ class MachinePermissionController extends AdminController // 非系統管理員僅能看到同公司的帳號 (因 User Model 排除 TenantScoped 全域過濾,需手動注入) if (!$currentUser->isSystemAdmin()) { $userQuery->where('company_id', $currentUser->company_id); + } elseif ($company_id) { + // 系統管理員的篩選邏輯 + $userQuery->where('company_id', $company_id); } if ($search) { @@ -44,8 +49,9 @@ class MachinePermissionController extends AdminController } $users_list = $userQuery->latest()->paginate($per_page)->withQueryString(); + $companies = $currentUser->isSystemAdmin() ? Company::all() : collect(); - return view('admin.machines.permissions', compact('users_list')); + return view('admin.machines.permissions', compact('users_list', 'companies')); } /** diff --git a/app/Http/Controllers/Admin/MaintenanceController.php b/app/Http/Controllers/Admin/MaintenanceController.php index bcbba15..f4d25de 100644 --- a/app/Http/Controllers/Admin/MaintenanceController.php +++ b/app/Http/Controllers/Admin/MaintenanceController.php @@ -22,6 +22,7 @@ class MaintenanceController extends Controller $this->authorize('viewAny', MaintenanceRecord::class); $query = MaintenanceRecord::with(['machine', 'user', 'company']) + ->whereHas('machine') // 確保僅顯示該帳號「看得見」的機台紀錄,避開因權限隔離導致的 null 報錯 ->latest('maintenance_at'); // 搜尋邏輯 diff --git a/lang/en.json b/lang/en.json index 775ed05..6b15b87 100644 --- a/lang/en.json +++ b/lang/en.json @@ -73,10 +73,14 @@ "Assign Machines": "Assign Machines", "Assigned Machines": "Assigned Machines", "Audit Management": "Audit Management", + "Authorization updated successfully": "Authorization updated successfully", "Authorize": "Authorize", + "Authorize Btn": "Authorize", "Authorized Accounts": "Authorized Accounts", + "Authorized Accounts Tab": "Authorized Accounts", "Authorized Machines": "Authorized Machines", "Authorized Machines Management": "Authorized Machines Management", + "Authorized Status": "Authorized", "Availability": "可用性 (Availability)", "Available Machines": "可供分配的機台", "Avatar updated successfully.": "Avatar updated successfully.", @@ -183,7 +187,6 @@ "Delete Product Confirmation": "Delete Product Confirmation", "Deposit Bonus": "Deposit Bonus", "Describe the repair or maintenance status...": "Describe the repair or maintenance status...", - "Deselect All": "取消全選", "Detail": "Detail", "Device Information": "Device Information", "Device Status Logs": "Device Status Logs", @@ -324,7 +327,6 @@ "Machine Model Settings": "Machine Model Settings", "Machine Name": "Machine Name", "Machine Permissions": "Machine Permissions", - "Manage machine access permissions": "Manage machine access permissions", "Machine Registry": "Machine Registry", "Machine Reports": "Machine Reports", "Machine Restart": "Machine Restart", @@ -354,6 +356,7 @@ "Manage Expiry": "Manage Expiry", "Manage administrative and tenant accounts": "Manage administrative and tenant accounts", "Manage all tenant accounts and validity": "Manage all tenant accounts and validity", + "Manage machine access permissions": "Manage machine access permissions", "Manage your catalog, prices, and multilingual details.": "Manage your catalog, prices, and multilingual details.", "Manage your machine fleet and operational data": "Manage your machine fleet and operational data", "Manage your profile information, security settings, and login history": "Manage your profile information, security settings, and login history", @@ -572,6 +575,7 @@ "Scale level and access control": "層級與存取控制", "Scan this code to quickly access the maintenance form for this device.": "Scan this code to quickly access the maintenance form for this device.", "Search configurations...": "Search configurations...", + "Search company...": "Search company...", "Search customers...": "Search customers...", "Search machines by name or serial...": "Search machines by name or serial...", "Search machines...": "Search machine name or serial...", @@ -581,20 +585,21 @@ "Search serial or machine...": "Search serial or machine...", "Search serial or name...": "Search serial or name...", "Search users...": "Search users...", - "Select All": "全選", + "Select All": "Select All", "Select Company": "Select Company Name", - "Select Machine": "選擇機台", - "Select Machine to view metrics": "請選擇機台以查看指標", + "Select Machine": "Select Machine", + "Select Machine to view metrics": "Please select a machine to view metrics", "Select Model": "Select Model", "Select Owner": "Select Company Name", - "Select a machine to deep dive": "請選擇機台以開始深度分析", + "Select a machine to deep dive": "Please select a machine to deep dive", "Select an asset from the left to start analysis": "Select an asset from the left to start analysis", "Select date to sync data": "Select date to sync data", "Selected": "Selected", - "Selected Date": "查詢日期", + "Selected Date": "Search Date", "Selection": "Selection", "Serial & Version": "Serial & Version", - "Serial NO": "Serial NO", + "Deselect All": "Deselect All", + "Serial NO": "SERIAL NO", "Serial No": "Serial No", "Serial Number": "Serial Number", "Show": "Show", @@ -652,6 +657,7 @@ "The Super Admin role is immutable.": "The Super Admin role is immutable.", "The Super Admin role name cannot be modified.": "The Super Admin role name cannot be modified.", "The image is too large. Please upload an image smaller than 1MB.": "The image is too large. Please upload an image smaller than 1MB.", + "This is a system administrator role. Its name is locked to ensure system stability.": "This is a system administrator role. Its name is locked to ensure system stability.", "This role belongs to another company and cannot be assigned.": "This role belongs to another company and cannot be assigned.", "Time": "Time", "Time Slots": "Time Slots", @@ -676,6 +682,7 @@ "Tutorial Page": "Tutorial Page", "Type": "Type", "UI Elements": "UI Elements", + "Unauthorized Status": "Unauthorized", "Uncategorized": "Uncategorized", "Unified Operational Timeline": "Unified Operational Timeline", "Units": "Units", @@ -793,11 +800,5 @@ "user": "一般用戶", "vs Yesterday": "vs Yesterday", "warehouses": "Warehouse Management", - "待填寫": "Pending", - "Authorized Accounts Tab": "Authorized Accounts", - "Authorize Btn": "Authorize", - "Authorization updated successfully": "Authorization updated successfully", - "Authorized Status": "Authorized", - "Unauthorized Status": "Unauthorized", - "This is a system administrator role. Its name is locked to ensure system stability.": "This is a system administrator role. Its name is locked to ensure system stability." + "待填寫": "Pending" } \ No newline at end of file diff --git a/lang/ja.json b/lang/ja.json index b1d6a61..0a32498 100644 --- a/lang/ja.json +++ b/lang/ja.json @@ -74,7 +74,12 @@ "Assigned Machines": "授權機台", "Audit Management": "監査管理", "Audit Permissions": "監査管理權限", + "Authorization updated successfully": "認証が更新されました", + "Authorize Btn": "認可", + "Authorized Accounts Tab": "認定アカウント", "Authorized Machines": "授權機台", + "Authorized Machines Management": "認定機台管理", + "Authorized Status": "認可済み", "Availability": "可用性 (Availability)", "Available Machines": "可供分配的機台", "Avatar updated successfully.": "アバターが正常に更新されました。", @@ -163,7 +168,7 @@ "Customer enabled successfully.": "顧客が正常に有効化されました。", "Customer updated successfully.": "顧客が正常に更新されました。", "Cycle Efficiency": "サイクル効率", - "Daily Revenue": "日次収益", + "Daily Revenue": "当日収益", "Danger Zone: Delete Account": "危険区域:アカウントの削除", "Dashboard": "ダッシュボード", "Data Configuration": "データ設定", @@ -179,7 +184,6 @@ "Delete Product Confirmation": "商品削除の確認", "Deposit Bonus": "入金ボーナス", "Describe the repair or maintenance status...": "修理またはメンテナンスの状況を説明してください...", - "Deselect All": "取消全選", "Detail": "詳細", "Device Information": "デバイス情報", "Device Status Logs": "デバイス状態ログ", @@ -242,7 +246,7 @@ "Fill in the device repair or maintenance details": "デバイスの修理またはメンテナンスの詳細を入力してください", "Fill in the product details below": "以下に商品の詳細を入力してください", "Firmware Version": "ファームウェアバージョン", - "Fleet Avg OEE": "フリート平均 OEE", + "Fleet Avg OEE": "全機台平均OEE", "Fleet Performance": "全機隊效能", "From": "から", "From:": "開始:", @@ -297,7 +301,7 @@ "Line Orders": "Line注文", "Line Permissions": "Line管理權限", "Line Products": "Line商品", - "Live Fleet Updates": "ライブフリート更新", + "Live Fleet Updates": "機台リアルタイム更新", "Loading machines...": "正在載入機台...", "Loading...": "読み込み中...", "Location": "場所", @@ -320,8 +324,7 @@ "Machine Model Settings": "機台型號設定", "Machine Name": "機台名", "Machine Permissions": "機台権限", - "Manage machine access permissions": "機台アクセス權限の管理", - "Machine Registry": "機台登録", + "Machine Registry": "機台登録簿", "Machine Reports": "機台レポート", "Machine Restart": "機台再起動", "Machine Settings": "機台設定", @@ -350,6 +353,7 @@ "Manage Expiry": "進入效期管理", "Manage administrative and tenant accounts": "管理者およびテナントアカウントを管理します", "Manage all tenant accounts and validity": "すべてのテナントアカウントと有効期限を管理します", + "Manage machine access permissions": "機台アクセス權限の管理", "Manage your catalog, prices, and multilingual details.": "カタログ、価格、多言語詳細を管理します。", "Manage your machine fleet and operational data": "機台フリートと運用データの管理", "Manage your profile information, security settings, and login history": "プロフィール情報、セキュリティ設定、ログイン履歴の管理", @@ -407,7 +411,7 @@ "No machines available in this company.": "此客戶目前沒有可供分配的機台。", "No maintenance records found": "メンテナンス記録が見つかりません", "No matching logs found": "一致するログが見つかりません", - "No matching machines": "一致する機台が見つかりません", + "No matching machines": "一致する機台がありません", "No permissions": "権限項目なし", "No roles found.": "ロールが見つかりませんでした。", "No slots found": "未找到貨道資訊", @@ -418,8 +422,8 @@ "Not Used Description": "不使用第三方支付介接", "Notes": "備考", "OEE": "OEE", - "OEE Efficiency Trend": "OEE 効率トレンド", - "OEE Score": "OEE スコア", + "OEE Efficiency Trend": "OEE効率トレンド", + "OEE Score": "OEE総合スコア", "OEE.Activity": "稼働アクティビティ", "OEE.Errors": "エラー", "OEE.Hours": "時間", @@ -432,12 +436,12 @@ "Online": "オンライン", "Online Duration": "累積連線時數", "Online Machines": "オンライン機台", - "Online Status": "オンライン状態", + "Online Status": "オンラインステータス", "Only system roles can be assigned to platform administrative accounts.": "プラットフォーム管理アカウントにはシステムロールのみ割り当て可能です。", "Operational Parameters": "運用パラメータ", "Operations": "運用設定", "Optimal": "最適", - "Optimized Performance": "最適化されたパフォーマンス", + "Optimized Performance": "パフォーマンスの最適化", "Optimized for display. Supported formats: JPG, PNG, WebP.": "表示用に最適化されています。対応形式:JPG, PNG, WebP。", "Optional": "任意", "Order Management": "注文管理", @@ -447,7 +451,7 @@ "Original:": "元:", "Other Permissions": "其他權限", "Others": "その他", - "Output Count": "出力数", + "Output Count": "出荷回数", "Owner": "会社名", "PARTNER_KEY": "パートナーキー", "PI_MERCHANT_ID": "Pi 拍錢包 加盟店ID", @@ -515,9 +519,9 @@ "Quick search...": "クイック検索...", "Real-time OEE analysis awaits": "リアルタイム OEE 分析待機中", "Real-time Operation Logs (Last 50)": "リアルタイム操作ログ (直近 50 件)", - "Real-time fleet efficiency and OEE metrics": "リアルタイムのフリート効率と OEE 指標", + "Real-time fleet efficiency and OEE metrics": "全機台リアルタイム効率とOEE指標", "Real-time monitoring across all machines": "全機台のリアルタイム監視", - "Real-time performance analytics": "リアルタイム・パフォーマンス分析", + "Real-time performance analytics": "リアルタイムパフォーマンス分析", "Real-time status monitoring": "リアルタイムステータス監視", "Receipt Printing": "レシート印刷", "Recent Login": "最近のログイン", @@ -572,6 +576,7 @@ "Scale level and access control": "層級與存取控制", "Scan this code to quickly access the maintenance form for this device.": "このコードをスキャンして、このデバイスのメンテナンスフォームに素早くアクセスしてください。", "Search configurations...": "設定を検索...", + "Search company...": "会社を検索...", "Search customers...": "顧客を検索...", "Search machines by name or serial...": "名称またはシリアル番号で検索...", "Search machines...": "マシン名またはシリアル番号で検索...", @@ -579,22 +584,23 @@ "Search roles...": "ロールを検索...", "Search serial no or name...": "シリアル番号または名前を検索...", "Search serial or machine...": "シリアルまたはマシンを検索...", - "Search serial or name...": "シリアル番号または名称で検索...", + "Search serial or name...": "機台名またはシリアル番号で検索...", "Search users...": "ユーザーを検索...", - "Select All": "全選", + "Select All": "すべて選択", "Select Company": "会社名を選択", - "Select Machine": "選擇機台", - "Select Machine to view metrics": "請選擇機台以查看指標", + "Select Machine": "機台を選択", + "Select Machine to view metrics": "指標を表示する機台を選択してください", "Select Model": "型番を選択", "Select Owner": "会社名を選択", - "Select a machine to deep dive": "請選擇機台以開始深度分析", + "Select a machine to deep dive": "詳細分析を開始する機台を選択してください", "Select an asset from the left to start analysis": "分析を開始するには左側のデバイスを選択してください", "Select date to sync data": "データ同期の日付を選択してください", - "Selected": "已選擇", - "Selected Date": "查詢日期", + "Selected": "選択済み", + "Selected Date": "検索日", "Selection": "選択済み", + "Deselect All": "すべて選択解除", "Serial & Version": "シリアルとバージョン", - "Serial NO": "シリアル番号", + "Serial NO": "機台シリアル番号", "Serial No": "機台シリアル番号", "Serial Number": "シリアル番号", "Show": "表示", @@ -654,6 +660,7 @@ "The Super Admin role is immutable.": "スーパー管理者ロールは変更できません。", "The Super Admin role name cannot be modified.": "スーパー管理者のロール名は変更できません。", "The image is too large. Please upload an image smaller than 1MB.": "画像が大きすぎます。1MB未満の画像をアップロードしてください。", + "This is a system administrator role. Its name is locked to ensure system stability.": "これはシステム管理者ロールです。システムの安定性を確保するため、名称は固定されています。", "This role belongs to another company and cannot be assigned.": "このロールは他の会社に属しており、割り当てることはできません。", "Time": "時間", "Time Slots": "タイムスロット", @@ -665,7 +672,7 @@ "Total Connected": "接続数合計", "Total Customers": "顧客總數", "Total Daily Sales": "本日累計銷量", - "Total Gross Value": "総売上額", + "Total Gross Value": "売上高計", "Total Logins": "總ログイン數", "Total Selected": "已選擇總數", "Total Slots": "合計スロット数", @@ -678,9 +685,10 @@ "Tutorial Page": "チュートリアル画面", "Type": "タイプ", "UI Elements": "UI要素", + "Unauthorized Status": "未認可", "Uncategorized": "未分類", "Unified Operational Timeline": "整合式營運時序圖", - "Units": "ユニット", + "Units": "台", "Unknown": "不明", "Update": "更新", "Update Authorization": "権限を更新", @@ -698,7 +706,7 @@ "Utilization Rate": "稼働率", "Utilization Timeline": "稼動時序", "Utilization, OEE and Operational Intelligence": "稼動率、OEE と運用インテリジェンス", - "Utilized Time": "稼働時間", + "Utilized Time": "稼動持続時間", "Valid Until": "有効期限", "Validation Error": "検証エラー", "Vending Page": "販売画面", @@ -795,12 +803,5 @@ "user": "一般用戶", "vs Yesterday": "前日比", "warehouses": "倉庫管理", - "待填寫": "待填寫", - "Authorized Accounts Tab": "認定アカウント", - "Authorize Btn": "認可", - "Authorized Machines Management": "認定機台管理", - "Authorization updated successfully": "認証が更新されました", - "Authorized Status": "認可済み", - "Unauthorized Status": "未認可", - "This is a system administrator role. Its name is locked to ensure system stability.": "これはシステム管理者ロールです。システムの安定性を確保するため、名称は固定されています。" + "待填寫": "待填寫" } \ No newline at end of file diff --git a/lang/zh_TW.json b/lang/zh_TW.json index 8f3aa72..bed85a6 100644 --- a/lang/zh_TW.json +++ b/lang/zh_TW.json @@ -77,10 +77,14 @@ "Assigned Machines": "授權機台", "Audit Management": "稽核管理", "Audit Permissions": "稽核管理權限", + "Authorization updated successfully": "授權更新成功", "Authorize": "授權", + "Authorize Btn": "授權", "Authorized Accounts": "授權帳號", + "Authorized Accounts Tab": "授權帳號", "Authorized Machines": "授權機台", "Authorized Machines Management": "授權機台管理", + "Authorized Status": "已授權", "Availability": "可用性 (Availability)", "Available Machines": "可供分配的機台", "Avatar updated successfully.": "頭像已成功更新。", @@ -189,7 +193,6 @@ "Delete Product Confirmation": "刪除商品確認", "Deposit Bonus": "儲值回饋", "Describe the repair or maintenance status...": "請描述維修或保養狀況...", - "Deselect All": "取消全選", "Detail": "詳細", "Device Information": "設備資訊", "Device Status Logs": "設備狀態紀錄", @@ -322,7 +325,7 @@ "Machine Details": "機台詳情", "Machine Images": "機台照片", "Machine Info": "機台資訊", - "Machine Information": "機台資訊", + "Machine Information": "機器資訊", "Machine List": "機台列表", "Machine Login Logs": "機台登入紀錄", "Machine Logs": "機台日誌", @@ -332,7 +335,6 @@ "Machine Model Settings": "機台型號設定", "Machine Name": "機台名稱", "Machine Permissions": "機台權限", - "Manage machine access permissions": "管理機台存取權限", "Machine Registry": "機台清冊", "Machine Reports": "機台報表", "Machine Restart": "機台重啟", @@ -362,6 +364,7 @@ "Manage Expiry": "進入效期管理", "Manage administrative and tenant accounts": "管理系統管理者與租戶帳號", "Manage all tenant accounts and validity": "管理所有租戶帳號與合約效期", + "Manage machine access permissions": "管理機台存取權限", "Manage your catalog, prices, and multilingual details.": "管理您的商品型錄、價格及多語系詳情。", "Manage your machine fleet and operational data": "管理您的機台群組與營運數據", "Manage your profile information, security settings, and login history": "管理您的個人資訊、安全設定與登入紀錄", @@ -421,7 +424,7 @@ "No machines available in this company.": "此客戶目前沒有可供分配的機台。", "No maintenance records found": "找不到維修紀錄", "No matching logs found": "找不到符合條件的日誌", - "No matching machines": "找不到符合的機台", + "No matching machines": "查無匹配機台", "No permissions": "無權限項目", "No roles found.": "找不到角色資料。", "No slots found": "未找到貨道資訊", @@ -432,7 +435,7 @@ "Not Used Description": "不使用第三方支付介接", "Notes": "備註", "OEE Efficiency Trend": "OEE 效率趨勢", - "OEE Score": "OEE 綜合得分", + "OEE Score": "OEE 綜合評分", "OEE.Activity": "營運活動", "OEE.Errors": "異常", "OEE.Hours": "小時", @@ -450,7 +453,7 @@ "Operational Parameters": "運作參數", "Operations": "運作設定", "Optimal": "良好", - "Optimized Performance": "效能優化", + "Optimized Performance": "效能最佳化", "Optimized for display. Supported formats: JPG, PNG, WebP.": "已針對顯示進行優化。支援格式:JPG, PNG, WebP。", "Optional": "選填", "Order Management": "訂單管理", @@ -460,7 +463,7 @@ "Original:": "原:", "Other Permissions": "其他權限", "Others": "其他功能", - "Output Count": "出貨數量", + "Output Count": "出貨次數", "Owner": "公司名稱", "PARTNER_KEY": "PARTNER_KEY", "PI_MERCHANT_ID": "Pi 拍錢包 商店代號", @@ -589,6 +592,7 @@ "Scale level and access control": "層級與存取控制", "Scan this code to quickly access the maintenance form for this device.": "掃描此 QR Code 即可快速進入此設備的維修單填寫頁面。", "Search accounts...": "搜尋帳號...", + "Search company...": "搜尋公司...", "Search configurations...": "搜尋設定...", "Search customers...": "搜尋客戶...", "Search machines by name or serial...": "搜尋機台名稱或序號...", @@ -598,6 +602,7 @@ "Search roles...": "搜尋角色...", "Search serial no or name...": "搜尋序號或機台名稱...", "Search serial or machine...": "搜尋序號或機台名稱...", + "Search serial or name...": "搜尋序號或機台名稱...", "Search users...": "搜尋用戶...", "Select All": "全選", "Select Category": "選擇類別", @@ -607,11 +612,14 @@ "Select Model": "選擇型號", "Select Owner": "選擇公司名稱", "Select a machine to deep dive": "請選擇機台以開始深度分析", + "Select an asset from the left to start analysis": "選擇左側機台以開始分析數據", "Select date to sync data": "選擇日期以同步數據", "Selected": "已選擇", "Selected Date": "查詢日期", "Selection": "已選擇", "Serial & Version": "序號與版本", + "Deselect All": "取消全選", + "Serial NO": "機台序號", "Serial No": "機台序號", "Serial Number": "機台序號", "Show": "顯示", @@ -674,6 +682,7 @@ "The Super Admin role is immutable.": "超級管理員角色不可修改。", "The Super Admin role name cannot be modified.": "超級管理員角色的名稱無法修改。", "The image is too large. Please upload an image smaller than 1MB.": "圖片檔案太大,請上傳小於 1MB 的圖片。", + "This is a system administrator role. Its name is locked to ensure system stability.": "這是系統管理員角色,名稱已鎖定以確保系統穩定性。", "This role belongs to another company and cannot be assigned.": "此角色屬於其他公司,無法指派。", "Time": "時間", "Time Slots": "時段組合", @@ -686,7 +695,7 @@ "Total Connected": "總計連線數", "Total Customers": "客戶總數", "Total Daily Sales": "本日累計銷量", - "Total Gross Value": "銷售總結", + "Total Gross Value": "銷售總額", "Total Logins": "總登入次數", "Total Selected": "已選擇總數", "Total Slots": "總貨道數", @@ -700,6 +709,7 @@ "Tutorial Page": "教學頁", "Type": "類型", "UI Elements": "UI元素", + "Unauthorized Status": "未授權", "Uncategorized": "未分類", "Unified Operational Timeline": "整合式營運時序圖", "Units": "台", @@ -818,11 +828,5 @@ "user": "一般用戶", "vs Yesterday": "較昨日", "warehouses": "倉庫管理", - "待填寫": "待填寫", - "Authorized Accounts Tab": "授權帳號", - "Authorize Btn": "授權", - "Authorization updated successfully": "授權更新成功", - "Authorized Status": "已授權", - "Unauthorized Status": "未授權", - "This is a system administrator role. Its name is locked to ensure system stability.": "這是系統管理員角色,名稱已鎖定以確保系統穩定性。" + "待填寫": "待填寫" } \ No newline at end of file diff --git a/resources/views/admin/machines/permissions.blade.php b/resources/views/admin/machines/permissions.blade.php index 785205e..53d705e 100644 --- a/resources/views/admin/machines/permissions.blade.php +++ b/resources/views/admin/machines/permissions.blade.php @@ -42,6 +42,16 @@ togglePermission(machineId) { this.permissions = { ...this.permissions, [machineId]: !this.permissions[machineId] }; }, + toggleSelectAll() { + const filtered = this.allMachines.filter(m => + !this.permissionSearchQuery || + m.name.toLowerCase().includes(this.permissionSearchQuery.toLowerCase()) || + m.serial_no.toLowerCase().includes(this.permissionSearchQuery.toLowerCase()) + ); + if (filtered.length === 0) return; + const allSelected = filtered.every(m => this.permissions[m.id]); + filtered.forEach(m => this.permissions[m.id] = !allSelected); + }, savePermissions() { const machineIds = Object.keys(this.permissions).filter(id => this.permissions[id]); @@ -80,19 +90,29 @@
-
-
- - - - - - - +
+ +
+ + + + + + + +
+ + @if(auth()->user()->isSystemAdmin()) +
+ +
+ @endif
@@ -100,13 +120,17 @@ - - - - @@ -115,40 +139,57 @@ - @@ -157,8 +198,12 @@ @@ -180,76 +225,114 @@ x-transition:enter-end='opacity-100' x-transition:leave='ease-in duration-200' x-transition:leave-start='opacity-100' x-transition:leave-end='opacity-0' class='fixed inset-0 bg-slate-900/60 backdrop-blur-sm transition-opacity'> - + -
- +
-

{{ __('Authorized Machines Management') }}

+

+ {{ __('Authorized Machines Management') }}

- {{ __('Account') }}: - + {{ + __('Account') }}: +
-
-
-
+
+
- + - +
+
-
-
+ {{ __('Account Info') }} + {{ __('Company Name') }} + {{ __('Authorized Machines') }} + {{ __('Action') }}
-
+
- +
- {{ $user->name }} - {{ $user->username }} + {{ + $user->name }} + {{ + $user->username }}
- + {{ $user->company->name ?? __('System') }} -
+
+
@forelse($user->machines as $m) -
- {{ $m->name }} - {{ $m->serial_no }} -
+
+ {{ + $m->name }} + {{ + $m->serial_no }} +
@empty -
- -- {{ __('None') }} -- -
+
+ -- + {{ __('None') }} -- +
@endforelse
-
- -

{{ __('No accounts found') }}

+ + + +

{{ __('No + accounts found') }}