From ff1424950736b432d42226fa4d8bcadf57a26151 Mon Sep 17 00:00:00 2001 From: samunohito <46447427+samunohito@users.noreply.github.com> Date: Mon, 29 Jan 2024 09:35:26 +0900 Subject: [PATCH] fix --- .../src/components/grid/MkDataCell.vue | 2 +- .../src/components/grid/MkHeaderCell.vue | 3 +- packages/frontend/src/components/grid/grid.ts | 1 + .../pages/admin/custom-emojis-grid.impl.ts | 2 + .../pages/admin/custom-emojis-grid.list.vue | 73 +++++++++++++------ .../admin/custom-emojis-grid.register.vue | 8 +- .../src/pages/admin/custom-emojis-grid.vue | 28 +++++-- 7 files changed, 83 insertions(+), 34 deletions(-) diff --git a/packages/frontend/src/components/grid/MkDataCell.vue b/packages/frontend/src/components/grid/MkDataCell.vue index 0f6acc965a..fa7674a03b 100644 --- a/packages/frontend/src/components/grid/MkDataCell.vue +++ b/packages/frontend/src/components/grid/MkDataCell.vue @@ -23,7 +23,7 @@
- +
- {{ text }} + + {{ text }}
- - - - +
+ + + + + {{ i18n.ts.search }} + +
-
- - +
+
+ + +
- - - - - - ... - - - - +
+ {{ i18n.ts.update }} + ăƒȘă‚»ăƒƒăƒˆ +
diff --git a/packages/frontend/src/pages/admin/custom-emojis-grid.register.vue b/packages/frontend/src/pages/admin/custom-emojis-grid.register.vue index 4e56beabb2..7613640bcb 100644 --- a/packages/frontend/src/pages/admin/custom-emojis-grid.register.vue +++ b/packages/frontend/src/pages/admin/custom-emojis-grid.register.vue @@ -75,10 +75,6 @@ type FolderItem = { type UploadResult = { key: string, item: IGridItem, success: boolean, err: any }; -const emit = defineEmits<{ - (ev: 'operation:registered'): void; -}>(); - const columnSettings: ColumnSetting[] = [ { bindTo: 'url', title: '🎹', type: 'image', editable: false, width: 50, validators: [required] }, { bindTo: 'name', title: 'name', type: 'text', editable: true, width: 140, validators: [required] }, @@ -90,6 +86,10 @@ const columnSettings: ColumnSetting[] = [ { bindTo: 'roleIdsThatCanBeUsedThisEmojiAsReaction', title: 'role', type: 'text', editable: true, width: 100 }, ]; +const emit = defineEmits<{ + (ev: 'operation:registered'): void; +}>(); + const uploadFolders = ref([]); const gridItems = ref([]); const selectedFolderId = ref(defaultStore.state.uploadFolder); diff --git a/packages/frontend/src/pages/admin/custom-emojis-grid.vue b/packages/frontend/src/pages/admin/custom-emojis-grid.vue index ebd00c2e51..886f8be6dc 100644 --- a/packages/frontend/src/pages/admin/custom-emojis-grid.vue +++ b/packages/frontend/src/pages/admin/custom-emojis-grid.vue @@ -11,8 +11,15 @@
- - + +
@@ -34,13 +41,24 @@ type PageMode = 'list' | 'register'; const customEmojis = ref([]); const headerTab = ref('local'); const modeTab = ref('list'); +const query = ref(); -async function refreshCustomEmojis() { - customEmojis.value = await misskeyApi('admin/emoji/list', { limit: 100 }); +async function refreshCustomEmojis(query?: string, sinceId?: string, untilId?: string) { + customEmojis.value = await misskeyApi('admin/emoji/list', { + limit: 100, + query, + sinceId, + untilId, + }); +} + +async function onOperationSearch(q: string, sinceId?: string, untilId?: string) { + query.value = q; + await refreshCustomEmojis(q, sinceId, untilId); } async function onOperationRegistered() { - await refreshCustomEmojis(); + await refreshCustomEmojis(query.value); } onMounted(async () => {