diff --git a/locales/en-US.yml b/locales/en-US.yml index c1854ba06..cc327c5aa 100644 --- a/locales/en-US.yml +++ b/locales/en-US.yml @@ -1513,6 +1513,7 @@ _2fa: renewTOTPConfirm: "This will cause verification codes from your previous app to stop working" renewTOTPOk: "Reconfigure" renewTOTPCancel: "Cancel" + token: "2FA Token" _permissions: "read:account": "View your account information" "write:account": "Edit your account information" diff --git a/locales/ja-JP.yml b/locales/ja-JP.yml index 617930db1..21f616808 100644 --- a/locales/ja-JP.yml +++ b/locales/ja-JP.yml @@ -1336,6 +1336,7 @@ _2fa: renewTOTPConfirm: "今までの認証アプリの確認コードは使用できなくなります" renewTOTPOk: "再設定する" renewTOTPCancel: "やめておく" + token: "多要素認証トークン" _permissions: "read:account": "アカウントの情報を見る" "write:account": "アカウントの情報を変更する" diff --git a/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts b/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts index eeccf6938..f34083233 100644 --- a/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts +++ b/packages/backend/src/server/api/endpoints/users/search-by-username-and-host.ts @@ -32,6 +32,12 @@ export const paramDef = { username: { type: "string", nullable: true }, host: { type: "string", nullable: true }, limit: { type: "integer", minimum: 1, maximum: 100, default: 10 }, + maxDaysSinceLastActive: { + type: "integer", + minimum: 1, + maximum: 1000, + default: 30, + }, detail: { type: "boolean", default: true }, }, anyOf: [{ required: ["username"] }, { required: ["host"] }], @@ -40,7 +46,9 @@ export const paramDef = { // TODO: avatar,bannerをJOINしたいけどエラーになる export default define(meta, paramDef, async (ps, me) => { - const activeThreshold = new Date(Date.now() - 1000 * 60 * 60 * 24 * 30); // 30日 + const activeThreshold = ps.maxDaysSinceLastActive + ? new Date(Date.now() - 1000 * 60 * 60 * 24 * ps.maxDaysSinceLastActive) + : null; if (ps.host) { const q = Users.createQueryBuilder("user") @@ -75,8 +83,10 @@ export default define(meta, paramDef, async (ps, me) => { .andWhere("user.isSuspended = FALSE") .andWhere("user.usernameLower LIKE :username", { username: `${sqlLikeEscape(ps.username.toLowerCase())}%`, - }) - .andWhere( + }); + + if (activeThreshold) { + query.andWhere( new Brackets((qb) => { qb.where("user.updatedAt IS NULL").orWhere( "user.updatedAt > :activeThreshold", @@ -84,6 +94,7 @@ export default define(meta, paramDef, async (ps, me) => { ); }), ); + } query.setParameters(followingQuery.getParameters()); diff --git a/packages/client/package.json b/packages/client/package.json index a843d63ed..2ec569381 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -89,7 +89,6 @@ "vue-isyourpasswordsafe": "^2.0.0", "vue-plyr": "^7.0.0", "vue-prism-editor": "2.0.0-alpha.2", - "vue3-otp-input": "^0.4.1", "vuedraggable": "4.1.0" } } diff --git a/packages/client/src/components/MkMenu.vue b/packages/client/src/components/MkMenu.vue index dea14ef05..aa3a3a300 100644 --- a/packages/client/src/components/MkMenu.vue +++ b/packages/client/src/components/MkMenu.vue @@ -130,7 +130,7 @@ class="_button item parent" :class="{ childShowing: childShowingItem === item }" @mouseenter="showChildren(item, $event)" - @click="showChildren(item, $event)" + @click.stop="showChildren(item, $event)" > - + > + + + + + +
+
+ + + + + + +
+
+
+
+ +
+ + +
+
+
+
+ {{ i18n.ts.noUsers }} +
+
+
+
+
+ +
+ + +
+
+
+
+
+
+ + + + + diff --git a/packages/client/src/os.ts b/packages/client/src/os.ts index 32bb8f76b..0802d8e34 100644 --- a/packages/client/src/os.ts +++ b/packages/client/src/os.ts @@ -631,6 +631,25 @@ export async function selectUser() { }); } +export async function selectLocalUser() { + return new Promise((resolve, reject) => { + popup( + defineAsyncComponent({ + loader: () => import("@/components/MkUserSelectLocalDialog.vue"), + loadingComponent: MkWaitingDialog, + delay: 1000, + }), + {}, + { + ok: (user) => { + resolve(user); + }, + }, + "closed", + ); + }); +} + export async function selectInstance(): Promise { return new Promise((resolve, reject) => { popup( diff --git a/packages/client/src/pages/admin/proxy-account.vue b/packages/client/src/pages/admin/proxy-account.vue index 87b3c684e..7d72b0ac0 100644 --- a/packages/client/src/pages/admin/proxy-account.vue +++ b/packages/client/src/pages/admin/proxy-account.vue @@ -20,12 +20,15 @@ }} - {{ i18n.ts.selectAccount }}{{ i18n.ts.selectAccount }}
+ {{ + i18n.ts.remove + }} @@ -34,7 +37,7 @@