summaryrefslogtreecommitdiff
path: root/packages/frontend/src/scripts
diff options
context:
space:
mode:
authorSayamame-beans <61457993+Sayamame-beans@users.noreply.github.com>2024-05-27 17:21:05 +0900
committerGitHub <noreply@github.com>2024-05-27 17:21:05 +0900
commit6af9492ea5492c02a11302afe7c6a6e83c00de1b (patch)
treeba0e8d04b5d4d5e05acd0c0118095067df17c8c6 /packages/frontend/src/scripts
parentenhance(frontend): お気に入りチャンネルをキャッシュするよ... (diff)
downloadmisskey-6af9492ea5492c02a11302afe7c6a6e83c00de1b.tar.gz
misskey-6af9492ea5492c02a11302afe7c6a6e83c00de1b.tar.bz2
misskey-6af9492ea5492c02a11302afe7c6a6e83c00de1b.zip
Quick action implement (#13878)
* enhance(frontend): quick action for file admin-lookup * docs(changelog): update changelog * enhance(frontend): quick action for general admin-lookup, remove unimplemented note, instance admin-lookup * docs(changelog): update changelog * chore: fix lint
Diffstat (limited to 'packages/frontend/src/scripts')
-rw-r--r--packages/frontend/src/scripts/admin-lookup.ts (renamed from packages/frontend/src/scripts/lookup-user.ts)23
1 files changed, 23 insertions, 0 deletions
diff --git a/packages/frontend/src/scripts/lookup-user.ts b/packages/frontend/src/scripts/admin-lookup.ts
index efc9132e75..1b57b853c9 100644
--- a/packages/frontend/src/scripts/lookup-user.ts
+++ b/packages/frontend/src/scripts/admin-lookup.ts
@@ -63,3 +63,26 @@ export async function lookupUserByEmail() {
}
}
}
+
+export async function lookupFile() {
+ const { canceled, result: q } = await os.inputText({
+ title: i18n.ts.fileIdOrUrl,
+ minLength: 1,
+ });
+ if (canceled) return;
+
+ const show = (file) => {
+ os.pageWindow(`/admin/file/${file.id}`);
+ };
+
+ misskeyApi('admin/drive/show-file', q.startsWith('http://') || q.startsWith('https://') ? { url: q.trim() } : { fileId: q.trim() }).then(file => {
+ show(file);
+ }).catch(err => {
+ if (err.code === 'NO_SUCH_FILE') {
+ os.alert({
+ type: 'error',
+ text: i18n.ts.notFound,
+ });
+ }
+ });
+}