Skip to content

Commit 405b5fc

Browse files
jtydhr88github-actions
andauthored
Add copy url button (#4000)
Co-authored-by: github-actions <[email protected]>
1 parent 0eaf7d1 commit 405b5fc

File tree

8 files changed

+24
-1
lines changed

8 files changed

+24
-1
lines changed

src/components/common/FileDownload.vue

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,15 @@
3030
@click="download.triggerBrowserDownload"
3131
/>
3232
</div>
33+
<div>
34+
<Button
35+
:label="$t('g.copyURL')"
36+
size="small"
37+
outlined
38+
:disabled="!!props.error"
39+
@click="copyURL"
40+
/>
41+
</div>
3342
</div>
3443
</template>
3544

@@ -38,6 +47,7 @@ import Button from 'primevue/button'
3847
import Message from 'primevue/message'
3948
import { computed } from 'vue'
4049
50+
import { useCopyToClipboard } from '@/composables/useCopyToClipboard'
4151
import { useDownload } from '@/composables/useDownload'
4252
import { formatSize } from '@/utils/formatUtil'
4353
@@ -49,9 +59,15 @@ const props = defineProps<{
4959
}>()
5060
5161
const label = computed(() => props.label || props.url.split('/').pop())
62+
5263
const hint = computed(() => props.hint || props.url)
5364
const download = useDownload(props.url)
5465
const fileSize = computed(() =>
5566
download.fileSize.value ? formatSize(download.fileSize.value) : '?'
5667
)
68+
const copyURL = async () => {
69+
await copyToClipboard(props.url)
70+
}
71+
72+
const { copyToClipboard } = useCopyToClipboard()
5773
</script>

src/locales/en/main.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,8 @@
121121
"edit": "Edit",
122122
"copy": "Copy",
123123
"imageUrl": "Image URL",
124-
"clear": "Clear"
124+
"clear": "Clear",
125+
"copyURL": "Copy URL"
125126
},
126127
"manager": {
127128
"title": "Custom Nodes Manager",

src/locales/es/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268
"control_before_generate": "control antes de generar",
269269
"copy": "Copiar",
270270
"copyToClipboard": "Copiar al portapapeles",
271+
"copyURL": "Copiar URL",
271272
"currentUser": "Usuario actual",
272273
"customBackground": "Fondo personalizado",
273274
"customize": "Personalizar",

src/locales/fr/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268
"control_before_generate": "contrôle avant génération",
269269
"copy": "Copier",
270270
"copyToClipboard": "Copier dans le presse-papiers",
271+
"copyURL": "Copier l’URL",
271272
"currentUser": "Utilisateur actuel",
272273
"customBackground": "Arrière-plan personnalisé",
273274
"customize": "Personnaliser",

src/locales/ja/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268
"control_before_generate": "生成前の制御",
269269
"copy": "コピー",
270270
"copyToClipboard": "クリップボードにコピー",
271+
"copyURL": "URLをコピー",
271272
"currentUser": "現在のユーザー",
272273
"customBackground": "カスタム背景",
273274
"customize": "カスタマイズ",

src/locales/ko/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268
"control_before_generate": "생성 전 제어",
269269
"copy": "복사",
270270
"copyToClipboard": "클립보드에 복사",
271+
"copyURL": "URL 복사",
271272
"currentUser": "현재 사용자",
272273
"customBackground": "맞춤 배경",
273274
"customize": "사용자 정의",

src/locales/ru/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268
"control_before_generate": "управление до генерации",
269269
"copy": "Копировать",
270270
"copyToClipboard": "Скопировать в буфер обмена",
271+
"copyURL": "Скопировать URL",
271272
"currentUser": "Текущий пользователь",
272273
"customBackground": "Пользовательский фон",
273274
"customize": "Настроить",

src/locales/zh/main.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -268,6 +268,7 @@
268268
"control_before_generate": "生成前控制",
269269
"copy": "复制",
270270
"copyToClipboard": "复制到剪贴板",
271+
"copyURL": "复制链接",
271272
"currentUser": "当前用户",
272273
"customBackground": "自定义背景",
273274
"customize": "自定义",

0 commit comments

Comments
 (0)