Skip to content

Commit

Permalink
システムユーザーのファイル一覧を追加 (misskey-dev#595)
Browse files Browse the repository at this point in the history
  • Loading branch information
kozakura913 authored and Ruruke committed Dec 30, 2024
1 parent da2ac0b commit e7ad95f
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ export const paramDef = {
untilId: { type: 'string', format: 'misskey:id' },
userId: { type: 'string', format: 'misskey:id', nullable: true },
type: { type: 'string', nullable: true, pattern: /^[a-zA-Z0-9\/\-*]+$/.toString().slice(1, -1) },
origin: { type: 'string', enum: ['combined', 'local', 'remote'], default: 'local' },
origin: { type: 'string', enum: ['combined', 'local', 'remote', 'system'], default: 'local' },
hostname: {
type: 'string',
nullable: true,
Expand Down Expand Up @@ -66,6 +66,8 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
query.andWhere('file.userHost IS NULL');
} else if (ps.origin === 'remote') {
query.andWhere('file.userHost IS NOT NULL');
} else if (ps.origin === 'system') {
query.andWhere('file.userId IS NULL');
}

if (ps.hostname) {
Expand Down
3 changes: 2 additions & 1 deletion packages/frontend/src/pages/admin/files.vue
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ SPDX-License-Identifier: AGPL-3.0-only
<option value="combined">{{ i18n.ts.all }}</option>
<option value="local">{{ i18n.ts.local }}</option>
<option value="remote">{{ i18n.ts.remote }}</option>
<option value="system">{{ i18n.ts.system }}</option>
</MkSelect>
<MkInput v-model="searchHost" :debounce="true" type="search" style="margin: 0; flex: 1;" :disabled="pagination.params.origin === 'local'">
<template #label>{{ i18n.ts.host }}</template>
Expand Down Expand Up @@ -50,7 +51,7 @@ const origin = ref('local');
const type = ref<string | null>(null);
const searchHost = ref('');
const userId = ref('');
const viewMode = ref('grid');
const viewMode = ref<'grid'|'list'>('grid');
const pagination = {
endpoint: 'admin/drive/files' as const,
limit: 10,
Expand Down
2 changes: 1 addition & 1 deletion packages/misskey-js/src/autogen/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7128,7 +7128,7 @@ export type operations = {
* @default local
* @enum {string}
*/
origin?: 'combined' | 'local' | 'remote';
origin?: 'combined' | 'local' | 'remote' | 'system';
/**
* @description The local host is represented with `null`.
* @default null
Expand Down

0 comments on commit e7ad95f

Please sign in to comment.