[FEAT] 新增 APK 下載連結複製功能與優化相關 UI
1. 在 APK 版本管理列表新增「複製下載連結」按鈕,並以 Alpine.js 結合 navigator.clipboard 實作複製成功 toast 通知。 2. 同步更新繁中、英文、日文多語系檔,補上複製下載連結相關語彙。 3. 修正 APK 新增頁面中外部連結按鈕 SVG 圖示閉合不全的問題。
This commit is contained in:
parent
23b3ea16ae
commit
d9e9c5e5db
@ -531,7 +531,10 @@
|
||||
"Done": "Done",
|
||||
"Door Closed": "Door Closed",
|
||||
"Door Opened": "Door Opened",
|
||||
"Copy Download Link": "Copy Download Link",
|
||||
"Download APK": "Download APK",
|
||||
"Download Image": "Download Image",
|
||||
"Download link copied": "Download link copied",
|
||||
"Download Template": "Download Template",
|
||||
"Download URL": "Download URL",
|
||||
"Draft": "Draft",
|
||||
|
||||
@ -531,7 +531,10 @@
|
||||
"Done": "完了",
|
||||
"Door Closed": "扉が閉まりました",
|
||||
"Door Opened": "扉が開きました",
|
||||
"Copy Download Link": "ダウンロードリンクをコピー",
|
||||
"Download APK": "APKをダウンロード",
|
||||
"Download Image": "画像をダウンロード",
|
||||
"Download link copied": "ダウンロードリンクをコピーしました",
|
||||
"Download Template": "テンプレートのダウンロード",
|
||||
"Download URL": "Download URL",
|
||||
"Draft": "下書き",
|
||||
|
||||
@ -531,7 +531,10 @@
|
||||
"Done": "已完成",
|
||||
"Door Closed": "機門已關閉",
|
||||
"Door Opened": "機門已開啟",
|
||||
"Copy Download Link": "複製下載連結",
|
||||
"Download APK": "下載 APK",
|
||||
"Download Image": "下載圖片",
|
||||
"Download link copied": "下載連結已複製",
|
||||
"Download Template": "下載範例檔",
|
||||
"Download URL": "下載連結",
|
||||
"Draft": "草稿",
|
||||
|
||||
@ -124,7 +124,7 @@
|
||||
@click="uploadMode = 'url'"
|
||||
:class="uploadMode === 'url' ? 'bg-white dark:bg-slate-700 text-cyan-600 dark:text-cyan-400 shadow-sm' : 'text-slate-500 dark:text-slate-400 hover:text-slate-700 dark:hover:text-slate-300'"
|
||||
class="flex-1 py-2.5 text-xs font-black uppercase tracking-widest rounded-lg transition-all duration-300 flex items-center justify-center gap-2">
|
||||
<svg class="w-4 h-4 stroke-[2.5]" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m9.86-1.637a4.5 4.5 0 00-1.242-7.244l-4.5-4.5a4.5 4.5 0 00-6.364 6.364L4.343 8.25"/></svg>
|
||||
<svg class="w-4 h-4 stroke-[2.5]" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M13.19 8.688a4.5 4.5 0 011.242 7.244l-4.5 4.5a4.5 4.5 0 01-6.364-6.364l1.757-1.757m13.35-.622l1.757-1.757a4.5 4.5 0 00-6.364-6.364l-4.5 4.5a4.5 4.5 0 001.242 7.244"/></svg>
|
||||
{{ __('External URL') }}
|
||||
</button>
|
||||
</div>
|
||||
|
||||
@ -34,6 +34,19 @@
|
||||
selectedMachineIds: [],
|
||||
|
||||
machines: @json($machinesJson),
|
||||
|
||||
async copyDownloadUrl(url) {
|
||||
try {
|
||||
await navigator.clipboard.writeText(url);
|
||||
window.dispatchEvent(new CustomEvent('toast', {
|
||||
detail: { message: '{{ __('Download link copied') }}', type: 'success' }
|
||||
}));
|
||||
} catch (error) {
|
||||
window.dispatchEvent(new CustomEvent('toast', {
|
||||
detail: { message: url, type: 'info' }
|
||||
}));
|
||||
}
|
||||
},
|
||||
|
||||
openPushModal(versionName, flavor, actionUrl) {
|
||||
this.selectedVersionName = versionName;
|
||||
@ -237,6 +250,14 @@
|
||||
<svg class="w-4 h-4 stroke-[2.5]" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M3 16.5v2.25A2.25 2.25 0 005.25 21h13.5A2.25 2.25 0 0021 18.75V16.5M16.5 12L12 16.5m0 0L7.5 12m4.5 4.5V3"/></svg>
|
||||
</a>
|
||||
|
||||
<!-- 複製下載連結 -->
|
||||
<button type="button"
|
||||
@click="copyDownloadUrl(@js($version->url))"
|
||||
class="p-2 rounded-lg bg-slate-50 dark:bg-slate-800 text-slate-400 hover:text-indigo-500 hover:bg-indigo-500/5 border border-transparent hover:border-indigo-500/20 transition-all inline-flex"
|
||||
title="{{ __('Copy Download Link') }}">
|
||||
<svg class="w-4 h-4 stroke-[2.5]" fill="none" stroke="currentColor" viewBox="0 0 24 24"><path stroke-linecap="round" stroke-linejoin="round" d="M15.75 17.25v3.375c0 .621-.504 1.125-1.125 1.125h-9.75A1.125 1.125 0 013.75 20.625v-9.75c0-.621.504-1.125 1.125-1.125H8.25m2.25-3h8.625c.621 0 1.125.504 1.125 1.125v8.625c0 .621-.504 1.125-1.125 1.125H10.5A1.125 1.125 0 019.375 16.5V7.875c0-.621.504-1.125 1.125-1.125z"/></svg>
|
||||
</button>
|
||||
|
||||
<!-- 刪除按鈕 -->
|
||||
<form action="{{ route('admin.basic-settings.apk-versions.destroy', $version) }}" method="POST" class="inline-block" @submit.prevent="confirmDelete($el.getAttribute('action'))">
|
||||
@csrf
|
||||
|
||||
Loading…
Reference in New Issue
Block a user