diff options
| author | おさむのひと <46447427+samunohito@users.noreply.github.com> | 2025-02-10 17:20:38 +0900 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-02-10 08:20:38 +0000 |
| commit | 420365c17fddbafb898cd83b2973e75ee288db7d (patch) | |
| tree | 3071de8dcc6aa7d805bbf5a08f3290d359180f20 /packages/frontend/src/components/MkPostFormAttaches.vue | |
| parent | fix(backend): correct `admin/meta` response schema (#15434) (diff) | |
| download | misskey-420365c17fddbafb898cd83b2973e75ee288db7d.tar.gz misskey-420365c17fddbafb898cd83b2973e75ee288db7d.tar.bz2 misskey-420365c17fddbafb898cd83b2973e75ee288db7d.zip | |
enhance(frontend): 開発者モードでメニューからファイルIDをコピー出来るようにする (#15444)
Diffstat (limited to 'packages/frontend/src/components/MkPostFormAttaches.vue')
| -rw-r--r-- | packages/frontend/src/components/MkPostFormAttaches.vue | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/packages/frontend/src/components/MkPostFormAttaches.vue b/packages/frontend/src/components/MkPostFormAttaches.vue index 33fe82b759..f2d6c7e2cd 100644 --- a/packages/frontend/src/components/MkPostFormAttaches.vue +++ b/packages/frontend/src/components/MkPostFormAttaches.vue @@ -36,6 +36,8 @@ SPDX-License-Identifier: AGPL-3.0-only import { defineAsyncComponent, inject } from 'vue'; import * as Misskey from 'misskey-js'; import type { MenuItem } from '@/types/menu'; +import { defaultStore } from '@/store'; +import { copyToClipboard } from '@/scripts/copy-to-clipboard'; import MkDriveFileThumbnail from '@/components/MkDriveFileThumbnail.vue'; import * as os from '@/os.js'; import { misskeyApi } from '@/scripts/misskey-api.js'; @@ -196,6 +198,16 @@ function showFileMenu(file: Misskey.entities.DriveFile, ev: MouseEvent | Keyboar action: () => { detachAndDeleteMedia(file); }, }); + if (defaultStore.state.devMode) { + menuItems.push({ type: 'divider' }, { + icon: 'ti ti-id', + text: i18n.ts.copyFileId, + action: () => { + copyToClipboard(file.id); + }, + }); + } + os.popupMenu(menuItems, ev.currentTarget ?? ev.target).then(() => menuShowing = false); menuShowing = true; } |